import type { ColumnFiltersColumn, ColumnFiltersColumnDef, ColumnFiltersInstance, ColumnFiltersOptions, ColumnFiltersRow, ColumnFiltersTableState, ColumnOrderColumn, ColumnOrderInstance, ColumnOrderOptions, ColumnOrderTableState, ColumnPinningColumn, ColumnPinningColumnDef, ColumnPinningInstance, ColumnPinningOptions, ColumnPinningRow, ColumnPinningTableState, ColumnSizingColumn, ColumnSizingColumnDef, ColumnSizingHeader, ColumnSizingInstance, ColumnSizingOptions, ExpandedInstance, ExpandedOptions, ExpandedRow, ExpandedTableState, FacetedColumn, FacetedOptions, Getter, GlobalFacetingInstance, GlobalFilterColumn, GlobalFilterInstance, GlobalFilterOptions, GlobalFilterTableState, GroupingCell, GroupingColumn, GroupingColumnDef, GroupingInstance, GroupingOptions, GroupingRow, GroupingTableState, PaginationInstance, PartialKeys, RowPinningInstance, RowPinningOptions, RowPinningRow, RowPinningTableState, RowSelectionInstance, RowSelectionOptions, RowSelectionRow, RowSelectionTableState, SortingColumn, SortingColumnDef, SortingInstance, SortingOptions, SortingTableState, UnionToIntersection, VisibilityColumn, VisibilityColumnDef, VisibilityInstance, VisibilityOptions, VisibilityTableState } from '@tanstack/react-table'; import type { DataTableAlignmentColumnDef } from '../../features/ColumnAlignment.js'; import type { DataTableColumnFontStyleColumn, DataTableColumnFontStyleInstance, DataTableColumnFontStyleOptions, DataTableColumnFontStyleTableState } from '../../features/ColumnFontStyle/column-font-style-types.js'; import type { DataTableColumnOrderColumn, DataTableColumnOrderHeader, DataTableColumnOrderInstance, DataTableColumnOrderOptions, DataTableColumnOrderState } from '../../features/ColumnOrder/column-order-types.js'; import type { DataTableColumnPinningColumn, DataTableColumnPinningHeader, DataTableColumnPinningInstance, DataTableColumnPinningOptions } from '../../features/ColumnPinning/column-pinning-types.js'; import type { DataTableColumnSizingHeader, DataTableColumnSizingTableState } from '../../features/ColumnSizing/column-sizing-types.js'; import type { DataTableColumnType, DataTableMeterbarColumnConfig, DataTableSparklineColumnConfig, DataTableGanttColumnConfig, DataTableMarkdownColumnConfig, DataTableLogContentColumnConfig, DataTableTextColumnConfig } from '../../features/ColumnTypes/column-types-types.js'; import type { DataTableColumnVisibilityColumn, DataTableColumnVisibilityInstance, DataTableVisibilityOptions } from '../../features/ColumnVisibility/column-visibility-types.js'; import type { DataTableCustomHeaderColumnDef } from '../../features/CustomHeader.js'; import type { DataTableDownloadDataCell, DataTableDownloadDataHeader, DataTableDownloadDataInstance, DataTableDownloadDataOptions } from '../../features/Download/download-types.js'; import type { DataTableGanttChartState, DataTableGanttChartInstance } from '../../features/GanttChart/gantt-chart-types.js'; import type { DataTableLayoutColumn, DataTableLayoutColumnDef, DataTableLayoutHeader, DataTableLayoutInstance, DataTableLayoutOptions, DataTableLayoutRow, DataTableLayoutTableState } from '../../features/Layout/layout-types.js'; import type { DataTableLineWrapColumn, DataTableLineWrapInstance, DataTableLineWrapOptions, DataTableLineWrapTableState } from '../../features/LineWrap/line-wrap-types.js'; import type { DataTableLoadingState } from '../../features/LoadingState/loading-state-types.js'; import type { DataTableMeterbarChartState } from '../../features/MeterBarChart/meterbar-chart-types.js'; import type { DataTablePaginationInitialTableState, DataTablePaginationInstance, DataTablePaginationOptions, DataTablePaginationTableState } from '../../features/Pagination/pagination-types.js'; import type { DataTableRowDetailsOptions, DataTableRowDetailsRow, DataTableRowDetailsState, DataTableRowDetailsInstance } from '../../features/RowDetails/row-details-types.js'; import type { DataTableRowIdentificationOptions } from '../../features/RowIdentification/row-identification-types.js'; import type { DataTableRowInteractivityInstance, DataTableRowInteractivityOptions, DataTableRowInteractivityRow, DataTableRowInteractivityState } from '../../features/RowInteractivity/row-interactivity-types.js'; import type { DataTableRowOrderInstance, DataTableRowOrderOptions, DataTableRowOrderRow, DataTableRowOrderState } from '../../features/RowOrder/row-order-types.js'; import type { DataTableRowSelectionInstance, DataTableRowSelectionOptions, DataTableRowSelectionRow } from '../../features/RowSelection/row-selection-types.js'; import type { DataTableCustomSortingFn, DataTableSortingColumnDef, DataTableSortingHeader, DataTableSortingOptions, DataTableSortingRow } from '../../features/Sorting/sorting-types.js'; import type { DataTableSubRowsInstance, DataTableSubRowsOptions, DataTableSubRowsRow } from '../../features/SubRows/sub-rows-types.js'; import type { DataTableRowThresholdOptions, DataTableThresholdCell, DataTableThresholdColumn, DataTableThresholdColumnDef, DataTableThresholdRow } from '../../features/Thresholds/threshold-types.js'; import type { DataTableUserActionColumnDef, DataTableUserActionsCell, DataTableUserActionsColumn, DataTableUserActionsInstance, DataTableUserActionsOptions, DataTableUserActionsState } from '../../features/UserActions/user-actions-types.js'; import type { DataTableVirtualScrollingInstance } from '../../features/VirtualScrolling/virtual-scrolling-types.js'; import type { DataTableVisualVariantTableInstance, DataTableVisualVariantTableState } from '../../features/VisualVariants/visual-variants-types.js'; import type { RequiredKeys } from '../../tanstack-table-core-override/src/index.js'; /** @internal */ export interface TableMeta { } /** @internal */ export interface ColumnMeta { config?: DataTableSparklineColumnConfig | DataTableMeterbarColumnConfig | DataTableGanttColumnConfig | DataTableMarkdownColumnConfig | DataTableLogContentColumnConfig | DataTableTextColumnConfig | never; hasFormatter?: boolean; hasCustomCellRenderer?: boolean; hasCustomHeaderRenderer?: boolean; /** Specifies if the column is an automatically generated, internal one. */ /** * Defines if it is considered a spacer column. Most likely the last * one that makes sure the columns continue on. */ spacer?: boolean; /** Specifies if the column is a automatically generated internal one. */ builtin?: true; /** Specifies if the column is a builtin prefix or postfix. */ builtinPlacement?: 'prefix' | 'suffix'; /** * Font style defined based on column level. */ fontStyle?: 'text' | 'code'; /** * This is used to control the memoization on our custom header renderers. * The returned value will be bound as a string prop to the DataTableHeader component * in order to control the React.memo invalidation on the component. */ headerDeps?: (header: Header) => Array; /** * This is used to control the memoization on our custom cell renderers. * The returned value will be bound as a string prop to the DataTableCell component * in order to control the React.memo invalidation on the component. */ cellDeps?: (cell: Cell) => Array; } /** @internal */ export interface FilterMeta { } /** @internal */ export interface FilterFns { } /** @internal */ export interface SortingFns { } /** @internal */ export interface AggregationFns { } /** @internal */ export type Updater = T | ((old: T) => T); /** @internal */ export type OnChangeFn = (updaterOrValue: Updater) => void; /** @internal */ export type RowData = unknown | object | any[]; /** @internal */ export type AnyRender = (Comp: any, props: any) => any; /** @internal */ export interface TableFeature { createCell?: (cell: any, column: any, row: any, table: any) => any; createColumn?: (column: any, table: any) => any; createHeader?: (column: any, table: any) => any; createRow?: (row: any, table: any) => any; createTable?: (table: any) => any; getDefaultColumnDef?: () => any; getDefaultOptions?: (table: any) => any; getInitialState?: (initialState?: InitialTableState) => any; } /** @internal */ export interface Table extends CoreInstance, HeadersInstance, Omit, 'getVisibleFlatColumns' | 'getVisibleLeafColumns' | 'getLeftVisibleLeafColumns' | 'getCenterVisibleLeafColumns' | 'getRightVisibleLeafColumns'>, Omit, '_getOrderColumnsFn'>, Omit, 'getLeftLeafColumns' | 'getRightLeafColumns' | 'getCenterLeafColumns'>, RowPinningInstance, ColumnFiltersInstance, GlobalFilterInstance, GlobalFacetingInstance, Omit, 'getPreSortedRowModel'>, GroupingInstance, ColumnSizingInstance, Omit, 'getExpandedRowModel'>, Omit, 'getPrePaginationRowModel' | 'getPaginationRowModel' | 'setPageIndex' | 'setPagination'>, Omit, 'getSelectedRowModel'>, DataTableLineWrapInstance, DataTableColumnFontStyleInstance, DataTableLayoutInstance, DataTableVisualVariantTableInstance, DataTableColumnVisibilityInstance>, DataTableColumnPinningInstance, Header>, DataTableColumnOrderInstance>, DataTableRowSelectionInstance, DataTableSubRowsInstance>, DataTableRowInteractivityInstance, DataTableVirtualScrollingInstance, DataTableDownloadDataInstance, DataTableRowDetailsInstance, DataTableUserActionsInstance, DataTablePaginationInstance, DataTableRowOrderInstance, RowModel>, DataTableGanttChartInstance { getPreSortedRowModel: () => RowModel; getPrePaginationRowModel: () => RowModel; getPaginationRowModel: () => RowModel; getSelectedRowModel: () => RowModel; getExpandedRowModel: () => RowModel; } /** @internal */ export interface FeatureOptions extends VisibilityOptions, DataTableVisibilityOptions, ColumnOrderOptions, DataTableColumnOrderOptions, ColumnPinningOptions, DataTableColumnPinningOptions, RowPinningOptions, FacetedOptions, ColumnFiltersOptions, GlobalFilterOptions, Omit, 'getSortedRowModel'>, GroupingOptions, ExpandedOptions, ColumnSizingOptions, Omit, 'enableRowSelection'>, DataTableLineWrapOptions, DataTableColumnFontStyleOptions, DataTableUserActionsOptions, DataTablePaginationOptions, RowModel>, DataTableRowThresholdOptions, DataTableLayoutOptions, DataTableSortingOptions, RowModel>, DataTableRowSelectionOptions>, DataTableRowInteractivityOptions>, DataTableDownloadDataOptions, DataTableSubRowsOptions, DataTableRowIdentificationOptions, DataTableRowDetailsOptions, DataTableRowOrderOptions, Row, RowModel> { } /** @internal */ export type TableOptionsResolved = CoreOptions & FeatureOptions; /** @internal */ export type TableOptions = PartialKeys, 'state' | 'onStateChange' | 'renderFallbackValue'>; /** @internal */ export interface TableState extends CoreTableState, VisibilityTableState, ColumnOrderTableState, ColumnPinningTableState, RowPinningTableState, ColumnFiltersTableState, GlobalFilterTableState, SortingTableState, ExpandedTableState, GroupingTableState, DataTableColumnSizingTableState, DataTablePaginationTableState, RowSelectionTableState, DataTableLineWrapTableState, DataTableColumnFontStyleTableState, DataTableLayoutTableState, DataTableVisualVariantTableState, DataTableLoadingState, DataTableRowInteractivityState, DataTableGanttChartState, DataTableMeterbarChartState, DataTableRowDetailsState, DataTableRowOrderState>, DataTableUserActionsState, DataTableColumnOrderState> { } /** @internal */ export interface CompleteInitialTableState extends CoreTableState, VisibilityTableState, ColumnOrderTableState, ColumnPinningTableState, RowPinningTableState, ColumnFiltersTableState, GlobalFilterTableState, SortingTableState, ExpandedTableState, GroupingTableState, DataTableColumnSizingTableState, DataTablePaginationInitialTableState, RowSelectionTableState, DataTableLineWrapTableState, DataTableLayoutTableState, DataTableVisualVariantTableState, DataTableRowInteractivityState, DataTableRowDetailsState, DataTableRowOrderState>, DataTableColumnOrderState> { } /** @internal */ export type InitialTableState = Partial>; /** @internal */ export interface CoreRow { _getAllCellsByColumnId: () => Record>; _uniqueValuesCache: Record; _valuesCache: Record; /** * Returns a shallow clone of the row, preserving the prototype chain. * This is needed because rows use prototypes for methods. */ clone: () => Row; /** * The depth of the row (if nested or grouped) relative to the root row array. * Zero-based, so the top-level rows have a depth of 0, their sub-rows have a depth of 1, and so on. */ depth: number; /** * Returns all the cells for the row. */ getAllCells: () => Cell[]; /** * Returns the leaf rows for the row, not including any parent rows. */ getLeafRows: () => Row[]; /** * Returns the parent row for the row, if it exists. */ getParentRow: () => Row | undefined; /** * Returns the parent rows for the row, all the way up to a root row. */ getParentRows: () => Row[]; /** * Returns a unique array of values from the row for a given columnId. */ getUniqueValues: (columnId: string) => TValue[]; /** * Returns the value from the row for a given columnId. */ getValue: (columnId: string) => TValue; /** * The resolved unique identifier for the row resolved via the `options.getRowId` option. Defaults to the row's index (or relative index if it is a subRow). */ id: string; /** * The index of the row within its parent array (or the root data array). */ index: number; /** * The original row object provided to the table. If the row is a grouped row, the original row object will be the first original in the group. */ original: TData; /** * An array of the original subRows as returned by the `options.getSubRows` option. */ originalSubRows?: TData[]; /** * If nested, this row's parent row id. */ parentId?: string; /** * Renders the value for the row in a given columnId the same as `getValue`, but will return the `renderFallbackValue` if no value is found. */ renderValue: (columnId: string) => TValue; /** * An array of subRows for the row as returned and created by the `options.getSubRows` option. */ subRows: Row[]; } /** @internal */ export interface VisibilityRow { _getAllVisibleCells: () => Cell[]; /** * Returns an array of cells that account for column visibility for the row. */ getVisibleCells: () => Cell[]; } /** @internal */ export interface Row extends CoreRow, VisibilityRow, ColumnPinningRow, RowPinningRow, ColumnFiltersRow, GroupingRow, Omit, DataTableLayoutRow, DataTableThresholdRow, ExpandedRow, DataTableSubRowsRow>, DataTableSortingRow, DataTableRowInteractivityRow, DataTableRowDetailsRow, DataTableRowSelectionRow, DataTableRowOrderRow { } /** @internal */ export interface RowModel { rows: Row[]; flatRows: Row[]; rowsById: Record>; } /** @internal */ export type AccessorFn = (originalRow: TData, index: number) => TValue; /** @internal */ export type ColumnDefTemplate = string | ((props: TProps) => any); /** @internal */ export type StringOrTemplateHeader = string | ColumnDefTemplate>; /** @internal */ export interface StringHeaderIdentifier { header: string; id?: string; } /** @internal */ export interface IdIdentifier { id: string; header?: StringOrTemplateHeader; } /** @internal */ export type ColumnIdentifiers = IdIdentifier | StringHeaderIdentifier; /** @internal */ export interface ColumnDefExtensions extends VisibilityColumnDef, ColumnPinningColumnDef, ColumnFiltersColumnDef, SortingColumnDef, GroupingColumnDef, ColumnSizingColumnDef, DataTableLayoutColumnDef, DataTableThresholdColumnDef, DataTableAlignmentColumnDef, DataTableSortingColumnDef, DataTableUserActionColumnDef, DataTableCustomHeaderColumnDef { } /** @internal */ export interface ColumnDefBase extends ColumnDefExtensions { getUniqueValues?: AccessorFn; columnType?: DataTableColumnType; sortType?: DataTableSortingColumnDef['sortType']; sortAccessor?: DataTableSortingColumnDef['sortAccessor']; customSortingFn?: DataTableCustomSortingFn; footer?: ColumnDefTemplate>; cell?: ColumnDefTemplate>; meta?: ColumnMeta; } /** @internal */ export interface IdentifiedColumnDef extends ColumnDefBase { id?: string; header?: StringOrTemplateHeader; } /** @internal */ export type DisplayColumnDef = ColumnDefBase & ColumnIdentifiers; /** @internal */ export interface GroupColumnDefBase extends ColumnDefBase { columns?: ColumnDef[]; } /** @internal */ export type GroupColumnDef = GroupColumnDefBase & ColumnIdentifiers; /** @internal */ export interface AccessorFnColumnDefBase extends ColumnDefBase { accessorFn: AccessorFn; } /** @internal */ export type AccessorFnColumnDef = AccessorFnColumnDefBase & ColumnIdentifiers; /** @internal */ export interface AccessorKeyColumnDefBase extends ColumnDefBase { id?: string; accessorKey: (string & {}) | keyof TData; } /** @internal */ export type AccessorKeyColumnDef = AccessorKeyColumnDefBase & Partial>; /** @internal */ export type AccessorColumnDef = AccessorKeyColumnDef | AccessorFnColumnDef; /** @internal */ export type ColumnDef = DisplayColumnDef | GroupColumnDef | AccessorColumnDef; /** @internal */ export type ColumnDefResolved = Partial>> & { accessorKey?: string; }; /** @internal */ export interface CoreColumn { /** * The resolved accessor function to use when extracting the value for the column from each row. Will only be defined if the column def has a valid accessor key or function defined. */ accessorFn?: AccessorFn; /** * The original column def used to create the column. */ columnDef: ColumnDef; /** * The child column (if the column is a group column). Will be an empty array if the column is not a group column. */ columns: Column[]; /** * The depth of the column (if grouped) relative to the root column def array. */ depth: number; /** * Returns the flattened array of this column and all child/grand-child columns for this column. */ getFlatColumns: () => Column[]; /** * Returns an array of all leaf-node columns for this column. If a column has no children, it is considered the only leaf-node column. */ getLeafColumns: () => Column[]; /** * The resolved unique identifier for the column resolved in this priority: - A manual `id` property from the column def - The accessor key from the column def - The header string from the column def */ id: string; /** * The parent column for this column. Will be undefined if this is a root column. */ parent?: Column; } /** @internal */ export interface Column extends CoreColumn, VisibilityColumn, ColumnPinningColumn, FacetedColumn, ColumnFiltersColumn, GlobalFilterColumn, DataTableUserActionsColumn, SortingColumn, GroupingColumn, ColumnSizingColumn, ColumnOrderColumn, DataTableLineWrapColumn, DataTableColumnFontStyleColumn, DataTableLayoutColumn, DataTableColumnPinningColumn, DataTableColumnVisibilityColumn>, DataTableColumnOrderColumn, DataTableThresholdColumn { getCustomSortingFn: () => DataTableCustomSortingFn; getIsSortableTable: () => boolean; } /** @internal */ export interface CellContext { cell: Cell; column: Column; getValue: Getter; renderValue: Getter; row: Row; table: Table; } /** @internal */ export interface CoreCell { /** * The associated Column object for the cell. */ column: Column; /** * Returns the rendering context (or props) for cell-based components like cells and aggregated cells. Use these props with your framework's `flexRender` utility to render these using the template of your choice: */ getContext: () => CellContext; /** * Returns the value for the cell, accessed via the associated column's accessor key or accessor function. */ getValue: CellContext['getValue']; /** * The unique ID for the cell across the entire table. */ id: string; /** * Renders the value for a cell the same as `getValue`, but will return the `renderFallbackValue` if no value is found. */ renderValue: CellContext['renderValue']; /** * The associated Row object for the cell. */ row: Row; } /** @internal */ export interface Cell extends CoreCell, GroupingCell, DataTableThresholdCell, DataTableUserActionsCell, DataTableDownloadDataCell { } /** @internal */ export interface HeaderContext { /** * An instance of a column. */ column: Column; /** * An instance of a header. */ header: Header; /** * The table instance. */ table: Table; } /** @internal */ export interface HeadersInstance { /** * Returns all header groups for the table. */ getHeaderGroups: () => HeaderGroup[]; /** * If pinning, returns the header groups for the left pinned columns. */ getLeftHeaderGroups: () => HeaderGroup[]; /** * If pinning, returns the header groups for columns that are not pinned. */ getCenterHeaderGroups: () => HeaderGroup[]; /** * If pinning, returns the header groups for the right pinned columns. */ getRightHeaderGroups: () => HeaderGroup[]; /** * Returns the footer groups for the table. */ getFooterGroups: () => HeaderGroup[]; /** * If pinning, returns the footer groups for the left pinned columns. */ getLeftFooterGroups: () => HeaderGroup[]; /** * If pinning, returns the footer groups for columns that are not pinned. */ getCenterFooterGroups: () => HeaderGroup[]; /** * If pinning, returns the footer groups for the right pinned columns. */ getRightFooterGroups: () => HeaderGroup[]; /** * Returns headers for all columns in the table, including parent headers. */ getFlatHeaders: () => Header[]; /** * If pinning, returns headers for all left pinned columns in the table, including parent headers. */ getLeftFlatHeaders: () => Header[]; /** * If pinning, returns headers for all columns that are not pinned, including parent headers. */ getCenterFlatHeaders: () => Header[]; /** * If pinning, returns headers for all right pinned columns in the table, including parent headers. */ getRightFlatHeaders: () => Header[]; /** * Returns headers for all leaf columns in the table, (not including parent headers). */ getLeafHeaders: () => Header[]; /** * If pinning, returns headers for all left pinned leaf columns in the table, (not including parent headers). */ getLeftLeafHeaders: () => Header[]; /** * If pinning, returns headers for all columns that are not pinned, (not including parent headers). */ getCenterLeafHeaders: () => Header[]; /** * If pinning, returns headers for all right pinned leaf columns in the table, (not including parent headers). */ getRightLeafHeaders: () => Header[]; } /** @internal */ export interface CoreHeader { /** * The col-span for the header. */ colSpan: number; /** * The header's associated column object. */ column: Column; /** * The depth of the header, zero-indexed based. */ depth: number; /** * Returns the rendering context (or props) for column-based components like headers, footers and filters. */ getContext: () => HeaderContext; /** * Returns the leaf headers hierarchically nested under this header. */ getLeafHeaders: () => Header[]; /** * The header's associated header group object. */ headerGroup: HeaderGroup; /** * The unique identifier for the header. */ id: string; /** * The index for the header within the header group. */ index: number; /** * A boolean denoting if the header is a placeholder header. */ isPlaceholder: boolean; /** * If the header is a placeholder header, this will be a unique header ID that does not conflict with any other headers across the table. */ placeholderId?: string; /** * The row-span for the header. */ rowSpan: number; /** * The header's hierarchical sub/child headers. Will be empty if the header's associated column is a leaf-column. */ subHeaders: Header[]; } /** @internal */ export interface Header extends CoreHeader, Omit, DataTableLayoutHeader>, DataTableColumnSizingHeader, DataTableSortingHeader, DataTableColumnOrderHeader, DataTableDownloadDataHeader, DataTableColumnPinningHeader { } /** @internal */ export interface CoreHeaderGroup { depth: number; headers: Header[]; id: string; } /** @internal */ export type HeaderGroup = CoreHeaderGroup; /** * Transform object for dnd kit drag and drop. * * The x and y coordinates represent the delta from the point of origin of your draggable element since it started being dragged. * The scaleX and scaleY properties represent the difference in scale between the item that is dragged and the droppable container it is currently over. * @internal */ export type DragAndDropTransform = { x: number; y: number; scaleX: number; scaleY: number; }; /** @internal */ export interface CoreInstance { _features: readonly TableFeature[]; _getAllFlatColumnsById: () => Record>; _getColumnDefs: () => ColumnDef[]; _getCoreRowModel?: () => RowModel; _getDefaultColumnDef: () => Partial>; _getRowId: (_: TData, index: number, parent?: Row) => string; _queue: (cb: () => void) => void; /** * Returns all columns in the table in their normalized and nested hierarchy. */ getAllColumns: () => Column[]; /** * Returns all columns in the table flattened to a single level. */ getAllFlatColumns: () => Column[]; /** * Returns all column IDs in the table flattened to a single level, excluding builtin columns. */ getAllFlatColumnIdsWithoutBuiltin: () => string[]; /** * Returns all leaf-node columns in the table flattened to a single level. This does not include parent columns. */ getAllLeafColumns: () => Column[]; /** * Returns all leaf-node columns in the table flattened to a single level. * This does not include parent and built-in columns. */ getAllLeafColumnsWithoutBuiltin: () => Column[]; /** * Returns a single column by its ID. */ getColumn: (columnId: string) => Column | undefined; /** * Returns a single header by its ID. */ getHeader: (headerId: string) => Header | undefined; /** * Returns the core row model before any processing has been applied. */ getCoreRowModel: () => RowModel; /** * Returns the row with the given ID. */ getRow: (id: string, searchAll?: boolean) => Row; /** * Returns the final model after all processing from other used features has been applied. This is the row model that is most commonly used for rendering. */ getRowModel: () => RowModel; /** * Call this function to get the table's current state. It's recommended to use this function and its state, especially when managing the table state manually. It is the exact same state used internally by the table for every feature and function it provides. */ getState: () => TableState; /** * This is the resolved initial state of the table. */ initialState: TableState; /** * A read-only reference to the table's current options. */ options: RequiredKeys, 'state'>; /** * Call this function to reset the table state to the initial state. */ reset: () => void; /** * This function can be used to update the table options. */ setOptions: (newOptions: Updater>) => void; /** * Call this function to update the table state. */ setState: (updater: Updater) => void; } /** @internal */ export interface CoreTableState { } /** @internal */ export interface CoreOptions { /** * Set this option to override any of the `autoReset...` feature options. */ autoResetAll?: boolean; /** * The array of column defs to use for the table. */ columns: ColumnDef[]; /** * The data for the table to display. This array should match the type you provided to `table.setRowType<...>`. Columns can access this data via string/index or a functional accessor. When the `data` option changes reference, the table will reprocess the data. */ data: TData[]; /** * Set this option to `true` to output all debugging information to the console. */ debugAll?: boolean; /** * Set this option to `true` to output cell debugging information to the console. */ debugCells?: boolean; /** * Set this option to `true` to output column debugging information to the console. */ debugColumns?: boolean; /** * Set this option to `true` to output header debugging information to the console. */ debugHeaders?: boolean; /** * Set this option to `true` to output row debugging information to the console. */ debugRows?: boolean; /** * Set this option to `true` to output table debugging information to the console. */ debugTable?: boolean; /** * Default column options to use for all column defs supplied to the table. */ defaultColumn?: Partial>; /** * This required option is a factory for a function that computes and returns the core row model for the table. */ getCoreRowModel: (table: Table) => () => RowModel; /** * This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with `.` using their grandparents' index eg. `index.index.index`). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc. */ getRowId?: (originalRow: TData, index: number, parent?: Row) => string; /** * This optional function is used to access the sub rows for any given row. If you are using nested rows, you will need to use this function to return the sub rows object (or undefined) from the row. */ getSubRows?: (originalRow: TData, index: number) => undefined | TData[]; /** * Use this option to optionally pass initial state to the table. This state will be used when resetting various table states either automatically by the table (eg. `options.autoResetPageIndex`) or via functions like `table.resetRowSelection()`. Most reset function allow you optionally pass a flag to reset to a blank/default state instead of the initial state. * * Table state will not be reset when this object changes, which also means that the initial state object does not need to be stable. * */ initialState?: InitialTableState; /** * This option is used to optionally implement the merging of table options. */ mergeOptions?: (defaultOptions: TableOptions, options: Partial>) => TableOptions; /** * You can pass any object to `options.meta` and access it anywhere the `table` is available via `table.options.meta`. */ meta?: TableMeta; /** * The `onStateChange` option can be used to optionally listen to state changes within the table. */ onStateChange: (updater: Updater) => void; /** * Value used when the desired value is not found in the data. */ renderFallbackValue: any; /** * The `state` option can be used to optionally _control_ part or all of the table state. The state you pass here will merge with and overwrite the internal automatically-managed state to produce the final state for the table. You can also listen to state changes via the `onStateChange` option. * Note: Any state passed in here will override both the internal state and any other `initialState` you provide. */ state: Partial; }