type FocusDirection = "advance" | "previous"; export interface FocusGuardScope { popover: HTMLElement; direction: FocusDirection; allowedTarget?: HTMLElement | null; allowTargetInteraction?: boolean; autoFocus?: boolean; /** The caller focuses a control later: keep a focus already in scope until then. */ deferFocus?: boolean; fallback?: HTMLElement | null; } export declare class FocusGuard { private initialFocus; private document; private popover; private allowedTarget; private allowTargetInteraction; private fallback; private fallbackLease; private direction; private active; private redirecting; private readonly handleFocusIn; activate(scope: FocusGuardScope): void; update(scope: FocusGuardScope): void; focus(): void; /** * Remembers the element focus returns to when the guard deactivates. The driver calls it before * making the rest of the page inert, because inerting an ancestor blurs the focused element. * Does nothing once a focus is remembered or the guard is active. `pending` is a focus a clear * could not give back before this show replaced it, and wins over the current focus. */ captureInitialFocus(reference: HTMLElement, pending?: HTMLElement | null): void; deactivate(): void; /** * Stops guarding and returns the element focus should go back to, without moving focus. Lets * the caller restore it once the page has left `inert`: screen readers ignore focus moved onto * content their accessibility tree has not caught up with yet. */ release(): HTMLElement | null; private isAllowed; private focusFallback; private setFallback; private restoreFallback; private findFocusable; } export {};