UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

16 lines • 1.18 kB
import { Temporal } from "../temporal.js"; import { RoundingSettings, Unit } from "./operations.js"; /** Upper bound on one unit's exact length in any zone: 366-day years, 31-day months, 2-day days. */ export declare const UNIT_REACH: Record<Unit, bigint>; /** True when `epochs`, widened by `reach` and the limit margin, touch either range limit. */ export declare function reachesRangeLimit(epochs: readonly bigint[], reach: bigint): boolean; /** An upper bound on how far `duration` moves an exact time in any zone. */ export declare function durationReach(duration: Temporal.Duration): bigint; /** How far rounding can look past its destination: one increment, then bubbling to `largestUnit`. */ export declare function roundingReach(settings: RoundingSettings): bigint; /** * Returns `compute(timeZone)`, the polyfill's own result, unchanged. Near a range limit only: * a UTC result is checked with `checkUtcValidity` (defect 2), and a named zone's error is * replaced by `fallback`'s TC39 result when it has one (defect 1). */ export declare function runAtRangeLimit<T>(timeZone: string, atRangeLimit: boolean, compute: (timeZone: string) => T, fallback: () => T | null): T;