Skip to main content

package @rimbu/core

The @rimbu/core package is a convenience package that exports most items from the following packages:

Interfaces

NameDescription
ArrowGraph<N>An type-invariant immutable arrow (directed) graph. See the Graph documentation and the ArrowGraph API documentation
ArrowGraphHashed<N>An type-invariant immutable valued arrow (directed) graph. The connections are internally maintained using hashed collections See the Graph documentation and the ArrowGraphHashed API documentation
ArrowGraphSorted<N>An type-invariant immutable valued arrow (directed) graph. The connections are internally maintained using sorted collections See the Graph documentation and the ArrowGraphSorted API documentation
ArrowValuedGraph<N,V>An type-invariant immutable valued arrow (directed) graph. See the Graph documentation and the ArrowValuedGraph API documentation
ArrowValuedGraphHashed<N,V>An type-invariant immutable valued arrow (directed) graph. The nodes are internally maintained using HashMaps See the Graph documentation and the ArrowValuedGraphHashed API documentation
ArrowValuedGraphSorted<N,V>An type-invariant immutable valued arrow (directed) graph. The nodes are internally maintained using SortedMaps See the Graph documentation and the ArrowValuedGraphSorted API documentation
BiMap<K,V>A type-invariant immutable bi-directional Map where keys and values have a one-to-one mapping. See the BiMap documentation and the BiMap API documentation
BiMultiMap<K,V>A type-invariant immutable bi-directional MultiMap where keys and values have a many-to-many mapping. See the BiMultiMap documentation and the BiMultiMap API documentation
Comp<K>An object providing methods to compare two values of type K.
EdgeGraph<N>An type-invariant immutable edge (undirected) graph. See the Graph documentation and the EdgeGraph API documentation
EdgeGraphHashed<N>An type-invariant immutable valued edge (undirected) graph. The connections are internally maintained using hashed collections See the Graph documentation and the EdgeGraphHashed API documentation
EdgeGraphSorted<N>An type-invariant immutable valued edge (undirected) graph. The connections are internally maintained using sorted collections See the Graph documentation and the EdgeGraphSorted API documentation
EdgeValuedGraph<N,V>An type-invariant immutable valued edge (undirected) graph. See the Graph documentation and the EdgeValuedGraph API documentation
EdgeValuedGraphHashed<N,V>An type-invariant immutable valued edge (undirected) graph. The nodes are internally maintained using HashMaps See the Graph documentation and the EdgeValuedGraphHashed API documentation
EdgeValuedGraphSorted<N,V>An type-invariant immutable valued edge (undirected) graph. The nodes are internally maintained using SortedMaps See the Graph documentation and the EdgeValuedGraphSorted API documentation
GenSource<E>undocumented
Graph<N>An type-invariant immutable graph. See the Graph documentation and the Graph API documentation
HashBiMultiMap<K,V>A type-invariant immutable bi-directional MultiMap where keys and values have a many-to-many mapping. Its keys and values are hashed. See the BiMultiMap documentation and the HashBiMultiMap API documentation
Hasher<UK>Interface used to hash objects for hashed collections.
HashMultiMapHashValue<K,V>A type-invariant immutable MultiMap of key type K, and value type V. In the MultiMap, each key has at least one value. See the MultiMap documentation and the HashMultiMapHashValue API documentation
HashMultiMapSortedValue<K,V>A type-invariant immutable MultiMap of key type K, and value type V. In the MultiMap, each key has at least one value. See the MultiMap documentation and the HashMultiMapSortedValue API documentation
HashMultiSet<T>A type-invariant immutable MultiSet of value type T. In the MultiSet, each value can occur multiple times. See the MultiSet documentation and the HashMultiSet API documentation
List<T>A random accessible immutable sequence of values of type T. See the List documentation and the List API documentation
MultiMap<K,V>A type-invariant immutable MultiMap of key type K, and value type V. In the Map, each key has at least one value. See the MultiMap documentation and the MultiMap API documentation
MultiSet<T>A type-invariant immutable MultiSet of value type T. In the MultiSet, each value can occur multiple times. See the MultiSet documentation and the MultiSet API documentation
SortedBiMultiMap<K,V>A type-invariant immutable bi-directional MultiMap where keys and values have a many-to-many mapping. Its keys and values are sorted. See the BiMultiMap documentation and the HashBiMultiMap API documentation
SortedMultiMapHashValue<K,V>A type-invariant immutable MultiMap of key type K, and value type V. In the MultiMap, each key has at least one value. See the MultiMap documentation and the SortedMultiMapHashValue API documentation
SortedMultiMapSortedValue<K,V>A type-invariant immutable MultiMap of key type K, and value type V. In the MultiMap, each key has at least one value. See the MultiMap documentation and the SortedMultiMapSortedValue API documentation
SortedMultiSet<T>A type-invariant immutable MultiSet of value type T. In the MultiSet, each value can occur multiple times. See the MultiSet documentation and the SortedMultiSet API documentation
Table<R,C,V>A type-invariant immutable Table of row key type R, column key type C, and value type V. In the Table, a combination of a row and column key has exactly one value. See the Table documentation and the Table API documentation
ToJSON<V,D>Utility type to convert some object to a JSON serializable format.
TraverseStateAn object used to track the state of a traversal, e.g. a forEach.
ValuedGraph<N,V>An type-invariant immutable valued graph. See the Graph documentation and the ValuedGraph API documentation
VariantGraph<N>An type-variant immutable graph. See the Graph documentation and the VariantGraph API documentation
VariantMultiMap<K,V>A type-variant immutable MultiMap of key type K, and value type V. In the Map, each key has at least one value. See the MultiMap documentation and the VariantMultiMap API documentation
VariantMultiSet<T>A type-variant immutable MultiSet of value type T. In the MultiSet, each value can occur multiple times. See the MultiSet documentation and the VariantMultiSet API documentation
VariantTable<R,C,V>A type-variant immutable Table of row key type R, column key type C, and value type V. In the Table, a combination of a row and column key has exactly one value. See the Table documentation and the VariantTable API documentation
VariantValuedGraph<N,V>An type-variant immutable valued graph. See the Graph documentation and the VariantValuedGraph API documentation

Namespaces

NameDescription
ArrowGraphAn type-invariant immutable arrow (directed) graph. See the Graph documentation and the ArrowGraph API documentation
ArrowGraphHashedAn type-invariant immutable valued arrow (directed) graph. The connections are internally maintained using hashed collections See the Graph documentation and the ArrowGraphHashed API documentation
ArrowGraphSortedAn type-invariant immutable valued arrow (directed) graph. The connections are internally maintained using sorted collections See the Graph documentation and the ArrowGraphSorted API documentation
ArrowValuedGraphAn type-invariant immutable valued arrow (directed) graph. See the Graph documentation and the ArrowValuedGraph API documentation
ArrowValuedGraphHashedAn type-invariant immutable valued arrow (directed) graph. The nodes are internally maintained using HashMaps See the Graph documentation and the ArrowValuedGraphHashed API documentation
ArrowValuedGraphSortedAn type-invariant immutable valued arrow (directed) graph. The nodes are internally maintained using SortedMaps See the Graph documentation and the ArrowValuedGraphSorted API documentation
AsyncOptLazyA potentially lazy and/or asynchronous value of type T.
AsyncReducerAn AsyncReducer is a stand-alone asynchronous calculation that takes input values of type I, and, when requested, produces an output value of type O.
BiMapA type-invariant immutable bi-directional Map where keys and values have a one-to-one mapping. See the BiMap documentation and the BiMap API documentation
BiMultiMapA type-invariant immutable bi-directional MultiMap where keys and values have a many-to-many mapping. See the BiMultiMap documentation and the BiMultiMap API documentation
CollectFunA function used in collect methods to collect values from a collection. This is basically a single-pass map and filter.
CompAn object providing methods to compare two values of type K.
Deepundocumented
EdgeGraphAn type-invariant immutable edge (undirected) graph. See the Graph documentation and the EdgeGraph API documentation
EdgeGraphHashedAn type-invariant immutable valued edge (undirected) graph. The connections are internally maintained using hashed collections See the Graph documentation and the EdgeGraphHashed API documentation
EdgeGraphSortedAn type-invariant immutable valued edge (undirected) graph. The connections are internally maintained using sorted collections See the Graph documentation and the EdgeGraphSorted API documentation
EdgeValuedGraphAn type-invariant immutable valued edge (undirected) graph. See the Graph documentation and the EdgeValuedGraph API documentation
EdgeValuedGraphHashedAn type-invariant immutable valued edge (undirected) graph. The nodes are internally maintained using HashMaps See the Graph documentation and the EdgeValuedGraphHashed API documentation
EdgeValuedGraphSortedAn type-invariant immutable valued edge (undirected) graph. The nodes are internally maintained using SortedMaps See the Graph documentation and the EdgeValuedGraphSorted API documentation
EqA function returning true if given v1 and v2 should be considered equal.
ErrBaseundocumented
GraphAn type-invariant immutable graph. See the Graph documentation and the Graph API documentation
HashBiMultiMapA type-invariant immutable bi-directional MultiMap where keys and values have a many-to-many mapping. Its keys and values are hashed. See the BiMultiMap documentation and the HashBiMultiMap API documentation
HasherInterface used to hash objects for hashed collections.
HashMultiMapHashValueA type-invariant immutable MultiMap of key type K, and value type V. In the MultiMap, each key has at least one value. See the MultiMap documentation and the HashMultiMapHashValue API documentation
HashMultiMapSortedValueA type-invariant immutable MultiMap of key type K, and value type V. In the MultiMap, each key has at least one value. See the MultiMap documentation and the HashMultiMapSortedValue API documentation
HashMultiSetA type-invariant immutable MultiSet of value type T. In the MultiSet, each value can occur multiple times. See the MultiSet documentation and the HashMultiSet API documentation
IndexRangeA flexible range specification for numeric indices. If a start or end is defined, a tuple can be used where the second item is a boolean indicating whether that end is inclusive or exclusive.

An IndexRange can have one of the following forms:

Classes

NameDescription
BlockBuilderBaseundocumented
CollisionBuilderBaseundocumented

Functions

Err

Throws an Err.ForcedError error when called.

Definition

export declare function Err(): never;

example
const emptyMap = HashMap.empty<number, string>()
emptyMap.get(5, Err);
// throws: Err.CustomError(message: 'Err: forced to throw error')

OptLazy

Returns the value contained in an OptLazy instance of type T.

Definition

export declare function OptLazy<T>(optLazy: OptLazy<T>): T;

Type parameters
NameDescription
T

Parameters

NameTypeDescription
optLazyOptLazy<T>the OptLazy value of type T
example
OptLazy(1)              // => 1
OptLazy(() => 1) // => 1
OptLazy(() => () => 1) // => () => 1

OptLazyOr

Returns the value contained in an OptLazyOr instance of type T, or the given otherValue if the lazy function returns it.

Definition

export declare function OptLazyOr<T, O>(optLazyOr: OptLazyOr<T, O>, otherValue: O): T | O;

Type parameters
NameDescription
T
O

Parameters

NameTypeDescription
optLazyOrOptLazyOr<T, O>a value or a function returning a value or otherwise the received value
otherValueOthe value to return if the optLazyOr does not return its own value
example
OptLazyOr(1, 'a')               // => 1
OptLazyOr(() => 1, 'a') // => 1
OptLazyOr((none) => none, 'a') // => 'a'

TraverseState

Returns a new TraverseState instance, using optionally given startIndex as a start index value.

Definition

export declare function TraverseState(startIndex?: number): TraverseState;

Parameters

NameTypeDescription
startIndexnumber(default: 0) the start index to use

Update

Returns the result of given update parameter, where it can either directly give a new value, or it is a function receiving the given value, and returns a new value.

Definition

export declare function Update<T>(value: T, update: Update<T>): T;

Type parameters
NameDescription
T

Parameters

NameTypeDescription
valueTthe current value
updateUpdate<T>an Update value, either a new value or a function receiving the old value and returning a new one.
example
Update(1, 2)          // => 2
Update(1, () => 10) // => 10
Update(1, v => v + 1) // => 2