Skip to content

Commit

Permalink
Fix Calendar.fields return type to match the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
justingrant committed Feb 18, 2022
1 parent f2e2658 commit 3145c6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ export namespace Temporal {
two: Temporal.PlainDate | PlainDateLike | string,
options?: DifferenceOptions<'year' | 'month' | 'week' | 'day'>
): Temporal.Duration;
fields(fields: Iterable<string>): Iterable<string>;
fields(fields: Iterable<string>): string[];
mergeFields(fields: Record<string, unknown>, additionalFields: Record<string, unknown>): Record<string, unknown>;
toString(): string;
toJSON(): string;
Expand Down Expand Up @@ -1340,7 +1340,7 @@ export namespace Temporal {
* a more ergonomic alternative to this method is
* `Temporal.Now.zonedDateTimeISO()`.
*
* @param {Temporal.Calendar | string} [calendar] - calendar identifier, or
* @param {CalendarLike} [calendar] - calendar identifier, or
* a `Temporal.Calendar` instance, or an object implementing the calendar
* protocol.
* @param {TimeZoneLike} [tzLike] -
Expand Down Expand Up @@ -1377,7 +1377,7 @@ export namespace Temporal {
* `Temporal.Now.zonedDateTimeISO` or `Temporal.Now.zonedDateTime` instead
* of this function.
*
* @param {Temporal.Calendar | string} [calendar] - calendar identifier, or
* @param {CalendarLike} [calendar] - calendar identifier, or
* a `Temporal.Calendar` instance, or an object implementing the calendar
* protocol.
* @param {TimeZoneLike} [tzLike] -
Expand Down
2 changes: 1 addition & 1 deletion lib/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ interface CalendarImpl {
two: Temporal.PlainDate,
largestUnit: 'year' | 'month' | 'week' | 'day'
): { years: number; months: number; weeks: number; days: number };
fields(fields: Iterable<string>): Iterable<string>;
fields(fields: string[]): string[];
mergeFields(fields: Record<string, unknown>, additionalFields: Record<string, unknown>): Record<string, unknown>;
}

Expand Down

0 comments on commit 3145c6c

Please sign in to comment.