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

x/rimbu/list/custom/implementation/leaf/leaf-tree.ts>LeafTree

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class LeafTree
implements Tree<T, LeafTree<T>, LeafBlock<T>, T>
import { LeafTree } from "https://deno.land/x/rimbu@0.14.0/list/custom/implementation/leaf/leaf-tree.ts";

Constructors

new
LeafTree(
context: ListContext,
left: LeafBlock<T>,
right: LeafBlock<T>,
middle: NonLeaf<T, LeafBlock<T>> | null,
length?,
)

Methods

_normalize(): List.NonEmpty<T>
append(value: T): LeafTree<T>
concat<T2>(...sources: ArrayNonEmpty<StreamSource<T2>>): List.NonEmpty<T | T2>
concatBlock(other: LeafBlock<T>): List.NonEmpty<T>
copy(
left?,
right?,
middle?,
): LeafTree<T>
copy2<T2>(
left: LeafBlock<T2>,
right: LeafBlock<T2>,
middle: NonLeaf<T2, LeafBlock<T2>> | null,
): LeafTree<T2>
drop(amount: number): List<T>
forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, state?: TraverseState
): void
get<O>(index: number, otherwise?: OptLazy<O>): T | O
map<T2>(
mapFun: (value: T, index: number) => T2,
reversed?,
indexOffset?,
): LeafTree<T2>
mapPure<T2>(
mapFun: (value: T) => T2,
reversed?,
cacheMap?,
): LeafTree<T2>
prepend(value: T): LeafTree<T>
reversed(cacheMap?): LeafTree<T>
stream(reversed?): Stream.NonEmpty<T>
streamRange(range: IndexRange, reversed?): Stream<T>
structure(): string
take(amount: number): List<T> | any
toArray(range?: IndexRange, reversed?): T[] | any
updateAt(index: number, update: Update<T>): LeafTree<T>