UNPKG

trellis

Version:

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

23 lines 934 B
/** * Dialog React — `useDialog` hook (ADR 0034 wedge 2). * * Import from `trellis/dialog/react`: * * const { state, actions } = useDialog(); * const result = await actions.open({ title: 'Confirm', kind: 'confirm', buttons: […] }); * {state.stack.map((d) => <DialogSurface key={d.id} instance={d} />)} * * The core is created once per mount; state flows through * `useSyncExternalStore` (same bridge as `trellis/forms/react`). * * @module trellis/dialog/react */ import type { DialogConfig, UseDialogReturn } from '../core/index.js'; /** Accept either a config (fresh core) or an existing core (shared mount). */ export type DialogInput = DialogConfig | UseDialogReturn; /** * Bind a dialog stack to React. Pass a config for a fresh core, or an * existing core to share one mount across adapters. */ export declare function useDialog(input?: DialogInput): UseDialogReturn; //# sourceMappingURL=index.d.ts.map