import type { FuseResultMatch, IFuseOptions } from 'fuse.js'; import Fuse from 'fuse.js'; export type CombinedFuseResult = { item: T; score: number; matches: FuseResultMatch[]; }; type Keys = Partial string; }>>>; export type SearchOptions = Keys> = { items?: Item[]; keys: K; } & Omit, 'includeMatches' | 'keys'>; export type SearchQueryOptions = { tokensSeparator?: string; tokensMaxCount?: number; }; export type SearchQueryResult = Keys> = { item: Item; spans: Record; score: number; }; export type SearchQueryResultSpan = { value: string; isMatch: boolean; }; export declare function useSearch>({ items, keys, ...fuseOptions }: SearchOptions): { fuse: Fuse; query: (value: string, { tokensSeparator, tokensMaxCount }?: SearchQueryOptions) => SearchQueryResult[]; prismaWhereTokens: (value: string, { tokensSeparator, tokensMaxCount }?: SearchQueryOptions) => { OR: { [P in keyof K]?: { contains: string; } | undefined; }[]; }[]; }; export {};