@karmaniverous/rrstack
    Preparing search index...

    Class RRStack

    Library entry point.

    • Re-export RRStack and public types.
    • Type-only exports to keep runtime lean.
    Index

    Constructors

    Properties

    Normalized, frozen options. Mutate via timezone, rules, or updateOptions.

    Accessors

    • get timezone(): string

      Get the current IANA timezone id (unbranded string).

      Returns string

    • set timezone(next: string): void

      Set the timezone and recompile.

      Parameters

      • next: string

        IANA timezone id (validated).

      Returns void

      If the timezone is invalid.

    Methods

    • Classify a range [from, to) as 'active', 'blackout', or 'partial'.

      Parameters

      • from: number

        Start of the window (inclusive), in the configured unit.

      • to: number

        End of the window (exclusive), in the configured unit.

      Returns rangeStatus

    • Compute effective active bounds across all rules.

      Returns { empty: boolean; end?: number; start?: number }

      { start?: number; end?: number; empty: boolean }

      • start and/or end are omitted for open-sided coverage.
      • empty indicates no active coverage.
    • Stream contiguous status segments over [from, to). *

      Parameters

      • from: number

        Start of the window (inclusive), in the configured unit.

      • to: number

        End of the window (exclusive), in the configured unit.

      Returns Iterable<{ end: number; start: number; status: instantStatus }>

      An iterable of { start, end, status } entries. Memory-bounded and stable for long windows.

      for (const seg of stack.getSegments(from, to)) {
      // { start: number; end: number; status: 'active' | 'blackout' }
      }
    • Determine whether the stack is active at t.

      Parameters

      • t: number

        Timestamp in the configured unit.

      Returns boolean

      true when active; false when blackout.

    • Validate an IANA timezone id.

      Parameters

      • tz: string

        Candidate IANA timezone string.

      Returns boolean

      True if recognized by the host ICU/Intl data.