import { CalendarDate } from './calendar'; import { TimePeriod } from './interval'; import { ZoneInfo } from './timezone'; export interface YearMonthDay { year: number; month: number; day: number; } export interface YearMonth { year: number; month: number; } /** * Extract year, month, and day fields. */ export declare const toYMD: (d: CalendarDate) => YearMonthDay; /** * Given a Julian day and local milliseconds (in UTC), return the Unix * epoch milliseconds UTC. */ export declare const unixEpochFromJD: (jd: number, msDay: number) => number; /** * Ensure n falls between min and max. */ export declare const clamp: (n: number, min: number, max: number) => number; /** * Ensure that the year, month, and day represent a valid date, clamping the * month and day fields to a valid range. */ export declare const clampYMD: (year: number, monthArg: number, d: number) => YearMonthDay; /** * Adjust the year and month to ensure they represent part of a valid date. */ export declare const adjustYM: (yearp: number, monthp: number) => YearMonth; /** * Add time fields in milliseconds. */ export declare const adjustTime: (millis: number, added: TimePeriod) => [number, number]; export declare const timeToMillis: (period: Partial) => number; /** * Keep the integral part of each field and replace undefined with zero. */ export declare const truncateFields: (fields: Partial) => TimePeriod; /** * Compute Julian day from timezone-adjusted Unix epoch milliseconds. */ export declare const fieldsFromUnixEpoch: (ms: number, f: number[]) => void; /** * Compute the Julian day and the milliseconds remainder from a Unix epoch timestamp. */ export declare const jdFromUnixEpoch: (ms: number) => [number, number]; /** * Initialize base calendar fields. */ export declare const initBaseFromUnixEpoch: (f: number[], ms: number, zoneId: string) => ZoneInfo; /** * Compute fields common to all calendars. Before calling this, we must * have the JULIAN_DAY and MILLIS_IN_DAY fields set. Every calculation * is relative to these. */ export declare const computeBaseFields: (f: number[]) => void;