/** * Pure focus-movement logic for the workbench's dialog chrome: the Tab-key * focus trap that keeps focus inside the open panel, the arrow-key cycling of * the rail tablist, and the shared cyclic-index helper the outline tree's * arrow navigation also uses. DOM-free so every rule is unit-testable — * ResearchPanel/PaperView adapt the live DOM (the focusable-element list, the * active element's index) into these numbers and apply the result. * @module dsh-client-ui-mimir/client/focus */ import type { ResearchTab } from './store.ts'; /** * Wrap `current + delta` into `[0, count)`, cycling both directions. Returns * -1 for an empty list so callers can no-op instead of focusing index NaN. */ export declare function wrapIndex(current: number, delta: number, count: number): number; /** * Resolve one Tab keydown inside a focus-trapped container. `current` is the * active element's index among the container's `count` focusable elements, or * -1 when focus sits outside the container entirely (e.g. on the page behind * the dialog). Returns the index to force-focus, or null when the browser's * default Tab movement already stays inside the container and should run. * Focus outside the container is pulled back in (to the first element, or the * last under Shift+Tab); Tab past the last wraps to the first and Shift+Tab * before the first wraps to the last. */ export declare function trapFocusIndex(current: number, count: number, shift: boolean): number | null; /** * The rail tab one arrow key selects: Left/Up move to the previous tab, * Right/Down to the next, cycling past both ends. Returns null for any other * key so the caller leaves the keydown alone. */ export declare function arrowTab(current: ResearchTab, key: string): ResearchTab | null; //# sourceMappingURL=focus.d.ts.map