import { CSSResultArray, PropertyValues, TemplateResult } from 'lit'; import { LuzmoElement } from '../../utils/base'; import '../action-button'; import '../button'; import '../button/clear-button'; import '../icon'; import '../overlay'; import '../tags'; import '../text-field'; import { AttachmentsController } from './controllers/attachments-controller'; import { RecordingController } from './controllers/recording-controller'; import { RichInputController } from './controllers/rich-input-controller'; import { TriggerMenuController } from './controllers/trigger-menu-controller'; import type { PromptBoxAttachment, PromptBoxElement, PromptBoxElementInsertedDetail, PromptBoxElementRemovedDetail, PromptBoxRecordErrorDetail, PromptBoxRecordingCompleteDetail, PromptBoxSegment, PromptBoxSubmitDetail, TriggerConfig, TriggerMenuChangeDetail, TriggerMenuSelectDetail, TriggerOption } from './types'; declare const LuzmoPromptBox_base: typeof LuzmoElement & { new (...args: any[]): import("../..").SizedElementInterface; prototype: import("../..").SizedElementInterface; }; /** * A prompt box component for chat/AI interfaces with text input and action slots. * * @element luzmo-prompt-box * * @slot - Default slot for additional content * @slot top-actions - Slot for action buttons displayed above the input * @slot bottom-actions - Slot for action buttons displayed below the input * @slot record-button - Slot for a custom record/voice button * @slot submit-button - Slot for a custom submit button * * @fires luzmo-submit - Fired when the prompt is submitted. * @fires luzmo-trigger-change - Fired when a trigger menu opens, closes, or the search string changes. * @fires luzmo-element-inserted - Fired when an inline element badge is inserted. * @fires luzmo-element-removed - Fired when an inline element badge is removed. * @fires luzmo-attachments-change - Fired when attachments change. * @fires luzmo-record - Fired when recording state changes. * @fires luzmo-recording-complete - Fired when recording finishes. * @fires luzmo-record-cancel - Fired when recording is cancelled. * @fires luzmo-record-error - Fired when recording errors. */ export declare class LuzmoPromptBox extends LuzmoPromptBox_base { static get styles(): CSSResultArray; /** The number of visible text rows for the textarea. */ rows: number; /** Whether the textarea should grow to accommodate content. */ grows: boolean; /** * Maximum rows the textarea can grow to (`-1` = unlimited). * Values less than 1 are disregarded. */ maxRows: number; /** Whether to show the record/voice button. */ recording: boolean; /** Whether the submit button is hidden. */ hideSubmit: boolean; /** Whether submit behavior is disabled while keeping the input interactive. */ disableSubmit: boolean; /** Whether to use single-line layout with actions, input, and submit in one row. */ singleLine: boolean; /** Placeholder text for the input. */ placeholder: string; /** The current value of the input. */ value: string; /** Whether the prompt box is disabled. */ disabled: boolean; /** Whether the input is readonly. */ readonly: boolean; /** Maximum number of characters allowed. */ maxlength: number; /** Whether the prompt box is in a pending/loading state. */ pending: boolean; /** Whether to allow image attachments. */ allowImages: boolean; /** Whether to allow file attachments. */ allowFiles: boolean; /** Accepted file types for attachments (MIME types or extensions). */ acceptedFileTypes: string[]; /** * Whether to enable rich input mode with inline element badges. * When enabled, the textarea is replaced with a contenteditable div. */ allowElements: boolean; /** Optional filter for accepted element types during drag-and-drop. */ acceptedElementTypes: string[]; /** * Trigger key configurations. Each entry defines a key character that * opens a popover when typed at a word boundary. * * ```ts * promptBox.triggers = [ * { key: '@', options: assetOptions, slotName: 'assets-menu' }, * { key: '/', options: skillOptions, lazy: true } * ]; * * ``` */ get triggers(): TriggerConfig[]; set triggers(value: TriggerConfig[]); private _hasTopActions; private _hasBottomActions; private _hasRecordButton; private _hasSubmitButton; private _inputFocused; private _inputElement; private _richInputElement; private _fileInput; private _finishRecordingButton; private _attachments; private _recording; private _richInput; private _triggerMenu; /** @internal — used by templates */ get attachmentsController(): AttachmentsController; /** @internal — used by templates */ get recordingController(): RecordingController; /** @internal — used by templates */ get richInputController(): RichInputController; /** @internal — used by templates */ get triggerMenuController(): TriggerMenuController; /** @internal — used by templates */ get hasRecordButton(): boolean; /** @internal — used by templates */ get hasSubmitButton(): boolean; get tagSize(): 's' | 'm'; get segments(): PromptBoxSegment[]; set segments(value: PromptBoxSegment[]); connectedCallback(): void; disconnectedCallback(): void; protected updated(changedProperties: PropertyValues): void; focus(): void; clear(): void; addFiles(files: File[]): string[]; removeAttachment(id: string): void; clearAttachments(): void; getAttachments(): PromptBoxAttachment[]; openFilePicker(): void; insertElement(elementType: string, label: string, data: unknown, icon?: unknown): string; removeElement(id: string): void; getElements(): PromptBoxElement[]; getTopActions(): Element[]; getBottomActions(): Element[]; submit(): void; /** @internal */ selectTriggerOption(option: TriggerOption): void; /** @internal */ highlightTriggerOption(index: number): void; /** @internal */ handleRecordButtonSlotChange: (e: Event) => void; /** @internal */ handleSubmitButtonSlotChange: (e: Event) => void; /** @internal */ handleRecordClick: (event: Event) => void; /** @internal */ handleInput: (e: Event) => void; /** @internal */ handleKeydown: (e: KeyboardEvent) => void; /** @internal */ handleInputFocusIn: () => void; /** @internal */ handleInputFocusOut: () => void; /** @internal */ handleRichInputEvent: (e: InputEvent) => void; /** @internal */ handleRichKeydown: (e: KeyboardEvent) => void; private _slotPresenceHandler; private _handleComponentFocusIn; private _handleComponentFocusOut; private _handlePaste; /** @internal */ handlePastedImages(clipboardData: DataTransfer | null): boolean; private _handleTopActionsSlotChange; private _handleBottomActionsSlotChange; private _submit; protected render(): TemplateResult; } export type { ActionValue, PromptBoxAttachment, PromptBoxElement, PromptBoxElementInsertedDetail, PromptBoxElementRemovedDetail, PromptBoxRecordErrorDetail, PromptBoxRecordingCompleteDetail, PromptBoxSegment, PromptBoxSubmitDetail, TriggerConfig, TriggerMenuChangeDetail, TriggerMenuSelectDetail, TriggerOption } from './types'; export { ELEMENT_MIME_TYPE } from './types'; declare global { interface GlobalEventHandlersEventMap { 'luzmo-submit': CustomEvent; 'luzmo-record': CustomEvent<{ isRecording: boolean; }>; 'luzmo-recording-complete': CustomEvent; 'luzmo-record-cancel': CustomEvent; 'luzmo-record-error': CustomEvent; 'luzmo-attachments-change': CustomEvent<{ attachments: PromptBoxAttachment[]; }>; 'luzmo-element-inserted': CustomEvent; 'luzmo-element-removed': CustomEvent; 'luzmo-trigger-change': CustomEvent; 'luzmo-trigger-select': CustomEvent; } }