@sparkpost/matchbox
Version:
A React UI component library
14 lines (13 loc) • 710 B
TypeScript
import React from 'react';
declare type EventKeys = 'backspace' | 'enter' | 'escape' | 'arrowRight' | 'arrowLeft' | 'arrowUp' | 'arrowDown' | 'home' | 'end' | 'space' | 'pageUp' | 'pageDown' | 'tab';
/**
* Key down event handler
* @example onKey('escape', () => foo())(e)
*/
export declare function onKey(event: EventKeys, callback: (e: React.KeyboardEvent | KeyboardEvent) => void): (e: React.KeyboardEvent | KeyboardEvent) => void;
/**
* Multiple key down event handler
* @example onKeys(['escape', 'enter'], () => foo())(e)
*/
export declare function onKeys(events: EventKeys[], callback: (e: React.KeyboardEvent | KeyboardEvent) => void): (e: React.KeyboardEvent | KeyboardEvent) => void;
export {};