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

x/rimbu/list/custom/implementation/nonleaf/interface.ts>NonLeaf

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface NonLeaf
import { type NonLeaf } from "https://deno.land/x/rimbu@1.0.2/list/custom/implementation/nonleaf/interface.ts";

Type Parameters

T
optional
C extends Block<any, C> = any

Properties

readonly
length: number
readonly
context: ListContext
readonly
level: number

Methods

get(index: number): T
prepend(child: C): NonLeaf<T, C>
append(child: C): NonLeaf<T, C>
dropFirst(): [NonLeaf<T, C> | null, C]
dropLast(): [NonLeaf<T, C> | null, C]
dropInternal(amount: number): [NonLeaf<T, C> | null, C, number]
takeInternal(amount: number): [NonLeaf<T, C> | null, C, number]
concat<T2>(other: NonLeaf<T2, C>): NonLeaf<T | T2, C>
updateAt(index: number, update: Update<T>): NonLeaf<T, C>
stream(reversed?: boolean): Stream.NonEmpty<T>
streamRange(range: IndexRange, reversed?: boolean): Stream<T>
forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, state?: TraverseState
): void
mapPure<T2>(
mapFun: (value: T) => T2,
reversed?: boolean,
cacheMap?: CacheMap,
): NonLeaf<T2>
map<T2>(
mapFun: (value: T, index: number) => T2,
reversed?: boolean,
indexOffset?: number,
): NonLeaf<T2>
reversed(cacheMap?: CacheMap): NonLeaf<T, C>
toArray(range?: IndexRange, reversed?: boolean): T[]
structure(): string
createNonLeafBuilder(): NonLeafBuilder<T, BlockBuilder<T>>