@@ -5,7 +5,17 @@ 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" ;
8+ type DurationTimeFormatUnit =
9+ | "years"
10+ | "months"
11+ | "weeks"
12+ | "days"
13+ | "hours"
14+ | "minutes"
15+ | "seconds"
16+ | "milliseconds"
17+ | "microseconds"
18+ | "nanoseconds" ;
919
1020 /**
1121 * The style of the formatted duration.
@@ -32,16 +42,21 @@ declare namespace Intl {
3242 */
3343 type DurationFormatPart =
3444 | {
35- type : "literal" ;
36- value : string ;
37- }
45+ type : "literal" ;
46+ value : string ;
47+ }
3848 | {
39- type : Exclude < NumberFormatPartTypes , "literal" > ;
40- value : string ;
41- unit : DurationFormatUnitSingular ;
42- } ;
49+ type : Exclude < NumberFormatPartTypes , "literal" > ;
50+ value : string ;
51+ unit : DurationFormatUnitSingular ;
52+ } ;
4353
44- type DurationFormatOption = "long" | "short" | "narrow" | "numeric" | "2-digit" ;
54+ type DurationFormatOption =
55+ | "long"
56+ | "short"
57+ | "narrow"
58+ | "numeric"
59+ | "2-digit" ;
4560
4661 type DurationFormatDisplayOption = "always" | "auto" ;
4762
@@ -74,8 +89,8 @@ declare namespace Intl {
7489 millisecondsDisplay ?: DurationFormatDisplayOption ;
7590 microseconds ?: DurationFormatOptions ;
7691 microsecondsDisplay ?: DurationFormatDisplayOption ;
77- nanosecond ?: DurationFormatOptions ;
78- nanosecondDisplay ?: DurationFormatDisplayOption ;
92+ nanoseconds ?: DurationFormatOptions ;
93+ nanosecondsDisplay ?: DurationFormatDisplayOption ;
7994 fractionalDigits ?: fractionalDigitsOption ;
8095 }
8196
@@ -101,8 +116,8 @@ declare namespace Intl {
101116 millisecondsDisplay ?: DurationFormatDisplayOption ;
102117 microseconds ?: DurationFormatOption ;
103118 microsecondsDisplay ?: DurationFormatDisplayOption ;
104- nanosecond ?: DurationFormatOption ;
105- nanosecondDisplay ?: DurationFormatDisplayOption ;
119+ nanoseconds ?: DurationFormatOption ;
120+ nanosecondsDisplay ?: DurationFormatDisplayOption ;
106121 fractionalDigits ?: fractionalDigitsOption ;
107122 }
108123
@@ -111,7 +126,7 @@ declare namespace Intl {
111126 *
112127 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format#duration).
113128 */
114- type DurationType = Record < DurationTimeFormatUnit , number > ;
129+ type DurationType = Partial < Record < DurationTimeFormatUnit , number > > ;
115130
116131 interface DurationFormat {
117132 /**
@@ -144,7 +159,10 @@ declare namespace Intl {
144159 *
145160 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat).
146161 */
147- new ( locales ?: LocalesArgument , options ?: DurationFormatOptions ) : DurationFormat ;
162+ new (
163+ locales ?: LocalesArgument ,
164+ options ?: DurationFormatOptions
165+ ) : DurationFormat ;
148166
149167 /**
150168 * 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.
@@ -159,6 +177,9 @@ declare namespace Intl {
159177 *
160178 * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/supportedLocalesOf).
161179 */
162- supportedLocalesOf ( locales ?: LocalesArgument , options ?: { localeMatcher ?: DurationTimeFormatLocaleMatcher ; } ) : UnicodeBCP47LocaleIdentifier [ ] ;
180+ supportedLocalesOf (
181+ locales ?: LocalesArgument ,
182+ options ?: { localeMatcher ?: DurationTimeFormatLocaleMatcher }
183+ ) : UnicodeBCP47LocaleIdentifier [ ] ;
163184 } ;
164185}
0 commit comments