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

x/rimbu/table/custom/interface/base.ts>TableBase

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

Interfaces

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

interface TableBase
implements VariantTableBase<R, C, V, Tp>
import { type TableBase } from "https://deno.land/x/rimbu@1.0.0/table/custom/interface/base.ts";

Properties

readonly
context: WithRow<Tp, R, C, V>["context"]

Returns the context associated to this collection instance.

Methods

set(
row: R,
column: C,
value: V,
): WithRow<Tp, R, C, V>["nonEmpty"]

Returns the collection where the given value is associated with the given row and column keys.

addEntry(entry: readonly [R, C, V]): WithRow<Tp, R, C, V>["nonEmpty"]

Returns the collection with the given entry added.

addEntries(entries: StreamSource.NonEmpty<readonly [R, C, V]>): WithRow<Tp, R, C, V>["nonEmpty"]

Returns the collection with the given entries added.

addEntries(entries: StreamSource<readonly [R, C, V]>): WithRow<Tp, R, C, V>["normal"]
modifyAt(
row: R,
column: C,
options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (value: V, remove: Token) => V | Token; },
): WithRow<Tp, R, C, V>["normal"]

Returns the collection with the value at given row and column keys modified according to given options.

updateAt<UR = R, UC = C>(
row: RelatedTo<R, UR>,
column: RelatedTo<C, UC>,
update: Update<V>,
): WithRow<Tp, R, C, V>["normal"]

Returns the collection with the value at given row and column keys updated according to the given update function.

toBuilder(): WithRow<Tp, R, C, V>["builder"]

Returns a builder object containing the entries of this collection.