mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-01-19 16:52:59 +08:00
26 lines
831 B
TypeScript
26 lines
831 B
TypeScript
import { KeyboardOptions, PhysicalKeyboardParams } from "../interfaces";
|
|
/**
|
|
* Physical Keyboard Service
|
|
*/
|
|
declare class PhysicalKeyboard {
|
|
getOptions: () => KeyboardOptions;
|
|
dispatch: any;
|
|
/**
|
|
* Creates an instance of the PhysicalKeyboard service
|
|
*/
|
|
constructor({ dispatch, getOptions }: PhysicalKeyboardParams);
|
|
handleHighlightKeyDown(e: KeyboardEvent): void;
|
|
handleHighlightKeyUp(e: KeyboardEvent): void;
|
|
/**
|
|
* Transforms a KeyboardEvent's "key.code" string into a simple-keyboard layout format
|
|
* @param {object} e The KeyboardEvent
|
|
*/
|
|
getSimpleKeyboardLayoutKey(e: KeyboardEvent): string;
|
|
/**
|
|
* Retrieve key from keyCode
|
|
*/
|
|
keyCodeToKey(keyCode: number): string;
|
|
isModifierKey: (e: KeyboardEvent) => boolean;
|
|
}
|
|
export default PhysicalKeyboard;
|