import { Renderable, Signal, TNode, Value } from '@tempots/dom'; export interface SpotlightItem { id: string; label: string; description?: string; icon?: string; shortcut?: string[]; section?: string; /** Extra terms for fuzzy search */ keywords?: string[]; onSelect: () => void; } export interface SpotlightOptions { items: Value; onSelect?: (item: SpotlightItem) => void; /** @default 'Search' */ placeholder?: Value; /** @default 'No results' */ emptyMessage?: Value; /** @default 'md' */ size?: Value<'sm' | 'md' | 'lg'>; recentItems?: Value; /** @default 'mod+k' */ hotkey?: string; /** @default 'body' */ container?: 'body' | 'element'; /** Overlay backdrop effect. @default 'opaque' */ overlayEffect?: 'opaque' | 'transparent'; } export interface SpotlightController { open: (items?: SpotlightItem[]) => void; close: () => void; isOpen: Signal; } /** * A unified search/command palette with fuzzy search, section grouping, * recent items, and a global hotkey (default: Mod+K). * * Returns a tuple of the rendered TNode and a controller for programmatic * open/close and access to the open state signal. * * @example * ```typescript * const [node, controller] = createSpotlight( * { items: myItems }, * ctrl => Button({ onClick: ctrl.open }, 'Open Spotlight') * ) * ``` */ export declare function createSpotlight(options: SpotlightOptions, children: (controller: SpotlightController) => TNode): [TNode, SpotlightController]; /** * Convenience Renderable wrapper around `createSpotlight`. * * @example * ```typescript * Spotlight( * { items: myItems }, * ctrl => Button({ onClick: ctrl.open }, 'Open') * ) * ``` */ export declare function Spotlight(options: SpotlightOptions, children: (controller: SpotlightController) => TNode): Renderable;