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

x/rimbu/list/custom/context.ts>ListContext

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class ListContext
implements [List.Context]
import { ListContext } from "https://deno.land/x/rimbu@0.14.0/list/custom/context.ts";

Constructors

new
ListContext(blockSizeBits: number)

Properties

readonly
_empty: List<any>
readonly
_types: List.Types
readonly
builder: <T>() => GenBuilder<T>
readonly
empty: <T>() => List<T>
readonly
flatten: (source: any) => any
readonly
from: <T>(...sources: ArrayNonEmpty<StreamSource<T>>) => any
readonly
fromString: (...sources: ArrayNonEmpty<string>) => any
readonly
maxBlockSize: number
readonly
minBlockSize: number
readonly
of: <T>(...values: ArrayNonEmpty<T>) => List.NonEmpty<T>
readonly
reducer: <T>(source?: StreamSource<T>) => Reducer<T, List<T>>
readonly
typeTag: "List"
readonly
unzip: (source: any, length: number) => any

Methods

createBuilder<T>(source?: List<T>): GenBuilder<T>
isLeafBlock<T>(obj: List<T> | Block<T>): obj is LeafBlock<T>
isLeafTree<T>(obj: List<T>): obj is LeafTree<T>
isNonLeafBlock<T>(obj: List<T> | Block<T> | NonLeaf<T>): obj is NonLeafBlock<T, any>
isNonLeafTree<T>(obj: NonLeaf<T>): obj is NonLeafTree<T, any>
isReversedLeafBlock<T>(obj: List<T> | Block<T>): obj is ReversedLeafBlock<T>
leafBlock<T>(children: readonly T[]): LeafBlock<T>
leafBlockBuilder<T>(children: T[]): LeafBlockBuilder<T>
leafTree<T>(
left: LeafBlock<T>,
right: LeafBlock<T>,
middle: NonLeaf<T, LeafBlock<T>> | null,
): LeafTree<T>
leafTreeBuilder<T>(
right: LeafBlockBuilder<T>,
length?: number,
): LeafTreeBuilder<T>
nonLeafBlock<T, C extends Block<T, C>>(
length: number,
children: readonly C[],
level: number,
): NonLeafBlock<T, C>
nonLeafBlockBuilder<T, C extends BlockBuilder<T>>(
level: number,
children: C[],
length: number,
): NonLeafBlockBuilder<T, C>
nonLeafTree<T, C extends Block<T, C>>(
left: NonLeafBlock<T, C>,
right: NonLeafBlock<T, C>,
middle: NonLeaf<T, NonLeafBlock<T, C>> | null,
level: number,
): NonLeafTree<T, C>
nonLeafTreeBuilder<T, C extends BlockBuilder<T>>(
level: number,
left: NonLeafBlockBuilder<T, C>,
right: NonLeafBlockBuilder<T, C>,
length?: number,
): NonLeafTreeBuilder<T, C>
nonLeafTreeBuilderSource<T, C extends BlockBuilder<T>>(source: NonLeafTree<T, any>): NonLeafTreeBuilder<T, C>
reversedLeaf<T>(children: readonly T[]): ReversedLeafBlock<T>