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