Skip to content

Commit 13bdc03

Browse files
Orta Theroxandrewbranch
Orta Therox
andauthored
Intl fix for nightly (microsoft#45820)
* Fix microsoft#45804 * Update src/lib/es2020.intl.d.ts Co-authored-by: Andrew Branch <[email protected]> * More fixes * Adds a test Co-authored-by: Andrew Branch <[email protected]>
1 parent 5820f82 commit 13bdc03

File tree

6 files changed

+28
-8
lines changed

6 files changed

+28
-8
lines changed

src/lib/es2018.intl.d.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ declare namespace Intl {
3737
supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit" }): string[];
3838
};
3939

40+
// We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here:
4041
type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name";
42+
type ES2020NumberFormatPartType = "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown";
43+
4144
interface NumberFormatPart {
42-
type: ES2018NumberFormatPartType;
45+
type: ES2018NumberFormatPartType | ES2020NumberFormatPartType;
4346
value: string;
4447
}
4548

src/lib/es2020.intl.d.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -197,24 +197,19 @@ declare namespace Intl {
197197
): UnicodeBCP47LocaleIdentifier[];
198198
};
199199

200-
type ES2020NumberFormatPartType = ES2018NumberFormatPartType | "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown";
201-
interface NumberFormatPart {
202-
type: ES2020NumberFormatPartType
203-
}
204-
205200
interface NumberFormatOptions {
206201
compactDisplay?: "short" | "long" | undefined;
207202
notation?: "standard" | "scientific" | "engineering" | "compact" | undefined;
208203
signDisplay?: "auto" | "never" | "always" | undefined;
209-
unit?: NumberFormatUnit | undefined;
204+
unit?: string | undefined;
210205
unitDisplay?: "short" | "long" | "narrow" | undefined;
211206
}
212207

213208
interface ResolvedNumberFormatOptions {
214209
compactDisplay?: "short" | "long";
215210
notation?: "standard" | "scientific" | "engineering" | "compact";
216211
signDisplay?: "auto" | "never" | "always";
217-
unit?: NumberFormatUnit;
212+
unit?: string;
218213
unitDisplay?: "short" | "long" | "narrow";
219214
}
220215

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//// [libCompileChecks.ts]
2+
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
3+
// as false everywhere.
4+
5+
//// [libCompileChecks.js]
6+
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
7+
// as false everywhere.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
=== tests/cases/compiler/libCompileChecks.ts ===
2+
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
3+
No type information for this code.// as false everywhere.
4+
No type information for this code.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
=== tests/cases/compiler/libCompileChecks.ts ===
2+
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
3+
No type information for this code.// as false everywhere.
4+
No type information for this code.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// @lib: esnext, dom
2+
// @target: esnext
3+
// @skipLibCheck: false
4+
// @skipDefaultLibCheck: false
5+
6+
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
7+
// as false everywhere.

0 commit comments

Comments
 (0)