mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
Change react-table version
This commit is contained in:
Vendored
+62
-31
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-table 6.7
|
||||
// Type definitions for react-table 6.6
|
||||
// Project: https://github.com/react-tools/react-table
|
||||
// Definitions by: Roy Xue <https://github.com/royxue>,
|
||||
// Pavel Sakalo <https://github.com/psakalo>,
|
||||
@@ -13,21 +13,53 @@ export type ReactTableFunction = (value?: any) => void;
|
||||
export type AccessorFunction<D = any> = (row: D) => any;
|
||||
export type Accessor<D = any> = string | string[] | AccessorFunction<D>;
|
||||
export type Aggregator = (values: any, rows: any) => any;
|
||||
export type TableCellRenderer = ((cellInfo: CellInfo, column: any) => React.ReactNode) | React.ReactNode;
|
||||
export type FilterRender = (params: { column: Column, filter: any, onChange: ReactTableFunction, key?: string }) => React.ReactElement<any>;
|
||||
export type PivotRenderer = ((cellInfo: CellInfo) => React.ReactNode) | (() => any) | string | React.ReactNode;
|
||||
export type TableCellRenderer =
|
||||
| ((cellInfo: CellInfo, column: any) => React.ReactNode)
|
||||
| React.ReactNode;
|
||||
export type FilterRender = (
|
||||
params: { column: Column; filter: any; onChange: ReactTableFunction; key?: string }
|
||||
) => React.ReactElement<any>;
|
||||
export type PivotRenderer =
|
||||
| ((cellInfo: CellInfo) => React.ReactNode)
|
||||
| (() => any)
|
||||
| string
|
||||
| React.ReactNode;
|
||||
|
||||
export type ComponentPropsGetter0 = (finalState: any, rowInfo: undefined, column: undefined, instance?: any) => object | undefined;
|
||||
export type ComponentPropsGetterR = (finalState: any, rowInfo?: RowInfo, column?: undefined, instance?: any) => object | undefined;
|
||||
export type ComponentPropsGetterC = (finalState: any, rowInfo?: undefined, column?: Column, instance?: any) => object | undefined;
|
||||
export type ComponentPropsGetterRC = (finalState: any, rowInfo?: RowInfo, column?: Column, instance?: any) => object | undefined;
|
||||
export type ComponentPropsGetter0 = (
|
||||
finalState: any,
|
||||
rowInfo: undefined,
|
||||
column: undefined,
|
||||
instance?: any
|
||||
) => object | undefined;
|
||||
export type ComponentPropsGetterR = (
|
||||
finalState: any,
|
||||
rowInfo?: RowInfo,
|
||||
column?: undefined,
|
||||
instance?: any
|
||||
) => object | undefined;
|
||||
export type ComponentPropsGetterC = (
|
||||
finalState: any,
|
||||
rowInfo?: undefined,
|
||||
column?: Column,
|
||||
instance?: any
|
||||
) => object | undefined;
|
||||
export type ComponentPropsGetterRC = (
|
||||
finalState: any,
|
||||
rowInfo?: RowInfo,
|
||||
column?: Column,
|
||||
instance?: any
|
||||
) => object | undefined;
|
||||
|
||||
export type DefaultFilterFunction = (filter: Filter, row: any, column: any) => boolean;
|
||||
export type FilterFunction = (filter: Filter, rows: any[], column: any) => any[];
|
||||
export type SubComponentFunction = (rowInfo: RowInfo) => React.ReactNode;
|
||||
export type PageChangeFunction = (page: number) => void;
|
||||
export type PageSizeChangeFunction = (newPageSize: number, newPage: number) => void;
|
||||
export type SortedChangeFunction = (newSorted: SortingRule[], column: any, additive: boolean) => void;
|
||||
export type SortedChangeFunction = (
|
||||
newSorted: SortingRule[],
|
||||
column: any,
|
||||
additive: boolean
|
||||
) => void;
|
||||
export type FilteredChangeFunction = (newFiltering: Filter[], column: any, value: any) => void;
|
||||
export type ExpandedChangeFunction = (column: any, event: any, isTouch: boolean) => void;
|
||||
export type ResizedChangeFunction = (newResized: Resize[], event: any) => void;
|
||||
@@ -48,13 +80,13 @@ export interface SortingRule {
|
||||
desc: boolean;
|
||||
}
|
||||
|
||||
export interface TableProps<D = any, ResolvedData = D> extends
|
||||
Partial<TextProps>,
|
||||
Partial<ComponentDecoratorProps>,
|
||||
Partial<ControlledStateCallbackProps>,
|
||||
Partial<PivotingProps>,
|
||||
Partial<ControlledStateOverrideProps>,
|
||||
Partial<ComponentProps> {
|
||||
export interface TableProps<D = any, ResolvedData = D>
|
||||
extends Partial<TextProps>,
|
||||
Partial<ComponentDecoratorProps>,
|
||||
Partial<ControlledStateCallbackProps>,
|
||||
Partial<PivotingProps>,
|
||||
Partial<ControlledStateOverrideProps>,
|
||||
Partial<ComponentProps> {
|
||||
/** Default: [] */
|
||||
data: D[];
|
||||
|
||||
@@ -381,13 +413,12 @@ export interface TextProps {
|
||||
rowsText: string;
|
||||
}
|
||||
|
||||
export interface GlobalColumn extends
|
||||
Column.Basics,
|
||||
Column.CellProps,
|
||||
Column.FilterProps,
|
||||
Column.FooterProps,
|
||||
Column.HeaderProps {
|
||||
}
|
||||
export interface GlobalColumn
|
||||
extends Column.Basics,
|
||||
Column.CellProps,
|
||||
Column.FilterProps,
|
||||
Column.FooterProps,
|
||||
Column.HeaderProps {}
|
||||
|
||||
export namespace Column {
|
||||
/** Basic column props */
|
||||
@@ -556,12 +587,12 @@ export interface PivotDefaults {
|
||||
render: TableCellRenderer;
|
||||
}
|
||||
|
||||
export interface Column<D = any> extends
|
||||
Partial<Column.Basics>,
|
||||
Partial<Column.CellProps>,
|
||||
Partial<Column.FilterProps>,
|
||||
Partial<Column.FooterProps>,
|
||||
Partial<Column.HeaderProps> {
|
||||
export interface Column<D = any>
|
||||
extends Partial<Column.Basics>,
|
||||
Partial<Column.CellProps>,
|
||||
Partial<Column.FilterProps>,
|
||||
Partial<Column.FooterProps>,
|
||||
Partial<Column.HeaderProps> {
|
||||
/**
|
||||
* Property name as string or Accessor
|
||||
* @example: 'myProperty'
|
||||
@@ -670,7 +701,7 @@ export interface RowInfo {
|
||||
original: any;
|
||||
}
|
||||
|
||||
export interface CellInfo extends RowInfo, Pick<ControlledStateOverrideProps, "resized"> {
|
||||
export interface CellInfo extends RowInfo, Pick<ControlledStateOverrideProps, 'resized'> {
|
||||
/* true if this row is expanded */
|
||||
isExpanded: boolean;
|
||||
|
||||
@@ -728,7 +759,7 @@ export interface FinalState<D = any> extends TableProps<D> {
|
||||
}
|
||||
|
||||
export const ReactTableDefaults: TableProps;
|
||||
export default class ReactTable<D> extends React.Component<Partial<TableProps<D>>> { }
|
||||
export default class ReactTable<D> extends React.Component<Partial<TableProps<D>>> {}
|
||||
|
||||
export interface Instance<D = any> extends ReactTable<D> {
|
||||
context: any;
|
||||
|
||||
Reference in New Issue
Block a user