fix(56513): Allow Intl locales to be readonly arrays (#56621)

This commit is contained in:
Rob Ballou
2023-12-13 09:07:48 -07:00
committed by GitHub
parent efc9c065a2
commit 431d3e878f
8 changed files with 181 additions and 29 deletions

View File

@@ -9,5 +9,5 @@ declare namespace Intl {
* @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[];
function getCanonicalLocales(locale?: string | readonly string[]): string[];
}

View File

@@ -30,9 +30,9 @@ declare namespace Intl {
}
interface PluralRulesConstructor {
new (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
(locales?: string | string[], options?: PluralRulesOptions): PluralRules;
supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
new (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
(locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
supportedLocalesOf(locales: string | readonly string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
}
const PluralRules: PluralRulesConstructor;