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:
Orta Therox 2021-09-10 18:46:46 +00:00 committed by GitHub
parent 5820f8222f
commit 13bdc03ab5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 8 deletions

View file

@ -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;
}

View file

@ -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";
}

View 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.

View 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.

View 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.

View 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.