import { type BiMapFactory } from "https://deno.land/x/rimbu@1.0.3/bimap/custom/interface.ts";
Methods
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]>): BiMap.NonEmpty<K, V>
Returns an immutable BiMap
, containing the given entries
.
from<K extends UK, V extends UV>(...sources: ArrayNonEmpty<StreamSource<readonly [K, V]>>): BiMap.NonEmpty<K, V>
Returns an immutable BiMap, containing the entries in the given sources
StreamSource
instances.
from<K extends UK, V extends UV>(...sources: ArrayNonEmpty<StreamSource.NonEmpty<readonly [K, V]>>): BiMap<K, V>
reducer<K extends UK, V extends UV>(source?: StreamSource<readonly [K, V]>): Reducer<readonly [K, V], BiMap<K, V>>
Returns a Reducer
that adds received tuples to a BiMap and returns the BiMap as a result. When a source
is given,
the reducer will first create a BiMap from the source, and then add tuples to it.