source: imaps-frontend/node_modules/react-use/lib/useKey.d.ts@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 654 bytes
Line 
1import { DependencyList } from 'react';
2import { UseEventOptions, UseEventTarget } from './useEvent';
3export declare type KeyPredicate = (event: KeyboardEvent) => boolean;
4export declare type KeyFilter = null | undefined | string | ((event: KeyboardEvent) => boolean);
5export declare type Handler = (event: KeyboardEvent) => void;
6export interface UseKeyOptions<T extends UseEventTarget> {
7 event?: 'keydown' | 'keypress' | 'keyup';
8 target?: T | null;
9 options?: UseEventOptions<T>;
10}
11declare const useKey: <T extends UseEventTarget>(key: KeyFilter, fn?: Handler, opts?: UseKeyOptions<T>, deps?: DependencyList) => void;
12export default useKey;
Note: See TracBrowser for help on using the repository browser.