MutableHashMap
Constructors
Signature
declare function empty<K = never, V = never>(): MutableHashMap<K, V>;fromIterable
Added in v2.0.0
Source
Signature
declare function fromIterable<K, V>(entries: Iterable<readonly [K, V]>): MutableHashMap<K, V>;Signature
declare const make: <Entries extends Array<readonly [any, any]>>(
...entries: Entries
) => MutableHashMap<
Entries[number] extends readonly [infer K, any] ? K : never,
Entries[number] extends readonly [any, infer V] ? V : never
>;Elements
Signature
declare const get: {
<K>(key: K): <V>(self: MutableHashMap<K, V>) => Option<V>;
<K, V>(self: MutableHashMap<K, V>, key: K): Option<V>;
};Signature
declare const has: {
<K>(key: K): <V>(self: MutableHashMap<K, V>) => boolean;
<K, V>(self: MutableHashMap<K, V>, key: K): boolean;
};Signature
declare function keys<K, V>(self: MutableHashMap<K, V>): Array<K>;Signature
declare function size<K, V>(self: MutableHashMap<K, V>): number;Signature
declare function values<K, V>(self: MutableHashMap<K, V>): Array<V>;Models
MutableHashMap interface
Added in v2.0.0
Source
Signature
interface MutableHashMap<out K, out V> extends Iterable<[K, V]>, Pipeable, Inspectable {
readonly [TypeId]: typeof TypeId;
}Other
Signature
declare function clear<K, V>(self: MutableHashMap<K, V>): MutableHashMap<K, V>;Signature
declare const forEach: {
<K, V>(f: (value: V, key: K) => void): (self: MutableHashMap<K, V>) => void;
<K, V>(self: MutableHashMap<K, V>, f: (value: V, key: K) => void): void;
};Signature
declare function isEmpty<K, V>(self: MutableHashMap<K, V>): boolean;Updates the value of the specified key within the MutableHashMap if it exists.
Signature
declare const modify: {
<K, V>(key: K, f: (v: V) => V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
<K, V>(self: MutableHashMap<K, V>, key: K, f: (v: V) => V): MutableHashMap<K, V>;
};Set or remove the specified key in the MutableHashMap using the specified update function.
Signature
declare const modifyAt: {
<K, V>(
key: K,
f: (value: Option<V>) => Option<V>,
): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
<K, V>(
self: MutableHashMap<K, V>,
key: K,
f: (value: Option<V>) => Option<V>,
): MutableHashMap<K, V>;
};Signature
declare const remove: {
<K>(key: K): <V>(self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
<K, V>(self: MutableHashMap<K, V>, key: K): MutableHashMap<K, V>;
};Signature
declare const set: {
<K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
<K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>;
};
Creates a new
MutableHashMapfrom an iterable collection of key/value pairs.