import type { ErrorType } from '../errors/utils.js'; /** @internal */ export declare const promiseCache: Map; /** @internal */ export declare const responseCache: Map; export type GetCacheErrorType = ErrorType; export declare function getCache(cacheKey: string): { clear: () => void; promise: { clear: () => boolean; get: () => Promise | undefined; set: (data: Promise) => Map>; }; response: { clear: () => boolean; get: () => { created: Date; data: data; } | undefined; set: (data: { created: Date; data: data; }) => Map; }; }; type WithCacheParameters = { /** The key to cache the data against. */ cacheKey: string; /** The time that cached data will remain in memory. Default: Infinity (no expiry) */ cacheTime?: number | undefined; }; /** * @description Returns the result of a given promise, and caches the result for * subsequent invocations against a provided cache key. */ export declare function withCache(fn: () => Promise, { cacheKey, cacheTime }: WithCacheParameters): Promise; export {}; //# sourceMappingURL=withCache.d.ts.map