type CacheMeta = { /** created timestamp (miliseconds) */ created: number; /** time to live (seconds) **/ ttl: number; }; interface CacheOptions { namespace: string; /** time to live (seconds) **/ ttl?: number; path: string; readonly?: boolean; pretty?: boolean; serialize?: (val: any) => string; unserialize?: (val: string) => any; } declare class Cache { options: CacheOptions; data: any; protected fileLastModified: number; protected fileContent: string; constructor(options: CacheOptions); protected loadDataFromFile(force?: boolean): void; protected saveDataToFile(force?: boolean): void; protected ensureFileExists(): void; protected getKey(key: string, ...parts: string[]): string; protected getKeys(key: string): { mkey: string; vkey: string; }; protected unsetIfExpired(key: string): void; getFilePath(): string; clear(): void; getSize(): number; get(key?: string, defaultValue?: any): T; has(key: string): boolean; set(key: string, value: any): any; set(key: string, value: any, ttl?: number): any; unset(key: string): this; } export { Cache, type CacheMeta, type CacheOptions };