UNPKG

@procore/core-react

Version:
39 lines (38 loc) 818 B
import type { Scope } from './EventListener'; declare type EventType = 'keydown' | 'keyup'; interface Config { /** * @since 10.19.0 */ dependencies?: any[]; /** * @since 10.19.0 */ event?: EventType; /** * @since 10.19.0 */ handler: (event: KeyboardEvent) => void; /** * @since 10.19.0 */ key: string | string[]; /** * @since 10.19.0 */ preventDefault?: boolean; /** * @since 10.19.0 */ scope?: Scope; /** * @since 10.19.0 */ stopPropagation?: boolean; } /** * @deprecatedSince 9.7.0 * @deprecated Pass functions directly to JSX elements. For window events, add a new listener and remove it in an effect */ export declare function useHotkey({ scope, ...config }: Config): void; export {};