diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index 5a6cdfafe5..477d8a2dbf 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -6,7 +6,7 @@ // Jason Clark // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.5 -// reflects react-table@7.0.0 - (prepping for stable 7.0.0 release https://github.com/tannerlinsley/react-table/issues/1964) +// reflects react-table@7.0.0 // tslint:disable:no-empty-interface // no-empty-interface is disabled to allow easy extension with declaration merging @@ -257,7 +257,6 @@ export interface UseTableRowProps { original: D; id: string; subRows: Array>; - state: object; } export interface UseTableCellProps { diff --git a/types/react-table/react-table-tests.tsx b/types/react-table/react-table-tests.tsx index 853adf6025..0a41b94d72 100644 --- a/types/react-table/react-table-tests.tsx +++ b/types/react-table/react-table-tests.tsx @@ -1,8 +1,5 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; - -// test heavily based up https://github.com/tannerlinsley/react-table/blob/master/examples/kitchen-sink-controlled/src/App.js - import { Cell, CellProps, @@ -14,6 +11,8 @@ import { Hooks, IdType, Row, + UseColumnOrderInstanceProps, + UseColumnOrderState, useExpanded, UseExpandedInstanceProps, UseExpandedOptions, @@ -25,8 +24,11 @@ import { UseFiltersInstanceProps, UseFiltersOptions, UseFiltersState, - UseGlobalFiltersOptions, + useGlobalFilter, UseGlobalFiltersColumnOptions, + UseGlobalFiltersInstanceProps, + UseGlobalFiltersOptions, + UseGlobalFiltersState, useGroupBy, UseGroupByCellProps, UseGroupByColumnOptions, @@ -39,11 +41,20 @@ import { UsePaginationInstanceProps, UsePaginationOptions, UsePaginationState, + UseResizeColumnsColumnOptions, + UseResizeColumnsColumnProps, + UseResizeColumnsOptions, + UseResizeColumnsState, useRowSelect, UseRowSelectInstanceProps, UseRowSelectOptions, UseRowSelectRowProps, UseRowSelectState, + UseRowStateCellProps, + UseRowStateInstanceProps, + UseRowStateOptions, + UseRowStateRowProps, + UseRowStateState, useSortBy, UseSortByColumnOptions, UseSortByColumnProps, @@ -51,9 +62,10 @@ import { UseSortByOptions, UseSortByState, useTable, - useGlobalFilter, } from 'react-table'; +// test heavily based up https://github.com/tannerlinsley/react-table/blob/master/examples/kitchen-sink-controlled/src/App.js + declare module 'react-table' { // take this file as-is, or comment out the sections that don't apply to your plugin configuration @@ -63,46 +75,58 @@ declare module 'react-table' { UseGlobalFiltersOptions, UseGroupByOptions, UsePaginationOptions, + UseResizeColumnsOptions, UseRowSelectOptions, + UseRowStateOptions, UseSortByOptions { updateMyData: (rowIndex: number, columnId: string, value: any) => void; } interface TableInstance - extends UseExpandedInstanceProps, + extends UseColumnOrderInstanceProps, + UseExpandedInstanceProps, UseFiltersInstanceProps, + UseGlobalFiltersInstanceProps, UseGroupByInstanceProps, UsePaginationInstanceProps, UseRowSelectInstanceProps, + UseRowStateInstanceProps, UseSortByInstanceProps { editable: boolean; } interface TableState - extends UseExpandedState, + extends UseColumnOrderState, + UseExpandedState, UseFiltersState, + UseGlobalFiltersState, UseGroupByState, UsePaginationState, + UseResizeColumnsState, UseRowSelectState, + UseRowStateState, UseSortByState {} interface Column extends UseFiltersColumnOptions, UseGlobalFiltersColumnOptions, UseGroupByColumnOptions, + UseResizeColumnsColumnOptions, UseSortByColumnOptions {} interface ColumnInstance extends UseFiltersColumnProps, UseGroupByColumnProps, + UseResizeColumnsColumnProps, UseSortByColumnProps {} - interface Cell extends UseGroupByCellProps {} + interface Cell extends UseGroupByCellProps, UseRowStateCellProps {} interface Row extends UseExpandedRowProps, UseGroupByRowProps, - UseRowSelectRowProps {} + UseRowSelectRowProps, + UseRowStateRowProps {} } interface Data {