@openfloor/protocol - v0.0.4
    Preparing search index...

    Class Span

    Represents a time span for a dialog event or token according to the Open Floor specification. Time spans can be absolute (using Date objects) or relative (using duration offsets).

    // Absolute time span
    const span1 = new Span({ startTime: new Date(), endTime: new Date(Date.now() + 5000) });

    // Relative time span
    const span2 = new Span({ startOffset: 1000, endOffset: 5000 });

    Implements

    Index

    Constructors

    • Creates a new Span instance

      Parameters

      • options: SpanOptions = {}

        Span configuration options

      Returns Span

      Error if invalid combination of time parameters is provided

    Properties

    endOffset?: number
    endTime?: Date
    startOffset?: number
    startTime?: Date

    Methods

    • Creates a Span instance from a dictionary with automatic type conversion

      Parameters

      • data: Record<string, unknown>

      Returns Span