From 55db928abc6e3d2d49f4a1cc9b3e1c529c9701e4 Mon Sep 17 00:00:00 2001 From: Justin Grant Date: Wed, 8 Dec 2021 12:20:59 -0800 Subject: [PATCH] Fix TS types for required CalendarProtocol methods The docs state that all CalendarProtocol methods are required to be implemented except `id`, `fields()`, `mergeFields()`, and `toJSON()`. This PR aligns the TS types to the docs. --- polyfill/index.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/polyfill/index.d.ts b/polyfill/index.d.ts index 355631dfa8..d8a202c788 100644 --- a/polyfill/index.d.ts +++ b/polyfill/index.d.ts @@ -631,20 +631,20 @@ export namespace Temporal { day(date: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainMonthDay | PlainDateLike | string): number; era(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): string | undefined; eraYear(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number | undefined; - dayOfWeek?(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number; - dayOfYear?(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number; - weekOfYear?(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number; - daysInWeek?(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number; - daysInMonth?( + dayOfWeek(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number; + dayOfYear(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number; + weekOfYear(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number; + daysInWeek(date: Temporal.PlainDate | Temporal.PlainDateTime | PlainDateLike | string): number; + daysInMonth( date: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | PlainDateLike | string ): number; - daysInYear?( + daysInYear( date: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | PlainDateLike | string ): number; - monthsInYear?( + monthsInYear( date: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | PlainDateLike | string ): number; - inLeapYear?( + inLeapYear( date: Temporal.PlainDate | Temporal.PlainDateTime | Temporal.PlainYearMonth | PlainDateLike | string ): boolean; dateFromFields( @@ -659,12 +659,12 @@ export namespace Temporal { fields: EitherMonthCodeOrMonthAndYear & { day: number }, options?: AssignmentOptions ): Temporal.PlainMonthDay; - dateAdd?( + dateAdd( date: Temporal.PlainDate | PlainDateLike | string, duration: Temporal.Duration | DurationLike | string, options?: ArithmeticOptions ): Temporal.PlainDate; - dateUntil?( + dateUntil( one: Temporal.PlainDate | PlainDateLike | string, two: Temporal.PlainDate | PlainDateLike | string, options?: DifferenceOptions<'year' | 'month' | 'week' | 'day'>