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

x/rimbu/list/custom/index.ts>NonLeafBlock

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

Constructors

new
NonLeafBlock(
context: ListContext,
_length: number,
children: readonly C[],
level: number,
)

Type Parameters

T
C extends Block<T, C>

Properties

readonly
canAddChild: boolean
readonly
childrenInMax: boolean
readonly
childrenInMin: boolean
length: number
readonly
mutateChildren: C[]
readonly
nrChildren: number

Methods

append(child: C): NonLeaf<T, C>
concat<T2>(other: NonLeaf<T2, C>): NonLeaf<T | T2, C>
copy(children: readonly C[], length?): NonLeafBlock<T, C>
copy2<T2, C2 extends Block<T2, C2>>(children: readonly C2[], length?): NonLeafBlock<T2, C2>
dropChildren(childAmount: number): NonLeafBlock<T, C> | null
dropFirst(): [NonLeafBlock<T, C> | null, C]
dropInternal(amount: number): [NonLeafBlock<T, C> | null, C, number]
dropLast(): [NonLeafBlock<T, C> | null, C]
forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, state: TraverseState
): void
get(index: number): T
getChild(childIndex: number): C
getCoordinates(
index: number,
forTake: boolean,
noEmptyLast: boolean,
): [number, number]
map<T2>(
mapFun: (value: T, index: number) => T2,
reversed?,
indexOffset?,
): NonLeafBlock<T2, Block<T2>>
mapPure<T2>(
mapFun: (value: T) => T2,
reversed?,
cacheMap?,
): NonLeafBlock<T2, Block<T2>>
prepend(child: C): NonLeaf<T, C>
reversed(cacheMap?): NonLeafBlock<T, C>
stream(reversed?): Stream.NonEmpty<T>
streamRange(range: IndexRange, reversed?): Stream<T>
structure(): string
takeChildren(childAmount: number): NonLeafBlock<T, C> | null
takeInternal(amount: number): [NonLeafBlock<T, C> | null, C, number]
toArray(range?: IndexRange, reversed?): T[] | any
updateAt(index: number, update: Update<T>): NonLeafBlock<T, C>