/** * Keyboard action map shared by the DOM controller. * * The returned action is a plain string that the controller wires to * Pencere methods. Keeping the mapping data-only makes it trivial to * override per WCAG 2.1.4 (Character Key Shortcuts). */ export type KeyboardAction = "close" | "next" | "prev" | "first" | "last" | "zoomIn" | "zoomOut" | "zoomReset" | "toggleSlideshow"; export interface KeyboardMapOptions { /** Override the default binding for a given action. */ overrides?: Partial>; /** Disable specific actions entirely. */ disable?: KeyboardAction[]; /** * Writing direction. In `rtl`, ArrowLeft maps to `next` and * ArrowRight to `prev` — matching the APG Carousel pattern and the * user's physical expectation that "forward" means toward the end * of the reading flow. PageUp/PageDown stay unchanged. */ direction?: "ltr" | "rtl"; } /** * Resolve a KeyboardEvent to an action, or `null` when no binding * matches or the event should be ignored (IME composition, modifier * keys, focus on a form field). * * NOTE on RTL + partial overrides: when `direction: "rtl"`, the * base map is flipped so that ArrowLeft → next and ArrowRight → * prev. User `overrides` are applied on top of this flipped base. * If you override only one of the pair (e.g. just `{ next: ["j"] }`) * in RTL mode, the OTHER action stays on the flipped default — * so `prev` remains `["ArrowRight", ...]`. Override both together * if you need to replace the whole navigation scheme in RTL. */ export declare function resolveKeyAction(event: KeyboardEvent, options?: KeyboardMapOptions): KeyboardAction | null;