import fetch = require("node-fetch"); declare class NFCResponse extends fetch.Response { ejectFromCache(): Promise; } interface Cache { get(key: string): Promise; remove(key: string): Promise; set(key: string, bodyStream: fetch.Response["body"], metaData: any): Promise; } interface MemoryCacheOptions { ttl?: number; } export class MemoryCache implements Cache { constructor(options?: MemoryCacheOptions); get(key: string): Promise; remove(key: string): Promise; set(key: string, bodyStream: fetch.Response["body"], metaData: any): Promise; } interface FileSystemCacheOptions { ttl?: number; cacheDirectory?: string; } export class FileSystemCache implements Cache { constructor(options?: FileSystemCacheOptions); get(key: string): Promise; remove(key: string): Promise; set(key: string, bodyStream: fetch.Response["body"], metaData: any): Promise; } type FetchBuilder = (cache: Cache) => FetchCache; type FetchCache = ((...args: Parameters) => Promise) & { withCache: FetchBuilder; }; declare const defaultFetch: FetchCache; export default defaultFetch; export const fetchBuilder: FetchCache;