UNPKG

@tanstack/table-devtools

Version:

Devtools for TanStack Table.

43 lines 2.17 kB
import { RowData, Table, TableFeatures } from "@tanstack/table-core"; import { Readable } from "@tanstack/solid-store"; //#region src/tableTarget.d.ts type Listener = (targets: Array<TableDevtoolsRegistration>) => void; interface TableDevtoolsStore<TState = unknown> extends Readable<TState> { state: TState; } interface TableDevtoolsTable { _features: Record<string, unknown>; _rowModelFns: unknown; baseAtoms: Record<string, unknown>; initialState: unknown; options: { atoms?: Record<string, unknown>; data?: unknown; features?: Record<string, unknown>; key?: string; state?: Record<string, unknown>; [key: string]: unknown; }; optionsStore?: TableDevtoolsStore; reset: () => void; store: TableDevtoolsStore; } interface TableDevtoolsRegistration { id: string; table: TableDevtoolsTable; } interface UpsertTableDevtoolsTargetOptions<TFeatures extends TableFeatures, TData extends RowData> { table: Table<TFeatures, TData>; } interface TableDevtoolsRegistrationManager { update: <TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData> | undefined, enabled?: boolean) => void; dispose: () => void; } declare function upsertTableDevtoolsTarget<TFeatures extends TableFeatures, TData extends RowData>(options: UpsertTableDevtoolsTargetOptions<TFeatures, TData>): (() => void) | undefined; declare function removeTableDevtoolsTarget(id: string): void; declare function getTableDevtoolsTargets(): Array<TableDevtoolsRegistration>; declare function subscribeTableDevtoolsTargets(listener: Listener): () => void; declare function setTableDevtoolsTarget<TFeatures extends TableFeatures, TData extends RowData>(table: Table<TFeatures, TData> | undefined): void; declare function createTableDevtoolsRegistrationManager(): TableDevtoolsRegistrationManager; //#endregion export { TableDevtoolsRegistration, TableDevtoolsRegistrationManager, TableDevtoolsStore, TableDevtoolsTable, UpsertTableDevtoolsTargetOptions, createTableDevtoolsRegistrationManager, getTableDevtoolsTargets, removeTableDevtoolsTarget, setTableDevtoolsTarget, subscribeTableDevtoolsTargets, upsertTableDevtoolsTarget };