import uFuzzy from "@leeoniya/ufuzzy"; //#region src/fuzzySearch.d.ts type SearchOptions = { items: T[]; getStringToMatch: (item: T) => string; searchQuery: string | null; /** Pass a stable uFuzzy instance, you can use `getUFuzzyInstance` for this */ uFuzzy: uFuzzy; ignoreBestMatch?: boolean; throwOnError?: boolean; }; /** * Performs fuzzy search on a list of items and returns matched items with score * metadata. * * Uses uFuzzy for efficient fuzzy matching with Latin character normalization. * Falls back to simple string inclusion matching if an error occurs. * * @returns Object containing filtered/sorted items and the best match score * (higher is better) */ declare function fuzzySearchItemsWithResultMetadata({ items, searchQuery: _searchQuery, getStringToMatch, uFuzzy: uf, ignoreBestMatch, throwOnError }: SearchOptions): { items: T[]; bestMatchScore: number; }; /** * Performs fuzzy search on a list of items and returns matched items. * * Simplified version of `fuzzySearchItemsWithResultMetadata` that only returns * items. */ declare function fuzzySearchItems({ items, searchQuery: _searchQuery, getStringToMatch, uFuzzy: uf }: Omit, 'ignoreBestMatch'>): T[]; /** * Creates a configured uFuzzy instance with custom sorting for optimal fuzzy * matching. * * The instance uses intraMode=1 and custom sorting that prioritizes: contiguous * character matches, prefix bounds, match density, and early start position. */ declare function getUFuzzyInstance(): uFuzzy; //#endregion export { fuzzySearchItems, fuzzySearchItemsWithResultMetadata, getUFuzzyInstance };