@@ -5,33 +5,32 @@ declare namespace Intl {
55 *
66 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format#duration).
77 */
8- type DurationTimeFormatUnit = "years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds"
9-
8+ type DurationTimeFormatUnit = "years" | "months" | "weeks" | "days" | "hours" | "minutes" | "seconds" | "milliseconds" | "microseconds" | "nanoseconds" ;
9+
1010 /**
1111 * The style of the formatted duration.
1212 *
1313 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#style).
1414 */
15- type DurationFormatStyle = "long" | "short" | "narrow" | "digital"
15+ type DurationFormatStyle = "long" | "short" | "narrow" | "digital" ;
1616
17-
1817 type DurationFormatUnitSingular =
19- | "year"
20- | "quarter"
21- | "month"
22- | "week"
23- | "day"
24- | "hour"
25- | "minute"
26- | "second" ;
18+ | "year"
19+ | "quarter"
20+ | "month"
21+ | "week"
22+ | "day"
23+ | "hour"
24+ | "minute"
25+ | "second" ;
2726
2827 /**
2928 * An object representing the relative time format in parts
3029 * that can be used for custom locale-aware formatting.
3130 *
3231 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/formatToParts#examples).
3332 */
34- type DurationFormatPart =
33+ type DurationFormatPart =
3534 | {
3635 type : "literal" ;
3736 value : string ;
@@ -42,85 +41,82 @@ declare namespace Intl {
4241 unit : DurationFormatUnitSingular ;
4342 } ;
4443
44+ type DurationFormatOption = "long" | "short" | "narrow" | "numeric" | "2-digit" ;
4545
46-
47- type DurationFormatOption = "long" | "short" | "narrow" | "numeric" | "2-digit"
48-
49-
50- type DurationFormatDisplayOption = "always" | "auto" ;
46+ type DurationFormatDisplayOption = "always" | "auto" ;
5147
5248 /**
5349 * Number of how many fractional second digits to display in the output.
5450 *
5551 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#fractionaldigits).
5652 */
57- type fractionalDigitsOption = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
53+ type fractionalDigitsOption = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;
5854
5955 interface ResolvedDurationFormatOptions {
60- locale ?: UnicodeBCP47LocaleIdentifier
61- numberingSystem ?: DateTimeFormatOptions [ "numberingSystem" ]
62- style ?: DurationFormatStyle
63- years ?: Omit < DurationFormatOptions , "numeric" | "2-digit" >
64- yearsDisplay ?:DurationFormatDisplayOption
65- months ?: Omit < DurationFormatOptions , "numeric" | "2-digit" >
66- monthsDisplay ?: DurationFormatDisplayOption
67- weeks ?: Omit < DurationFormatOptions , "numeric" | "2-digit" >
68- weeksDisplay ?: DurationFormatDisplayOption
69- days ?: Omit < DurationFormatOptions , "numeric" | "2-digit" >
70- daysDisplay ?: DurationFormatDisplayOption
71- hours ?: DurationFormatOptions
72- hoursDisplay ?: DurationFormatDisplayOption
73- minutes ?: DurationFormatOptions
74- minutesDisplay ?: DurationFormatDisplayOption
75- seconds ?: DurationFormatOptions
76- secondsDisplay ?: DurationFormatDisplayOption
77- milliseconds ?: DurationFormatOptions
78- millisecondsDisplay ?: DurationFormatDisplayOption
79- microseconds ?: DurationFormatOptions
80- microsecondsDisplay ?: DurationFormatDisplayOption
81- nanosecond ?: DurationFormatOptions
82- nanosecondDisplay ?: DurationFormatDisplayOption
83- fractionalDigits ?: fractionalDigitsOption
56+ locale ?: UnicodeBCP47LocaleIdentifier ;
57+ numberingSystem ?: DateTimeFormatOptions [ "numberingSystem" ] ;
58+ style ?: DurationFormatStyle ;
59+ years ?: Exclude < DurationFormatOption , "numeric" | "2-digit" > ;
60+ yearsDisplay ?: DurationFormatDisplayOption ;
61+ months ?: Exclude < DurationFormatOption , "numeric" | "2-digit" > ;
62+ monthsDisplay ?: DurationFormatDisplayOption ;
63+ weeks ?: Exclude < DurationFormatOption , "numeric" | "2-digit" > ;
64+ weeksDisplay ?: DurationFormatDisplayOption ;
65+ days ?: Exclude < DurationFormatOption , "numeric" | "2-digit" > ;
66+ daysDisplay ?: DurationFormatDisplayOption ;
67+ hours ?: DurationFormatOptions ;
68+ hoursDisplay ?: DurationFormatDisplayOption ;
69+ minutes ?: DurationFormatOptions ;
70+ minutesDisplay ?: DurationFormatDisplayOption ;
71+ seconds ?: DurationFormatOptions ;
72+ secondsDisplay ?: DurationFormatDisplayOption ;
73+ milliseconds ?: DurationFormatOptions ;
74+ millisecondsDisplay ?: DurationFormatDisplayOption ;
75+ microseconds ?: DurationFormatOptions ;
76+ microsecondsDisplay ?: DurationFormatDisplayOption ;
77+ nanosecond ?: DurationFormatOptions ;
78+ nanosecondDisplay ?: DurationFormatDisplayOption ;
79+ fractionalDigits ?: fractionalDigitsOption ;
8480 }
8581
8682 interface DurationFormatOptions {
87- localeMatcher ?: DurationTimeFormatLocaleMatcher
88- numberingSystem ?: DateTimeFormatOptions [ "numberingSystem" ]
89- style ?: DurationFormatStyle
90- years ?: Omit < DurationFormatOption , "numeric" | "2-digit" >
91- yearsDisplay ?:DurationFormatDisplayOption
92- months ?: Omit < DurationFormatOption , "numeric" | "2-digit" >
93- monthsDisplay ?: DurationFormatDisplayOption
94- weeks ?: Omit < DurationFormatOption , "numeric" | "2-digit" >
95- weeksDisplay ?: DurationFormatDisplayOption
96- days ?: Omit < DurationFormatOption , "numeric" | "2-digit" >
97- daysDisplay ?: DurationFormatDisplayOption
98- hours ?: DurationFormatOption
99- hoursDisplay ?: DurationFormatDisplayOption
100- minutes ?: DurationFormatOption
101- minutesDisplay ?: DurationFormatDisplayOption
102- seconds ?: DurationFormatOption
103- secondsDisplay ?: DurationFormatDisplayOption
104- milliseconds ?: DurationFormatOption
105- millisecondsDisplay ?: DurationFormatDisplayOption
106- microseconds ?: DurationFormatOption
107- microsecondsDisplay ?: DurationFormatDisplayOption
108- nanosecond ?: DurationFormatOption
109- nanosecondDisplay ?: DurationFormatDisplayOption
110- fractionalDigits ?: fractionalDigitsOption
83+ localeMatcher ?: DurationTimeFormatLocaleMatcher ;
84+ numberingSystem ?: DateTimeFormatOptions [ "numberingSystem" ] ;
85+ style ?: DurationFormatStyle ;
86+ years ?: Exclude < DurationFormatOption , "numeric" | "2-digit" > ;
87+ yearsDisplay ?: DurationFormatDisplayOption ;
88+ months ?: Exclude < DurationFormatOption , "numeric" | "2-digit" > ;
89+ monthsDisplay ?: DurationFormatDisplayOption ;
90+ weeks ?: Exclude < DurationFormatOption , "numeric" | "2-digit" > ;
91+ weeksDisplay ?: DurationFormatDisplayOption ;
92+ days ?: Exclude < DurationFormatOption , "numeric" | "2-digit" > ;
93+ daysDisplay ?: DurationFormatDisplayOption ;
94+ hours ?: DurationFormatOption ;
95+ hoursDisplay ?: DurationFormatDisplayOption ;
96+ minutes ?: DurationFormatOption ;
97+ minutesDisplay ?: DurationFormatDisplayOption ;
98+ seconds ?: DurationFormatOption ;
99+ secondsDisplay ?: DurationFormatDisplayOption ;
100+ milliseconds ?: DurationFormatOption ;
101+ millisecondsDisplay ?: DurationFormatDisplayOption ;
102+ microseconds ?: DurationFormatOption ;
103+ microsecondsDisplay ?: DurationFormatDisplayOption ;
104+ nanosecond ?: DurationFormatOption ;
105+ nanosecondDisplay ?: DurationFormatDisplayOption ;
106+ fractionalDigits ?: fractionalDigitsOption ;
111107 }
112108
113109 /**
114110 * The duration object to be formatted
115- *
111+ *
116112 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format#duration).
117113 */
118- type DurationType = Record < DurationTimeFormatUnit , number >
114+ type DurationType = Record < DurationTimeFormatUnit , number > ;
119115
120116 interface DurationFormat {
121117 /**
122118 * @param duration The duration object to be formatted. It should include some or all of the following properties: months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds.
123- *
119+ *
124120 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format).
125121 */
126122 format ( duration : DurationType ) : string ;
@@ -148,7 +144,7 @@ declare namespace Intl {
148144 *
149145 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat).
150146 */
151- new ( locales : LocalesArgument , options : DurationFormatOptions ) : DurationFormat ;
147+ new ( locales ? : LocalesArgument , options ? : DurationFormatOptions ) : DurationFormat ;
152148
153149 /**
154150 * Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
0 commit comments