/** * Focus Management Service * Provides utilities for focus management, focus traps, and focus restoration */ export interface FocusTrapOptions { initialFocus?: HTMLElement; restoreFocus?: boolean; allowOutsideClick?: boolean; } /** * FocusService - Centralized focus management * Provides: * - Focus trap implementation * - Focus restoration * - Focusable element detection * - Focus utilities for accessibility */ export declare class FocusService { private focusTrapStack; private previouslyFocusedElement; /** * Get all focusable elements within a container * Includes buttons, links, inputs, textareas, selects, and elements with tabindex */ getFocusableElements(container?: HTMLElement | Document): HTMLElement[]; /** * Check if an element is focusable */ isFocusable(element: HTMLElement): boolean; /** * Set focus to an element with optional callbacks */ setFocus(element: HTMLElement | null, options?: { preventScroll?: boolean; }): boolean; /** * Trap focus within a container (keyboard navigation stays within bounds) * @param container - The element to trap focus within * @param options - Focus trap options */ createFocusTrap(container: HTMLElement, options?: FocusTrapOptions): void; /** * Release focus trap from a container */ releaseFocusTrap(container: HTMLElement, restoreFocus?: boolean): void; /** * Get the first focusable element in a container */ getFirstFocusable(container?: HTMLElement | Document): HTMLElement | null; /** * Get the last focusable element in a container */ getLastFocusable(container?: HTMLElement | Document): HTMLElement | null; /** * Move focus to the next focusable element */ focusNext(container?: HTMLElement | Document): boolean; /** * Move focus to the previous focusable element */ focusPrevious(container?: HTMLElement | Document): boolean; /** * Clear all focus traps */ clearFocusTraps(): void; } /** * Get the singleton FocusService instance */ export declare function getFocusService(): FocusService; /** * Create a new isolated FocusService instance */ export declare function createFocusService(): FocusService;