UNPKG

687 BTypeScriptView Raw
1import * as React from "react";
2import { HotkeyConfig } from "./hotkeyConfig";
3export interface UseHotkeysOptions {
4 /**
5 * The key combo which will trigger the hotkeys dialog to open.
6 *
7 * @default "?"
8 */
9 showDialogKeyCombo?: string;
10}
11export interface UseHotkeysReturnValue {
12 handleKeyDown: React.KeyboardEventHandler<HTMLElement>;
13 handleKeyUp: React.KeyboardEventHandler<HTMLElement>;
14}
15/**
16 * React hook to register global and local hotkeys for a component.
17 *
18 * @param keys list of hotkeys to configure
19 * @param options hook options
20 */
21export declare function useHotkeys(keys: HotkeyConfig[], options?: UseHotkeysOptions): UseHotkeysReturnValue;