import { Temporal } from '@js-temporal/polyfill-patched'; import { CalendarDate, SupportedCalendar } from '../types'; type ConvertDateFn = (date: string | Temporal.PlainDateLike, calendar: SupportedCalendar) => CalendarDate; /** * converts from an iso8601 (gregorian) date to a specific calendar * * @param date string in the format yyyy-MM-dd * @param userCalendar the calendar to covert to * @returns an object representing the date * * NOTE: the returned object contains two properties year and eraYear * to be consistent with the default behaviour of Temporal. `eraYear` is only * populated for calendars that have an era concept - this includes not just * Ethiopic but also Gregorian (AD) and others; Islamic, for example, has * none and always leaves it undefined. When accessing year, consumers * should be defensive and do: `const yearToUse = result.eraYear ?? result.year`. * * @see https://github.com/tc39/ecma402/issues/534 for more details */ export declare const convertFromIso8601: ConvertDateFn; /** * converts from a specific calendar (i.e. ethiopic or nepali) to iso8601 (gregorian) * * @param date calendar date in the format yyyy-MM-dd * @param userCalendar the calendar to convert from * @returns an object representing the iso8601 date */ export declare const convertToIso8601: ConvertDateFn; export {};