import type { ReactiveControllerHost } from 'lit'; interface SelectionControllerHost extends ReactiveControllerHost { selected: number; } interface SelectionItem extends HTMLElement { selected?: boolean; } /** * `SelectionController` * * Owns the selection semantics of a tab set: * * - Sanitizes the 1-based `selected` index on write (nearest-bound clamp) and * reports the committed value so the host can correct its reflected attribute * (attribute and effective state never diverge). * - Applies the selection idempotently to every tab/tabpanel pair, so no * "last selected item" bookkeeping is needed. * - Wires the bidirectional ARIA relationship of each pair (`aria-controls` on * the tab <-> `aria-labelledby` on the tabpanel), generating missing ids and * always respecting author-supplied values; warns when an author-supplied * half does not close the pair (dangling idref). * - Re-syncs selection and wiring when the slotted items change. * * Focus and activation are intentionally out of scope here. */ export declare class SelectionController { #private; host: SelectionControllerHost; constructor(host: SelectionControllerHost); get length(): number; get selectedIndex(): number; get selectedIndexFromOne(): number; get selectedTab(): SelectionItem; get selectedTabpanel(): SelectionItem; /** * Updates the slotted items, wires their ARIA relationships and re-syncs the * selection. When the current selection falls outside the new range, the * host's `selected` is corrected and the commit happens on the next update. */ setItems(tabs?: HTMLElement[], tabpanels?: HTMLElement[]): void; /** * Applies a 1-based selection and returns the committed 1-based value. When * the committed value differs from the requested one, nothing is applied and * the host should correct `selected` (the commit happens on the next update). */ commit(selectedFromOne: number): number; } export {};