@phonecheck/phone-number-validator-js
Version:
Validate, parse, and enrich international phone numbers — geocoding, carrier lookup, and timezone resolution. Sync (Node) + async (serverless) APIs, platform adapters, and a CLI.
18 lines (17 loc) • 938 B
TypeScript
import type { CacheStats, LookupTable } from './types';
export declare const DEFAULT_CACHE_SIZE = 100;
/** Internal — used by `core.ts` for read/write. */
export declare function cacheGet(key: string): LookupTable | undefined;
export declare function cacheSet(key: string, value: LookupTable): void;
/** Drop every entry. Useful between tests and for long-running processes. */
export declare function clearCache(): void;
/** Live entry count (does not include keys evicted by the LRU). */
export declare function getCacheSize(): number;
/** Snapshot — helpful for `/health` endpoints in serverless adapters. */
export declare function getCacheStats(): CacheStats;
/**
* Resize the cache. Existing entries are migrated newest-first up to the new
* ceiling; any overflow is dropped. Calling this with the current size is a
* no-op (kept for symmetry with `clearCache`).
*/
export declare function setCacheSize(size: number): void;