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

x/rimbu/list/custom/implementation/block.ts>Block

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

Type Parameters

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

Properties

readonly
length: number
readonly
canAddChild: boolean
readonly
childrenInMin: boolean
children: readonly C[]

Methods

copy(children: C[], length: number): TS
concatChildren(other: TS): TS
prependInternal(child: C): TS
appendInternal(child: C): TS
get<O>(index: number, otherwise?: OptLazy<O>): T | O
updateAt(index: number, update: Update<T>): TS
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,
cache?: CacheMap,
): Block<T2>
map<T2>(
mapFun: (value: T, index: number) => T2,
reversed?: boolean,
indexOffset?: number,
): Block<T2>
reversed(cache: CacheMap): TS
toArray(range?: IndexRange, reversed?: boolean): T[] | any
structure(): string
_mutateSplitRight(index?: number): TS
createBlockBuilder(): BlockBuilder<T, any>