Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/multimap/custom/interface/base.ts>MultiMapBase

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
namespace MultiMapBase
import { MultiMapBase } from "https://deno.land/x/rimbu@1.0.2/multimap/custom/interface/base.ts";

Interfaces

The multimap's Context instance that serves as a factory for all related immutable instances and builders.

Utility interface that provides higher-kinded types for this collection.

interface MultiMapBase
implements VariantMultiMapBase<K, V, Tp>
import { type MultiMapBase } from "https://deno.land/x/rimbu@1.0.2/multimap/custom/interface/base.ts";

Properties

readonly
context: WithKeyValue<Tp, K, V>["context"]

Returns the context associated to this collection instance.

Methods

add(key: K, value: V): WithKeyValue<Tp, K, V>["nonEmpty"]

Returns the collection with the given value added to the given key values.

addEntries(entries: StreamSource.NonEmpty<readonly [K, V]>): WithKeyValue<Tp, K, V>["nonEmpty"]

Returns the collection with the given entries added.

addEntries(entries: StreamSource<readonly [K, V]>): WithKeyValue<Tp, K, V>["normal"]
setValues(key: K, values: StreamSource.NonEmpty<V>): WithKeyValue<Tp, K, V>["nonEmpty"]

Returns the collection where given key has the given values associated with it.

setValues(key: K, values: StreamSource<V>): WithKeyValue<Tp, K, V>["normal"]
modifyAt(atKey: K, options: { ifNew?: OptLazy<StreamSource<V>>; ifExists?: (currentValues: WithKeyValue<Tp, K, V>["keyMapValuesNonEmpty"]) => StreamSource<V>; }): WithKeyValue<Tp, K, V>["normal"]

Returns the collection with the given atKey key modified according to given options.

toBuilder(): WithKeyValue<Tp, K, V>["builder"]

Returns a builder object containing the entries of this collection.