Skip to main content Link Search Menu Expand Document (external link)

MutableHashMap.ts overview

Since v2.0.0


Exports Grouped by Category


constructors

empty

Signature

declare const empty: <K, V>() => MutableHashMap<K, V>

Source

Since v2.0.0

fromIterable

Creates a new MutableHashMap from an iterable collection of key/value pairs.

Signature

declare const fromIterable: <K, V>(entries: Iterable<readonly [K, V]>) => MutableHashMap<K, V>

Source

Since v2.0.0

make

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
>

Source

Since v2.0.0

elements

get

Signature

declare const get: {
  <K>(key: K): <V>(self: MutableHashMap<K, V>) => Option.Option<V>
  <K, V>(self: MutableHashMap<K, V>, key: K): Option.Option<V>
}

Source

Since v2.0.0

has

Signature

declare const has: {
  <K>(key: K): <V>(self: MutableHashMap<K, V>) => boolean
  <K, V>(self: MutableHashMap<K, V>, key: K): boolean
}

Source

Since v2.0.0

keys

Signature

declare const keys: <K, V>(self: MutableHashMap<K, V>) => Array<K>

Source

Since v3.8.0

size

Signature

declare const size: <K, V>(self: MutableHashMap<K, V>) => number

Source

Since v2.0.0

values

Signature

declare const values: <K, V>(self: MutableHashMap<K, V>) => Array<V>

Source

Since v3.8.0

models

MutableHashMap (interface)

Signature

export interface MutableHashMap<out K, out V> extends Iterable<[K, V]>, Pipeable, Inspectable {
  readonly [TypeId]: TypeId
  /** @internal */
  readonly referential: Map<K, V>
  /** @internal */
  readonly buckets: Map<number, NonEmptyArray<readonly [K & Equal.Equal, V]>>
  /** @internal */
  bucketsSize: number
}

Source

Since v2.0.0

symbol

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v2.0.0

utils

clear

Signature

declare const clear: <K, V>(self: MutableHashMap<K, V>) => MutableHashMap<K, V>

Source

Since v2.0.0

forEach

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
}

Source

Since v2.0.0

isEmpty

Signature

declare const isEmpty: <K, V>(self: MutableHashMap<K, V>) => boolean

Source

Since v2.0.0

modify

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>
}

Source

Since v2.0.0

modifyAt

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.Option<V>) => Option.Option<V>): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K, f: (value: Option.Option<V>) => Option.Option<V>): MutableHashMap<K, V>
}

Source

Since v2.0.0

remove

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>
}

Source

Since v2.0.0

set

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>
}

Source

Since v2.0.0