Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/rimbu/list/custom/index.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>
Re-export
import { LeafTree } from "https://deno.land/x/rimbu@0.13.0/list/custom/index.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>