export interface SynchronousWriteCache { set: (key: string, value: T | null) => void; delete: (key: string) => void; deleteMany: (keys: string[]) => void; clear: () => void; } export type GetManyResult = { resolvedValues: T[]; unresolvedKeys: string[]; }; export interface SynchronousCache extends SynchronousWriteCache { readonly ttlLeftBeforeRefreshInMsecs?: number; get: (key: string) => LoadedValue | undefined | null; getMany: (keys: string[]) => GetManyResult; getExpirationTime: (key: string) => number | undefined; } export interface SynchronousWriteGroupCache { setForGroup: (key: string, value: T | null, group: string) => void; deleteFromGroup: (key: string, group: string) => void; deleteGroup: (group: string) => void; clear: () => void; } export interface SynchronousGroupCache extends SynchronousWriteGroupCache { readonly ttlLeftBeforeRefreshInMsecs?: number; getFromGroup: (key: string, group: string) => T | undefined | null; getManyFromGroup: (keys: string[], group: string) => GetManyResult; getExpirationTimeFromGroup: (key: string, group: string) => number | undefined; }