@types/react-table
- Version 7.7.20
- Published
- 33.3 kB
- 1 dependency
- MIT license
Install
npm i @types/react-table
yarn add @types/react-table
pnpm add @types/react-table
Overview
TypeScript definitions for react-table
Index
Variables
Functions
- defaultGroupByFn()
- defaultOrderByFn()
- ensurePluginOrder()
- functionalUpdate()
- loopHooks()
- makePropGetter()
- makeRenderer()
- reduceHooks()
- safeUseLayoutEffect()
- useAbsoluteLayout()
- useAsyncDebounce()
- useBlockLayout()
- useColumnOrder()
- useExpanded()
- useFilters()
- useFlexLayout()
- useGetLatest()
- useGlobalFilter()
- useGridLayout()
- useGroupBy()
- useMountedLayoutEffect()
- usePagination()
- useResizeColumns()
- useRowSelect()
- useRowState()
- useSortBy()
- useTable()
Interfaces
UseTableHooks
- allColumns
- allColumnsDeps
- columns
- columnsDeps
- getCellProps
- getFooterGroupProps
- getFooterProps
- getHeaderGroupProps
- getHeaderProps
- getRowProps
- getTableBodyProps
- getTableProps
- headerGroups
- headerGroupsDeps
- prepareRow
- stateReducers
- useControlledState
- useFinalInstance
- useInstance
- useInstanceBeforeDimensions
- useOptions
- visibleColumns
- visibleColumnsDeps
Type Aliases
- Accessor
- ActionType
- AggregatedValue
- Aggregator
- AggregatorFn
- CellPropGetter
- CellProps
- CellValue
- Column
- ColumnGroup
- ColumnWithLooseAccessor
- ColumnWithStrictAccessor
- DefaultAggregators
- DefaultFilterTypes
- DefaultSortTypes
- FilterProps
- Filters
- FilterTypes
- FilterValue
- FooterGroupPropGetter
- FooterPropGetter
- FooterProps
- HeaderGroupPropGetter
- HeaderPropGetter
- HeaderProps
- IdType
- Meta
- OrderByFn
- PropGetter
- Renderer
- RowPropGetter
- SortByFn
- StringKey
- TableBodyPropGetter
- TableDispatch
- TablePropGetter
- UseExpandedOptions
- UseFiltersColumnOptions
- UseFiltersOptions
- UseGlobalFiltersColumnOptions
- UseGlobalFiltersOptions
- UseGroupByColumnOptions
- UseGroupByOptions
- UsePaginationOptions
- UseRowSelectOptions
- UseRowStateLocalState
- UseRowStateOptions
- UseRowUpdater
- UseSortByColumnOptions
- UseSortByOptions
- UseTableOptions
Namespaces
Variables
variable actions
const actions: Record<string, string>;
variable defaultColumn
const defaultColumn: Partial<Column<{}>> & Record<string, any>;
Functions
function defaultGroupByFn
defaultGroupByFn: <D extends object = {}>( rows: Array<Row<D>>, columnId: IdType<D>) => Record<string, Array<Row<D>>>;
function defaultOrderByFn
defaultOrderByFn: <D extends object = {}>( arr: Array<Row<D>>, funcs: Array<OrderByFn<D>>, dirs: boolean[]) => Array<Row<D>>;
function ensurePluginOrder
ensurePluginOrder: <D extends object = {}>( plugins: Array<PluginHook<D>>, befores: string[], pluginName: string) => void;
function functionalUpdate
functionalUpdate: <D extends object = {}>( updater: any, old: Partial<TableState<D>>) => Partial<TableState<D>>;
function loopHooks
loopHooks: (hooks: Hooks, ...args: any[]) => void;
function makePropGetter
makePropGetter: (hooks: Hooks, ...meta: any[]) => any;
function makeRenderer
makeRenderer: ( instance: TableInstance, column: ColumnInstance, meta?: any) => ReactElement;
function reduceHooks
reduceHooks: <T extends object = {}>( hooks: Hooks, initial: T, ...args: any[]) => T;
function safeUseLayoutEffect
safeUseLayoutEffect: (effect: EffectCallback, deps?: DependencyList) => void;
function useAbsoluteLayout
useAbsoluteLayout: typeof useAbsoluteLayout;
function useAsyncDebounce
useAsyncDebounce: <F extends (...args: any[]) => any>( defaultFn: F, defaultWait?: number) => F;
function useBlockLayout
useBlockLayout: typeof useBlockLayout;
function useColumnOrder
useColumnOrder: typeof useColumnOrder;
function useExpanded
useExpanded: typeof useExpanded;
function useFilters
useFilters: typeof useFilters;
function useFlexLayout
useFlexLayout: typeof useFlexLayout;
function useGetLatest
useGetLatest: <T>(obj: T) => () => T;
function useGlobalFilter
useGlobalFilter: typeof useGlobalFilter;
function useGridLayout
useGridLayout: typeof useGridLayout;
function useGroupBy
useGroupBy: typeof useGroupBy;
function useMountedLayoutEffect
useMountedLayoutEffect: (effect: EffectCallback, deps?: DependencyList) => void;
function usePagination
usePagination: typeof usePagination;
function useResizeColumns
useResizeColumns: typeof useResizeColumns;
function useRowSelect
useRowSelect: typeof useRowSelect;
function useRowState
useRowState: typeof useRowState;
function useSortBy
useSortBy: typeof useSortBy;
function useTable
useTable: <D extends object = {}>( options: TableOptions<D>, ...plugins: Array<PluginHook<D>>) => TableInstance<D>;
Interfaces
interface Cell
interface Cell<D extends object = {}, V = any> extends UseTableCellProps<D, V> {}
interface ColumnGroupInterface
interface ColumnGroupInterface<D extends object> {}
property columns
columns: Array<Column<D>>;
interface ColumnInstance
interface ColumnInstance<D extends object = {}> extends Omit<ColumnInterface<D>, 'id'>, ColumnInterfaceBasedOnValue<D>, UseTableColumnProps<D> {}
interface ColumnInterface
interface ColumnInterface<D extends object = {}> extends UseTableColumnOptions<D> {}
interface ColumnInterfaceBasedOnValue
interface ColumnInterfaceBasedOnValue<D extends object = {}, V = any> {}
property Cell
Cell?: Renderer<CellProps<D, V>> | undefined;
interface FilterType
interface FilterType<D extends object> {}
property autoRemove
autoRemove?: ((filterValue: FilterValue) => boolean) | undefined;
call signature
( rows: Array<Row<D>>, columnIds: Array<IdType<D>>, filterValue: FilterValue): Array<Row<D>>;
interface HeaderGroup
interface HeaderGroup<D extends object = {}> extends ColumnInstance<D>, UseTableHeaderGroupProps<D> {}
interface Hooks
interface Hooks<D extends object = {}> extends UseTableHooks<D> {}
interface MetaBase
interface MetaBase<D extends object> {}
interface PluginHook
interface PluginHook<D extends object> {}
property pluginName
pluginName?: string | undefined;
call signature
(hooks: Hooks<D>): void;
interface ReducerTableState
interface ReducerTableState<D extends object> extends TableState<D>, Record<string, any> {}
interface Row
interface Row<D extends object = {}> extends UseTableRowProps<D> {}
interface SortingRule
interface SortingRule<D> {}
interface TableBodyProps
interface TableBodyProps extends TableCommonProps {}
interface TableCellProps
interface TableCellProps extends TableKeyedProps {}
interface TableCommonProps
interface TableCommonProps {}
interface TableExpandedToggleProps
interface TableExpandedToggleProps extends TableKeyedProps {}
interface TableFooterGroupProps
interface TableFooterGroupProps extends TableKeyedProps {}
interface TableFooterProps
interface TableFooterProps extends TableKeyedProps {}
interface TableGroupByToggleProps
interface TableGroupByToggleProps {}
interface TableHeaderGroupProps
interface TableHeaderGroupProps extends TableKeyedProps {}
interface TableHeaderProps
interface TableHeaderProps extends TableKeyedProps {}
interface TableInstance
interface TableInstance<D extends object = {}> extends Omit<TableOptions<D>, 'columns' | 'pageCount'>, UseTableInstanceProps<D> {}
interface TableKeyedProps
interface TableKeyedProps extends TableCommonProps {}
property key
key: React.Key;
interface TableOptions
interface TableOptions<D extends object> extends UseTableOptions<D> {}
The empty definitions of below provides a base definition for the parts used by useTable, that can then be extended in the users code.
Example 1
export interface TableOptions<D extends object = {}}> extends UseExpandedOptions, UseFiltersOptions {} see https://gist.github.com/ggascoigne/646e14c9d54258e40588a13aabf0102d for more details
interface TableProps
interface TableProps extends TableCommonProps {}
interface TableResizerProps
interface TableResizerProps {}
interface TableRowProps
interface TableRowProps extends TableKeyedProps {}
interface TableSortByToggleProps
interface TableSortByToggleProps {}
interface TableState
interface TableState<D extends object = {}> {}
property hiddenColumns
hiddenColumns?: Array<IdType<D>> | undefined;
interface TableToggleAllRowsSelectedProps
interface TableToggleAllRowsSelectedProps extends TableToggleCommonProps {}
interface TableToggleCommonProps
interface TableToggleCommonProps extends TableCommonProps {}
property checked
checked?: boolean | undefined;
property indeterminate
indeterminate?: boolean | undefined;
property onChange
onChange?: ((e: ChangeEvent) => void) | undefined;
property title
title?: string | undefined;
interface TableToggleHideAllColumnProps
interface TableToggleHideAllColumnProps extends TableToggleCommonProps {}
interface TableToggleRowsSelectedProps
interface TableToggleRowsSelectedProps extends TableToggleCommonProps {}
interface UseColumnOrderInstanceProps
interface UseColumnOrderInstanceProps<D extends object> {}
property setColumnOrder
setColumnOrder: ( updater: | ((columnOrder: Array<IdType<D>>) => Array<IdType<D>>) | Array<IdType<D>>) => void;
interface UseColumnOrderState
interface UseColumnOrderState<D extends object> {}
property columnOrder
columnOrder: Array<IdType<D>>;
interface UseExpandedHooks
interface UseExpandedHooks<D extends object> {}
property getToggleAllRowsExpandedProps
getToggleAllRowsExpandedProps: Array<PropGetter<D, TableCommonProps>>;
property getToggleRowsExpandedProps
getToggleRowsExpandedProps: Array<PropGetter<D, TableCommonProps>>;
interface UseExpandedInstanceProps
interface UseExpandedInstanceProps<D extends object> {}
property expandedDepth
expandedDepth: number;
property expandedRows
expandedRows: Array<Row<D>>;
property isAllRowsExpanded
isAllRowsExpanded: boolean;
property preExpandedRows
preExpandedRows: Array<Row<D>>;
property rows
rows: Array<Row<D>>;
property toggleAllRowsExpanded
toggleAllRowsExpanded: (value?: boolean) => void;
property toggleRowExpanded
toggleRowExpanded: (id: Array<IdType<D>>, value?: boolean) => void;
interface UseExpandedRowProps
interface UseExpandedRowProps<D extends object> {}
property canExpand
canExpand: boolean;
property depth
depth: number;
property getToggleRowExpandedProps
getToggleRowExpandedProps: ( props?: Partial<TableExpandedToggleProps>) => TableExpandedToggleProps;
property isExpanded
isExpanded: boolean;
property subRows
subRows: Array<Row<D>>;
property toggleRowExpanded
toggleRowExpanded: (value?: boolean) => void;
interface UseExpandedState
interface UseExpandedState<D extends object> {}
property expanded
expanded: Record<IdType<D>, boolean>;
interface UseFiltersColumnProps
interface UseFiltersColumnProps<D extends object> {}
property canFilter
canFilter: boolean;
property filteredRows
filteredRows: Array<Row<D>>;
property filterValue
filterValue: FilterValue;
property preFilteredRows
preFilteredRows: Array<Row<D>>;
property setFilter
setFilter: ( updater: ((filterValue: FilterValue) => FilterValue) | FilterValue) => void;
interface UseFiltersInstanceProps
interface UseFiltersInstanceProps<D extends object> {}
property filteredFlatRows
filteredFlatRows: Array<Row<D>>;
property filteredRows
filteredRows: Array<Row<D>>;
property filteredRowsById
filteredRowsById: Record<string, Row<D>>;
property flatRows
flatRows: Array<Row<D>>;
property preFilteredFlatRows
preFilteredFlatRows: Array<Row<D>>;
property preFilteredRows
preFilteredRows: Array<Row<D>>;
property preFilteredRowsById
preFilteredRowsById: Record<string, Row<D>>;
property rows
rows: Array<Row<D>>;
property rowsById
rowsById: Record<string, Row<D>>;
property setAllFilters
setAllFilters: ( updater: Filters<D> | ((filters: Filters<D>) => Filters<D>)) => void;
property setFilter
setFilter: ( columnId: IdType<D>, updater: ((filterValue: FilterValue) => FilterValue) | FilterValue) => void;
interface UseFiltersState
interface UseFiltersState<D extends object> {}
property filters
filters: Filters<D>;
interface UseGlobalFiltersInstanceProps
interface UseGlobalFiltersInstanceProps<D extends object> {}
property flatRows
flatRows: Array<Row<D>>;
property globalFilteredFlatRows
globalFilteredFlatRows: Array<Row<D>>;
property globalFilteredRows
globalFilteredRows: Array<Row<D>>;
property globalFilteredRowsById
globalFilteredRowsById: Record<string, Row<D>>;
property preGlobalFilteredFlatRows
preGlobalFilteredFlatRows: Array<Row<D>>;
property preGlobalFilteredRows
preGlobalFilteredRows: Array<Row<D>>;
property preGlobalFilteredRowsById
preGlobalFilteredRowsById: Record<string, Row<D>>;
property rows
rows: Array<Row<D>>;
property rowsById
rowsById: Record<string, Row<D>>;
property setGlobalFilter
setGlobalFilter: (filterValue: FilterValue) => void;
interface UseGlobalFiltersState
interface UseGlobalFiltersState<D extends object> {}
property globalFilter
globalFilter: any;
interface UseGroupByCellProps
interface UseGroupByCellProps<D extends object> {}
property isAggregated
isAggregated: boolean;
property isGrouped
isGrouped: boolean;
property isPlaceholder
isPlaceholder: boolean;
interface UseGroupByColumnProps
interface UseGroupByColumnProps<D extends object> {}
property canGroupBy
canGroupBy: boolean;
property getGroupByToggleProps
getGroupByToggleProps: ( props?: Partial<TableGroupByToggleProps>) => TableGroupByToggleProps;
property groupedIndex
groupedIndex: number;
property isGrouped
isGrouped: boolean;
property toggleGroupBy
toggleGroupBy: () => void;
interface UseGroupByHooks
interface UseGroupByHooks<D extends object> {}
property getGroupByToggleProps
getGroupByToggleProps: Array<HeaderGroupPropGetter<D>>;
interface UseGroupByInstanceProps
interface UseGroupByInstanceProps<D extends object> {}
property flatRows
flatRows: Array<Row<D>>;
property groupedFlatRows
groupedFlatRows: Array<Row<D>>;
property groupedRows
groupedRows: Array<Row<D>>;
property groupedRowsById
groupedRowsById: Record<string, Row<D>>;
property nonGroupedFlatRows
nonGroupedFlatRows: Array<Row<D>>;
property nonGroupedRowsById
nonGroupedRowsById: Record<string, Row<D>>;
property onlyGroupedFlatRows
onlyGroupedFlatRows: Array<Row<D>>;
property onlyGroupedRowsById
onlyGroupedRowsById: Record<string, Row<D>>;
property preGroupedFlatRows
preGroupedFlatRows: Array<Row<D>>;
property preGroupedRows
preGroupedRows: Array<Row<D>>;
property preGroupedRowsById
preGroupedRowsById: Record<string, Row<D>>;
property rows
rows: Array<Row<D>>;
property rowsById
rowsById: Record<string, Row<D>>;
property toggleGroupBy
toggleGroupBy: (columnId: IdType<D>, value?: boolean) => void;
interface UseGroupByRowProps
interface UseGroupByRowProps<D extends object> {}
property depth
depth: number;
property groupByID
groupByID: IdType<D>;
property groupByVal
groupByVal: string;
property id
id: string;
property index
index: number;
property isGrouped
isGrouped: boolean;
property leafRows
leafRows: Array<Row<D>>;
property subRows
subRows: Array<Row<D>>;
property values
values: Record<IdType<D>, AggregatedValue>;
interface UseGroupByState
interface UseGroupByState<D extends object> {}
property groupBy
groupBy: Array<IdType<D>>;
interface UsePaginationInstanceProps
interface UsePaginationInstanceProps<D extends object> {}
property canNextPage
canNextPage: boolean;
property canPreviousPage
canPreviousPage: boolean;
property gotoPage
gotoPage: (updater: ((pageIndex: number) => number) | number) => void;
property nextPage
nextPage: () => void;
property page
page: Array<Row<D>>;
property pageCount
pageCount: number;
property pageOptions
pageOptions: number[];
property previousPage
previousPage: () => void;
property setPageSize
setPageSize: (pageSize: number) => void;
interface UsePaginationState
interface UsePaginationState<D extends object> {}
interface UseResizeColumnsColumnOptions
interface UseResizeColumnsColumnOptions<D extends object> {}
property disableResizing
disableResizing?: boolean | undefined;
interface UseResizeColumnsColumnProps
interface UseResizeColumnsColumnProps<D extends object> {}
property canResize
canResize: boolean;
property getResizerProps
getResizerProps: (props?: Partial<TableResizerProps>) => TableResizerProps;
property isResizing
isResizing: boolean;
interface UseResizeColumnsOptions
interface UseResizeColumnsOptions<D extends object> {}
property autoResetResize
autoResetResize?: boolean | undefined;
property disableResizing
disableResizing?: boolean | undefined;
interface UseResizeColumnsState
interface UseResizeColumnsState<D extends object> {}
property columnResizing
columnResizing: { startX?: number | undefined; columnWidth: number; headerIdWidths: Record<string, number>; columnWidths: any; isResizingColumn?: string | undefined;};
interface UseRowSelectHooks
interface UseRowSelectHooks<D extends object> {}
property getToggleAllPageRowsSelectedProps
getToggleAllPageRowsSelectedProps: Array< PropGetter<D, TableToggleAllRowsSelectedProps>>;
property getToggleAllRowsSelectedProps
getToggleAllRowsSelectedProps: Array< PropGetter<D, TableToggleAllRowsSelectedProps>>;
property getToggleRowSelectedProps
getToggleRowSelectedProps: Array<PropGetter<D, TableToggleRowsSelectedProps>>;
interface UseRowSelectInstanceProps
interface UseRowSelectInstanceProps<D extends object> {}
property getToggleAllPageRowsSelectedProps
getToggleAllPageRowsSelectedProps: ( props?: Partial<TableToggleAllRowsSelectedProps>) => TableToggleAllRowsSelectedProps;
property getToggleAllRowsSelectedProps
getToggleAllRowsSelectedProps: ( props?: Partial<TableToggleAllRowsSelectedProps>) => TableToggleAllRowsSelectedProps;
property isAllRowsSelected
isAllRowsSelected: boolean;
property selectedFlatRows
selectedFlatRows: Array<Row<D>>;
property toggleAllRowsSelected
toggleAllRowsSelected: (value?: boolean) => void;
property toggleRowSelected
toggleRowSelected: (rowId: IdType<D>, set?: boolean) => void;
interface UseRowSelectRowProps
interface UseRowSelectRowProps<D extends object> {}
property getToggleRowSelectedProps
getToggleRowSelectedProps: ( props?: Partial<TableToggleRowsSelectedProps>) => TableToggleRowsSelectedProps;
property isSelected
isSelected: boolean;
property isSomeSelected
isSomeSelected: boolean;
property toggleRowSelected
toggleRowSelected: (set?: boolean) => void;
interface UseRowSelectState
interface UseRowSelectState<D extends object> {}
property selectedRowIds
selectedRowIds: Record<IdType<D>, boolean>;
interface UseRowStateCellProps
interface UseRowStateCellProps<D extends object> {}
interface UseRowStateInstanceProps
interface UseRowStateInstanceProps<D extends object> {}
property setCellState
setCellState: ( rowPath: string[], columnId: IdType<D>, updater: UseRowUpdater) => void;
property setRowState
setRowState: (rowPath: string[], updater: UseRowUpdater) => void;
interface UseRowStateRowProps
interface UseRowStateRowProps<D extends object> {}
interface UseRowStateState
interface UseRowStateState<D extends object> {}
property rowState
rowState: Record<string, { cellState: UseRowStateLocalState<D> }>;
interface UseSortByColumnProps
interface UseSortByColumnProps<D extends object> {}
property canSort
canSort: boolean;
property clearSortBy
clearSortBy: () => void;
property getSortByToggleProps
getSortByToggleProps: ( props?: Partial<TableSortByToggleProps>) => TableSortByToggleProps;
property isSorted
isSorted: boolean;
property isSortedDesc
isSortedDesc: boolean | undefined;
property sortedIndex
sortedIndex: number;
property toggleSortBy
toggleSortBy: (descending?: boolean, multi?: boolean) => void;
interface UseSortByHooks
interface UseSortByHooks<D extends object> {}
property getSortByToggleProps
getSortByToggleProps: Array<PropGetter<D, TableCommonProps>>;
interface UseSortByInstanceProps
interface UseSortByInstanceProps<D extends object> {}
property preSortedRows
preSortedRows: Array<Row<D>>;
property rows
rows: Array<Row<D>>;
property setSortBy
setSortBy: (sortBy: Array<SortingRule<D>>) => void;
property toggleSortBy
toggleSortBy: ( columnId: IdType<D>, descending?: boolean, isMulti?: boolean) => void;
interface UseSortByState
interface UseSortByState<D extends object> {}
property sortBy
sortBy: Array<SortingRule<D>>;
interface UseTableCellProps
interface UseTableCellProps<D extends object, V = any> {}
property column
column: ColumnInstance<D>;
property getCellProps
getCellProps: (propGetter?: CellPropGetter<D>) => TableCellProps;
property render
render: (type: 'Cell' | string, userProps?: object) => ReactNode;
property row
row: Row<D>;
property value
value: CellValue<V>;
interface UseTableColumnOptions
interface UseTableColumnOptions<D extends object> {}
property Footer
Footer?: Renderer<FooterProps<D>> | undefined;
property Header
Header?: Renderer<HeaderProps<D>> | undefined;
property id
id?: IdType<D> | undefined;
property maxWidth
maxWidth?: number | undefined;
property minWidth
minWidth?: number | undefined;
property width
width?: number | string | undefined;
interface UseTableColumnProps
interface UseTableColumnProps<D extends object> {}
property columns
columns?: Array<ColumnInstance<D>> | undefined;
property depth
depth: number;
property getFooterProps
getFooterProps: (propGetter?: FooterPropGetter<D>) => TableFooterProps;
property getHeaderProps
getHeaderProps: (propGetter?: HeaderPropGetter<D>) => TableHeaderProps;
property getToggleHiddenProps
getToggleHiddenProps: (userProps?: any) => any;
property id
id: IdType<D>;
property isVisible
isVisible: boolean;
property parent
parent?: ColumnInstance<D> | undefined;
property placeholderOf
placeholderOf?: ColumnInstance | undefined;
property render
render: (type: 'Header' | 'Footer' | string, props?: object) => ReactNode;
property toggleHidden
toggleHidden: (value?: boolean) => void;
property totalLeft
totalLeft: number;
property totalWidth
totalWidth: number;
interface UseTableHeaderGroupProps
interface UseTableHeaderGroupProps<D extends object> {}
property getFooterGroupProps
getFooterGroupProps: (propGetter?: FooterGroupPropGetter<D>) => TableFooterProps;
property getHeaderGroupProps
getHeaderGroupProps: (propGetter?: HeaderGroupPropGetter<D>) => TableHeaderProps;
property headers
headers: Array<HeaderGroup<D>>;
property totalHeaderCount
totalHeaderCount: number;
interface UseTableHooks
interface UseTableHooks<D extends object> extends Record<string, any> {}
property allColumns
allColumns: Array< (allColumns: Array<ColumnInstance<D>>, meta: Meta<D>) => Array<Column<D>>>;
property allColumnsDeps
allColumnsDeps: Array<(deps: any[], meta: Meta<D>) => any[]>;
property columns
columns: Array<(columns: Array<Column<D>>, meta: Meta<D>) => Array<Column<D>>>;
property columnsDeps
columnsDeps: Array<(deps: any[], meta: Meta<D>) => any[]>;
property getCellProps
getCellProps: Array<CellPropGetter<D>>;
property getFooterGroupProps
getFooterGroupProps: Array<FooterGroupPropGetter<D>>;
property getFooterProps
getFooterProps: Array<FooterPropGetter<D>>;
property getHeaderGroupProps
getHeaderGroupProps: Array<HeaderGroupPropGetter<D>>;
property getHeaderProps
getHeaderProps: Array<HeaderPropGetter<D>>;
property getRowProps
getRowProps: Array<RowPropGetter<D>>;
property getTableBodyProps
getTableBodyProps: Array<TableBodyPropGetter<D>>;
property getTableProps
getTableProps: Array<TablePropGetter<D>>;
property headerGroups
headerGroups: Array< (allColumns: Array<HeaderGroup<D>>, meta: Meta<D>) => Array<HeaderGroup<D>>>;
property headerGroupsDeps
headerGroupsDeps: Array<(deps: any[], meta: Meta<D>) => any[]>;
property prepareRow
prepareRow: Array<(row: Row<D>, meta: Meta<D>) => void>;
property stateReducers
stateReducers: Array< ( newState: TableState<D>, action: ActionType, previousState?: TableState<D>, instance?: TableInstance<D> ) => ReducerTableState<D> | undefined>;
property useControlledState
useControlledState: Array< (state: TableState<D>, meta: Meta<D>) => TableState<D>>;
property useFinalInstance
useFinalInstance: Array<(instance: TableInstance<D>) => void>;
property useInstance
useInstance: Array<(instance: TableInstance<D>) => void>;
property useInstanceBeforeDimensions
useInstanceBeforeDimensions: Array<(instance: TableInstance<D>) => void>;
property useOptions
useOptions: Array< (options: TableOptions<D>, args: TableOptions<D>) => TableOptions<D>>;
property visibleColumns
visibleColumns: Array< (allColumns: Array<ColumnInstance<D>>, meta: Meta<D>) => Array<Column<D>>>;
property visibleColumnsDeps
visibleColumnsDeps: Array<(deps: any[], meta: Meta<D>) => any[]>;
interface UseTableInstanceProps
interface UseTableInstanceProps<D extends object> {}
property allColumns
allColumns: Array<ColumnInstance<D>>;
property allColumnsHidden
allColumnsHidden: boolean;
property columns
columns: Array<ColumnInstance<D>>;
property dispatch
dispatch: TableDispatch;
property flatHeaders
flatHeaders: Array<ColumnInstance<D>>;
property flatRows
flatRows: Array<Row<D>>;
property footerGroups
footerGroups: Array<HeaderGroup<D>>;
property getHooks
getHooks: () => Hooks<D>;
property getTableBodyProps
getTableBodyProps: (propGetter?: TableBodyPropGetter<D>) => TableBodyProps;
property getTableProps
getTableProps: (propGetter?: TablePropGetter<D>) => TableProps;
property getToggleHideAllColumnsProps
getToggleHideAllColumnsProps: ( props?: Partial<TableToggleHideAllColumnProps>) => TableToggleHideAllColumnProps;
property headerGroups
headerGroups: Array<HeaderGroup<D>>;
property headers
headers: Array<ColumnInstance<D>>;
property plugins
plugins: Array<PluginHook<D>>;
property prepareRow
prepareRow: (row: Row<D>) => void;
property rows
rows: Array<Row<D>>;
property rowsById
rowsById: Record<string, Row<D>>;
property setHiddenColumns
setHiddenColumns: (param: Array<IdType<D>> | UpdateHiddenColumns<D>) => void;
property state
state: TableState<D>;
property toggleHideAllColumns
toggleHideAllColumns: (value?: boolean) => void;
property toggleHideColumn
toggleHideColumn: (columnId: IdType<D>, value?: boolean) => void;
property totalColumnsWidth
totalColumnsWidth: number;
property visibleColumns
visibleColumns: Array<ColumnInstance<D>>;
interface UseTableRowProps
interface UseTableRowProps<D extends object> {}
property allCells
allCells: Array<Cell<D>>;
property cells
cells: Array<Cell<D>>;
property getRowProps
getRowProps: (propGetter?: RowPropGetter<D>) => TableRowProps;
property id
id: string;
property index
index: number;
property original
original: D;
property subRows
subRows: Array<Row<D>>;
property values
values: Record<IdType<D>, CellValue>;
Type Aliases
type Accessor
type Accessor<D extends object> = ( originalRow: D, index: number, sub: { subRows: D[]; depth: number; data: D[]; }) => CellValue;
type ActionType
type ActionType = { type: string } & Record<string, any>;
type AggregatedValue
type AggregatedValue = any;
type Aggregator
type Aggregator<D extends object> = AggregatorFn<D> | DefaultAggregators | string;
type AggregatorFn
type AggregatorFn<D extends object> = ( columnValues: CellValue[], rows: Array<Row<D>>, isAggregated: boolean) => AggregatedValue;
type CellPropGetter
type CellPropGetter<D extends object> = PropGetter< D, TableCellProps, { cell: Cell<D> }>;
type CellProps
type CellProps<D extends object, V = any> = TableInstance<D> & { column: ColumnInstance<D>; row: Row<D>; cell: Cell<D, V>; value: CellValue<V>;};
type CellValue
type CellValue<V = any> = V;
type Column
type Column<D extends object = {}> = | ColumnGroup<D> | ColumnWithLooseAccessor<D> | ColumnWithStrictAccessor<D>;
type ColumnGroup
type ColumnGroup<D extends object = {}> = ColumnInterface<D> & ColumnGroupInterface<D> & ( | { Header: string } | ({ id: IdType<D> } & { Header: Renderer<HeaderProps<D>>; }) ) & // Not used, but needed for backwards compatibility { accessor?: Accessor<D> | undefined };
type ColumnWithLooseAccessor
type ColumnWithLooseAccessor<D extends object = {}> = ColumnInterface<D> & ColumnInterfaceBasedOnValue<D> & ( | { Header: string } | { id: IdType<D> } | { accessor: keyof D extends never ? IdType<D> : never } ) & { accessor?: | (keyof D extends never ? IdType<D> | Accessor<D> : Accessor<D>) | undefined; };
type ColumnWithStrictAccessor
type ColumnWithStrictAccessor<D extends object = {}> = ColumnInterface<D> & ValueOf<{ [K in keyof D]: { accessor: K; } & ColumnInterfaceBasedOnValue<D, D[K]>; }>;
type DefaultAggregators
type DefaultAggregators = 'sum' | 'average' | 'median' | 'uniqueCount' | 'count';
type DefaultFilterTypes
type DefaultFilterTypes = | 'text' | 'exactText' | 'exactTextCase' | 'includes' | 'includesAll' | 'exact' | 'equals' | 'between';
type DefaultSortTypes
type DefaultSortTypes = 'alphanumeric' | 'datetime' | 'basic' | 'string' | 'number';
type FilterProps
type FilterProps<D extends object> = HeaderProps<D>;
type Filters
type Filters<D extends object> = Array<{ id: IdType<D>; value: FilterValue }>;
type FilterTypes
type FilterTypes<D extends object> = Record<string, FilterType<D>>;
type FilterValue
type FilterValue = any;
type FooterGroupPropGetter
type FooterGroupPropGetter<D extends object> = PropGetter< D, TableFooterGroupProps, { column: HeaderGroup<D> }>;
type FooterPropGetter
type FooterPropGetter<D extends object> = PropGetter< D, TableFooterProps, { column: HeaderGroup<D> }>;
type FooterProps
type FooterProps<D extends object> = TableInstance<D> & { column: ColumnInstance<D>;};
type HeaderGroupPropGetter
type HeaderGroupPropGetter<D extends object> = PropGetter< D, TableHeaderGroupProps, { column: HeaderGroup<D> }>;
type HeaderPropGetter
type HeaderPropGetter<D extends object> = PropGetter< D, TableHeaderProps, { column: HeaderGroup<D> }>;
type HeaderProps
type HeaderProps<D extends object> = TableInstance<D> & { column: ColumnInstance<D>;};
type IdType
type IdType<D> = StringKey<D> | string;
type Meta
type Meta<D extends object, Extension = never, M = MetaBase<D>> = [ Extension] extends [never] ? M : M & Extension;
type OrderByFn
type OrderByFn<D extends object> = (rowA: Row<D>, rowB: Row<D>) => number;
type PropGetter
type PropGetter< D extends object, Props, T extends object = never, P = Partial<Props>> = ((props: P, meta: Meta<D, T>) => P | P[]) | P | P[];
type Renderer
type Renderer<Props> = | ComponentType<Props> | ReactElement | string | number | readonly ReactNode[];
type RowPropGetter
type RowPropGetter<D extends object> = PropGetter<D, TableRowProps, { row: Row<D> }>;
type SortByFn
type SortByFn<D extends object> = ( rowA: Row<D>, rowB: Row<D>, columnId: IdType<D>, desc?: boolean) => number;
type StringKey
type StringKey<D> = Extract<keyof D, string>;
type TableBodyPropGetter
type TableBodyPropGetter<D extends object> = PropGetter<D, TableBodyProps>;
type TableDispatch
type TableDispatch<A = any> = (action: A) => void;
type TablePropGetter
type TablePropGetter<D extends object> = PropGetter<D, TableProps>;
type UseExpandedOptions
type UseExpandedOptions<D extends object> = Partial<{ manualExpandedKey: IdType<D>; paginateExpandedRows: boolean; expandSubRows: boolean; autoResetExpanded?: boolean | undefined;}>;
type UseFiltersColumnOptions
type UseFiltersColumnOptions<D extends object> = Partial<{ Filter: Renderer<FilterProps<D>>; disableFilters: boolean; defaultCanFilter: boolean; filter: FilterType<D> | DefaultFilterTypes | string;}>;
type UseFiltersOptions
type UseFiltersOptions<D extends object> = Partial<{ manualFilters: boolean; disableFilters: boolean; defaultCanFilter: boolean; filterTypes: FilterTypes<D>; autoResetFilters?: boolean | undefined;}>;
type UseGlobalFiltersColumnOptions
type UseGlobalFiltersColumnOptions<D extends object> = Partial<{ disableGlobalFilter?: boolean | undefined;}>;
type UseGlobalFiltersOptions
type UseGlobalFiltersOptions<D extends object> = Partial<{ globalFilter: | (( rows: Array<Row<D>>, columnIds: Array<IdType<D>>, filterValue: any ) => Array<Row<D>>) | string; manualGlobalFilter: boolean; filterTypes: FilterTypes<D>; autoResetGlobalFilter?: boolean | undefined; disableGlobalFilter?: boolean | undefined;}>;
type UseGroupByColumnOptions
type UseGroupByColumnOptions<D extends object> = Partial<{ aggregate: Aggregator<D>; Aggregated: Renderer<CellProps<D>>; disableGroupBy: boolean; defaultCanGroupBy: boolean;}>;
type UseGroupByOptions
type UseGroupByOptions<D extends object> = Partial<{ manualGroupBy: boolean; disableGroupBy: boolean; defaultCanGroupBy: boolean; aggregations: Record<string, AggregatorFn<D>>; groupByFn: ( rows: Array<Row<D>>, columnId: IdType<D> ) => Record<string, Array<Row<D>>>; autoResetGroupBy?: boolean | undefined;}>;
type UsePaginationOptions
type UsePaginationOptions<D extends object> = Partial<{ pageCount: number; manualPagination: boolean; autoResetPage?: boolean | undefined; paginateExpandedRows: boolean;}>;
type UseRowSelectOptions
type UseRowSelectOptions<D extends object> = Partial<{ manualRowSelectedKey: IdType<D>; autoResetSelectedRows: boolean; selectSubRows: boolean;}>;
type UseRowStateLocalState
type UseRowStateLocalState<D extends object, T = unknown> = Record<IdType<D>, T>;
type UseRowStateOptions
type UseRowStateOptions<D extends object> = Partial<{ initialRowStateAccessor: (row: Row<D>) => UseRowStateLocalState<D>; getResetRowStateDeps: (instance: TableInstance<D>) => any[]; autoResetRowState?: boolean | undefined;}>;
type UseRowUpdater
type UseRowUpdater<T = unknown> = T | ((prev: T) => T);
type UseSortByColumnOptions
type UseSortByColumnOptions<D extends object> = Partial<{ defaultCanSort: boolean; disableSortBy: boolean; sortDescFirst: boolean; sortInverted: boolean; sortType: SortByFn<D> | DefaultSortTypes | string;}>;
type UseSortByOptions
type UseSortByOptions<D extends object> = Partial<{ manualSortBy: boolean; disableSortBy: boolean; defaultCanSort: boolean; disableMultiSort: boolean; isMultiSortEvent: (e: MouseEvent) => boolean; maxMultiSortColCount: number; disableSortRemove: boolean; disabledMultiRemove: boolean; orderByFn: ( rows: Array<Row<D>>, sortFns: Array<OrderByFn<D>>, directions: boolean[] ) => Array<Row<D>>; sortTypes: Record<string, SortByFn<D>>; autoResetSortBy?: boolean | undefined;}>;
type UseTableOptions
type UseTableOptions<D extends object> = { columns: ReadonlyArray<Column<D>>; data: readonly D[];} & Partial<{ initialState: Partial<TableState<D>>; stateReducer: ( newState: TableState<D>, action: ActionType, previousState: TableState<D>, instance?: TableInstance<D> ) => TableState<D>; useControlledState: (state: TableState<D>, meta: Meta<D>) => TableState<D>; defaultColumn: Partial<Column<D>>; getSubRows: (originalRow: D, relativeIndex: number) => D[]; getRowId: (originalRow: D, relativeIndex: number, parent?: Row<D>) => string; autoResetHiddenColumns: boolean;}>;
NOTE: To use custom options, use "Interface Merging" to add the custom options
Namespaces
namespace useAbsoluteLayout
namespace useAbsoluteLayout {}
variable pluginName
const pluginName: string;
namespace useBlockLayout
namespace useBlockLayout {}
variable pluginName
const pluginName: string;
namespace useColumnOrder
namespace useColumnOrder {}
variable pluginName
const pluginName: string;
namespace useExpanded
namespace useExpanded {}
variable pluginName
const pluginName: string;
namespace useFilters
namespace useFilters {}
variable pluginName
const pluginName: string;
namespace useFlexLayout
namespace useFlexLayout {}
variable pluginName
const pluginName: string;
namespace useGlobalFilter
namespace useGlobalFilter {}
variable pluginName
const pluginName: string;
namespace useGridLayout
namespace useGridLayout {}
variable pluginName
const pluginName: string;
namespace useGroupBy
namespace useGroupBy {}
variable pluginName
const pluginName: string;
namespace usePagination
namespace usePagination {}
variable pluginName
const pluginName: string;
namespace useResizeColumns
namespace useResizeColumns {}
variable pluginName
const pluginName: string;
namespace useRowSelect
namespace useRowSelect {}
variable pluginName
const pluginName: string;
namespace useRowState
namespace useRowState {}
variable pluginName
const pluginName: string;
namespace useSortBy
namespace useSortBy {}
variable pluginName
const pluginName: string;
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/react-table
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/react-table)
- HTML<a href="https://www.jsdocs.io/package/@types/react-table"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 7674 ms. - Missing or incorrect documentation? Open an issue for this package.