/** * Apply Melauto sorting algorithm on the data * * 1. Sort by melauto score * 2. When scores are equal, sort alphabetically with numeric awareness * This ensures consistent ordering for items with identical scores * (e.g., "0111Z" will appear before "0115Z" when both match "011") * Numeric awareness means "item2" will come before "item10" (not "item10" before "item2") */ export type WithMelautoScore = T & { melautoScore?: number; }; export declare function applyMelauto(query: string, data: T[]): WithMelautoScore[]; /** * Melauto scoring algorithm * * - Rank up result if the word is closer to the start of the string * - Rank better the first word in the query * - Rank up the proportion of query terms in the string */ export declare function melautoScore(str: string, query: string): number;