export type CacheTtl = { value: number; unit: "years" | "months" | "days" | "hours" | "minutes" | "seconds"; }; export type CacheEntryInfo = { instanceName: string; key: string; expiration: Date; createdOn: Date; updatedOn: Date; }; export type CacheEntryDetail = CacheEntryInfo & { data: any; }; export interface ICacheInstance { getInstanceName(): string; getEntries(): Promise; getEntry(key: string): Promise; get(key: string): Promise; set(key: string, input: { value: T; ttl: CacheTtl; }): Promise; retrieve(key: string, input: { ttl: CacheTtl; valueFactory: () => Promise; }): Promise; delete(key: string): Promise; clear(): Promise; } export interface ICache { getInstance(instanceName: string): Promise; }