Skip to main content
Module

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

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

Constructors

new
LeafBlock(context: ListContext, children: readonly T[])

Properties

readonly
canAddChild: boolean
readonly
childrenInMax: boolean
readonly
childrenInMin: boolean
readonly
length: number
readonly
level: 0
readonly
mutateChildren: T[]

Methods

_mutateNormalize(): List.NonEmpty<T>
append(value: T): List.NonEmpty<T>
concat<T2>(...sources: ArrayNonEmpty<StreamSource<T2>>): List.NonEmpty<T | T2>
concatBlock(other: LeafBlock<T>): List.NonEmpty<T>
copy(children: readonly T[]): LeafBlock<T>
copy2<T2>(children: readonly T2[]): LeafBlock<T2>
drop(amount: number): List<T>
dropChildren(childAmount: number): LeafBlock<T>
forEach(f: (
value: T,
index: number,
halt: () => void,
) => void
, options?: { reversed?: boolean; state?: TraverseState; }
): void
get<O>(index: number, otherwise?: OptLazy<O>): T | O
map<T2>(mapFun: (value: T, index: number) => T2, options?: { reversed?: boolean; indexOffset?: number; }): LeafBlock<T2>
mapPure<T2>(mapFun: (value: T) => T2, options?: { reversed?: boolean; cacheMap?: CacheMap; }): LeafBlock<T2>
prepend(value: T): List.NonEmpty<T>
reversed(cacheMap?): LeafBlock<T>
stream(options?: { reversed?: boolean; }): Stream.NonEmpty<T>
streamRange(range: IndexRange, options?: { reversed?: boolean; }): Stream<T>
structure(): string
take(amount: number): List<T> | any
takeChildren(childAmount: number): LeafBlock<T>
toArray(options?: { range?: IndexRange | undefined; reversed?: boolean; }): T[] | any
updateAt(index: number, update: Update<T>): LeafBlock<T>