/** * A suggested correction for a likely-misspelled email address. */ interface TypoSuggestion { /** The suggested corrected domain. */ domain: string; /** The full suggested address (original local part + corrected domain). */ full: string; } /** * Options for typo suggestion. */ interface TypoOptions { /** Popular full domains to match against (e.g. `gmail.com`). */ domains?: string[]; /** * Distance threshold for the full-domain match. * @default 2 */ domainThreshold?: number; /** Popular second-level domains to match against (e.g. `gmail`). */ secondLevelDomains?: string[]; /** * Distance threshold for the second-level match. * @default 2 */ secondLevelThreshold?: number; /** Popular top-level domains to match against (e.g. `com`). */ topLevelDomains?: string[]; /** * Distance threshold for the top-level match. * @default 2 */ topLevelThreshold?: number; } declare const sift3Distance: (s1: string, s2: string) => number; /** * Suggests a corrected domain for a likely-misspelled one, using the mailcheck * algorithm (full-domain match, then second-level + top-level matching). * @param domain The domain to check. * @param options Override domain lists and thresholds. * @returns The suggested domain, or `undefined` when the domain looks fine. */ declare const suggestDomain: (domain: string, options?: TypoOptions) => string | undefined; /** * Suggests a corrected email address when the domain looks misspelled * (e.g. `user@gmial.com` → `user@gmail.com`). * @param email The email address to check. * @param options Override domain lists and thresholds. * @returns A {@link TypoSuggestion}, or `undefined` when nothing looks wrong. * @example * ```ts * import { suggestEmailTypo } from "@visulima/email-verifier/enrich/typo"; * * suggestEmailTypo("user@gmial.com")?.full; // "user@gmail.com" * ``` */ declare const suggestEmailTypo: (email: string, options?: TypoOptions) => TypoSuggestion | undefined; export { type TypoOptions, type TypoSuggestion, suggestEmailTypo as default, sift3Distance, suggestDomain, suggestEmailTypo };