declare module 'fast-fuzzy' { export enum sortKind { insertOrder = "insertOrder", bestMatch = "bestMatch", }; interface FuzzyOptions { ignoreCase?: boolean, ignoreSymbols?: boolean, normalizeWhitespace?: boolean, useDamerau?: boolean, useSellers?: boolean, returnMatchData?: boolean, sortBy?: sortKind, } interface AdditionalOptions { keySelector?: (s: T) => string | string[], threshold?: number, } export type FullOptions = FuzzyOptions & AdditionalOptions; export interface MatchData { item: T, original: string, key: string, score: number, match: { index: number, length: number, }, } export function fuzzy(term: string, candidate: string, options?: T): T["returnMatchData"] extends true ? MatchData : number; export function search>(term: string, candidates: T[], options?: U): U["returnMatchData"] extends true ? MatchData[] : T[]; export class Searcher> { constructor(candidates?: T[], options?: U); add(...candidates: T[]): void; search>(term: string, options?: V): V["returnMatchData"] extends true ? MatchData[] : V["returnMatchData"] extends false ? T[] : U["returnMatchData"] extends true ? MatchData[] : T[]; } }