export type CacheMetadata = { createdTime: number; ttl?: number | null; }; export type CacheEntry = { metadata: CacheMetadata; value: Value; }; export type Eventually = Value | null | undefined | Promise; export type CacheStore = { name?: string; get: (key: string) => Eventually>; set: (key: string, value: CacheEntry) => unknown | Promise; delete: (key: string) => unknown | Promise; }; export type CacheFunction = (cacheKey: string, fn: () => Promise | Value) => Promise | Value; export declare class InMemoryCache { private _cache; get(key: string): Eventually>; set(key: string, value: CacheEntry): unknown; delete(key: string): unknown; } /** * Create a cache function that uses the provided store to cache values. Using InMemoryCache is safe because each task run is isolated. * @param store * @returns */ export declare function createCache(store: CacheStore): CacheFunction;