mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
fixed to the react-table rc.15 definitions (#41278)
This commit is contained in:
committed by
Andrew Branch
parent
1bf49129a6
commit
a8fb783542
@@ -58,6 +58,7 @@ import {
|
||||
UseFiltersState,
|
||||
UseGlobalFiltersInstanceProps,
|
||||
UseGlobalFiltersOptions,
|
||||
UseGlobalFiltersState,
|
||||
UseGroupByCellProps,
|
||||
UseGroupByColumnOptions,
|
||||
UseGroupByColumnProps,
|
||||
@@ -131,6 +132,7 @@ declare module 'react-table' {
|
||||
extends UseColumnOrderState<D>,
|
||||
UseExpandedState<D>,
|
||||
UseFiltersState<D>,
|
||||
UseGlobalFiltersState<D>,
|
||||
UseGroupByState<D>,
|
||||
UsePaginationState<D>,
|
||||
UseResizeColumnsState<D>,
|
||||
@@ -150,8 +152,8 @@ declare module 'react-table' {
|
||||
UseResizeColumnsColumnProps<D>,
|
||||
UseSortByColumnProps<D> {}
|
||||
|
||||
export interface Cell<D extends object = {}>
|
||||
extends UseGroupByCellProps<D>,
|
||||
export interface Cell<D extends object = {}>
|
||||
extends UseGroupByCellProps<D>,
|
||||
UseRowStateCellProps<D> {}
|
||||
|
||||
export interface Row<D extends object = {}>
|
||||
|
||||
Vendored
+14
-10
@@ -148,16 +148,16 @@ export interface UseTableHooks<D extends object> extends Record<string, any> {
|
||||
instance?: TableInstance<D>,
|
||||
) => ReducerTableState<D> | undefined
|
||||
>;
|
||||
columns: Array<(columns: Array<Column<D>>, instance: TableInstance<D>) => Array<Column<D>>>;
|
||||
columnsDeps: Array<(deps: any[], instance: TableInstance<D>) => any[]>;
|
||||
flatColumns: Array<(flatColumns: Array<Column<D>>, instance: TableInstance<D>) => Array<Column<D>>>;
|
||||
flatColumnsDeps: Array<(deps: any[], instance: TableInstance<D>) => any[]>;
|
||||
headerGroups: Array<(flatColumns: Array<HeaderGroup<D>>, instance: TableInstance<D>) => Array<HeaderGroup<D>>>;
|
||||
headerGroupDeps: Array<(deps: any[], instance: TableInstance<D>) => any[]>;
|
||||
columns: Array<(columns: Array<Column<D>>, meta: Meta<D>) => Array<Column<D>>>;
|
||||
columnsDeps: Array<(deps: any[], meta: Meta<D>) => any[]>;
|
||||
flatColumns: Array<(flatColumns: Array<Column<D>>, meta: Meta<D>) => Array<Column<D>>>;
|
||||
flatColumnsDeps: Array<(deps: any[], meta: Meta<D>) => any[]>;
|
||||
headerGroups: Array<(flatColumns: Array<HeaderGroup<D>>, meta: Meta<D>) => Array<HeaderGroup<D>>>;
|
||||
headerGroupDeps: Array<(deps: any[], meta: Meta<D>) => any[]>;
|
||||
useInstanceBeforeDimensions: Array<(instance: TableInstance<D>) => void>;
|
||||
useInstance: Array<(instance: TableInstance<D>) => void>;
|
||||
useRows: Array<(rows: Array<Row<D>>, instance: TableInstance<D>) => Array<Row<D>>>;
|
||||
prepareRow: Array<(row: Row<D>, instance: TableInstance<D>) => void>;
|
||||
useRows: Array<(rows: Array<Row<D>>, meta: Meta<D>) => Array<Row<D>>>;
|
||||
prepareRow: Array<(row: Row<D>, meta: Meta<D>) => void>;
|
||||
useControlledState: Array<(state: TableState<D>, meta: Meta<D>) => TableState<D>>;
|
||||
|
||||
getTableProps: Array<TablePropGetter<D>>;
|
||||
@@ -411,7 +411,7 @@ export type DefaultFilterTypes =
|
||||
| 'between';
|
||||
|
||||
export interface FilterType<D extends object> {
|
||||
(rows: Array<Row<D>>, columnId: Array<IdType<D>>, filterValue: FilterValue): Array<Row<D>>;
|
||||
(rows: Array<Row<D>>, columnIds: Array<IdType<D>>, filterValue: FilterValue): Array<Row<D>>;
|
||||
|
||||
autoRemove?: (filterValue: FilterValue) => boolean;
|
||||
}
|
||||
@@ -434,12 +434,16 @@ export namespace useGlobalFilter {
|
||||
}
|
||||
|
||||
export type UseGlobalFiltersOptions<D extends object> = Partial<{
|
||||
globalFilter: ((filterValue: FilterValue) => void) | string;
|
||||
globalFilter: ((rows: Array<Row<D>>, columnIds: Array<IdType<D>>, filterValue: any) => Array<Row<D>>) | string;
|
||||
manualGlobalFilter: boolean;
|
||||
filterTypes: FilterTypes<D>;
|
||||
autoResetGlobalFilter?: boolean;
|
||||
}>;
|
||||
|
||||
export interface UseGlobalFiltersState<D extends object> {
|
||||
globalFilter: any;
|
||||
}
|
||||
|
||||
export interface UseGlobalFiltersInstanceProps<D extends object> {
|
||||
rows: Array<Row<D>>;
|
||||
preGlobalFilteredRows: Array<Row<D>>;
|
||||
|
||||
Reference in New Issue
Block a user