* ```
*
* Works with both HTML and SVG elements.
*/
export declare function keyboardToggle(node: HTMLElement | SVGElement, options: KeyboardToggleOptions): {
update: (options: KeyboardToggleOptions) => void;
destroy: () => void;
};
/**
* Options for the focusTrap action
*/
export interface FocusTrapOptions {
/**
* Whether the focus trap is currently active
* @default true
*/
active?: boolean;
/**
* Element to receive initial focus when trap activates
* If not provided, focuses the first focusable element
*/
initialFocus?: HTMLElement | null;
/**
* Element to return focus to when trap deactivates
* If not provided, returns focus to document.activeElement at mount time
*/
returnFocusTo?: HTMLElement | null;
/**
* Callback fired when Escape is pressed
*/
onEscape?: () => void;
}
/**
* Svelte action for modal focus trapping.
*
* Traps keyboard focus within a container, cycling through focusable elements.
* Essential for modal dialogs to meet WCAG 2.4.3 (Focus Order).
*
* Features:
* - Traps Tab and Shift+Tab within container
* - Auto-focuses first focusable element (or specified initialFocus)
* - Returns focus to trigger element on deactivation
* - Handles Escape key for dismissal
*
* Usage:
* ```svelte
*