import type { ReactTable, RowData, Table, TableFeature, TableOptions, TableState, tableMemo } from '@tanstack/react-table'; import type { TDataTableFeatures } from './features.types.js'; /** * The DataTable's `useTable` instance. * * The table subscribes to no state slice at all. Components and hooks * subscribe to the specific slice they need close to where they use it, so * `table.state` carries nothing here. The third `ReactTable` generic argument * is pinned to `null` to keep that explicit in the type and to discourage * reading `table.state` from the table instance. */ export type DataTableInstance = ReactTable; /** * The table options composed by the DataTable config hooks. * * In the TanStack Table 9 beta typings used here, `state` is `readonly`. * Before the options are handed to `useTable`, the object is still owned by * DataTable and its state slices are composed incrementally. */ export type DataTableOptions = TableOptions & { state?: Partial>; }; /** * The `table` option of `tableMemo`. * * Upstream types it as `Table`. TanStack Table 9 marks `TData` * invariant, which means a table that stays generic over its row type is not * assignable to that shape. The row model factories use this alias instead of * repeating the upstream lookup. */ export type TableMemoTable = Parameters[0]['table']; type DataTablePrototypeConstructor = (prototype: Record, table: Table) => void; type DataTableTableConstructor = (table: Table) => void; type TableFeaturePrototypeConstructor = NonNullable; type TableFeatureTableConstructor = NonNullable; /** * Narrows an upstream table lifecycle callback to DataTable's feature map. * @internal */ export declare function createPrototypeConstructor(constructor: DataTablePrototypeConstructor): TableFeaturePrototypeConstructor; /** * Narrows an upstream table API lifecycle callback to DataTable's feature map. * @internal */ export declare function createTableConstructor(constructor: DataTableTableConstructor): TableFeatureTableConstructor; export {}; //# sourceMappingURL=table.types.d.ts.map