import { CoverageWindow } from '../types.js'; /** The coverage terms a Service Target clock runs against. */ export interface CoverageCalendar { /** Weekly coverage windows; empty means 24×7 coverage. */ windows: CoverageWindow[]; /** Holiday dates excluded from coverage (`YYYY-MM-DD`). */ holidays: string[]; /** IANA timezone the windows and holidays are expressed in. */ timezone: string; } /** Wall-clock projection of a UTC instant in a target timezone. */ export interface ZonedParts { /** Calendar year in the target timezone. */ year: number; /** Calendar month in the target timezone (1–12). */ month: number; /** Calendar day of month in the target timezone (1–31). */ day: number; /** 0 = Sunday … 6 = Saturday (matches {@link CoverageWindow} docs). */ weekday: number; /** Minutes from local midnight (0–1439). */ minuteOfDay: number; /** `YYYY-MM-DD` date key in the target timezone (holiday comparisons). */ dateKey: string; } /** * Hard ceiling on how many calendar days {@link addCoveredMinutes} will walk * forward looking for coverage before failing loudly (a plan whose calendar * never covers anything would otherwise loop forever). */ export declare const MAX_COVERAGE_SCAN_DAYS = 400; /** * Project a UTC instant onto a timezone's wall clock via * `Intl.DateTimeFormat#formatToParts`. Throws a `RangeError` for an invalid * IANA timezone name (surfacing plan misconfiguration immediately). */ export declare function zonedParts(date: Date, timeZone: string): ZonedParts; /** * Covered minutes between two instants (fractional; `0` when `to <= from`). * * Walks forward day by day through the calendar timezone, summing the overlap * of `[from, to)` with each day's covered spans. */ export declare function coveredMinutesBetween(calendar: CoverageCalendar, from: Date, to: Date): number; /** * The instant at which `minutes` of covered time have elapsed from `from` — * the Service Target due-time computation. Walks forward day by day through * coverage windows, skipping holidays; throws a descriptive error after * {@link MAX_COVERAGE_SCAN_DAYS} days without accumulating enough coverage * (an effectively-empty calendar). */ export declare function addCoveredMinutes(calendar: CoverageCalendar, from: Date, minutes: number): Date; //# sourceMappingURL=coverage-calendar.d.ts.map