Intl fix for nightly (#45820)
* Fix #45804 * Update src/lib/es2020.intl.d.ts Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> * More fixes * Adds a test Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
This commit is contained in:
parent
5820f8222f
commit
13bdc03ab5
5
src/lib/es2018.intl.d.ts
vendored
5
src/lib/es2018.intl.d.ts
vendored
|
@ -37,9 +37,12 @@ declare namespace Intl {
|
|||
supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit" }): string[];
|
||||
};
|
||||
|
||||
// We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here:
|
||||
type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name";
|
||||
type ES2020NumberFormatPartType = "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown";
|
||||
|
||||
interface NumberFormatPart {
|
||||
type: ES2018NumberFormatPartType;
|
||||
type: ES2018NumberFormatPartType | ES2020NumberFormatPartType;
|
||||
value: string;
|
||||
}
|
||||
|
||||
|
|
9
src/lib/es2020.intl.d.ts
vendored
9
src/lib/es2020.intl.d.ts
vendored
|
@ -197,16 +197,11 @@ declare namespace Intl {
|
|||
): UnicodeBCP47LocaleIdentifier[];
|
||||
};
|
||||
|
||||
type ES2020NumberFormatPartType = ES2018NumberFormatPartType | "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown";
|
||||
interface NumberFormatPart {
|
||||
type: ES2020NumberFormatPartType
|
||||
}
|
||||
|
||||
interface NumberFormatOptions {
|
||||
compactDisplay?: "short" | "long" | undefined;
|
||||
notation?: "standard" | "scientific" | "engineering" | "compact" | undefined;
|
||||
signDisplay?: "auto" | "never" | "always" | undefined;
|
||||
unit?: NumberFormatUnit | undefined;
|
||||
unit?: string | undefined;
|
||||
unitDisplay?: "short" | "long" | "narrow" | undefined;
|
||||
}
|
||||
|
||||
|
@ -214,7 +209,7 @@ declare namespace Intl {
|
|||
compactDisplay?: "short" | "long";
|
||||
notation?: "standard" | "scientific" | "engineering" | "compact";
|
||||
signDisplay?: "auto" | "never" | "always";
|
||||
unit?: NumberFormatUnit;
|
||||
unit?: string;
|
||||
unitDisplay?: "short" | "long" | "narrow";
|
||||
}
|
||||
|
||||
|
|
7
tests/baselines/reference/libCompileChecks.js
Normal file
7
tests/baselines/reference/libCompileChecks.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
//// [libCompileChecks.ts]
|
||||
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
|
||||
// as false everywhere.
|
||||
|
||||
//// [libCompileChecks.js]
|
||||
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
|
||||
// as false everywhere.
|
4
tests/baselines/reference/libCompileChecks.symbols
Normal file
4
tests/baselines/reference/libCompileChecks.symbols
Normal file
|
@ -0,0 +1,4 @@
|
|||
=== tests/cases/compiler/libCompileChecks.ts ===
|
||||
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
|
||||
No type information for this code.// as false everywhere.
|
||||
No type information for this code.
|
4
tests/baselines/reference/libCompileChecks.types
Normal file
4
tests/baselines/reference/libCompileChecks.types
Normal file
|
@ -0,0 +1,4 @@
|
|||
=== tests/cases/compiler/libCompileChecks.ts ===
|
||||
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
|
||||
No type information for this code.// as false everywhere.
|
||||
No type information for this code.
|
7
tests/cases/compiler/libCompileChecks.ts
Normal file
7
tests/cases/compiler/libCompileChecks.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
// @lib: esnext, dom
|
||||
// @target: esnext
|
||||
// @skipLibCheck: false
|
||||
// @skipDefaultLibCheck: false
|
||||
|
||||
// This test is effectively the 'lib check' for all our .d.ts files because we use skipLibCheck
|
||||
// as false everywhere.
|
Loading…
Reference in a new issue