trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
23 lines • 987 B
TypeScript
/**
* Combobox React — `useCombobox` hook (ADR 0034).
*
* Import from `trellis/combobox/react`:
*
* const { state, actions } = useCombobox({ 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/combobox/react
*/
import type { ComboboxConfig, UseComboboxReturn } from '../core/index.js';
/** Accept either a config (fresh core) or an existing core (shared mount). */
export type ComboboxInput = ComboboxConfig | UseComboboxReturn;
/**
* Bind a combobox 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 useCombobox(input: ComboboxInput): UseComboboxReturn;
//# sourceMappingURL=index.d.ts.map