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'
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[] = [
},
],
},
]
] as const

View File

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