import { Temporal } from '@js-temporal/polyfill-patched'; type CalendarYMD = { year: number; month: number; day: number; }; /** * `@js-temporal/polyfill` 0.5.x removed the `Temporal.Calendar` class and the * user-defined calendar protocol entirely - calendars are now plain string * identifiers understood natively by the polyfill, and Nepali (a luni-solar * calendar not in CLDR) can no longer be registered with Temporal's engine. * * `NepaliPlainDate` is a standalone, hand-rolled replacement that wraps a * real ISO `Temporal.PlainDate`. It intentionally mirrors the previous * `NepaliCalendar` class's actual behaviour rather than "fixing" it: * `dateAdd`/`dateUntil`/`fields`/`mergeFields` were never overridden on the * old `NepaliCalendar extends Temporal.Calendar` class - they were inherited * from its `super('iso8601')` call. This meant `.add()`/`.subtract()` on a * Nepali-tagged date always did plain ISO-calendar arithmetic on the * underlying ISO date, then re-derived Nepali fields from the result - not * genuine Nepali calendar arithmetic. `add`/`subtract`/`with` below * reproduce that exact "ISO-then-reconvert" behaviour by delegating to * `isoDate`, since existing workarounds elsewhere (e.g. the day-14 clamp in * `useNavigation.ts` and `generate-fixed-periods-monthly.ts`) depend on it. * * This implementation is based on World-Calendars library by Keith Wood: * https://github.com/kbwood/world-calendars */ declare class NepaliPlainDate { readonly calendarId: "nepali"; readonly isoDate: Temporal.PlainDate; private constructor(); /** Tags an existing ISO date as Nepali (reads its ISO y/m/d, converts to Nepali fields lazily). */ static fromIso(isoDate: Temporal.PlainDate | Temporal.PlainDateLike | string): NepaliPlainDate; /** Constructs from Nepali-calendar-space fields (year/month/day as displayed in Nepali). */ static from(fields: CalendarYMD, options?: Temporal.AssignmentOptions): NepaliPlainDate; get year(): number; get eraYear(): number; get month(): number; get monthCode(): string; get day(): number; get daysInMonth(): number; get monthsInYear(): number; get dayOfWeek(): number; get daysInWeek(): number; get dayOfYear(): number; get era(): string | undefined; get daysInYear(): number; get inLeapYear(): boolean; get weekOfYear(): undefined; get yearOfWeek(): undefined; with(fields: Partial, options?: Temporal.AssignmentOptions): NepaliPlainDate; add(duration: Temporal.Duration | Temporal.DurationLike | string, options?: Temporal.ArithmeticOptions): NepaliPlainDate; subtract(duration: Temporal.Duration | Temporal.DurationLike | string, options?: Temporal.ArithmeticOptions): NepaliPlainDate; equals(other: NepaliPlainDate): boolean; toString(options?: Temporal.ShowCalendarOption): string; toJSON(): string; } export { NepaliPlainDate };