declare type CacheKey = string; declare type Callback = (data: any) => void; interface Task { request: () => Promise; cacheKey: CacheKey; callback: Callback; } declare class Cache { private queue; private cached; request(): Promise; flushCallback(cacheKey: CacheKey): void; registerCallback(cacheKey: CacheKey, callback: Callback): void; apply(newTask: Task): void; get(cacheKey: CacheKey): any; } declare const globalCache: Cache; export default globalCache;