import { CalendarDate, DateDiffOptions } from './calendar'; import { TimePeriod, TimePeriodFieldFlag } from './interval'; import { YearMonthDay } from './math'; /** * State maintained for the difference calculation. * * Public for testing. */ export declare class DifferenceState { readonly date1: CalendarDate; readonly date2: CalendarDate; readonly options: DateDiffOptions; one: YearMonthDay; two: YearMonthDay; readonly epoch2: number; ms1: number; ms2: number; zoneId: string; readonly sign: number; readonly incr: number; readonly fractions: boolean; readonly flags: number; readonly smallestFlag: number; readonly monthCount: number; constructor(date1: CalendarDate, date2: CalendarDate, options: DateDiffOptions); /** * Return true if the flag is set. */ has(flag: TimePeriodFieldFlag): boolean; /** * Return true if a flag is the smallest field in the set. */ smallest(flag: TimePeriodFieldFlag): boolean; } /** * Calculate the difference between two dates in years, months, days, etc. * * Specification of algorithm: * https://tc39.es/proposal-temporal/#sec-temporal-differencezoneddatetime * * Compatible with the Temporal API until and since methods: * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/since * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime/until */ export declare const difference: (date1: CalendarDate, date2: CalendarDate, options: DateDiffOptions) => TimePeriod; /** * WARNING: This is only designed to be used for small day increments, mainly * to support 1- or 2-day adjustments. We use Julian day in other calculations * which lets us directly add or subtract any number of days. * * Adjust the day parameter to correct for underflow and overflow of the * given year and month. * * For example: adding 3 days to "2024-01-30" returns "2024-02-02" and * subtracting 3 days from "2024-02-02" returns "2024-01-30". */ export declare const adjustDays: (year: number, month: number, day: number) => { year: number; month: number; day: number; };