/** * Handle keys in a grid * Return true from any of the events to indicate they're consumed, and stopPropagation/preventDefault will be called. */ import type React from 'react'; import { type EventHandlerResult } from './EventHandlerResult'; import type Grid from './Grid'; /** * Some events we listen to are a native keyboard event, and others are wrapped with React's SyntheticEvent. * The KeyHandler shouldn't care though - the properties it accesses should be common on both types of events. */ export type GridKeyboardEvent = KeyboardEvent | React.KeyboardEvent; export type GridKeyHandlerFunctionName = 'onDown' | 'onUp'; export declare class KeyHandler { order: number; constructor(order?: number); cursor: string | null; /** * Handle a keydown event on the grid. * @param event The keyboard event * @param grid The grid component the key press is on * @returns Response indicating if the key was consumed */ onDown(event: GridKeyboardEvent, grid: Grid): EventHandlerResult; /** * Handle a keyup event on the grid. * @param event The keyboard event * @param grid The grid component the key press is on * @returns Response indicating if the key was consumed */ onUp(event: GridKeyboardEvent, grid: Grid): EventHandlerResult; } export default KeyHandler; //# sourceMappingURL=KeyHandler.d.ts.map