trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
23 lines • 973 B
TypeScript
/**
* Palette React — `usePalette` hook (ADR 0034).
*
* Import from `trellis/palette/react`:
*
* const { state, actions } = usePalette({ items, onSelect });
* <input value={state.query} onInput={(e) => actions.setQuery(e.currentTarget.value)} />
*
* The core is created once per mount; state flows through
* `useSyncExternalStore` (same bridge as `trellis/forms/react`).
*
* @module trellis/palette/react
*/
import type { PaletteConfig, UsePaletteReturn } from '../core/index.js';
/** Accept either a config (fresh core) or an existing core (shared mount). */
export type PaletteInput = PaletteConfig | UsePaletteReturn;
/**
* Bind a palette core to React. Pass a config for a fresh core, or an
* existing core to share one mount across adapters. Returns the same
* surface as the core; the `state` object is the React-observed snapshot.
*/
export declare function usePalette(input: PaletteInput): UsePaletteReturn;
//# sourceMappingURL=index.d.ts.map