Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TimeSeriesEventDataType<ValueType, S>

A data type for time series Event values

param

the type(s) from which a value can be constructed

Type parameters

  • ValueType

    the value type of the data type

  • S

Hierarchy

Implements

Index

Constructors

constructor

  • new TimeSeriesEventDataType(name: string, valueTypeName: string, bytesToValue: (bytes: Uint8Array) => ValueType, valueToBytes: (value: S) => BytesImpl): TimeSeriesEventDataType
  • Create a new TimeSeriesEventDataType instance

    Parameters

    • name: string

      the name of the data type

    • valueTypeName: string

      the data type name of the event's value type

    • bytesToValue: (bytes: Uint8Array) => ValueType

      a converter function that converts a byte data to a value

        • (bytes: Uint8Array): ValueType
        • Parameters

          • bytes: Uint8Array

          Returns ValueType

    • valueToBytes: (value: S) => BytesImpl

      a converter function that converts a value to bytes data

    Returns TimeSeriesEventDataType

Properties

Readonly valueClass

valueClass: {}

The constructor function creating the value type

param

the arguments to the constructor

returns

a new value object

Type declaration

Private valueToBytes

valueToBytes: (value: S) => BytesImpl

A converter function that converts a value to bytes data

param

the value in any of the allowed source types

returns

the value stored in binary form

Type declaration

Readonly valueTypeName

valueTypeName: string

The data type name of the event's value type

Methods

binaryDeltaType

canReadAs

  • canReadAs(valueClass: {}): boolean
  • inheritdoc

    Parameters

    • valueClass: {}

    Returns boolean

deltaType

from

  • inheritdoc

    Parameters

    Returns BufferSlice

name

  • name(): string
  • The external type identifier.

    Returns string

    the name of this datatype

readAs

  • readAs<T>(valueClass: {}, buffer: Uint8Array | Bytes, offset?: undefined | number, length?: undefined | number): T
  • inheritdoc

    Type parameters

    • T

    Parameters

    • valueClass: {}
    • buffer: Uint8Array | Bytes
    • Optional offset: undefined | number
    • Optional length: undefined | number

    Returns T

readValue

  • readValue(buffer: Uint8Array | Bytes, offset?: undefined | number, length?: undefined | number): Event<ValueType> | null
  • inheritdoc

    Parameters

    • buffer: Uint8Array | Bytes
    • Optional offset: undefined | number
    • Optional length: undefined | number

    Returns Event<ValueType> | null

toBytes

  • Convert a value to bytes

    throws

    an error if the supplied value could not be converted

    Parameters

    • value: Event<S>

      the value

    Returns Bytes

    a CBOR representation of the value

toString

  • toString(): string
  • Convert the objet to a string

    Returns string

    a string representation of the AbstractDataType

writeValue

  • writeValue(event: Event<S>): Buffer
  • inheritdoc
    deprecated

    since 6.11

    Parameters

    Returns Buffer

writeValueToArray

  • writeValueToArray(event: Event<S>): Uint8Array
  • inheritdoc

    Parameters

    Returns Uint8Array

Static create

  • Create a new time series event datatype from a delegate datatype.

    Type parameters

    • ValueType

      the value type of the data type

    • SourceType

      the type(s) from which a value can be constructed

    • CBORType

      the binary type containing the CBOR data

    Parameters

    • delegate: DataType<ValueType, SourceType, CBORType>

      the delegate data type

    Returns TimeSeriesEventDataType<ValueType, SourceType>

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.