Notes TypeScript

This commit is contained in:
Mo Bitar
2020-04-11 23:26:02 -05:00
parent 2bc3658f1a
commit 3542cba002
7 changed files with 301 additions and 245 deletions

View File

@@ -20,7 +20,7 @@ enum KeyboardKeyEvent {
};
type KeyboardObserver = {
key?: KeyboardKey
key?: KeyboardKey | string
modifiers?: KeyboardModifier[]
onKeyDown?: (event: KeyboardEvent) => void
onKeyUp?: (event: KeyboardEvent) => void
@@ -87,7 +87,7 @@ export class KeyboardManager {
eventMatchesKeyAndModifiers(
event: KeyboardEvent,
key: KeyboardKey,
key: KeyboardKey | string,
modifiers: KeyboardModifier[] = []
) {
const eventModifiers = this.modifiersForEvent(event);