import { ICachingStrategy, ICachable } from "../types.js"; import { ICacheStore } from "./ICacheStore.js"; export default class GenericCache implements ICachingStrategy { private storage; private updateFunctions; private autoRenewInterval; private autoRenewWindow; constructor(storage: ICacheStore, updateFunctions?: Map Promise>, autoRenewInterval?: number, autoRenewWindow?: number); getOrCreate(cacheKey: string, createFunction: () => Promise, updateFunction?: (item: T) => Promise): Promise; get(cacheKey: string): Promise; set(cacheKey: string, value: object, expiresIn: number): void; setCacheItem(cacheKey: string, cacheItem: ICachable): void; remove(cacheKey: string): void; private itemDueToExpire; private autoRenewRenewableItems; private tryUpdateItem; }