diff --git a/src/runtime/components/navigation/CommandPaletteGroup.vue b/src/runtime/components/navigation/CommandPaletteGroup.vue index 840389e5..6f08bde2 100644 --- a/src/runtime/components/navigation/CommandPaletteGroup.vue +++ b/src/runtime/components/navigation/CommandPaletteGroup.vue @@ -74,7 +74,7 @@ import { computed, defineComponent } from 'vue' import type { PropType } from 'vue' import { ComboboxOption as HComboboxOption, provideUseId } from '@headlessui/vue' import { UIcon, UAvatar, UKbd } from '#components' -import type { Group } from '../../types' +import type { Command, Group } from '../../types' import { commandPalette } from '#ui/ui.config' import { useId } from '#imports' @@ -118,7 +118,7 @@ export default defineComponent({ return typeof label === 'function' ? label(props.query) : label }) - function highlight (text: string, { indices, value }: { indices: number[][], value: string }): string { + function highlight (text: string, { indices, value }: Command['matches'][number]): string { if (text === value) { return '' } diff --git a/src/runtime/types/command-palette.ts b/src/runtime/types/command-palette.ts index f8d2c05f..4a46f5f1 100644 --- a/src/runtime/types/command-palette.ts +++ b/src/runtime/types/command-palette.ts @@ -1,4 +1,4 @@ -import type { FuseSortFunctionMatch, FuseSortFunctionMatchList } from 'fuse.js' +import Fuse from 'fuse.js' import type { Avatar } from './avatar' export interface Command { @@ -13,7 +13,7 @@ export interface Command { shortcuts?: string[] group?: string score?: number - matches?: (FuseSortFunctionMatch | FuseSortFunctionMatchList)[] + matches?: Fuse.FuseResultMatch[] [key: string]: any }