export declare type CacheOptions = { keyPrefix?: string; defaultDuration?: number; }; export declare abstract class Cache { static initialize(config: [new (...args: any[]) => Cache, CacheOptions]): Cache; protected readonly keyPrefix: string; protected readonly defaultDuration: number; constructor(config: CacheOptions); exists(key: string): Promise; get(key: string, defaultValue: T): Promise; get(key: string): Promise; getOrSet(key: string, orSet: () => T | Promise, duration?: number): Promise; set(key: string, value: any, duration?: number): Promise; add(key: string, value: any, duration?: number): Promise; delete(key: string): Promise; deleteAll(): Promise; protected buildKey(key: string): string; protected abstract getValue(key: string): Promise; protected abstract setValue(key: string, value: string, duration: number): Promise; protected abstract addValue(key: string, value: string, duration: number): Promise; protected abstract deleteValue(key: string): Promise; protected abstract deleteAllValues(): Promise; }