/** * Sets a new cache expiry duration, in ms. * Setting this to a value <= 0 will disable the caching logic altogether * and not store cache entries at all * @param value Duration in ms */ export declare function setCacheExpiryDuration(value: number): void; /** * Returns the current cache expiry duration in ms */ export declare function getCacheExpiryDuration(): number; export declare function getCache(): Promise; export declare function _resetCache(): void; export declare function storeCacheEntry(object: unknown, ...keys: string[]): Promise; export declare function hasValidCacheEntry(...keys: string[]): Promise; export declare function readCacheEntry(...keys: string[]): Promise; /** * This will skip a long/expensive task and use a cached value if available, * otherwise the task will be run normally * Note: outside of a browser's main thread, caching will never happen! * @param factory A function encapsulating * the long/expensive task; non-serializable properties of the returned object * will be set to null * @param keys Keys will be concatenated for storage * @return Resolves to either a cached object or a fresh one */ export declare function useCache(factory: () => T | Promise, ...keys: string[]): Promise; /** * Removes all expired entries from the cache */ export declare function purgeOutdatedEntries(): Promise; /** * Remove all cache entries; will not prevent the creation of new ones */ export declare function clearCache(): Promise; //# sourceMappingURL=cache.d.ts.map