Skip to content

Commit 2e7aadb

Browse files
committed
fix(48218): Split Intl.DisplayNames options
Closes microsoft#48218
1 parent 5f017df commit 2e7aadb

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/lib/es2020.intl.d.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,23 @@ declare namespace Intl {
291291
new (tag: BCP47LanguageTag | Locale, options?: LocaleOptions): Locale;
292292
};
293293

294-
interface DisplayNamesOptions {
295-
locale: UnicodeBCP47LocaleIdentifier;
294+
type DisplayNamesFallback =
295+
| "code"
296+
| "none"
297+
298+
interface DisplayNamesOptions {
296299
localeMatcher: RelativeTimeFormatLocaleMatcher;
297300
style: RelativeTimeFormatStyle;
301+
type: "calendar" | "currency" | "datetimeField" | "language" | "region" | "script";
302+
languageDisplay: "dialect" | "standard";
303+
fallback: DisplayNamesFallback;
304+
}
305+
306+
interface ResolvedDisplayNamesOptions {
307+
locale: UnicodeBCP47LocaleIdentifier;
308+
style: RelativeTimeFormatStyle;
298309
type: "language" | "region" | "script" | "currency";
299-
fallback: "code" | "none";
310+
fallback: DisplayNamesFallback;
300311
}
301312

302313
interface DisplayNames {
@@ -322,7 +333,7 @@ declare namespace Intl {
322333
*
323334
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions).
324335
*/
325-
resolvedOptions(): DisplayNamesOptions;
336+
resolvedOptions(): ResolvedDisplayNamesOptions;
326337
}
327338

328339
/**

0 commit comments

Comments
 (0)