/** * Builds a utility grid allowing for easier keyboard-navigation between cells on columns and rows */ declare function buildTableGridMap(tableRef: HTMLTableElement): { grid: (Element | undefined)[][]; positions: Map; }; type GridCache = { grid: ReturnType | null; dirty: boolean; }; /** * Pure function that calculates the next grid position given a current position and delta. * Returns the position if valid, or null if out of bounds. */ declare function getNextGridPosition(grid: (Element | undefined)[][], currentPos: { x: number; y: number; }, delta: { x: number; y: number; }): { x: number; y: number; } | null; /** * Checks if a cell is focusable (contains focusable elements). * Type guard that narrows Element | undefined to Element. */ declare function isCellFocusable(cell: Element | undefined): cell is Element; /** * Finds the next cell in the given direction, starting from the current position. * Skips over cells that are not focusable. * Returns null if no next cell is found in the given direction. */ declare function findNextFocusableCell(grid: (Element | undefined)[][], currentPos: { x: number; y: number; }, delta: { x: number; y: number; }, currentCell: Element): Element | null; /** * Finds the first focusable cell in the given row. */ declare function findFirstCellInRow(grid: (Element | undefined)[][], rowIndex: number): Element | null; /** * Finds the last focusable cell in the given row. */ declare function findLastCellInRow(grid: (Element | undefined)[][], rowIndex: number): Element | null; /** * Finds the first focusable cell in the entire table. */ declare function findFirstCell(grid: (Element | undefined)[][]): Element | null; /** * Finds the last focusable cell in the entire table. */ declare function findLastCell(grid: (Element | undefined)[][]): Element | null; export { buildTableGridMap, findFirstCell, findFirstCellInRow, findLastCell, findLastCellInRow, findNextFocusableCell, getNextGridPosition, isCellFocusable, }; export type { GridCache };