export type ListboxActivation = 'first' | 'last' | 'none'; export type ListboxPopoverBehaviorConfig = { getAnchor: () => HTMLElement | null; getFloating: () => HTMLElement | null; getOpen: () => boolean; getOptions: () => HTMLElement[]; getActiveDescendantHost: () => HTMLElement | null; getOptionIdPrefix: () => string; }; export type ListboxKeydownConfig = { isOpen: boolean; canUseSpace: boolean; closesOnTab: boolean; enterWhenClosed: 'open' | 'ignore'; enterWithoutActive: 'close' | 'ignore'; onOpen: (activation?: ListboxActivation) => void; onClose: (reason: 'arrow' | 'escape' | 'enter' | 'tab') => void; onSelectActive: () => void; onEscapeWhenClosed?: () => void; }; /** * Shared state and interaction plumbing for listbox-backed popovers. * * @remarks Select and combobox intentionally keep their selection and filtering * policies local. This behavior owns only the state machine both controls must * agree on: active-descendant navigation, popover positioning, and dismissal. */ export declare class ListboxPopoverBehavior { private readonly config; private readonly popoverController; private activeIndex; private visualFocus; constructor(config: ListboxPopoverBehaviorConfig); get activeOptionIndex(): number; get hasVisualFocus(): boolean; ensureOptionIds(): void; getVisibleOptions(): HTMLElement[]; clearActiveOption(): void; setActiveOption(index: number): void; moveActive(direction: 1 | -1, onOpen: (activation: ListboxActivation) => void): void; /** Handles the APG keys shared by select-only and autocomplete listboxes. */ handleKeydown(event: KeyboardEvent, options: ListboxKeydownConfig): void; syncPopoverPosition(): void; shouldDismissFocus(relatedTarget: EventTarget | null): boolean; shouldDismissPointer(target: Node | null): boolean; destroy(): void; }