export interface ActionValue { element: Element; name?: string; value?: unknown; checked?: boolean; } export interface PromptBoxAttachment { file: File; id: string; previewUrl?: string; } export interface PromptBoxElement { id: string; elementType: string; label: string; data: unknown; icon?: unknown; } export type PromptBoxSegment = { type: 'text'; value?: string; } | { type: 'element'; value: PromptBoxElement; }; export interface PromptBoxSubmitDetail { value: string; segments: PromptBoxSegment[]; topActions: Element[]; bottomActions: Element[]; actionValues: ActionValue[]; attachments: PromptBoxAttachment[]; } export interface PromptBoxElementInsertedDetail { element: PromptBoxElement; } export interface PromptBoxElementRemovedDetail { element: PromptBoxElement; } export interface PromptBoxRecordingCompleteDetail { audioBlob: Blob; duration: number; mimeType: string; } export interface PromptBoxRecordErrorDetail { error: string; } export interface TriggerOption { label: string; value: string; description?: string; icon?: unknown; /** Arbitrary payload attached to the option when selected. */ data?: unknown; /** Element type used when inserting as inline badge (defaults to trigger key). */ elementType?: string; /** When true, renders as a non-interactive category header instead of a selectable option. */ header?: boolean; } /** * Configuration for a single trigger key. * * When the user types this key at a word boundary the prompt box opens a * popover. The popover can contain: * - A named slot (if `slotName` is set) rendered inside the popover for fully custom content. * - A built-in `luzmo-options` list populated from `options`. * - Both at the same time (slot first, then auto-generated list). * * When `lazy` is true the component does **not** filter locally — it emits * `luzmo-trigger-change` and expects the consumer to update `options` via the * `triggers` property. */ export interface TriggerConfig { /** The character that activates this trigger (e.g. `@`, `/`). */ key: string; /** Named slot to render inside the popover for this trigger. */ slotName?: string; /** Options rendered in a built-in `luzmo-options` component. */ options?: TriggerOption[]; /** * When true the component skips local filtering and relies on the consumer * to update `options` in response to `luzmo-trigger-change`. */ lazy?: boolean; /** When true, matching search text is highlighted in option labels. */ highlightSearch?: boolean; /** * Custom render function for the option icon. Receives the option and should * return a Lit `TemplateResult`. When set, the returned template replaces * the default `luzmo-icon` for every option in this trigger. * * ```ts * iconTemplate: (option) => html` * * ` * ``` */ iconTemplate?: (option: TriggerOption) => unknown; } export interface TriggerMenuChangeDetail { trigger: string; open: boolean; searchString: string; } export interface TriggerMenuSelectDetail { trigger: string; elementType: string; label: string; data: unknown; icon?: unknown; } export declare const ELEMENT_MIME_TYPE = "application/x-luzmo-element";