import LRU from "lru-cache"; export type CacheOptions = LRU.Options; export declare function seconds(num: number, max?: number): CacheOptions; export declare function minutes(num: number, max?: number): CacheOptions; export declare function hours(num: number, max?: number): CacheOptions; export type CacheRes, T> = { (...args: A): Promise; force: (...args: A) => Promise; hydrate: (key: string, value: T) => void; clear: (key: string) => void; reset: () => void; }; /** * Creates an LRU cache function that wraps the given async function `f`. * By default it will have a lifespan of 300 seconds and a change in the key * will invalidate its value. * * @param {(...args: A) => Promise} f - The async function to be cached. * @param {(...args: A) => string} [keyExtractor] - A function that extracts a cache key from the arguments passed to `f`. * @param {LRU.Options} [lruOpts] - Options for the internal LRU cache. * * @returns {CacheRes} A cached version of the async function `f`. */ export declare const makeLRUCache: , T>(f: (...args: A) => Promise, keyExtractor?: (...args: A) => string, lruOpts?: LRU.Options) => CacheRes; //# sourceMappingURL=cache.d.ts.map