/** * The UTS #39 "skeleton" of a string: NFD-normalize, replace every code * point that has a known confusable prototype with that prototype, then * NFD-normalize again (a substitution can itself need decomposing). Two * strings are visually confusable exactly when their skeletons match; see * https://www.unicode.org/reports/tr39/#Confusable_Detection. */ declare function getSkeleton(input: string): string; /** * True when `a` and `b` would look the same, or close enough to fool a * quick glance, for example a newly chosen username that's visually * indistinguishable from one that already exists. */ declare function areConfusable(a: string, b: string): boolean; interface SuspiciousScriptChar { char: string; codePoint: number; index: number; script: string; } interface MixedScriptResult { /** True when the input mixes two or more scripts outside of Common and * Inherited (which are excluded because they're shared by every script, * for example digits and punctuation, and never indicate mixing on * their own). */ mixed: boolean; /** Every non-Common, non-Inherited script found, in first-seen order. */ scripts: string[]; /** The characters belonging to whichever scripts are NOT the majority * script, the ones actually worth showing a caller: in `"аpple"` this is * just the Cyrillic а, not all four Latin letters. Empty when `mixed` is * false. */ suspicious: SuspiciousScriptChar[]; } /** * Flags a string that mixes two or more scripts outside of Common and * Inherited, the pattern behind domain/identity spoofing like an "apple" * with a Cyrillic а substituted for the Latin one. This is a practical * heuristic, not an implementation of UTS #39's full restriction-level * algorithm: it reports the majority script (by character count, ties * broken by first appearance) and flags everything else as suspicious. */ declare function detectMixedScript(input: string): MixedScriptResult; export { type MixedScriptResult, type SuspiciousScriptChar, areConfusable, detectMixedScript, getSkeleton };