summaryrefslogtreecommitdiff
path: root/cli/dts/lib.es2020.intl.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/dts/lib.es2020.intl.d.ts')
-rw-r--r--cli/dts/lib.es2020.intl.d.ts51
1 files changed, 43 insertions, 8 deletions
diff --git a/cli/dts/lib.es2020.intl.d.ts b/cli/dts/lib.es2020.intl.d.ts
index 3e47f89cf..af981e31c 100644
--- a/cli/dts/lib.es2020.intl.d.ts
+++ b/cli/dts/lib.es2020.intl.d.ts
@@ -79,6 +79,13 @@ declare namespace Intl {
type BCP47LanguageTag = string;
/**
+ * The locale(s) to use
+ *
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
+ */
+ type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
+
+ /**
* An object with some or all of properties of `options` parameter
* of `Intl.RelativeTimeFormat` constructor.
*
@@ -274,6 +281,10 @@ declare namespace Intl {
}
interface Locale extends LocaleOptions {
+ /** A string containing the language, and the script and region if available. */
+ baseName: string;
+ /** The primary language subtag associated with the locale. */
+ language: string;
/** Gets the most likely values for the language, script, and region of the locale based on existing values. */
maximize(): Locale;
/** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */
@@ -297,15 +308,39 @@ declare namespace Intl {
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale).
*/
const Locale: {
- new (tag?: BCP47LanguageTag, options?: LocaleOptions): Locale;
+ new (tag: BCP47LanguageTag | Locale, options?: LocaleOptions): Locale;
};
- interface DisplayNamesOptions {
+ type DisplayNamesFallback =
+ | "code"
+ | "none";
+
+ type DisplayNamesType =
+ | "language"
+ | "region"
+ | "script"
+ | "calendar"
+ | "dateTimeField"
+ | "currency";
+
+ type DisplayNamesLanguageDisplay =
+ | "dialect"
+ | "standard";
+
+ interface DisplayNamesOptions {
+ localeMatcher?: RelativeTimeFormatLocaleMatcher;
+ style?: RelativeTimeFormatStyle;
+ type: DisplayNamesType;
+ languageDisplay?: DisplayNamesLanguageDisplay;
+ fallback?: DisplayNamesFallback;
+ }
+
+ interface ResolvedDisplayNamesOptions {
locale: UnicodeBCP47LocaleIdentifier;
- localeMatcher: RelativeTimeFormatLocaleMatcher;
style: RelativeTimeFormatStyle;
- type: "language" | "region" | "script" | "currency";
- fallback: "code" | "none";
+ type: DisplayNamesType;
+ fallback: DisplayNamesFallback;
+ languageDisplay?: DisplayNamesLanguageDisplay;
}
interface DisplayNames {
@@ -331,7 +366,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions).
*/
- resolvedOptions(): DisplayNamesOptions;
+ resolvedOptions(): ResolvedDisplayNamesOptions;
}
/**
@@ -352,7 +387,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames).
*/
- new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: Partial<DisplayNamesOptions>): DisplayNames;
+ new(locales: LocalesArgument, options: DisplayNamesOptions): DisplayNames;
/**
* Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
@@ -367,7 +402,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
*/
- supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: {localeMatcher: RelativeTimeFormatLocaleMatcher}): BCP47LanguageTag[];
+ supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher }): BCP47LanguageTag[];
};
}