import { type BiMultiMapBase } from "https://deno.land/x/rimbu@1.1.0/bimultimap/custom/index.ts";
const { Factory } = BiMultiMapBase;
Type Parameters
optional
Tp extends BiMultiMapBase.Types = BiMultiMapBase.TypesMethods
empty<K extends UK, V extends UV>(): WithKeyValue<Tp, K, V>["normal"]
Returns the (singleton) empty instance of this type and context with given key and value types.
of<K extends UK, V extends UV>(...entries: ArrayNonEmpty<readonly [K, V]>): WithKeyValue<Tp, K, V>["nonEmpty"]
Returns an immutable BiMultiMap, containing the given entries
.
from<K extends UK, V extends UV>(...sources: ArrayNonEmpty<StreamSource.NonEmpty<readonly [K, V]>>): WithKeyValue<Tp, K, V>["nonEmpty"]
Returns an immutable BiMultiMap, containing the entries in the given sources
StreamSource
instances.
from<K extends UK, V extends UV>(...sources: ArrayNonEmpty<StreamSource<readonly [K, V]>>): WithKeyValue<Tp, K, V>["normal"]
builder<K extends UK, V extends UV>(): WithKeyValue<Tp, K, V>["builder"]
Returns an empty BiMultiMap
builder instance.
reducer<K extends UK, V extends UV>(source?: StreamSource<readonly [K, V]>): Reducer<[K, V], WithKeyValue<Tp, K, V>["normal"]>
Returns a Reducer
that adds received tuples to a BiMultiMap and returns the BiMultiMap as a result. When a source
is given,
the reducer will first create a BiMultiMap from the source, and then add tuples to it.