1
0

feat: improve shortcut types

This commit is contained in:
Dominik Pschenitschni 2024-06-15 17:23:38 +02:00 committed by konrad
parent 1665cd57cb
commit 6c113eaca1
2 changed files with 10 additions and 16 deletions

View File

@ -4,13 +4,13 @@ import {isAppleDevice} from '@/helpers/isAppleDevice'
const ctrl = isAppleDevice() ? '⌘' : 'ctrl' const ctrl = isAppleDevice() ? '⌘' : 'ctrl'
interface Shortcut { export interface Shortcut {
title: string title: string
keys: string[] keys: string[]
combination?: 'then' combination?: 'then'
} }
interface ShortcutGroup { export interface ShortcutGroup {
title: string title: string
available?: (route: RouteLocation) => boolean available?: (route: RouteLocation) => boolean
shortcuts: Shortcut[] shortcuts: Shortcut[]
@ -158,4 +158,4 @@ export const KEYBOARD_SHORTCUTS : ShortcutGroup[] = [
}, },
], ],
}, },
] ] as const

View File

@ -14,19 +14,13 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
defineProps({ withDefaults(defineProps<{
keys: { keys: string[],
type: Array, combination?: string,
required: true, is?: string
}, }>(), {
combination: { combination: '+',
type: String, is: 'div',
default: '+',
},
is: {
type: String,
default: 'div',
},
}) })
</script> </script>