import { type ISODateRecord } from '../../intrinsics/Temporal/PlainDate.mts'; import type { YearWeekRecord } from './addition.mts'; import { type DateUnit } from './temporal.mts'; import { ObjectValue, Value, type DateDurationRecord, type Integer, type PlainCompletion, type PlainEvaluator } from '#self'; /** https://tc39.es/proposal-temporal/#sec-calendar-types */ export type CalendarType = 'iso8601'; /** https://tc39.es/proposal-temporal/#sec-temporal-canonicalizecalendar */ export declare function CanonicalizeCalendar(id: string): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-availablecalendars */ export declare function AvailableCalendars(): CalendarType[]; export type MonthCode = string & { __brand: 'MonthCode'; }; /** https://tc39.es/proposal-temporal/#sec-temporal-createmonthcode */ export declare function CreateMonthCode(monthNumber: Integer, isLeapMonth: boolean): MonthCode; /** https://tc39.es/proposal-temporal/#sec-temporal-calendar-date-records */ export interface CalendarDateRecord { readonly Era: string | undefined; readonly EraYear: Integer | undefined; readonly Year: Integer; readonly Month: Integer; readonly MonthCode: string; readonly Day: Integer; readonly DayOfWeek: Integer; readonly DayOfYear: Integer; readonly WeekOfYear: YearWeekRecord; readonly DaysInWeek: Integer; readonly DaysInMonth: Integer; readonly DaysInYear: Integer; readonly MonthsInYear: Integer; readonly InLeapYear: boolean; } /** https://tc39.es/proposal-temporal/#table-temporal-calendar-fields-record-fields */ export interface CalendarFieldsRecord { readonly Era: string | undefined; readonly EraYear: Integer | undefined; Year: Integer | undefined; Month: Integer | undefined; MonthCode: string | undefined; Day: Integer | undefined; Hour: Integer | undefined; Minute: Integer | undefined; Second: Integer | undefined; Millisecond: Integer | undefined; Microsecond: Integer | undefined; Nanosecond: Integer | undefined; OffsetString: string | undefined; readonly TimeZone: string | undefined; } export declare enum Table19_Conversion { ToString = "to-string", ToIntegerWithTruncation = "to-integer-with-truncation", ToPositiveIntegerWithTruncation = "to-positive-integer-with-truncation", ToTemporalTimeZoneIdentifier = "to-temporal-time-zone-identifier", ToMonthCode = "to-month-code", ToOffsetString = "to-offset-string" } export type CalendarFieldsRecordEnumerationKey = 'era' | 'era-year' | 'year' | 'month' | 'month-code' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' | 'microsecond' | 'nanosecond' | 'offset' | 'time-zone'; /** https://tc39.es/ecma262/pr/3759/#table-calendar-fields-record-fields */ export declare const Table63_CalendarFieldsRecordFields: [{ readonly FieldName: 'Era'; readonly DefaultValue: undefined; readonly PropertyKey: 'era'; readonly EnumerationKey: 'era'; readonly Conversion: Table19_Conversion.ToString; }, { readonly FieldName: 'EraYear'; readonly DefaultValue: undefined; readonly PropertyKey: 'eraYear'; readonly EnumerationKey: 'era-year'; readonly Conversion: Table19_Conversion.ToIntegerWithTruncation; }, { readonly FieldName: 'Year'; readonly DefaultValue: undefined; readonly PropertyKey: 'year'; readonly EnumerationKey: 'year'; readonly Conversion: Table19_Conversion.ToIntegerWithTruncation; }, { readonly FieldName: 'Month'; readonly DefaultValue: undefined; readonly PropertyKey: 'month'; readonly EnumerationKey: 'month'; readonly Conversion: Table19_Conversion.ToPositiveIntegerWithTruncation; }, { readonly FieldName: 'MonthCode'; readonly DefaultValue: undefined; readonly PropertyKey: 'monthCode'; readonly EnumerationKey: 'month-code'; readonly Conversion: Table19_Conversion.ToMonthCode; }, { readonly FieldName: 'Day'; readonly DefaultValue: undefined; readonly PropertyKey: 'day'; readonly EnumerationKey: 'day'; readonly Conversion: Table19_Conversion.ToPositiveIntegerWithTruncation; }, { readonly FieldName: 'Hour'; readonly DefaultValue: 0n; readonly PropertyKey: 'hour'; readonly EnumerationKey: 'hour'; readonly Conversion: Table19_Conversion.ToIntegerWithTruncation; }, { readonly FieldName: 'Minute'; readonly DefaultValue: 0n; readonly PropertyKey: 'minute'; readonly EnumerationKey: 'minute'; readonly Conversion: Table19_Conversion.ToIntegerWithTruncation; }, { readonly FieldName: 'Second'; readonly DefaultValue: 0n; readonly PropertyKey: 'second'; readonly EnumerationKey: 'second'; readonly Conversion: Table19_Conversion.ToIntegerWithTruncation; }, { readonly FieldName: 'Millisecond'; readonly DefaultValue: 0n; readonly PropertyKey: 'millisecond'; readonly EnumerationKey: 'millisecond'; readonly Conversion: Table19_Conversion.ToIntegerWithTruncation; }, { readonly FieldName: 'Microsecond'; readonly DefaultValue: 0n; readonly PropertyKey: 'microsecond'; readonly EnumerationKey: 'microsecond'; readonly Conversion: Table19_Conversion.ToIntegerWithTruncation; }, { readonly FieldName: 'Nanosecond'; readonly DefaultValue: 0n; readonly PropertyKey: 'nanosecond'; readonly EnumerationKey: 'nanosecond'; readonly Conversion: Table19_Conversion.ToIntegerWithTruncation; }, { readonly FieldName: 'OffsetString'; readonly DefaultValue: undefined; readonly PropertyKey: 'offset'; readonly EnumerationKey: 'offset'; readonly Conversion: Table19_Conversion.ToOffsetString; }, { readonly FieldName: 'TimeZone'; readonly DefaultValue: undefined; readonly PropertyKey: 'timeZone'; readonly EnumerationKey: 'time-zone'; readonly Conversion: Table19_Conversion.ToTemporalTimeZoneIdentifier; }]; /** https://tc39.es/proposal-temporal/#sec-temporal-preparecalendarfields */ export declare function PrepareCalendarFields(calendar: CalendarType, fields: ObjectValue, calendarFieldNames: readonly CalendarFieldsRecordEnumerationKey[], nonCalendarFieldNames: readonly CalendarFieldsRecordEnumerationKey[], requiredFieldNames: 'partial' | readonly CalendarFieldsRecordEnumerationKey[]): PlainEvaluator; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarfieldkeyspresent */ export declare function CalendarFieldKeysPresent(fields: CalendarFieldsRecord): CalendarFieldsRecordEnumerationKey[]; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarmergefields */ export declare function CalendarMergeFields(calendar: CalendarType, fields: CalendarFieldsRecord, additionalFields: CalendarFieldsRecord): CalendarFieldsRecord; /** https://tc39.es/proposal-temporal/#sec-temporal-nonisodateadd */ export declare function NonISODateAdd(_calendar: CalendarType, _isoDate: ISODateRecord, _duration: DateDurationRecord, _overflow: 'constrain' | 'reject'): never; /** https://tc39.es/proposal-temporal/#sec-temporal-calendardateadd */ export declare function CalendarDateAdd(calendar: CalendarType, isoDate: ISODateRecord, duration: DateDurationRecord, overflow: 'constrain' | 'reject'): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-nonisodateuntil */ export declare function NonISODateUntil(_calendar: CalendarType, _one: ISODateRecord, _two: ISODateRecord, _largestUnit: DateUnit): never; /** https://tc39.es/proposal-temporal/#sec-temporal-calendardateuntil */ export declare function CalendarDateUntil(calendar: CalendarType, one: ISODateRecord, two: ISODateRecord, largestUnit: DateUnit): DateDurationRecord; /** https://tc39.es/proposal-temporal/#sec-temporal-totemporalcalendaridentifier */ export declare function ToTemporalCalendarIdentifier(temporalCalendarLike: Value): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-gettemporalcalendaridentifierwithisodefault */ export declare function GetTemporalCalendarIdentifierWithISODefault(item: ObjectValue): PlainEvaluator; /** https://tc39.es/proposal-temporal/#sec-temporal-calendardatefromfields */ export declare function CalendarDateFromFields(calendar: CalendarType, fields: CalendarFieldsRecord, overflow: 'constrain' | 'reject'): PlainEvaluator; /** https://tc39.es/proposal-temporal/#sec-temporal-calendaryearmonthfromfields */ export declare function CalendarYearMonthFromFields(calendar: CalendarType, fields: CalendarFieldsRecord, overflow: 'constrain' | 'reject'): PlainEvaluator; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarmonthdayfromfields */ export declare function CalendarMonthDayFromFields(calendar: CalendarType, fields: CalendarFieldsRecord, overflow: 'constrain' | 'reject'): PlainEvaluator; /** https://tc39.es/proposal-temporal/#sec-temporal-formatcalendarannotation */ export declare function FormatCalendarAnnotation(id: CalendarType, showCalendar: 'auto' | 'always' | 'never' | 'critical'): string; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarequals */ export declare function CalendarEquals(one: CalendarType, two: CalendarType): boolean; /** https://tc39.es/proposal-temporal/#sec-temporal-isodaysinmonth */ export declare function ISODaysInMonth(year: Integer, month: Integer): Integer; /** https://tc39.es/proposal-temporal/#sec-temporal-isoweekofyear */ export declare function ISOWeekOfYear(isoDate: ISODateRecord): YearWeekRecord; /** https://tc39.es/proposal-temporal/#sec-temporal-isodayofyear */ export declare function ISODayOfYear(isoDate: ISODateRecord): Integer; /** https://tc39.es/proposal-temporal/#sec-temporal-isodayofweek */ export declare function ISODayOfWeek(isoDate: ISODateRecord): Integer; /** https://tc39.es/proposal-temporal/#sec-temporal-nonisocalendardatetoiso */ export declare function NonISOCalendarDateToISO(_calendar: CalendarType, _fields: CalendarFieldsRecord, _overflow: 'constrain' | 'reject'): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-calendardatetoiso */ export declare function CalendarDateToISO(calendar: CalendarType, fields: CalendarFieldsRecord, overflow: 'constrain' | 'reject'): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-nonisomonthdaytoisoreferencedate */ export declare function NonISOMonthDayToISOReferenceDate(_calendar: CalendarType, _fields: CalendarFieldsRecord, _overflow: 'constrain' | 'reject'): never; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarmonthdaytoisoreferencedate */ export declare function CalendarMonthDayToISOReferenceDate(calendar: CalendarType, fields: CalendarFieldsRecord, overflow: 'constrain' | 'reject'): PlainCompletion; /** https://tc39.es/proposal-temporal/#sec-temporal-nonisocalendarisotodate */ export declare function NonISOCalendarISOToDate(_calendar: CalendarType, _isoDate: ISODateRecord): CalendarDateRecord; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarisotodate */ export declare function CalendarISOToDate(calendar: CalendarType, isoDate: ISODateRecord): CalendarDateRecord; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarextrafields */ export declare function CalendarExtraFields(calendar: CalendarType, _fields: readonly CalendarFieldsRecordEnumerationKey[]): CalendarFieldsRecordEnumerationKey[]; /** https://tc39.es/proposal-temporal/#sec-temporal-nonisofieldkeystoignore */ export declare function NonISOFieldKeysToIgnore(_calendar: CalendarType, _keys: readonly CalendarFieldsRecordEnumerationKey[]): CalendarFieldsRecordEnumerationKey[]; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarfieldkeystoignore */ export declare function CalendarFieldKeysToIgnore(calendar: CalendarType, keys: readonly CalendarFieldsRecordEnumerationKey[]): CalendarFieldsRecordEnumerationKey[]; /** https://tc39.es/proposal-temporal/#sec-temporal-nonisoresolvefields */ export declare function NonISOResolveFields(_calendar: CalendarType, _fields: CalendarFieldsRecord, _type: 'date' | 'year-month' | 'month-day'): CalendarFieldsRecord; /** https://tc39.es/proposal-temporal/#sec-temporal-calendarresolvefields */ export declare function CalendarResolveFields(calendar: CalendarType, fields: CalendarFieldsRecord, type: 'date' | 'year-month' | 'month-day'): PlainEvaluator; //# sourceMappingURL=calendar.d.mts.map