export function makeCacheMapKit["set"]>[0] = Parameters["set"]>[0], V extends unknown = unknown>(capacity: number, options?: { makeMap?: C | (() => SingleEntryMap) | undefined; }): CacheMapKit; /** * Intentionally limited to local needs; refer to * https://github.com/sindresorhus/type-fest if insufficient. */ export type WritableDeep = T extends object ? { -readonly [K in keyof T]: T[K]; } : never; /** * A cache of bounded size, implementing the WeakMap interface but holding keys * strongly if created with a non-weak `makeMap` option of * {@link makeCacheMapKit}. */ export type WeakMapAPI = Pick, Exclude, "set">> & { set: (key: K, value: V) => WeakMapAPI; }; export type SingleEntryMap = WeakMapAPI & ({ clear?: undefined; } | Pick, "clear">); /** * A cell of a doubly-linked ring (circular list) for a cache map. * Instances are not frozen, and so should be closely encapsulated. */ export type CacheMapCell = { /** * for debugging */ id: number; next: CacheMapCell; prev: CacheMapCell; data: SingleEntryMap; }; export type CacheMapMetrics = typeof zeroMetrics; export type CacheMapKit["set"]>[0] = Parameters["set"]>[0], V extends unknown = unknown> = { cache: WeakMapAPI; getMetrics: () => CacheMapMetrics; }; declare const zeroMetrics: Readonly<{ totalQueryCount: 0; totalHitCount: 0; }>; export {}; //# sourceMappingURL=cachemap.d.ts.map