/** * Edit-distance-based "did you mean X?" suggestions. * * Used when the user references an unknown name — template path, * generator type, sequence identifier — and we have a closed list of * known candidates. If one candidate is "close enough" (small edit * distance, same ballpark length), we point at it in the diagnostic's * `suggestion` field. * * Classic Damerau-Levenshtein is overkill here; plain Levenshtein * handles the common typos (single insertion / deletion / substitution) * which is what we care about. Transpositions ("frist" → "first") cost 2 * edits instead of 1 but still rank top of the list for realistic * candidate sets. */ /** * Find the candidate closest to `needle`. Returns `undefined` if the * best distance exceeds `maxDistance` OR exceeds ~half the needle length * (what feels like a typo shouldn't exceed that). * * Case-insensitive match is tried first — most DSL typos are in casing * (e.g. `person.male.firstname` vs `person.male.firstName`) and we want * those to score 0. */ export declare function closestMatch(needle: string, candidates: readonly string[], maxDistance?: number): string | undefined; /** Format an array of candidates as "a, b, c" for diagnostic hints. */ export declare function formatCandidates(candidates: readonly string[], max?: number): string; //# sourceMappingURL=suggestions.d.ts.map