mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
chore(CommandPalette): improve fuse.js import types .ts file
This commit is contained in:
@@ -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 ''
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user