Documentation
    Preparing search index...

    Class TimelineItemTimer

    A timeline item that represents a timer.

    Timers are used in 2 ways. One for simply delaying the stream's content and the other is to expect that a certain amount of time has passed since the previous item.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • ms: number
      • options: TimelineItemOptions

      Returns TimelineItemTimer

    Properties

    clock: Clockable
    regexEnding: RegExp

    A piece of regular expression that will match something after a timeline item.

    This is generally one of:

    • a dash
    • a close symbol
    • the end of the timeline

    Accessors

    • get finished(): boolean

      If returns true, the item can be considered finished or "unimportant".

      Returns boolean

    • get rawValue(): string

      Returns string

    Methods

    • Returns Promise<void>

    • Passing a timer advances the clock by the timer's full duration — not the 1-frame-per-character default. This is what makes a Tn consume n frames of virtual time when a timeline is iterated, so a consumer never has to wait on TimelineTimer.promise (which, on a virtual clock, would deadlock: nothing advances the clock while you await it).

      Advanced one frame at a time (like TimelineItem.dash) so each frame yields control — letting a timeline sharing this clock interleave in lock-step rather than the source jumping the whole duration at once.

      Returns Promise<void>

    • Called when this item is reached in the timeline.

      Returns Promise<void>

    • The string representation of this item in a timeline.

      Returns string

    • Creates a RegExp item to match your timeline item.

      Parameters

      • regexp: RegExp

      Returns RegExp

      Prepends the regexp with a start character (^) and appends it with TimelineItem.regexEnding.

    • Parameters

      • timeline: string
      • options: TimelineItemOptions

      Returns readonly [TimelineItemTimer, string] | undefined