From 63067b3e91b7ec2ffe7314dc6a504b61ca74c8f2 Mon Sep 17 00:00:00 2001 From: nick-funk Date: Tue, 1 Sep 2020 15:22:41 -0600 Subject: [PATCH] Declare type on key event handlers CORL-1334 --- src/core/client/embed/WindowEvents.ts | 2 +- .../stream/common/KeyboardShortcuts/KeyboardShortcuts.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/client/embed/WindowEvents.ts b/src/core/client/embed/WindowEvents.ts index a1d84ad856e..91e2834ecf5 100644 --- a/src/core/client/embed/WindowEvents.ts +++ b/src/core/client/embed/WindowEvents.ts @@ -1,7 +1,7 @@ import PymControl from "./PymControl"; export default function hookUpWindowEvents(pym: PymControl) { - window.addEventListener("keypress", (e) => { + window.addEventListener("keypress", (e: KeyboardEvent) => { const payload = { event: "keypress", data: { diff --git a/src/core/client/stream/common/KeyboardShortcuts/KeyboardShortcuts.tsx b/src/core/client/stream/common/KeyboardShortcuts/KeyboardShortcuts.tsx index 22160f4247a..c810b0dc79f 100644 --- a/src/core/client/stream/common/KeyboardShortcuts/KeyboardShortcuts.tsx +++ b/src/core/client/stream/common/KeyboardShortcuts/KeyboardShortcuts.tsx @@ -132,7 +132,7 @@ const KeyboardShortcuts: FunctionComponent = () => { }, [findPreviousElement, scrollToElement]); const handleKeyMessage = useCallback( - (e: any) => { + (e) => { try { if (!e.data) { return; @@ -161,7 +161,7 @@ const KeyboardShortcuts: FunctionComponent = () => { ); const handleKeyPress = useCallback( - (e: any) => { + (e: KeyboardEvent) => { try { if (e.shiftKey && e.key === "C") { jumpToPreviousElement();