fix: add Intl.getCanonicalLocales type definition (#56079)

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
kazuya kawaguchi
2023-11-03 10:56:44 -07:00
committed by GitHub
co-authored by Nathan Shively-Sanders
parent fd0936755b
commit 09fc67bd48
42 changed files with 332 additions and 56 deletions
+1
View File
@@ -175,6 +175,7 @@ const libEntries: [string, string][] = [
["es2015.symbol", "lib.es2015.symbol.d.ts"],
["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"],
["es2016.array.include", "lib.es2016.array.include.d.ts"],
["es2016.intl", "lib.es2016.intl.d.ts"],
["es2017.date", "lib.es2017.date.d.ts"],
["es2017.object", "lib.es2017.object.d.ts"],
["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"],
+1
View File
@@ -1,2 +1,3 @@
/// <reference lib="es2015" />
/// <reference lib="es2016.array.include" />
/// <reference lib="es2016.intl" />
+13
View File
@@ -0,0 +1,13 @@
declare namespace Intl {
/**
* The `Intl.getCanonicalLocales()` method returns an array containing
* the canonical locale names. Duplicates will be omitted and elements
* will be validated as structurally valid language tags.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales)
*
* @param locale A list of String values for which to get the canonical locale names
* @returns An array containing the canonical and validated locale names.
*/
function getCanonicalLocales(locale?: string | string[]): string[];
}
+1
View File
@@ -30,6 +30,7 @@
"es2015.symbol",
"es2015.symbol.wellknown",
"es2016.array.include",
"es2016.intl",
"es2017.date",
"es2017.object",
"es2017.sharedmemory",