UNPKG

@jsonhero/fuzzy-json-search

Version:
18 lines (17 loc) 745 B
export declare type FuzzyScore = [number, number[]]; export interface IItemAccessor<T> { /** * Just the label of the item to score on. */ getItemLabel(item: T): string | undefined; /** * The optional description of the item to score on. */ getItemDescription(item: T): string | undefined; getItemPath(item: T): string | undefined; getRawValue(item: T): string | undefined; getFormattedValue(item: T): string | undefined; getIsArrayItem(item: T): boolean; } export declare function scoreFuzzy(target: string, query: string, queryLower: string, allowNonContiguousMatches: boolean, optimizeForPaths?: boolean): FuzzyScore; export declare function isUpper(code: number): boolean;