Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Builder<T, TNull>

Type parameters

Hierarchy

  • Builder

Index

Constructors

constructor

  • new Builder(__namedParameters: object): Builder

Properties

children

children: Builder[]

finished

finished: boolean = false

length

length: number = 0

Optional nullValues

nullValues: TNull[] | ReadonlyArray<TNull> | null

stride

stride: number

type

type: T

Accessors

ArrayType

ArrayType:

byteLength

byteLength:

nullBitmap

nullBitmap:

nullCount

nullCount:

numChildren

numChildren:

reservedByteLength

reservedByteLength:

reservedLength

reservedLength:

typeIds

typeIds:

valueOffsets

valueOffsets:

values

values:

Methods

addChild

  • addChild(child: Builder, name?: string): void
  • Parameters

    • child: Builder
    • Default value name: string = `${this.numChildren}`

    Returns void

append

  • append(value: T["TValue"] | TNull): this
  • Parameters

    • value: T["TValue"] | TNull

    Returns this

clear

  • clear(): this
  • Returns this

    The cleared Builder instance.

finish

  • finish(): this
  • Returns this

    The finalized Builder instance.

flush

  • flush(): Data<T>
  • Returns Data<T>

    A Data<T> of the buffers and childData representing the values written.

getChildAt

  • getChildAt<R>(index: number): Builder<R> | null
  • Type parameters

    Parameters

    • index: number

    Returns Builder<R> | null

    The child Builder at the supplied index or null.

isValid

  • isValid(value: T["TValue"] | TNull): boolean
  • Parameters

    • value: T["TValue"] | TNull

    Returns boolean

set

  • set(index: number, value: T["TValue"] | TNull): this
  • Parameters

    • index: number
    • value: T["TValue"] | TNull

    Returns this

    The updated Builder instance.

setValid

  • setValid(index: number, valid: boolean): boolean
  • Parameters

    • index: number
    • valid: boolean

    Returns boolean

setValue

  • setValue(index: number, value: T["TValue"]): void
  • Parameters

    • index: number
    • value: T["TValue"]

    Returns void

toVector

  • toVector(): VectorType<T>
  • Returns VectorType<T>

    A Vector<T> of the flushed values.

Static new

Static throughAsyncIterable

  • Type parameters

    Parameters

    Returns function

    A function which accepts a JavaScript AsyncIterable of values to write, and returns an AsyncIterator that yields Vectors according to the chunking semantics defined in the options argument.

      • (source: Iterable<T["TValue"] | TNull> | AsyncIterable<T["TValue"] | TNull>): AsyncIterableIterator<V<T>>
      • Parameters

        • source: Iterable<T["TValue"] | TNull> | AsyncIterable<T["TValue"] | TNull>

        Returns AsyncIterableIterator<V<T>>

Static throughDOM

  • throughDOM<T, TNull>(options: BuilderTransformOptions<T, TNull>): BuilderTransform<T, TNull>
  • Type parameters

    Parameters

    • options: BuilderTransformOptions<T, TNull>

    Returns BuilderTransform<T, TNull>

Static throughIterable

  • Type parameters

    Parameters

    Returns function

    A function which accepts a JavaScript Iterable of values to write, and returns an Iterator that yields Vectors according to the chunking semantics defined in the options argument.

      • (source: Iterable<T["TValue"] | TNull>): IterableIterator<V<T>>
      • Parameters

        • source: Iterable<T["TValue"] | TNull>

        Returns IterableIterator<V<T>>

Static throughNode

  • throughNode<T, TNull>(options: BuilderDuplexOptions<T, TNull>): Duplex
  • Type parameters

    Parameters

    • options: BuilderDuplexOptions<T, TNull>

    Returns Duplex

Generated using TypeDoc