Skip to main content

class LeafTree<T>

undocumented

Implements: Tree<T,TS,TB,C>

Type parameters

NameDescription
Tundocumented

Properties

context

undocumented

Definition

readonly context: ListContext;

Overrides

Tree.context

left

undocumented

Definition

readonly left: LeafBlock<T>;

Overrides

Tree.left

length

undocumented

Definition

readonly length: number;

Overrides

Tree.length

middle

undocumented

Definition

readonly middle: NonLeaf<T, LeafBlock<T>> | null;

Overrides

Tree.middle

undocumented

Definition

readonly right: LeafBlock<T>;

Overrides

Tree.right

Methods

_normalize

undocumented

Definition

_normalize(): List.NonEmpty<T>;

append

undocumented

Definition

append(value: T): LeafTree<T>;

Parameters

NameTypeDescription
valueT

appendMiddle

undocumented

Definition

appendMiddle(child: LeafBlock<T>): NonLeaf<T, LeafBlock<T>>;

Parameters

NameTypeDescription
childLeafBlock<T>

Overrides

Tree.appendMiddle

concat

undocumented

Definition

concat<T2>(...sources: ArrayNonEmpty<StreamSource<T2>>): List.NonEmpty<T | T2>;

Type parameters

NameDescription
T2

Parameters

NameTypeDescription
sourcesArrayNonEmpty<StreamSource<T2>>

concatBlock

undocumented

Definition

concatBlock(other: LeafBlock<T>): List.NonEmpty<T>;

Parameters

NameTypeDescription
otherLeafBlock<T>

concatTree

undocumented

Definition

concatTree(other: LeafTree<T>): LeafTree<T>;

Parameters

NameTypeDescription
otherLeafTree<T>

copy

undocumented

Definition

copy(left?: LeafBlock<T>, right?: LeafBlock<T>, middle?: NonLeaf<T, LeafBlock<T>> |null):LeafTree<T>;

Parameters

NameTypeDescription
leftLeafBlock<T>
rightLeafBlock<T>
middleNonLeaf<T, LeafBlock<T>> | null

Overrides

Tree.copy

copy2

undocumented

Definition

copy2<T2>(left: LeafBlock<T2>, right: LeafBlock<T2>, middle: NonLeaf<T2, LeafBlock<T2>> |null):LeafTree<T2>;

Type parameters

NameDescription
T2

Parameters

NameTypeDescription
leftLeafBlock<T2>
rightLeafBlock<T2>
middleNonLeaf<T2, LeafBlock<T2>> | null

drop

undocumented

Definition

drop(amount: number): List<T>;

Parameters

NameTypeDescription
amountnumber

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;
  }

get

undocumented

Definition

get<O>(index: number, otherwise?: OptLazy<O>): T | O;

Type parameters

NameDescription
O

Parameters

NameTypeDescription
indexnumber
otherwiseOptLazy<O>

getChildLength

undocumented

Definition

getChildLength(): 1;

Overrides

Tree.getChildLength

map

undocumented

Definition

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

Type parameters

NameDescription
T2

Parameters

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

mapPure

undocumented

Definition

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

Type parameters

NameDescription
T2

Parameters

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

prepend

undocumented

Definition

prepend(value: T): LeafTree<T>;

Parameters

NameTypeDescription
valueT

prependMiddle

undocumented

Definition

prependMiddle(child: LeafBlock<T>): NonLeaf<T, LeafBlock<T>>;

Parameters

NameTypeDescription
childLeafBlock<T>

Overrides

Tree.prependMiddle

reversed

undocumented

Definition

reversed(cacheMap?: CacheMap): LeafTree<T>;

Parameters

NameTypeDescription
cacheMapCacheMap

stream

undocumented

Definition

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

Parameters

NameTypeDescription
options{
    reversed?: boolean;
  }

streamRange

undocumented

Definition

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

Parameters

NameTypeDescription
rangeIndexRange
options{
    reversed?: boolean;
  }

structure

undocumented

Definition

structure(): string;

take

undocumented

Definition

take(amountInput: number): List<T> | any;

Parameters

NameTypeDescription
amountInputnumber

toArray

undocumented

Definition

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

Parameters

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

updateAt

undocumented

Definition

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

Parameters

NameTypeDescription
indexnumber
updateUpdate<T>