weakref
Version:
Extend built-in collections with weak references for efficient garbage collection and optimal performance in memory-intensive applications with IterableWeakSet, IterableWeakMap, and WeakValueMap.
18 lines • 734 B
TypeScript
export declare class IterableWeakMap<K extends object, V> implements WeakMap<K, V>, Map<K, V> {
#private;
constructor(entries?: readonly (readonly [K, V])[] | null);
constructor(iterable: Iterable<readonly [K, V]>);
get size(): number;
clear(): void;
delete(key: K): boolean;
get(key: K): V | undefined;
has(key: K): boolean;
set(key: K, value: V): this;
get [Symbol.toStringTag](): string;
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: unknown): void;
[Symbol.iterator](): IterableIterator<[K, V]>;
entries(): IterableIterator<[K, V]>;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
}
//# sourceMappingURL=iterable_weak_map.d.ts.map