diff --git a/src/lib/es2018.intl.d.ts b/src/lib/es2018.intl.d.ts index 9fe8f63c28620..9395f43903554 100644 --- a/src/lib/es2018.intl.d.ts +++ b/src/lib/es2018.intl.d.ts @@ -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; } diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 3a5c4958aa5e0..f351ee3c0cee6 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -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"; } diff --git a/tests/baselines/reference/libCompileChecks.js b/tests/baselines/reference/libCompileChecks.js new file mode 100644 index 0000000000000..d36f70bb440d0 --- /dev/null +++ b/tests/baselines/reference/libCompileChecks.js @@ -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. diff --git a/tests/baselines/reference/libCompileChecks.symbols b/tests/baselines/reference/libCompileChecks.symbols new file mode 100644 index 0000000000000..2bed52247c080 --- /dev/null +++ b/tests/baselines/reference/libCompileChecks.symbols @@ -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. \ No newline at end of file diff --git a/tests/baselines/reference/libCompileChecks.types b/tests/baselines/reference/libCompileChecks.types new file mode 100644 index 0000000000000..2bed52247c080 --- /dev/null +++ b/tests/baselines/reference/libCompileChecks.types @@ -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. \ No newline at end of file diff --git a/tests/cases/compiler/libCompileChecks.ts b/tests/cases/compiler/libCompileChecks.ts new file mode 100644 index 0000000000000..36f17f009e0a3 --- /dev/null +++ b/tests/cases/compiler/libCompileChecks.ts @@ -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. \ No newline at end of file