interface MatchResult { match: boolean; pos?: [number, number]; score: number; } /** * Matches `pattern` against `str`, preferring a substring match over a fuzzy match. * Returns whether a match was found, its score, and the matched character range. * @param pattern - the search pattern * @param str - the string to search in * @returns whether a match was found, the match score and the position of the match if found * @internal */ export declare function fuzzyMatch(pattern: string, str: string): MatchResult; /** * Returns true if the label is longer than maxLength characters and should be truncated with a middle ellipsis. * @param label - the label to check * @param maxLength - the maximum length of the label before truncation * @returns true if the label should be truncated, false otherwise * @internal */ export declare function labelShouldBeTruncated(label: string, maxLength?: number): boolean; /** * Will add middle ellipsis (…) if the label is longer than maxLength characters * @param label - the label to truncate * @param maxLength - the maximum length of the label before truncation * @returns the truncated label with middle ellipsis if needed * @internal */ export declare function convertToMiddleEllipsis(label: string, maxLength?: number): string; /** * Returns the highlight position of `pattern` inside `fullLabel`, remapped to the * truncated label that is actually displayed in the autocomplete dropdown. * * @param pattern - the search pattern typed by the user * @param fullLabel - the full, untruncated suggestion string * @param maxLength - must match the value passed to `convertToMiddleEllipsis` when the * label was rendered — using a different value produces highlight positions that no * longer correspond to the visible text * @internal */ export declare function getFuzzyMatchFullLabelPosition(pattern: string, fullLabel: string | undefined, maxLength?: number): number[] | undefined; export {}; //# sourceMappingURL=fuzzy-match.d.ts.map