UNPKG

trellis

Version:

Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications

34 lines 1.87 kB
/** * Table core — headless datatable behind the standard bridge * (ADR 0034 wedge 6). * * Framework-free, DOM-free, timer-free: the grid engine is * `@tanstack/table-core` (adopted per ADR 0034 §4.2 — Tier 2, no DOM, * Node-testable), wrapped behind the HeadlessCore contract so every * behavior is deterministic. The Trellis-specific layer is built: * * - rows are bound to entities — `updateRow`/cell edit mutate one row * (one op when an app writes through `onCellEdit`); * - `undoHistory` composes the undo-history service core: * edit/add/remove each push one reversible command, and the table * projects `canUndo`/`canRedo` (live, even for external pushes); * - inline editing: `startEdit``setEditDraft``commitEdit` with * per-column-type coercion (`number` rejects non-finite drafts) and an * external write hook that can reject; grid moves cancel the editor. * * const undo = createUndoHistoryCore(); * const table = createTableCore({ data: tasks, columns, undoHistory: undo }); * table.actions.startEdit('t1', 'title'); * table.actions.setEditDraft('Ship it'); * table.actions.commitEdit(); // one undo step; onCellEdit writes the op * table.actions.undo(); // local row reverts; op-log reverses durably * * Boundary: schema-derived columns (forms-descriptor generator) and * durable entity writes live in the app layer. * * @module trellis/table */ import type { TableConfig, UseTableReturn } from './types.js'; export type { CellValueType, EditingCell, SortDirection, SortSpec, TableActions, TableColumn, TableColumnView, TableConfig, TableRowView, TableState, UndoCommandLike, UndoLike, UseTableReturn, } from './types.js'; export declare function createTableCore<T extends object>(config: TableConfig<T>): UseTableReturn<T>; //# sourceMappingURL=index.d.ts.map