Signature for toLocale[X]String
is missing Intl.Locale
#47802
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Help Wanted
You can do this
Milestone
Bug Report
The signature for all
toLocale[X]String()
should be changed to:toLocaleString(locales?: string | string[] | Intl.Locale | Intl.Locale[], options?: Intl.DateTimeFormatOptions): string;
See locales argument at MDN and 9.2.1 CanonicalizeLocaleList from ECMA-402.
Edit: This works in plain JavaScript.
🔎 Search Terms
toLocaleString
toLocaleDateString
toLocaleTimeString
Intl.Locale
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
🙂 Expected behavior
TS should allow for
Intl.Locale
.The text was updated successfully, but these errors were encountered: