import { ICache, IExpiryPolicyDelegate } from './_types'; import { Awaitable } from '../Types'; /** * Creates an in-memory cache. This cache will be forgotten on disposal. */ export default class MemoryCache implements ICache { #private; constructor(); add(key: TKey, value: Awaitable, expiryPolicy: IExpiryPolicyDelegate): void; addOrGetAsync(key: TKey, factory: (key: TKey) => Awaitable, expiryPolicy: IExpiryPolicyDelegate): Promise; addOrReplace(key: TKey, value: Awaitable, expiryPolicy: IExpiryPolicyDelegate): void; cleanAsync(): Promise; getAsync(key: TKey): Promise; tryGetAsync(key: TKey): Promise<{ success: boolean; value?: T; }>; replace(key: TKey, value: Awaitable, expiryPolicy: IExpiryPolicyDelegate): void; }