Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventImpl<V>

Implementation of a time series event

Type parameters

  • V

Hierarchy

  • EventImpl

Implements

Index

Constructors

constructor

  • Create a new EventImpl instance

    Parameters

    • metadata: EventMetadata

      the metadata of the event

    • originalEvent: EventMetadata

      the original event

    • value: V

      the value of the event

    Returns EventImpl

Properties

Readonly author

author: string

Server-authenticated identity of the session that created the event.

If the session that created the event was not authenticated, the author will be an empty string.

Readonly isEditEvent

isEditEvent: boolean

Flag indicating whether this is an edit event.

x.isEditEvent is equivalent to x.originalEvent != x.

Readonly isOriginalEvent

isOriginalEvent: boolean

Flag indicating whether this is an original event

Is the same as !this.isEditEvent

Readonly metadata

metadata: EventMetadata

The metadata of the event

Readonly originalEvent

originalEvent: EventMetadata

If this is an edit event, returns the metadata of the original event that this event replaces; otherwise returns this event.

The result is always the metadata of an original event, never that of an edit event.

Readonly sequence

sequence: number

Sequence number identifying this event within its time series. Assigned by the server when the event is created.

Sequence numbers are unique within a time series. Each event appended to a time series is assigned a sequence number that is is equal to the sequence number of the preceding event plus one.

Readonly timestamp

timestamp: number

Event timestamp. Assigned by the server when the event is created.

Events do not have unique timestamps. Events with different sequence numbers may have the same timestamp.

Subsequent events in a time series usually have timestamps that are greater or equal to the timestamps of earlier events, but this is not guaranteed due to changes to the time source used by the server.

Timestamps represent the difference, measured in milliseconds, between the time the server added the event to the time series and midnight, January 1, 1970 UTC

Readonly value

value: V

The value associated with the event.

Methods

equals

  • equals(other: any): boolean
  • Check if the EventMetadata is equal to another object

    Parameters

    • other: any

    Returns boolean

    true if the two objects are equal

toString

  • toString(): string
  • Convert the time series event into a string

    Returns string

    a string representation of the event

withValue

  • Createa copy of this EventImpl with a different value

    Parameters

    • newValue: V

      the new value

    Returns EventImpl<V>

    a new EventImpl instance

Static create

  • Static factory to create a new EventImpl instance

    Type parameters

    • V

    Parameters

    • metadata: EventMetadata

      the metadata of the event

    • originalEvent: EventMetadata

      the original event

    • value: V

      the value of the event

    Returns EventImpl<V>

    a new EventImpl instance

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.