@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.
47 lines (46 loc) • 1.34 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 the default cache instance
* Useful for testing or when you want to reset cache state
*/
export declare function clearDefaultCache(): void;
/**
* Reset the default cache instance to a fresh one
*/
export declare function resetDefaultCache(): void;
export type { Cache, CacheStore } from './cache-interface';