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

x/rimbu/list/custom/implementation/nonleaf/nonleaf-tree.ts>NonLeafTree

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

Constructors

new
NonLeafTree(
context: ListContext,
left: NonLeafBlock<T, C>,
right: NonLeafBlock<T, C>,
middle: NonLeaf<T, NonLeafBlock<T, C>> | null,
level: number,
length?,
)

Type Parameters

T
C extends Block<T, C>

Methods

append(child: C): NonLeafTree<T, C>
concat<T2>(other: NonLeaf<T2, C>): NonLeaf<T | T2, C>
copy(
left?,
right?,
middle?,
): NonLeafTree<T, C>
copy2<T2, C2 extends Block<T2, C2>>(
left: NonLeafBlock<T2, C2>,
right: NonLeafBlock<T2, C2>,
middle: NonLeaf<T2, NonLeafBlock<T2, C2>> | null,
): NonLeafTree<T2, C2>
dropFirst(): [NonLeaf<T, C> | null, C]
dropInternal(amount: number): [NonLeaf<T, C> | null, C, number]
dropLast(): [NonLeaf<T, C> | null, C]
forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, options: { reversed: boolean; state: TraverseState; }
): void
get(index: number): T
getChildLength(child: C): number
map<T2>(mapFun: (value: T, index: number) => T2, options?: { reversed?: boolean; indexOffset?: number; }): NonLeafTree<T2, any>
mapPure<T2>(mapFun: (value: T) => T2, options?: { reversed?: boolean; cacheMap?: CacheMap; }): NonLeafTree<T2, any>
prepend(child: C): NonLeafTree<T, C>
reversed(cacheMap?): NonLeafTree<T, C>
stream(options?: { reversed?: boolean; }): Stream.NonEmpty<T>
streamRange(range: IndexRange, options?: { reversed?: boolean; }): Stream<T>
structure(): string
takeInternal(amount: number): [NonLeaf<T, C> | null, C, number]
toArray(options?: { range?: IndexRange | undefined; reversed?: boolean; }): T[] | any
updateAt(index: number, update: Update<T>): NonLeafTree<T, C>