import type { ReactiveController, ReactiveControllerHost } from 'lit'; /** * Configuration for {@link ListboxNavController}. All accessors are read lazily, * so the host can back them with getters over its own reactive state. */ export interface ListboxNavConfig { /** Stable id of the `role="listbox"`; option ids derive from it. */ listboxId: string; /** Number of currently navigable options. */ getCount: () => number; /** Whether the option at `index` is disabled (skipped while navigating). */ isDisabled: (index: number) => boolean; /** Whether the listbox is currently open. */ isOpen: () => boolean; /** Open the listbox — called when a navigation key is pressed while closed. */ open: () => void; /** The rendered option elements, in order, for scroll-into-view. */ getOptionElements: () => ArrayLike | null | undefined; } /** * Owns roving `aria-activedescendant` navigation for the combobox/listbox * pattern: Arrow Up/Down move a virtual cursor over a `role="listbox"` while DOM * focus stays on the host input, skipping disabled options and scrolling the * active one into view. Enter/Escape/Tab stay with the host, which owns * commit/close semantics. * * Home/End are intentionally not handled — an editable combobox reserves them * for the text cursor (ARIA APG). Shared by `l-combobox` and (future) `l-select`. */ export declare class ListboxNavController implements ReactiveController { private host; private config; /** Index of the active option, or `-1` when none is active. */ activeIndex: number; constructor(host: ReactiveControllerHost, config: ListboxNavConfig); hostConnected(): void; /** The DOM id for the option at `index` (matches the rendered option `id`). */ optionId(index: number): string; /** `aria-activedescendant` value for the input, or `undefined` when none. */ get activeDescendant(): string | undefined; /** Clear the active option. */ reset(): void; /** Set the active option explicitly (e.g. pre-activate the current value). */ setActive(index: number): void; /** Move the active option by `diff`, opening the listbox first if closed. */ move(diff: 1 | -1): void; /** * Handle a keydown for listbox navigation. Returns `true` when the key was * consumed, so the host can early-return before its own Enter/Escape/Tab * handling. */ onKeyDown(e: KeyboardEvent): boolean; private _step; private _scrollActiveIntoView; } //# sourceMappingURL=listbox-nav.d.ts.map