@jsonhero/fuzzy-json-search
Version:
VSCode style fuzzy search for JSON documents
18 lines (17 loc) • 745 B
TypeScript
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;