import "./icon-YIyJDwM9.js"; import { LitElement, PropertyValues } from "lit"; export type AcTextItem = { readonly label: string; readonly subLabel?: string; readonly icon?: string; readonly key?: string; readonly data?: unknown; /** When true, Tab-accept will not append `tabSuffix`. */ readonly isLeaf?: boolean; /** Character positions within label that matched the query, used for CSS highlight rendering. */ readonly positions?: ReadonlySet; }; export type AcTextSelectDetail = { readonly item: AcTextItem; readonly query: string; }; export type AcTextSelectEvent = CustomEvent; /** * Fired when the user commits a value — either by pressing Enter on typed text * or by selecting an item from the autocomplete popup (keyboard or click). */ export type AcTextChangeDetail = { /** The committed text value (typed text, or the selected item's label). */ readonly value: string; /** * The item key. For autocomplete items: `item.key ?? item.label`. * For plain typed text: the text itself. */ readonly key: string; /** The item's `data` payload. Only present for autocomplete selections. */ readonly data?: unknown; /** Whether the commit came from plain typed text or an autocomplete selection. */ readonly source: `text` | `autocomplete`; }; export type AcTextChangeEvent = CustomEvent; /** * Fired on every edit of the text (each keystroke, paste, or Tab-accept), * whether or not it is ever committed. Lets a consumer keep a half-typed value * that is left with a blur, which `change` never reports. */ export type AcTextValueDetail = { /** The text now in the input. */ readonly value: string; }; export type AcTextValueEvent = CustomEvent; export type AcTextCompletionProvider = (query: string, signal: AbortSignal) => Promise | AcTextItem[]; export declare class AcTextElement extends LitElement { #private; private static _count; private readonly _anchorName; /** Provides completion results for a query string. */ completionProvider: AcTextCompletionProvider | undefined; /** Placeholder text for the input. */ placeholder: string; /** Maximum number of query results to cache (LRU). */ cacheSize: number; /** Debounce delay in ms before invoking the provider after keystroke. */ debounceMs: number; /** * Pre-populate the input with this value. Updated externally after construction is ignored * unless the input is not currently focused. */ value: string; /** * String appended to the label when Tab is used to accept a suggestion. * Useful for path-style inputs where Tab-accepting a segment should add the separator. */ tabSuffix: string; private _query; private _results; private _isOpen; private _isLoading; /** How many of `_results` are in the DOM (the rest render as the popup scrolls). */ private _renderLimit; private tickled; constructor(); disconnectedCallback(): void; firstUpdated(): void; protected updated(changedProps: PropertyValues): void; focus(options?: FocusOptions, selectionStart?: number, selectionEnd?: number): void; focusWithValue(value: string, selectionStart?: number, selectionEnd?: number): void; selectRange(start: number, end?: number): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-ac-text': AcTextElement; } }