usekeyboard-react
Version:
UseKeyBoard is a React library that executes code depending on the key pressed.
14 lines (13 loc) • 396 B
TypeScript
import { default as React } from 'react';
export type UseKeyBoard = NonNullable<unknown>;
export interface UseKeyBoardProps {
config: {
keys: {
key: string;
fn: (e: KeyboardEvent) => void;
}[];
dependencies: React.DependencyList;
debug: boolean;
};
}
export declare const useKeyBoard: ({ config }: UseKeyBoardProps) => UseKeyBoard;