UNPKG

@acusti/use-keyboard-events

Version:

React hook that takes keyboard event handlers and attaches them to the document

27 lines (24 loc) 696 B
/** * Flowtype definitions for useKeyboardEvents * Generated by Flowgen from a Typescript Definition * Flowgen v1.21.0 * @flow */ import { type, Handler } from "./handlers.js"; declare export { isEventTargetUsingKeyEvent, isPrimaryModifierPressed, usesKeyEvents, } from "./handlers.js"; declare type Props = {| ignoreUsedKeyboardEvents?: boolean, onKeyDown?: Handler, onKeyPress?: Handler, onKeyUp?: Handler, /** * Priority defines what order handlers should be invoked and defaults to 0. * It can be any number between -50 (lowest priority) and 50 (highest priority). */ priority?: number, |}; declare export default function useKeyboardEvents(x: Props): void;