import type { GraphNode } from "../interfaces"; export type KeyboardAction = KeyboardActionSwitchActiveNode | KeyboardActionEnter | KeyboardActionScroll; export interface KeyboardActionSwitchActiveNode { action: "switch-active-node"; node: GraphNode | null; } export interface KeyboardActionEnter { action: "enter"; node: GraphNode; } export interface KeyboardActionScroll { action: "scroll"; direction: "up" | "down" | "left" | "right"; range: "line" | "page" | "document"; node?: undefined; } /** * Keyboard navigation: * - When no node is active, simulate browser page scrolling shortcuts: * - Space: scroll down (or up with shift) by page * - Arrow keys: scroll by line in the direction of the arrow * - Arrow up/down with ⌘ on Mac: scroll to top/bottom of document * - Home/end: scroll to top/bottom of document * - When a node is active: * - Arrow keys: switch active node in the direction of the arrow * - Arrow up/down with ⌘ on Mac: switch active node to the top/bottom most node * - Escape: clear active node * - Enter: Enter the detail of the active node */ export declare function handleKeyboardNav(event: KeyboardEvent, { activeNodeId, nodes, }: { activeNodeId: string | null; nodes: GraphNode[]; }): KeyboardAction | undefined;