Skip to main content

class NonLeafBlock<T,C>

undocumented

Implements: Block<T,TS,C>, NonLeaf<T,C>

Type parameters

NameConstraintsDescription
Tundocumented
CBlock<T, C>undocumented

Properties

_length

undocumented

Definition

_length: number;

canAddChild

undocumented

Definition

get canAddChild(): boolean;

Overrides

Block.canAddChild

children

undocumented

Definition

readonly children: readonly C[];

Overrides

Block.children

childrenInMax

undocumented

Definition

get childrenInMax(): boolean;

childrenInMin

undocumented

Definition

get childrenInMin(): boolean;

Overrides

Block.childrenInMin

context

undocumented

Definition

readonly context: ListContext;

Overrides

NonLeaf.context

length

undocumented

Definition

get length(): number;

set length(value: number);

Overrides

Block.lengthNonLeaf.length

level

undocumented

Definition

readonly level: number;

Overrides

NonLeaf.level

mutateChildren

undocumented

Definition

get mutateChildren(): C[];

nrChildren

undocumented

Definition

get nrChildren(): number;

Methods

_mutateNormalize

undocumented

Definition

_mutateNormalize(): NonLeaf<T>;

_mutateRebalance

undocumented

Definition

_mutateRebalance(): NonLeafBlock<T, C>;

_mutateSplitRight

undocumented

Definition

_mutateSplitRight(childIndex?: number): NonLeafBlock<T, C>;

Parameters

NameTypeDescription
childIndexnumber

Overrides

Block._mutateSplitRight

append

undocumented

Definition

append(child: C): NonLeaf<T, C>;

Parameters

NameTypeDescription
childC

Overrides

NonLeaf.append

appendInternal

undocumented

Definition

appendInternal(child: C): NonLeafBlock<T, C>;

Parameters

NameTypeDescription
childC

Overrides

Block.appendInternal

concat

undocumented

Definition

concat<T2>(other: NonLeaf<T2, C>): NonLeaf<T | T2, C>;

Type parameters

NameDescription
T2

Parameters

NameTypeDescription
otherNonLeaf<T2, C>

Overrides

NonLeaf.concat

concatBlock

undocumented

Definition

concatBlock(other: NonLeafBlock<T, C>): NonLeaf<T, C>;

Parameters

NameTypeDescription
otherNonLeafBlock<T, C>

concatChildren

undocumented

Definition

concatChildren(other: NonLeafBlock<T, C>): NonLeafBlock<T, C>;

Parameters

NameTypeDescription
otherNonLeafBlock<T, C>

Overrides

Block.concatChildren

concatTree

undocumented

Definition

concatTree(other: NonLeafTree<T, C>): NonLeaf<T, C>;

Parameters

NameTypeDescription
otherNonLeafTree<T, C>

copy

undocumented

Definition

copy(children: readonly C[], length?: number): NonLeafBlock<T, C>;

Parameters

NameTypeDescription
childrenreadonly C[]
lengthnumber

Overrides

Block.copy

copy2

undocumented

Definition

copy2<T2, C2 extends Block<T2, C2>>(children: readonly C2[], length?: number): NonLeafBlock<T2, C2>;

Type parameters

NameConstraintsDescription
T2
C2Block<T2, C2>

Parameters

NameTypeDescription
childrenreadonly C2[]
lengthnumber

createBlockBuilder

undocumented

Definition

createBlockBuilder(): BlockBuilder<T, any>;

Overrides

Block.createBlockBuilder

createNonLeafBuilder

undocumented

Definition

createNonLeafBuilder(): NonLeafBuilder<T, BlockBuilder<T, unknown>>;

Overrides

NonLeaf.createNonLeafBuilder

dropChildren

undocumented

Definition

dropChildren(childAmount: number): NonLeafBlock<T, C> | null;

Parameters

NameTypeDescription
childAmountnumber

dropFirst

undocumented

Definition

dropFirst(): [NonLeafBlock<T, C> | null, C];

Overrides

NonLeaf.dropFirst

dropInternal

undocumented

Definition

dropInternal(amount: number): [NonLeafBlock<T, C> | null, C, number];

Parameters

NameTypeDescription
amountnumber

Overrides

NonLeaf.dropInternal

dropLast

undocumented

Definition

dropLast(): [NonLeafBlock<T, C> | null, C];

Overrides

NonLeaf.dropLast

forEach

undocumented

Definition

forEach(f: (value: T, index: number, halt: () => void) => void, options: {
    reversed: boolean;
    state: TraverseState;
  }): void;

Parameters

NameTypeDescription
f(value: T, index: number, halt: () => void) => void
options{
    reversed: boolean;
    state: TraverseState;
  }

Overrides

Block.forEach, NonLeaf.forEach

get

undocumented

Definition

get(index: number): T;

Parameters

NameTypeDescription
indexnumber

Overrides

Block.get, NonLeaf.get

getChild

undocumented

Definition

getChild(childIndex: number): C;

Parameters

NameTypeDescription
childIndexnumber

getCoordinates

undocumented

Definition

getCoordinates(index: number, forTake: boolean, noEmptyLast: boolean): [number, number];

Parameters

NameTypeDescription
indexnumber
forTakeboolean
noEmptyLastboolean

map

undocumented

Definition

map<T2>(mapFun: (value: T, index: number) => T2, options?: {
    reversed?: boolean;
    indexOffset?: number;
  }): NonLeafBlock<T2, Block<T2>>;

Type parameters

NameDescription
T2

Parameters

NameTypeDescription
mapFun(value: T, index: number) => T2
options{
    reversed?: boolean;
    indexOffset?: number;
  }

Overrides

Block.map, NonLeaf.map

mapPure

undocumented

Definition

mapPure<T2>(mapFun: (value: T) => T2, options?: {
    reversed?: boolean;
    cacheMap?: CacheMap;
  }): NonLeafBlock<T2, Block<T2>>;

Type parameters

NameDescription
T2

Parameters

NameTypeDescription
mapFun(value: T) => T2
options{
    reversed?: boolean;
    cacheMap?: CacheMap;
  }

Overrides

Block.mapPure, NonLeaf.mapPure

prepend

undocumented

Definition

prepend(child: C): NonLeaf<T, C>;

Parameters

NameTypeDescription
childC

Overrides

NonLeaf.prepend

prependInternal

undocumented

Definition

prependInternal(child: C): NonLeafBlock<T, C>;

Parameters

NameTypeDescription
childC

Overrides

Block.prependInternal

reversed

undocumented

Definition

reversed(cacheMap?: CacheMap): NonLeafBlock<T, C>;

Parameters

NameTypeDescription
cacheMapCacheMap

Overrides

Block.reversed, NonLeaf.reversed

stream

undocumented

Definition

stream(options?: {
    reversed?: boolean;
  }): Stream.NonEmpty<T>;

Parameters

NameTypeDescription
options{
    reversed?: boolean;
  }

Overrides

Block.stream, NonLeaf.stream

streamRange

undocumented

Definition

streamRange(range: IndexRange, options?: {
    reversed?: boolean;
  }): Stream<T>;

Parameters

NameTypeDescription
rangeIndexRange
options{
    reversed?: boolean;
  }

Overrides

Block.streamRange, NonLeaf.streamRange

structure

undocumented

Definition

structure(): string;

Overrides

Block.structure, NonLeaf.structure

takeChildren

undocumented

Definition

takeChildren(childAmount: number): NonLeafBlock<T, C> | null;

Parameters

NameTypeDescription
childAmountnumber

takeInternal

undocumented

Definition

takeInternal(amount: number): [NonLeafBlock<T, C> | null, C, number];

Parameters

NameTypeDescription
amountnumber

Overrides

NonLeaf.takeInternal

toArray

undocumented

Definition

toArray(options?: {
    range?: IndexRange | undefined;
    reversed?: boolean;
  }): T[] | any;

Parameters

NameTypeDescription
options{
    range?: IndexRange | undefined;
    reversed?: boolean;
  }

Overrides

Block.toArray, NonLeaf.toArray

updateAt

undocumented

Definition

updateAt(index: number, update: Update<T>): NonLeafBlock<T, C>;

Parameters

NameTypeDescription
indexnumber
updateUpdate<T>

Overrides

Block.updateAt, NonLeaf.updateAt