are-visual
Version:
A Component Library for React.
14 lines (13 loc) • 440 B
TypeScript
import React from 'react';
export declare type KeyboardEventShape<T> = React.KeyboardEvent<T>;
/** 空格键盘码 */
declare const SPACE = 32;
/** 回车键盘码 */
declare const ENTER = 13;
/** ESC 键盘码 */
declare const ESC = 27;
/**
* 键盘按下事件
*/
declare function onKeyBoardEvent<T>(event: KeyboardEventShape<T>, keyCode: number, callback: () => void): void;
export { onKeyBoardEvent, SPACE, ENTER, ESC };