/** * Command palette component. * * @augments IvComponent */ export class Command extends IvComponent { /** @type {Readonly} */ static defaults: Readonly; /** * Returns the palette instance attached to `el`, if any. * * @param {Element} el Host element. * @returns {Command|undefined} The instance or `undefined`. */ static get(el: Element): Command | undefined; /** * Returns the existing instance or creates one. * * @param {Element} el Host element. * @param {Partial} [options] Options passed in JavaScript. * @returns {Command} The instance. */ static getOrCreate(el: Element, options?: Partial): Command; /** * Instantiates every `[data-iv-component="command"]` inside `root`. * * @param {ParentNode} [root] Subtree to scan. * @returns {Command[]} Newly created instances. */ static initAll(root?: ParentNode): Command[]; /** * @param {Element} el A `` element. * @param {Partial} [options] Options passed in JavaScript. * @throws {IvError} `invalid-element` when `el` is not a `` or has no input. */ constructor(el: Element, options?: Partial); /** @type {HTMLInputElement} The search input. */ _input: HTMLInputElement; /** @type {Dialog} The dialog the palette is built on. */ _dialog: Dialog; /** @type {boolean} Whether this instance created the dialog. */ _ownsDialog: boolean; /** @type {Element} The listbox holding the groups. */ _groups: Element; /** @type {Element} The "no results" message. */ _empty: Element; /** @type {Element} The generated live region. */ _status: Element; /** @type {Element|null} The generated "Recent" group. */ _recent: Element | null; /** @type {CommandAction[]} Commands of the palette. */ _actions: CommandAction[]; /** @type {CommandRow[]} Rendered rows, in document order. */ _rows: CommandRow[]; /** @type {number} Index of the highlighted row, or `-1`. */ _active: number; /** @type {Map>} Attributes to restore. */ _saved: Map>; /** @type {Map} Attribute order of the touched elements. */ _order: Map; /** @type {Element[]} Generated nodes removed by `destroy`. */ _generated: Element[]; /** @type {{ node: Element, parent: Node, next: Node|null }[]} Nodes taken out by `remove()`. */ _detached: { node: Element; parent: Node; next: Node | null; }[]; /** @type {boolean} Guard against the synthetic click of a keyboard activation. */ _activating: boolean; /** @type {number} Counter behind the option ids of this instance. */ _seq: number; /** @type {number} Id of this instance, used in generated ids. */ _uid: number; /** * Resolved options. * * @returns {Readonly} The options. */ get options(): Readonly; /** * Whether the palette is open. * * @returns {boolean} `true` when open. */ get isOpen(): boolean; /** * Current text of the search input. * * @returns {string} The query. */ get query(): string; /** * The commands of the palette, in document order. * * @returns {CommandAction[]} A copy of the command list. */ get actions(): CommandAction[]; /** * The search input. * * @returns {HTMLInputElement} The input element. */ get input(): HTMLInputElement; /** * Id of the `