@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.
20 lines • 1.86 kB
TypeScript
import { Temporal } from "../temporal.js";
import { ResolvedRelativeTo } from "../resolveDurationRelativeTo.js";
import { DurationRoundOptions, RoundingSettings, Unit } from "./operations.js";
/**
* `PlainDate#until(other, options)` with rounding options for two dates in one calendar, as TC39
* `DifferenceTemporalPlainDate` computes it: `CalendarDateUntil` through the Temporal compat layer,
* then — unless the granularity is one day — `RoundRelativeDuration` in a plain context.
*
* @param one the start, in the calendar to measure in
* @param two the end, in the same calendar
* @param options Temporal `largestUnit` / `smallestUnit` / `roundingIncrement` / `roundingMode`
* @returns the rounded date duration; throws where TC39 Temporal throws
*/
export declare function plainDateUntilWithRounding(one: Temporal.PlainDate, two: Temporal.PlainDate, options: Temporal.DifferenceOptions<Temporal.DateUnit>): Temporal.Duration;
/** Defect 3: `Duration#total` by the spec when the `relativeTo` calendar needs the compat layer. */
export declare function calendarTotalBySpec(duration: Temporal.Duration, unitOption: string, unit: Unit, relativeTo: ResolvedRelativeTo | undefined, zoned: Temporal.ZonedDateTime | null): number | null;
/** Defect 3: `Duration#round` by the spec when the `relativeTo` calendar needs the compat layer. */
export declare function calendarRoundBySpec(duration: Temporal.Duration, roundTo: DurationRoundOptions, settings: RoundingSettings, zoned: Temporal.ZonedDateTime | null): Temporal.Duration | null;
/** Defect 3: `Duration.compare` by the spec when the `relativeTo` calendar needs the compat layer. */
export declare function calendarCompareBySpec(one: Temporal.Duration | string, two: Temporal.Duration | string, relativeTo: ResolvedRelativeTo | undefined, zoned: Temporal.ZonedDateTime | null): number | null;