weakref
Version:
IterableWeakSet, IterableWeakMap, and WeakValueMap provide iterable weak collections whose entries disappear automatically when their objects are garbage collected—perfect for caches and registries in any JavaScript runtime.
18 lines • 714 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](): MapIterator<[K, V]>;
entries(): MapIterator<[K, V]>;
keys(): MapIterator<K>;
values(): MapIterator<V>;
}
//# sourceMappingURL=iterable_weak_map.d.ts.map