Add missing Intl.ListFormat.prototype.resolvedOptions() (#51024)

* Add missing Intl.ListFormat.prototype.resolvedOptions()

Fixes #51023

* lint
This commit is contained in:
swandir 2022-12-09 03:45:17 +03:00 committed by GitHub
parent a3dbe7dc70
commit f0f415b671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,6 +65,12 @@ declare namespace Intl {
style?: ListFormatStyle | undefined;
}
interface ResolvedListFormatOptions {
locale: string;
style: ListFormatStyle;
type: ListFormatType;
}
interface ListFormat {
/**
* Returns a string with a language-specific representation of the list.
@ -91,6 +97,15 @@ declare namespace Intl {
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/formatToParts).
*/
formatToParts(list: Iterable<string>): { type: "element" | "literal", value: string; }[];
/**
* Returns a new object with properties reflecting the locale and style
* formatting options computed during the construction of the current
* `Intl.ListFormat` object.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/resolvedOptions).
*/
resolvedOptions(): ResolvedListFormatOptions;
}
const ListFormat: {