/** * @module autoclose-window * @category Internal * * Off-hours window math for autoclose — hour-in-zone, DST-gap handling, and * "next time the window opens". The autoclose **config** (defaults, schema, * resolver) lives in `./config.js`, the single home for builder-facing config * bags; this module is the runtime window logic those knobs drive. * * @internal */ import type { AutocloseConfig } from "./config.js"; /** * The current hour `[0, 23]` in the given IANA time zone, DST-correct * via `Intl`. Split out so the window check can be unit-tested without * spinning a controller. * * @internal */ export declare function hour_in_zone(now: Date, timeZone: string): number; /** * Whether `now` falls inside the configured off-hours window. The * window is half-open on hour boundaries — `[start, end)` — and wraps * past midnight when `start > end`. With no window configured every * tick runs, so callers treat `undefined` as "always in window." * * On a DST spring-forward day whose `start` hour is skipped, the window * would otherwise be closed for the whole day (the `start` hour never * occurs). The gap's replacement instant is admitted so autoclose still * runs — see {@link is_dst_gap_open}. * * @internal */ export declare function in_autoclose_window(window: AutocloseConfig["autocloseWindow"], now: Date): boolean; /** * The next instant the off-hours window opens at or after `now`. The * synthesized autoclose reaction defers to this when a tick lands * outside the window — parking until the window actually opens instead * of blind-polling on a configured cadence (the pre-#1175 behavior, * where a poll interval longer than the window could oscillate around * it and miss it repeatedly). * * Walks forward hour by hour and asks `Intl` for the local hour at each * step, so DST transitions resolve exactly the way the runtime's zone * database says they do — a 23- or 25-hour day never desynchronizes the * walk. The window validates as non-empty at build, and every zone hits * each `[0, 23]` hour label within any 48-hour span, so the walk always * terminates; the bound is a defensive backstop, with "one day out" as * the fallback no real zone can reach. * * Minute/second offsets within the opening hour are preserved from * `now` shifted by whole hours — the contract is hour-granular, matching * the window's own `[start, end)` hour semantics. * * On a DST spring-forward day whose `start` hour is skipped, the `start` * hour never occurs, so the minute-preserving walk would never match and * the window would defer ~24 h. The walk also checks each hour-aligned * boundary for the gap opening (see {@link is_dst_gap_open}) and returns * that boundary instant — deferring ~1 h to the replacement instant * rather than a full day. The boundary is returned as-is (no minute * offset): the gap opening is a single transition instant, not a range. * * @internal */ export declare function next_window_open(window: NonNullable, now: Date): Date; //# sourceMappingURL=autoclose-window.d.ts.map