summaryrefslogtreecommitdiff
path: root/cli/tsc/dts/lib.es2020.intl.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tsc/dts/lib.es2020.intl.d.ts')
-rw-r--r--cli/tsc/dts/lib.es2020.intl.d.ts52
1 files changed, 36 insertions, 16 deletions
diff --git a/cli/tsc/dts/lib.es2020.intl.d.ts b/cli/tsc/dts/lib.es2020.intl.d.ts
index 9c41b38b2..59c0d7ebd 100644
--- a/cli/tsc/dts/lib.es2020.intl.d.ts
+++ b/cli/tsc/dts/lib.es2020.intl.d.ts
@@ -19,9 +19,11 @@ and limitations under the License.
/// <reference lib="es2018.intl" />
declare namespace Intl {
/**
- * [Unicode BCP 47 Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers) definition.
+ * A string that is a valid [Unicode BCP 47 Locale Identifier](https://unicode.org/reports/tr35/#Unicode_locale_identifier).
*
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
+ * For example: "fa", "es-MX", "zh-Hant-TW".
+ *
+ * See [MDN - Intl - locales argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
*/
type UnicodeBCP47LocaleIdentifier = string;
@@ -89,16 +91,9 @@ declare namespace Intl {
type RelativeTimeFormatStyle = "long" | "short" | "narrow";
/**
- * [BCP 47 language tag](http://tools.ietf.org/html/rfc5646) definition.
+ * The locale or locales to use
*
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
- */
- type BCP47LanguageTag = string;
-
- /**
- * The locale(s) to use
- *
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
+ * See [MDN - Intl - locales argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
*/
type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | readonly (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
@@ -218,7 +213,7 @@ declare namespace Intl {
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).
*/
new (
- locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
+ locales?: LocalesArgument,
options?: RelativeTimeFormatOptions,
): RelativeTimeFormat;
@@ -241,7 +236,7 @@ declare namespace Intl {
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf).
*/
supportedLocalesOf(
- locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
+ locales?: LocalesArgument,
options?: RelativeTimeFormatOptions,
): UnicodeBCP47LocaleIdentifier[];
};
@@ -312,7 +307,7 @@ declare namespace Intl {
/** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */
minimize(): Locale;
/** Returns the locale's full locale identifier string. */
- toString(): BCP47LanguageTag;
+ toString(): UnicodeBCP47LocaleIdentifier;
}
/**
@@ -330,7 +325,7 @@ declare namespace Intl {
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale).
*/
const Locale: {
- new (tag: BCP47LanguageTag | Locale, options?: LocaleOptions): Locale;
+ new (tag: UnicodeBCP47LocaleIdentifier | Locale, options?: LocaleOptions): Locale;
};
type DisplayNamesFallback =
@@ -424,6 +419,31 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
*/
- supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): BCP47LanguageTag[];
+ supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
};
+
+ interface CollatorConstructor {
+ new (locales?: LocalesArgument, options?: CollatorOptions): Collator;
+ (locales?: LocalesArgument, options?: CollatorOptions): Collator;
+ supportedLocalesOf(locales: LocalesArgument, options?: CollatorOptions): string[];
+ }
+
+ interface DateTimeFormatConstructor {
+ new (locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat;
+ (locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat;
+ supportedLocalesOf(locales: LocalesArgument, options?: DateTimeFormatOptions): string[];
+ }
+
+ interface NumberFormatConstructor {
+ new (locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat;
+ (locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat;
+ supportedLocalesOf(locales: LocalesArgument, options?: NumberFormatOptions): string[];
+ }
+
+ interface PluralRulesConstructor {
+ new (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
+ (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
+
+ supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
+ }
}