From 6c113eaca1add681b8bcad74dbb4a537f29458e8 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sat, 15 Jun 2024 17:23:38 +0200 Subject: [PATCH] feat: improve shortcut types --- .../misc/keyboard-shortcuts/shortcuts.ts | 6 +++--- frontend/src/components/misc/shortcut.vue | 20 +++++++------------ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/misc/keyboard-shortcuts/shortcuts.ts b/frontend/src/components/misc/keyboard-shortcuts/shortcuts.ts index 58a0d980f..d41b13679 100644 --- a/frontend/src/components/misc/keyboard-shortcuts/shortcuts.ts +++ b/frontend/src/components/misc/keyboard-shortcuts/shortcuts.ts @@ -4,13 +4,13 @@ import {isAppleDevice} from '@/helpers/isAppleDevice' const ctrl = isAppleDevice() ? '⌘' : 'ctrl' -interface Shortcut { +export interface Shortcut { title: string keys: string[] combination?: 'then' } -interface ShortcutGroup { +export interface ShortcutGroup { title: string available?: (route: RouteLocation) => boolean shortcuts: Shortcut[] @@ -158,4 +158,4 @@ export const KEYBOARD_SHORTCUTS : ShortcutGroup[] = [ }, ], }, -] \ No newline at end of file +] as const diff --git a/frontend/src/components/misc/shortcut.vue b/frontend/src/components/misc/shortcut.vue index 9288a27fa..5eb13db3f 100644 --- a/frontend/src/components/misc/shortcut.vue +++ b/frontend/src/components/misc/shortcut.vue @@ -14,19 +14,13 @@