@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.
43 lines (42 loc) • 1.26 kB
TypeScript
import type { Cache, CacheStore } from './cache-interface';
/**
* Default cache options
*/
export declare const DEFAULT_CACHE_OPTIONS: {
ttl: {
mx: number;
disposable: number;
free: number;
domainValid: number;
smtp: number;
smtpPort: number;
domainSuggestion: number;
whois: number;
};
maxSize: {
mx: number;
disposable: number;
free: number;
domainValid: number;
smtp: number;
smtpPort: number;
domainSuggestion: number;
whois: number;
};
};
/**
* Get the default in-memory cache singleton using LRU
* This is created on first access and reused for all subsequent calls
*/
export declare function getDefaultCache(): Cache;
/**
* Helper function to get cache store from cache parameter
* Follows same pattern as logging - use passed cache or default
*/
export declare function getCacheStore<T>(cache: Cache | null | undefined, key: keyof Cache): CacheStore<T>;
/**
* Clear all entries from every store in the default cache instance.
* No-op if the cache hasn't been lazily constructed yet.
*/
export declare function clearDefaultCache(): void;
export type { Cache, CacheStore } from './cache-interface';