import { DependencyList, RefObject } from 'react'; export declare type KeyboardEventPredicate = (event: KeyboardEvent) => boolean; export declare type KeyboardEventFilter = null | undefined | string | boolean | KeyboardEventPredicate; export declare type KeyboardEventHandler = (this: T, event: KeyboardEvent) => void; export declare type UseKeyboardEventOptions = { /** * Event name that triggers handler. * @default `keydown` */ event?: 'keydown' | 'keypress' | 'keyup'; /** * Target that should emit event. * @default window */ target?: RefObject | T | null; /** * Options that will be passed to underlying `useEventListener` hook. */ eventOptions?: boolean | AddEventListenerOptions; }; /** * Executes callback when keyboard event occurred on target (window by default). * * @param keyOrPredicate Filters keypresses on which `callback` will be executed. * @param callback Function to call when key is pressed and `keyOrPredicate` matches positive. * @param deps Dependencies list that will be passed to underlying `useMemo`. * @param options Hook options. */ export declare function useKeyboardEvent(keyOrPredicate: KeyboardEventFilter, callback: KeyboardEventHandler, deps?: DependencyList, options?: UseKeyboardEventOptions): void;