Skip to content

Function: useFuseSearch()

useFuseSearch<T>(search, options?): object

Type Parameters

T extends FuseListItem = FuseListItem

Parameters

search: MaybeRefOrGetter<string>

options?: MaybeRefOrGetter<UseFuseOptions<T>>

Returns

object

fuse

fuse: Ref<object, Fuse<T> | object>

Type declaration

add()

add: (doc) => void

Parameters

doc: T

Returns

void

getIndex()

getIndex: () => FuseIndex<T>

Returns

FuseIndex<T>

remove()

remove: (predicate) => T[]

Parameters

predicate

Returns

T[]

removeAt()

removeAt: (idx) => void

Parameters

idx: number

Returns

void

search: <R>(pattern, options?) => FuseResult<R>[]

Type Parameters

R = T

Parameters

pattern: string | Expression

options?: FuseSearchOptions

Returns

FuseResult<R>[]

setCollection()

setCollection: (docs, index?) => void

Parameters

docs: readonly T[]

index?: FuseIndex<T>

Returns

void

results

results: ComputedRef<FuseResult<T>[]>

Defined in

packages/valaxy/client/composables/search/fuse.ts:8