simple-keyboard/build/services/PhysicalKeyboard.d.ts

26 lines
831 B
TypeScript
Raw Normal View History

2022-09-30 10:07:34 +08:00
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);
2023-01-19 08:51:34 +08:00
handleHighlightKeyDown(e: KeyboardEvent): void;
handleHighlightKeyUp(e: KeyboardEvent): void;
2022-09-30 10:07:34 +08:00
/**
* Transforms a KeyboardEvent's "key.code" string into a simple-keyboard layout format
2023-01-19 08:51:34 +08:00
* @param {object} e The KeyboardEvent
2022-09-30 10:07:34 +08:00
*/
2023-01-19 08:51:34 +08:00
getSimpleKeyboardLayoutKey(e: KeyboardEvent): string;
2022-09-30 10:07:34 +08:00
/**
* Retrieve key from keyCode
*/
2023-01-19 08:51:34 +08:00
keyCodeToKey(keyCode: number): string;
isMofifierKey: (e: KeyboardEvent) => boolean;
2022-09-30 10:07:34 +08:00
}
export default PhysicalKeyboard;