UNPKG

trellis

Version:

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

25 lines 915 B
/** * Editor React — `useEditor` hook (ADR 0034 wedge 4). * * Import from `trellis/editor/react`: * * const editor = useEditor({ undoHistory: undo }); * editor.actions.type('hello'); * // <div onKeyDown={(e) => editor.actions.type(e.key)}> * // {editor.state.text} * // </div> * * The core is created once per mount; state flows through * `useSyncExternalStore` (same bridge as `trellis/table/react`). * * @module trellis/editor/react */ import type { EditorConfig, UseEditorReturn } from '../core/index.js'; /** Accept either a config (fresh core) or an existing core (shared mount). */ export type EditorInput = EditorConfig | UseEditorReturn; /** * Bind an editor core to React. Pass a config for a fresh core, or an * existing core to share one mount across adapters. */ export declare function useEditor(input?: EditorInput): UseEditorReturn; //# sourceMappingURL=index.d.ts.map