LegacyWeakMap is deprecated. Use WeakMapStore instead if possible.

interface LegacyWeakMap<K, V> {
    delete: ((key: K) => void);
    get: ((key: K) => V);
    has: ((key: K) => boolean);
    init: ((key: K, value: V) => void);
    set: ((key: K, value: V) => void);
}

Type Parameters

  • K
  • V

Properties

Properties

delete: ((key: K) => void)

Remove the key. Throws if not found.

get: ((key: K) => V)

Return a value for the key. Throws if not found.

has: ((key: K) => boolean)

Check if a key exists

init: ((key: K, value: V) => void)

Initialize the key only if it doesn't already exist

set: ((key: K, value: V) => void)

Set the key. Throws if not found.