/** * Focus trapping utility for modals, dialogs, and popover content. * * Constrains keyboard focus within a container so that Tab and Shift+Tab * cycle only through the container's focusable elements. * * @module bquery/a11y */ import type { FocusTrapHandle, TrapFocusOptions } from './types'; /** * Gets all focusable elements within a container. * * @param container - The container element * @returns Array of focusable elements * @internal */ export declare const getFocusableElements: (container: Element) => HTMLElement[]; /** * Traps keyboard focus within a container element. * * When activated, Tab and Shift+Tab will cycle only through focusable * elements within the container. Useful for modals, dialogs, and * dropdown menus. * * @param container - The DOM element to trap focus within * @param options - Configuration options * @returns A handle with a `release()` method to deactivate the trap * * @example * ```ts * import { trapFocus } from '@bquery/bquery/a11y'; * * const dialog = document.querySelector('#my-dialog'); * const trap = trapFocus(dialog, { escapeDeactivates: true }); * * // Later, release the trap * trap.release(); * ``` */ export declare const trapFocus: (container: HTMLElement, options?: TrapFocusOptions) => FocusTrapHandle; /** * Releases a focus trap handle. * This is a convenience function — in most cases, use the `release()` * method on the individual trap handle directly. * * @deprecated Prefer using the handle returned by `trapFocus()` directly. */ export declare const releaseFocus: (handle: FocusTrapHandle) => void; //# sourceMappingURL=trap-focus.d.ts.map