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