UNPKG

@emailcheck/email-validator-js

Version:

Advanced email validation with MX records, SMTP verification, disposable email detection, batch processing, and caching. Production-ready with TypeScript support.

19 lines (18 loc) 1.4 kB
import type { Cache } from './cache-interface'; import type { DomainSuggestion, DomainSuggestionParams } from './types'; /** * List of common email domains for typo detection — popular free providers, * business providers, and hosting services. Source data lives in * src/data/common-email-domains.json. */ export declare const commonEmailDomains: readonly string[]; /** Sync default — no cache. Public for callers that need a synchronous answer. */ export declare function defaultDomainSuggestionMethod(domain: string, commonDomains?: string[]): DomainSuggestion | null; /** Async default — wraps the sync match with a per-domain cache layer. */ export declare function defaultDomainSuggestionMethodAsync(domain: string, commonDomains?: string[], cache?: Cache): Promise<DomainSuggestion | null>; /** Sync entry: pass a domain (or email-shaped string), get a suggestion or null. */ export declare function suggestDomain(params: DomainSuggestionParams): DomainSuggestion | null; /** Async entry: takes a full email, returns a suggestion that rewrites the local-part too. */ export declare function suggestEmailDomain(email: string, commonDomains?: string[], cache?: Cache): Promise<DomainSuggestion | null>; export declare function isCommonDomain(domain: string, commonDomains?: string[]): boolean; export declare function getDomainSimilarity(domain1: string, domain2: string): number;