Files
NapCatQQ/.pnpm-store/v3/files/1f/9e348b5f4b08f44cda619cf69cdb4d7eed199fd05d94b32a954fd41ddcbc290aeee68d816992d9c24b48a18492196686648aa1d1185ebfa30ae74565ee6404
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

15 lines
661 B
Plaintext

import type { BasicTarget } from '../utils/domTarget';
export type KeyType = number | string;
export type KeyPredicate = (event: KeyboardEvent) => KeyType | boolean | undefined;
export type KeyFilter = KeyType | KeyType[] | ((event: KeyboardEvent) => boolean);
export type KeyEvent = 'keydown' | 'keyup';
export type Target = BasicTarget<HTMLElement | Document | Window>;
export type Options = {
events?: KeyEvent[];
target?: Target;
exactMatch?: boolean;
useCapture?: boolean;
};
declare function useKeyPress(keyFilter: KeyFilter, eventHandler: (event: KeyboardEvent, key: KeyType) => void, option?: Options): void;
export default useKeyPress;