UNPKG

@payfit/unity-components

Version:

22 lines (21 loc) 978 B
/** * Interface representing the position of a cell in the table. */ export interface CellPosition { /** The row index (0-based) */ rowIndex: number; /** The column index (0-based) */ colIndex: number; } export declare function useTableKeyboardNavigation(): { focusedCell: CellPosition; setFocusedCell: import('react').Dispatch<import('react').SetStateAction<CellPosition>>; isCellFocused: (rowIndex: number, colIndex: number) => boolean; handleCellKeyDown: (e: React.KeyboardEvent<HTMLTableCellElement>) => void; handleTableKeyDown: (e: React.KeyboardEvent<HTMLTableElement>) => void; handleTableFocus: (e: React.FocusEvent<HTMLTableElement>) => void; handleCellFocus: (e: React.FocusEvent<HTMLTableCellElement>) => void; tableRef: import('react').MutableRefObject<HTMLTableElement | null>; focusCell: (rowIndex: number, colIndex: number, direction?: "left" | "right") => void; focusRow: (rowIndex: number) => void; };