@@ -59,22 +59,8 @@ declare namespace Temporal {
5959 offset ?: string | undefined ;
6060 }
6161
62- type DateUnit = "year" | "month" | "week" | "day" ;
63- type TimeUnit = "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond" ;
64- type PluralizeUnit < T extends DateUnit | TimeUnit > =
65- | T
66- | {
67- year : "years" ;
68- month : "months" ;
69- week : "weeks" ;
70- day : "days" ;
71- hour : "hours" ;
72- minute : "minutes" ;
73- second : "seconds" ;
74- millisecond : "milliseconds" ;
75- microsecond : "microseconds" ;
76- nanosecond : "nanoseconds" ;
77- } [ T ] ;
62+ type DateUnit = "year" | "month" | "week" | "day" | "years" | "months" | "weeks" | "days" ;
63+ type TimeUnit = "hour" | "minute" | "second" | "millisecond" | "microsecond" | "nanosecond" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds" ;
7864
7965 interface DisambiguationOptions {
8066 disambiguation ?: "compatible" | "earlier" | "later" | "reject" | undefined ;
@@ -89,13 +75,13 @@ declare namespace Temporal {
8975 }
9076
9177 interface RoundingOptions < Units extends DateUnit | TimeUnit > {
92- smallestUnit ?: PluralizeUnit < Units > | undefined ;
78+ smallestUnit ?: Units | undefined ;
9379 roundingIncrement ?: number | undefined ;
9480 roundingMode ?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined ;
9581 }
9682
9783 interface RoundingOptionsWithLargestUnit < Units extends DateUnit | TimeUnit > extends RoundingOptions < Units > {
98- largestUnit ?: "auto" | PluralizeUnit < Units > | undefined ;
84+ largestUnit ?: "auto" | Units | undefined ;
9985 }
10086
10187 interface ToStringRoundingOptions < Units extends DateUnit | TimeUnit > extends Pick < RoundingOptions < Units > , "smallestUnit" | "roundingMode" > { }
@@ -166,7 +152,7 @@ declare namespace Temporal {
166152 }
167153 var PlainDate : PlainDateConstructor ;
168154
169- interface PlainTimeToStringOptions extends ToStringRoundingOptionsWithFractionalSeconds < Exclude < TimeUnit , "hour" > > { }
155+ interface PlainTimeToStringOptions extends ToStringRoundingOptionsWithFractionalSeconds < Exclude < TimeUnit , "hour" | "hours" > > { }
170156
171157 interface PlainTime {
172158 readonly hour : number ;
@@ -181,7 +167,7 @@ declare namespace Temporal {
181167 until ( other : PlainTimeLike , options ?: RoundingOptionsWithLargestUnit < TimeUnit > ) : Duration ;
182168 since ( other : PlainTimeLike , options ?: RoundingOptionsWithLargestUnit < TimeUnit > ) : Duration ;
183169 equals ( other : PlainTimeLike ) : boolean ;
184- round ( roundTo : PluralizeUnit < TimeUnit > ) : PlainTime ;
170+ round ( roundTo : TimeUnit ) : PlainTime ;
185171 round ( roundTo : RoundingOptions < TimeUnit > ) : PlainTime ;
186172 toString ( options ?: PlainTimeToStringOptions ) : string ;
187173 toLocaleString ( locales ?: Intl . LocalesArgument , options ?: Intl . DateTimeFormatOptions ) : string ;
@@ -230,8 +216,8 @@ declare namespace Temporal {
230216 subtract ( duration : DurationLike , options ?: OverflowOptions ) : PlainDateTime ;
231217 until ( other : PlainDateTimeLike , options ?: RoundingOptionsWithLargestUnit < DateUnit | TimeUnit > ) : Duration ;
232218 since ( other : PlainDateTimeLike , options ?: RoundingOptionsWithLargestUnit < DateUnit | TimeUnit > ) : Duration ;
233- round ( roundTo : PluralizeUnit < "day" | TimeUnit > ) : PlainDateTime ;
234- round ( roundTo : RoundingOptions < "day" | TimeUnit > ) : PlainDateTime ;
219+ round ( roundTo : "day" | "days" | TimeUnit ) : PlainDateTime ;
220+ round ( roundTo : RoundingOptions < "day" | "days" | TimeUnit > ) : PlainDateTime ;
235221 equals ( other : PlainDateTimeLike ) : boolean ;
236222 toString ( options ?: PlainDateTimeToStringOptions ) : string ;
237223 toLocaleString ( locales ?: Intl . LocalesArgument , options ?: Intl . DateTimeFormatOptions ) : string ;
@@ -297,8 +283,8 @@ declare namespace Temporal {
297283 subtract ( duration : DurationLike , options ?: OverflowOptions ) : ZonedDateTime ;
298284 until ( other : ZonedDateTimeLike , options ?: RoundingOptionsWithLargestUnit < DateUnit | TimeUnit > ) : Duration ;
299285 since ( other : ZonedDateTimeLike , options ?: RoundingOptionsWithLargestUnit < DateUnit | TimeUnit > ) : Duration ;
300- round ( roundTo : PluralizeUnit < "day" | TimeUnit > ) : ZonedDateTime ;
301- round ( roundTo : RoundingOptions < "day" | TimeUnit > ) : ZonedDateTime ;
286+ round ( roundTo : "day" | "days" | TimeUnit ) : ZonedDateTime ;
287+ round ( roundTo : RoundingOptions < "day" | "days" | TimeUnit > ) : ZonedDateTime ;
302288 equals ( other : ZonedDateTimeLike ) : boolean ;
303289 toString ( options ?: ZonedDateTimeToStringOptions ) : string ;
304290 toLocaleString ( locales ?: Intl . LocalesArgument , options ?: Intl . DateTimeFormatOptions ) : string ;
@@ -328,10 +314,10 @@ declare namespace Temporal {
328314
329315 interface DurationRoundingOptions extends DurationRelativeToOptions , RoundingOptionsWithLargestUnit < DateUnit | TimeUnit > { }
330316
331- interface DurationToStringOptions extends ToStringRoundingOptionsWithFractionalSeconds < Exclude < TimeUnit , "hour" | "minute" > > { }
317+ interface DurationToStringOptions extends ToStringRoundingOptionsWithFractionalSeconds < Exclude < TimeUnit , "hour" | "minute" | "hours" | "minutes" > > { }
332318
333319 interface DurationTotalOptions extends DurationRelativeToOptions {
334- unit : PluralizeUnit < DateUnit | TimeUnit > ;
320+ unit : DateUnit | TimeUnit ;
335321 }
336322
337323 interface Duration {
@@ -352,9 +338,9 @@ declare namespace Temporal {
352338 abs ( ) : Duration ;
353339 add ( other : DurationLike ) : Duration ;
354340 subtract ( other : DurationLike ) : Duration ;
355- round ( roundTo : PluralizeUnit < "day" | TimeUnit > ) : Duration ;
341+ round ( roundTo : "day" | "days" | TimeUnit ) : Duration ;
356342 round ( roundTo : DurationRoundingOptions ) : Duration ;
357- total ( totalOf : PluralizeUnit < "day" | TimeUnit > ) : number ;
343+ total ( totalOf : "day" | "days" | TimeUnit ) : number ;
358344 total ( totalOf : DurationTotalOptions ) : number ;
359345 toString ( options ?: DurationToStringOptions ) : string ;
360346 toLocaleString ( locales ?: Intl . LocalesArgument , options ?: Intl . DurationFormatOptions ) : string ;
@@ -382,7 +368,7 @@ declare namespace Temporal {
382368 subtract ( duration : DurationLike ) : Instant ;
383369 until ( other : InstantLike , options ?: RoundingOptionsWithLargestUnit < TimeUnit > ) : Duration ;
384370 since ( other : InstantLike , options ?: RoundingOptionsWithLargestUnit < TimeUnit > ) : Duration ;
385- round ( roundTo : PluralizeUnit < TimeUnit > ) : Instant ;
371+ round ( roundTo : TimeUnit ) : Instant ;
386372 round ( roundTo : RoundingOptions < TimeUnit > ) : Instant ;
387373 equals ( other : InstantLike ) : boolean ;
388374 toString ( options ?: InstantToStringOptions ) : string ;
@@ -421,8 +407,8 @@ declare namespace Temporal {
421407 with ( yearMonthLike : PartialTemporalLike < YearMonthLikeObject > , options ?: OverflowOptions ) : PlainYearMonth ;
422408 add ( duration : DurationLike , options ?: OverflowOptions ) : PlainYearMonth ;
423409 subtract ( duration : DurationLike , options ?: OverflowOptions ) : PlainYearMonth ;
424- until ( other : PlainYearMonthLike , options ?: RoundingOptionsWithLargestUnit < "year" | "month" > ) : Duration ;
425- since ( other : PlainYearMonthLike , options ?: RoundingOptionsWithLargestUnit < "year" | "month" > ) : Duration ;
410+ until ( other : PlainYearMonthLike , options ?: RoundingOptionsWithLargestUnit < "year" | "month" | "years" | "months" > ) : Duration ;
411+ since ( other : PlainYearMonthLike , options ?: RoundingOptionsWithLargestUnit < "year" | "month" | "years" | "months" > ) : Duration ;
426412 equals ( other : PlainYearMonthLike ) : boolean ;
427413 toString ( options ?: PlainDateToStringOptions ) : string ;
428414 toLocaleString ( locales ?: Intl . LocalesArgument , options ?: Intl . DateTimeFormatOptions ) : string ;
0 commit comments