Tempo API
    Preparing search index...

    Class Interval<T>

    Represents a continuous span of time with optional start and end boundaries, supporting set operations.

    Type Parameters

    • T = any
    Index
    • Type Parameters

      • T = any

      Parameters

      • start: T | null
      • end: T | null

      Returns Interval<T>

    isInterval: IntervalTypeGuard

    Type guard to check if a value is an authentic Interval instance

    • get end(): T | null

      The end point of the interval, or null for unbounded end

      Returns T | null

    • get endNs(): number | bigint

      The end time in nanoseconds since epoch, or Infinity for unbounded end

      Returns number | bigint

    • get start(): T | null

      The start point of the interval, or null for unbounded start

      Returns T | null

    • get startNs(): number | bigint

      The start time in nanoseconds since epoch, or -Infinity for unbounded start

      Returns number | bigint

    • Returns true if this interval starts exactly when the other ends, or vice versa

      Parameters

      Returns boolean

    • Returns true if the specified temporal point is within this interval

      Parameters

      • point: any

      Returns boolean

    • Lazily yields points across this half-open [start, end) interval advancing by step. Scales calendar steps from start to avoid month-end drift (Jan 31 → Feb 28 → Mar 31). Supports open-ended intervals (end === null) as an infinite lazy stream.

      Parameters

      Returns IterableIterator<T>

    • Returns the intersection of this interval and another, or null if they do not overlap

      Type Parameters

      • U extends unknown = T

      Parameters

      Returns Interval<T | U> | null

    • Returns true if this interval overlaps with another interval

      Parameters

      Returns boolean

    • Lazily splits this interval into contiguous half-open sub-intervals of size step. The final chunk is clamped to this.end when bounded. Supports open-ended intervals (end === null) as an infinite lazy stream of chunks.

      Parameters

      Returns IterableIterator<Interval<T>>

    • Returns the union of this interval and another, or null if they do not overlap/abut

      Type Parameters

      • U extends unknown = T

      Parameters

      Returns Interval<T | U> | null