Interface Map<K, V>

The counterpart of Daml's DA.Map.Map K V type.

This is an immutable map which compares keys via deep equality. The order of iteration is unspecified; the only guarantee is that the order in keys and values match, i.e. m.get(k) is (deep-, value-based) equal to [...m.values()][[...m.keys()].findIndex((l) => _.isEqual(k, l))]

K The type of the map keys.

V The type of the map values.

interface Map<K, V> {
    delete: (k: K) => Map<K, V>;
    entries: () => Iterator<[K, V], undefined, undefined>;
    entriesArray: () => [K, V][];
    forEach: <T, U>(f: (value: V, key: K, map: Map<K, V>) => T, u?: U) => void;
    get: (k: K) => undefined | V;
    has: (k: K) => boolean;
    keys: () => Iterator<K, undefined, undefined>;
    set: (k: K, v: V) => Map<K, V>;
    values: () => Iterator<V, undefined, undefined>;
}

Type Parameters

  • K
  • V

Properties

delete: (k: K) => Map<K, V>
entries: () => Iterator<[K, V], undefined, undefined>
entriesArray: () => [K, V][]
forEach: <T, U>(f: (value: V, key: K, map: Map<K, V>) => T, u?: U) => void
get: (k: K) => undefined | V
has: (k: K) => boolean
keys: () => Iterator<K, undefined, undefined>
set: (k: K, v: V) => Map<K, V>
values: () => Iterator<V, undefined, undefined>