// Type definitions for cache-manager v1.2.0 // Project: https://github.com/BryanDonovan/node-cache-manager // Definitions by: Simon Gausmann // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module 'cache-manager' { interface CachingConfig { ttl: number; } interface StoreConfig extends CachingConfig { store: string; max?: number; isCacheableValue?: (value: any) => boolean; } interface Cache { set(key: string, value: T, options: CachingConfig, callback?: (error: any) => void): void; set(key: string, value: T, ttl: number, callback?: (error: any) => void): void; wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void, options: CachingConfig, callback: (error: any, result: T) => void): void; wrap(key: string, wrapper: (callback: (error: any, result: T) => void) => void, callback: (error: any, result: T) => void): void; get(key: string, callback: (error: any, result: T) => void): void; del(key: string, callback?: (error: any) => void): void; } module cacheManager { function caching(IConfig: StoreConfig): Cache; function multiCaching(Caches: Cache[]): Cache; } export = cacheManager; }