export declare enum CACHE_STORE { NONE = 0, MEMORY = 1, REDIS = 2, ALL = 3 } export declare enum CACHE_TTL { NO = 0, SEC = 1000,// only for testing ? MINUTE = 60000, TEN_MINUTES = 600000, HOUR = 3600000, DAY = 86400000 } export declare enum CACHE_COUNT { NO = 0, SMALL = 1000, MEDIUM = 100000, LARGE = 10000000 } export interface ICacheOptions { ttl?: CACHE_TTL; store?: CACHE_STORE; } export interface ICacheConfig { instanceName: string; redisUrl?: string; redisConfig?: any; ttl?: CACHE_TTL; max?: CACHE_COUNT; store?: CACHE_STORE; } export declare const CACHE_DEFAULT_OPTIONS_AS_MUCH_AS_POSSIBLE: { ttl: CACHE_TTL; }; export declare const CACHE_DEFAULT_OPTIONS_LRU: { ttl: CACHE_TTL; }; export interface ICache { set(key: string | object, value: string | object, options?: ICacheOptions): Promise; setIfNotExists(key: string | object, value: string | object, options?: ICacheOptions): Promise; get(key: string | object): Promise; incr(key: string): Promise; execute(options: ICacheOptions, fn: (...params: any[]) => any, ...params: any[]): Promise; } export declare class CacheFactory implements ICache { protected config: ICacheConfig; private memoryCache; private redisCache; private bypass; private ok; constructor(); setUp(config: ICacheConfig): void; release(): Promise; reset(): Promise; set(key: string | object, value: string | object, options?: ICacheOptions): Promise; setIfNotExists(key: string | object, value: string | object, options?: ICacheOptions): Promise; get(key: string | object): Promise; execute(options: ICacheOptions, fn: (...params: any[]) => any, ...params: any[]): Promise; remove(key: string): Promise; removeByPattern(keyPattern: string): Promise; setBypass(bypass?: boolean): void; isOk(): boolean; incr(key: string): Promise; protected init(): Promise; private buildUniqueKey; } export declare const cacheFactory: CacheFactory; export declare class CacheFake implements ICache { get(key: any): Promise; set(key: any, value: any): Promise; setIfNotExists(key: any, value: any): Promise; incr(key: string): Promise; execute(options: ICacheOptions, fn: (...params: any[]) => any, ...params: any[]): any; }