import { TableOptions, Table, RowData } from '@tanstack/react-table'; /** * Arguments for {@link useBeamTable}. * * The full TanStack `TableOptions` shape passes through — `data`, `columns`, * `state`, `onSortingChange`, `manualSorting`, `meta`, and every other TanStack * table option — except: * - `getCoreRowModel`/`getSortedRowModel`/`getExpandedRowModel`: discarded if * passed; this hook always computes and wires these itself. * - `enableSorting`/`enableExpanding`: read from the caller only to pick a * default (`false` when omitted) — see {@link useBeamTable} for why. * * @typeParam TData - Shape of a single row's data. */ export type UseBeamTableArgs = Omit, 'getCoreRowModel' | 'getSortedRowModel' | 'getExpandedRowModel'>; /** * Beam's Layer 2 table hook (see ADR-000: DataTable Architecture & API Model). * * Wraps TanStack's `useReactTable`, always wiring the core row model, and * returns a real, unmodified TanStack `Table` instance — no Beam state is * attached to it (rendering parity across Layer 1/2/3 relies on this). * * `enableSorting`/`enableExpanding` default to `false` (not TanStack's own * default of `true`) and wire the matching row model alongside the flag, so * the two can't drift apart. This closes two footguns (see ADR-000): * - `column.getCanSort()`/`row.getCanExpand()` default to `true` even with no * row model wired, so an instance built without this defaulting can report * an affordance is available when activating it would do nothing. * - Expansion also needs TanStack's own `getSubRows` option (e.g. * `getSubRows: row => row.subRows`) alongside `enableExpanding: true` — * without it, `getCanExpand()` stays `false` forever, silently. This hook * doesn't special-case `getSubRows`; it passes through via `options` like * any other TanStack option. * * A caller needing a fully custom sorting/expanding row-model function should * use the raw `useReactTable` escape hatch (Layer 3) instead of fighting this * hook's flag-driven wiring. * * @typeParam TData - Shape of a single row's data. * @param options - {@link UseBeamTableArgs}. * @returns The TanStack `Table` instance. */ export declare function useBeamTable(options: UseBeamTableArgs): Table;