1 | import type { BasicTarget } from '../utils/domTarget';
|
2 | export type KeyPredicate = (event: KeyboardEvent) => boolean;
|
3 | export type keyType = number | string;
|
4 | export type KeyFilter = keyType | keyType[] | ((event: KeyboardEvent) => boolean);
|
5 | export type EventHandler = (event: KeyboardEvent) => void;
|
6 | export type KeyEvent = 'keydown' | 'keyup';
|
7 | export type Target = BasicTarget<HTMLElement | Document | Window>;
|
8 | export type Options = {
|
9 | events?: KeyEvent[];
|
10 | target?: Target;
|
11 | exactMatch?: boolean;
|
12 | useCapture?: boolean;
|
13 | };
|
14 | declare function useKeyPress(keyFilter: KeyFilter, eventHandler: EventHandler, option?: Options): void;
|
15 | export default useKeyPress;
|