transitioning to ts

This commit is contained in:
2023-05-01 23:23:43 +02:00
parent 412f1ae3e3
commit 46d030cf8e
18 changed files with 302 additions and 171 deletions

11
src/scripts/hotkeys.ts Normal file
View File

@@ -0,0 +1,11 @@
import hotkeyjs, { HotkeysEvent } from "hotkeys-js";
export const addHotkey = function (
keys: string,
func: (event?: KeyboardEvent, args?: HotkeysEvent) => void
) {
hotkeyjs(keys, function (event, args) {
event.preventDefault();
func(event, args);
});
};