/** * The near name a diagnostic offers when something was not found. * * Five codes promise one: OS2001, OS2009, OS2010, OS3002 and OS3008 each carry * a `suggestion` slot documented as the closest candidate by edit distance. So * the answer is the closest one and not the closest one within some threshold: * a threshold would leave the slot with nothing to put in it, and a message * with a hole in it is a defect a reader cannot report. * * The distance is Levenshtein over code units, computed with two rows rather * than a matrix because this runs once per unresolved name against every name * in scope, and an editor asks for it while somebody is still typing. */ /** The edit distance between two names, capped so a hopeless pair costs little. */ export declare function editDistance(left: string, right: string): number; /** * The closest candidate, or the written name when there are no candidates. * * Returning the written name happens only where a namespace holds nothing, * which the library never does, so it is a floor rather than an outcome. Case * is folded before comparing, because a name written with the wrong capital is * the commonest near miss of all and costs a full edit distance otherwise. */ export declare function closestName(written: string, candidates: Iterable): string; //# sourceMappingURL=suggest.d.ts.map