diff --git a/src/lib/es2018.intl.d.ts b/src/lib/es2018.intl.d.ts index 9dfc84ed364de..8e0a27fe965d4 100644 --- a/src/lib/es2018.intl.d.ts +++ b/src/lib/es2018.intl.d.ts @@ -29,12 +29,13 @@ declare namespace Intl { select(n: number): LDMLPluralRule; } - const PluralRules: { + 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[]; - }; + } + + const PluralRules: PluralRulesConstructor; // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here: type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name"; diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index 550edaaa6c848..d63508249ddcb 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -1,9 +1,11 @@ /// declare namespace Intl { /** - * [Unicode BCP 47 Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers) definition. + * A string that is a valid [Unicode BCP 47 Locale Identifier](https://unicode.org/reports/tr35/#Unicode_locale_identifier). * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). + * For example: "fa", "es-MX", "zh-Hant-TW". + * + * See [MDN - Intl - locales argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). */ type UnicodeBCP47LocaleIdentifier = string; @@ -71,16 +73,9 @@ declare namespace Intl { type RelativeTimeFormatStyle = "long" | "short" | "narrow"; /** - * [BCP 47 language tag](http://tools.ietf.org/html/rfc5646) definition. + * The locale or locales to use * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). - */ - type BCP47LanguageTag = string; - - /** - * The locale(s) to use - * - * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). + * See [MDN - Intl - locales argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). */ type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | readonly (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined; @@ -200,7 +195,7 @@ declare namespace Intl { * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat). */ new ( - locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[], + locales?: LocalesArgument, options?: RelativeTimeFormatOptions, ): RelativeTimeFormat; @@ -223,7 +218,7 @@ declare namespace Intl { * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf). */ supportedLocalesOf( - locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[], + locales?: LocalesArgument, options?: RelativeTimeFormatOptions, ): UnicodeBCP47LocaleIdentifier[]; }; @@ -294,7 +289,7 @@ declare namespace Intl { /** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */ minimize(): Locale; /** Returns the locale's full locale identifier string. */ - toString(): BCP47LanguageTag; + toString(): UnicodeBCP47LocaleIdentifier; } /** @@ -312,7 +307,7 @@ declare namespace Intl { * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale). */ const Locale: { - new (tag: BCP47LanguageTag | Locale, options?: LocaleOptions): Locale; + new (tag: UnicodeBCP47LocaleIdentifier | Locale, options?: LocaleOptions): Locale; }; type DisplayNamesFallback = @@ -406,6 +401,31 @@ declare namespace Intl { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf). */ - supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): BCP47LanguageTag[]; + supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[]; }; + + interface CollatorConstructor { + new (locales?: LocalesArgument, options?: CollatorOptions): Collator; + (locales?: LocalesArgument, options?: CollatorOptions): Collator; + supportedLocalesOf(locales: LocalesArgument, options?: CollatorOptions): string[]; + } + + interface DateTimeFormatConstructor { + new (locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat; + (locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat; + supportedLocalesOf(locales: LocalesArgument, options?: DateTimeFormatOptions): string[]; + } + + interface NumberFormatConstructor { + new (locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat; + (locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat; + supportedLocalesOf(locales: LocalesArgument, options?: NumberFormatOptions): string[]; + } + + interface PluralRulesConstructor { + new (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules; + (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules; + + supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; + } } diff --git a/src/lib/es2020.string.d.ts b/src/lib/es2020.string.d.ts index 382bc75595e92..1602ac7b10f01 100644 --- a/src/lib/es2020.string.d.ts +++ b/src/lib/es2020.string.d.ts @@ -7,4 +7,18 @@ interface String { * @param regexp A variable name or string literal containing the regular expression pattern and flags. */ matchAll(regexp: RegExp): IterableIterator; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(locales?: Intl.LocalesArgument): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(locales?: Intl.LocalesArgument): string; + + /** + * Determines whether two strings are equivalent in the current or specified locale. + * @param that String to compare to target string + * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number; } diff --git a/src/lib/es2021.intl.d.ts b/src/lib/es2021.intl.d.ts index b3835b8b1ff04..1566a7353f8dd 100644 --- a/src/lib/es2021.intl.d.ts +++ b/src/lib/es2021.intl.d.ts @@ -125,7 +125,7 @@ declare namespace Intl { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat). */ - new (locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: ListFormatOptions): ListFormat; + new (locales?: LocalesArgument, options?: ListFormatOptions): ListFormat; /** * Returns an array containing those of the provided locales that are @@ -143,6 +143,6 @@ declare namespace Intl { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf). */ - supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick): BCP47LanguageTag[]; + supportedLocalesOf(locales: LocalesArgument, options?: Pick): UnicodeBCP47LocaleIdentifier[]; }; } diff --git a/src/lib/es2022.intl.d.ts b/src/lib/es2022.intl.d.ts index 7ed03b05e07ca..3beaea6af8ddd 100644 --- a/src/lib/es2022.intl.d.ts +++ b/src/lib/es2022.intl.d.ts @@ -71,7 +71,7 @@ declare namespace Intl { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter). */ - new (locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter; + new (locales?: LocalesArgument, options?: SegmenterOptions): Segmenter; /** * Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. @@ -85,7 +85,7 @@ declare namespace Intl { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf) */ - supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick): BCP47LanguageTag[]; + supportedLocalesOf(locales: LocalesArgument, options?: Pick): UnicodeBCP47LocaleIdentifier[]; }; /** diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 8065e2d3de83c..f3df23047022d 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -4400,11 +4400,14 @@ declare namespace Intl { compare(x: string, y: string): number; resolvedOptions(): ResolvedCollatorOptions; } - var Collator: { + + interface CollatorConstructor { new (locales?: string | string[], options?: CollatorOptions): Collator; (locales?: string | string[], options?: CollatorOptions): Collator; supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[]; - }; + } + + var Collator: CollatorConstructor; interface NumberFormatOptions { localeMatcher?: string | undefined; @@ -4436,12 +4439,15 @@ declare namespace Intl { format(value: number): string; resolvedOptions(): ResolvedNumberFormatOptions; } - var NumberFormat: { + + interface NumberFormatConstructor { new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; (locales?: string | string[], options?: NumberFormatOptions): NumberFormat; supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[]; readonly prototype: NumberFormat; - }; + } + + var NumberFormat: NumberFormatConstructor; interface DateTimeFormatOptions { localeMatcher?: "best fit" | "lookup" | undefined; @@ -4480,12 +4486,15 @@ declare namespace Intl { format(date?: Date | number): string; resolvedOptions(): ResolvedDateTimeFormatOptions; } - var DateTimeFormat: { + + interface DateTimeFormatConstructor { new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[]; readonly prototype: DateTimeFormat; - }; + } + + var DateTimeFormat: DateTimeFormatConstructor; } interface String { diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols index 43802d659323c..82aede47ba9b7 100644 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols +++ b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.symbols @@ -2,19 +2,19 @@ === DateTimeFormatAndNumberFormatES2021.ts === Intl.NumberFormat.prototype.formatRange ->Intl.NumberFormat.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Intl.NumberFormat.prototype : Symbol(Intl.NumberFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) >Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) >NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(Intl.NumberFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) Intl.DateTimeFormat.prototype.formatRange >Intl.DateTimeFormat.prototype.formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) ->Intl.DateTimeFormat.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Intl.DateTimeFormat.prototype : Symbol(Intl.DateTimeFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) >Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) >DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) ->prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>prototype : Symbol(Intl.DateTimeFormatConstructor.prototype, Decl(lib.es5.d.ts, --, --)) >formatRange : Symbol(Intl.DateTimeFormat.formatRange, Decl(lib.es2021.intl.d.ts, --, --)) new Intl.NumberFormat().formatRange diff --git a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types index 51ec4fc0d8a1c..e499924e25857 100644 --- a/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types +++ b/tests/baselines/reference/DateTimeFormatAndNumberFormatES2021.types @@ -4,50 +4,50 @@ Intl.NumberFormat.prototype.formatRange >Intl.NumberFormat.prototype.formatRange : any >Intl.NumberFormat.prototype : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >prototype : Intl.NumberFormat >formatRange : any Intl.DateTimeFormat.prototype.formatRange >Intl.DateTimeFormat.prototype.formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string >Intl.DateTimeFormat.prototype : Intl.DateTimeFormat ->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor >Intl : typeof Intl ->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>DateTimeFormat : Intl.DateTimeFormatConstructor >prototype : Intl.DateTimeFormat >formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string new Intl.NumberFormat().formatRange >new Intl.NumberFormat().formatRange : any >new Intl.NumberFormat() : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >formatRange : any new Intl.NumberFormat().formatRangeToParts >new Intl.NumberFormat().formatRangeToParts : any >new Intl.NumberFormat() : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >formatRangeToParts : any new Intl.DateTimeFormat().formatRange >new Intl.DateTimeFormat().formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string >new Intl.DateTimeFormat() : Intl.DateTimeFormat ->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor >Intl : typeof Intl ->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>DateTimeFormat : Intl.DateTimeFormatConstructor >formatRange : (startDate: number | bigint | Date, endDate: number | bigint | Date) => string new Intl.DateTimeFormat().formatRangeToParts >new Intl.DateTimeFormat().formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] >new Intl.DateTimeFormat() : Intl.DateTimeFormat ->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor >Intl : typeof Intl ->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>DateTimeFormat : Intl.DateTimeFormatConstructor >formatRangeToParts : (startDate: number | bigint | Date, endDate: number | bigint | Date) => Intl.DateTimeRangeFormatPart[] diff --git a/tests/baselines/reference/bigintWithLib.types b/tests/baselines/reference/bigintWithLib.types index 659ef454134f8..52f029d8cd577 100644 --- a/tests/baselines/reference/bigintWithLib.types +++ b/tests/baselines/reference/bigintWithLib.types @@ -392,9 +392,9 @@ new Intl.NumberFormat("fr").format(3000n); >new Intl.NumberFormat("fr").format(3000n) : string >new Intl.NumberFormat("fr").format : { (value: number): string; (value: number | bigint): string; } >new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >"fr" : "fr" >format : { (value: number): string; (value: number | bigint): string; } >3000n : 3000n @@ -403,9 +403,9 @@ new Intl.NumberFormat("fr").format(bigintVal); >new Intl.NumberFormat("fr").format(bigintVal) : string >new Intl.NumberFormat("fr").format : { (value: number): string; (value: number | bigint): string; } >new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >"fr" : "fr" >format : { (value: number): string; (value: number | bigint): string; } >bigintVal : bigint diff --git a/tests/baselines/reference/bigintWithoutLib.types b/tests/baselines/reference/bigintWithoutLib.types index 8935093c1338b..6789435ca906c 100644 --- a/tests/baselines/reference/bigintWithoutLib.types +++ b/tests/baselines/reference/bigintWithoutLib.types @@ -376,9 +376,9 @@ new Intl.NumberFormat("fr").format(3000n); >new Intl.NumberFormat("fr").format(3000n) : string >new Intl.NumberFormat("fr").format : (value: number) => string >new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >"fr" : "fr" >format : (value: number) => string >3000n : 3000n @@ -387,9 +387,9 @@ new Intl.NumberFormat("fr").format(bigintVal); >new Intl.NumberFormat("fr").format(bigintVal) : string >new Intl.NumberFormat("fr").format : (value: number) => string >new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >"fr" : "fr" >format : (value: number) => string >bigintVal : bigint diff --git a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types index ef5b52309ec8e..c24c8846bc11e 100644 --- a/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types +++ b/tests/baselines/reference/doYouNeedToChangeYourTargetLibraryES2016Plus.types @@ -57,9 +57,9 @@ const testIntlFormatToParts = new Intl.DateTimeFormat("en-US").formatToParts(); >new Intl.DateTimeFormat("en-US").formatToParts() : any >new Intl.DateTimeFormat("en-US").formatToParts : any >new Intl.DateTimeFormat("en-US") : Intl.DateTimeFormat ->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor >Intl : typeof Intl ->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>DateTimeFormat : Intl.DateTimeFormatConstructor >"en-US" : "en-US" >formatToParts : any @@ -150,9 +150,9 @@ const testNumberFormatFormatToParts = new Intl.NumberFormat("en-US").formatToPar >new Intl.NumberFormat("en-US").formatToParts() : any >new Intl.NumberFormat("en-US").formatToParts : any >new Intl.NumberFormat("en-US") : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >"en-US" : "en-US" >formatToParts : any diff --git a/tests/baselines/reference/es2018IntlAPIs.symbols b/tests/baselines/reference/es2018IntlAPIs.symbols index c76cf73671b18..56fe5b94adbb3 100644 --- a/tests/baselines/reference/es2018IntlAPIs.symbols +++ b/tests/baselines/reference/es2018IntlAPIs.symbols @@ -16,11 +16,11 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >Intl.PluralRules.supportedLocalesOf(locales, options).join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) ->Intl.PluralRules.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --)) +>Intl.PluralRules.supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --)) >Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) >Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) >PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) ->supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --)) >locales : Symbol(locales, Decl(es2018IntlAPIs.ts, 2, 5)) >options : Symbol(options, Decl(es2018IntlAPIs.ts, 3, 5)) >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/es2018IntlAPIs.types b/tests/baselines/reference/es2018IntlAPIs.types index 1de5c1cc79a25..b9631962c97d5 100644 --- a/tests/baselines/reference/es2018IntlAPIs.types +++ b/tests/baselines/reference/es2018IntlAPIs.types @@ -26,9 +26,9 @@ console.log(Intl.PluralRules.supportedLocalesOf(locales, options).join(', ')); >Intl.PluralRules.supportedLocalesOf(locales, options).join : (separator?: string) => string >Intl.PluralRules.supportedLocalesOf(locales, options) : string[] >Intl.PluralRules.supportedLocalesOf : (locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }) => string[] ->Intl.PluralRules : { (locales?: string | string[], options?: Intl.PluralRulesOptions): Intl.PluralRules; new (locales?: string | string[], options?: Intl.PluralRulesOptions): Intl.PluralRules; supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; } +>Intl.PluralRules : Intl.PluralRulesConstructor >Intl : typeof Intl ->PluralRules : { (locales?: string | string[], options?: Intl.PluralRulesOptions): Intl.PluralRules; new (locales?: string | string[], options?: Intl.PluralRulesOptions): Intl.PluralRules; supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; } +>PluralRules : Intl.PluralRulesConstructor >supportedLocalesOf : (locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }) => string[] >locales : string[] >options : { readonly localeMatcher: "lookup"; } diff --git a/tests/baselines/reference/es2020IntlAPIs.types b/tests/baselines/reference/es2020IntlAPIs.types index 598446d7edaae..686d7e1d13777 100644 --- a/tests/baselines/reference/es2020IntlAPIs.types +++ b/tests/baselines/reference/es2020IntlAPIs.types @@ -27,18 +27,18 @@ function log(locale: string) { >new Intl.DateTimeFormat(locale).format(date) : string >new Intl.DateTimeFormat(locale).format : (date?: number | Date) => string >new Intl.DateTimeFormat(locale) : Intl.DateTimeFormat ->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor >Intl : typeof Intl ->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>DateTimeFormat : Intl.DateTimeFormatConstructor >locale : string >format : (date?: number | Date) => string >date : Date >new Intl.NumberFormat(locale).format(count) : string >new Intl.NumberFormat(locale).format : { (value: number): string; (value: number | bigint): string; } >new Intl.NumberFormat(locale) : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >locale : string >format : { (value: number): string; (value: number | bigint): string; } >count : 26254.39 @@ -64,9 +64,9 @@ log("de-DE"); const rtf1 = new Intl.RelativeTimeFormat('en', { style: 'narrow' }); >rtf1 : Intl.RelativeTimeFormat >new Intl.RelativeTimeFormat('en', { style: 'narrow' }) : Intl.RelativeTimeFormat ->Intl.RelativeTimeFormat : { new (locales?: string | string[], options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: string | string[], options?: Intl.RelativeTimeFormatOptions): string[]; } +>Intl.RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } >Intl : typeof Intl ->RelativeTimeFormat : { new (locales?: string | string[], options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: string | string[], options?: Intl.RelativeTimeFormatOptions): string[]; } +>RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } >'en' : "en" >{ style: 'narrow' } : { style: "narrow"; } >style : "narrow" @@ -104,9 +104,9 @@ console.log(rtf1.format(-1, 'day')); const rtf2 = new Intl.RelativeTimeFormat('es', { numeric: 'auto' }); >rtf2 : Intl.RelativeTimeFormat >new Intl.RelativeTimeFormat('es', { numeric: 'auto' }) : Intl.RelativeTimeFormat ->Intl.RelativeTimeFormat : { new (locales?: string | string[], options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: string | string[], options?: Intl.RelativeTimeFormatOptions): string[]; } +>Intl.RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } >Intl : typeof Intl ->RelativeTimeFormat : { new (locales?: string | string[], options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: string | string[], options?: Intl.RelativeTimeFormatOptions): string[]; } +>RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } >'es' : "es" >{ numeric: 'auto' } : { numeric: "auto"; } >numeric : "auto" diff --git a/tests/baselines/reference/es2021LocalesObjectArgument.js b/tests/baselines/reference/es2021LocalesObjectArgument.js new file mode 100644 index 0000000000000..4287c3f534793 --- /dev/null +++ b/tests/baselines/reference/es2021LocalesObjectArgument.js @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/es2021/es2021LocalesObjectArgument.ts] //// + +//// [es2021LocalesObjectArgument.ts] +const enUS = new Intl.Locale("en-US"); +const deDE = new Intl.Locale("de-DE"); +const jaJP = new Intl.Locale("ja-JP"); + +new Intl.ListFormat(enUS); +new Intl.ListFormat([deDE, jaJP]); +Intl.ListFormat.supportedLocalesOf(enUS); +Intl.ListFormat.supportedLocalesOf([deDE, jaJP]); + + +//// [es2021LocalesObjectArgument.js] +const enUS = new Intl.Locale("en-US"); +const deDE = new Intl.Locale("de-DE"); +const jaJP = new Intl.Locale("ja-JP"); +new Intl.ListFormat(enUS); +new Intl.ListFormat([deDE, jaJP]); +Intl.ListFormat.supportedLocalesOf(enUS); +Intl.ListFormat.supportedLocalesOf([deDE, jaJP]); diff --git a/tests/baselines/reference/es2021LocalesObjectArgument.symbols b/tests/baselines/reference/es2021LocalesObjectArgument.symbols new file mode 100644 index 0000000000000..877746c916e94 --- /dev/null +++ b/tests/baselines/reference/es2021LocalesObjectArgument.symbols @@ -0,0 +1,51 @@ +//// [tests/cases/conformance/es2021/es2021LocalesObjectArgument.ts] //// + +=== es2021LocalesObjectArgument.ts === +const enUS = new Intl.Locale("en-US"); +>enUS : Symbol(enUS, Decl(es2021LocalesObjectArgument.ts, 0, 5)) +>Intl.Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) + +const deDE = new Intl.Locale("de-DE"); +>deDE : Symbol(deDE, Decl(es2021LocalesObjectArgument.ts, 1, 5)) +>Intl.Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) + +const jaJP = new Intl.Locale("ja-JP"); +>jaJP : Symbol(jaJP, Decl(es2021LocalesObjectArgument.ts, 2, 5)) +>Intl.Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) + +new Intl.ListFormat(enUS); +>Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(es2021LocalesObjectArgument.ts, 0, 5)) + +new Intl.ListFormat([deDE, jaJP]); +>Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(es2021LocalesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(es2021LocalesObjectArgument.ts, 2, 5)) + +Intl.ListFormat.supportedLocalesOf(enUS); +>Intl.ListFormat.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2021.intl.d.ts, --, --)) +>Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2021.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(es2021LocalesObjectArgument.ts, 0, 5)) + +Intl.ListFormat.supportedLocalesOf([deDE, jaJP]); +>Intl.ListFormat.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2021.intl.d.ts, --, --)) +>Intl.ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 3 more) +>ListFormat : Symbol(Intl.ListFormat, Decl(lib.es2021.intl.d.ts, --, --), Decl(lib.es2021.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2021.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(es2021LocalesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(es2021LocalesObjectArgument.ts, 2, 5)) + diff --git a/tests/baselines/reference/es2021LocalesObjectArgument.types b/tests/baselines/reference/es2021LocalesObjectArgument.types new file mode 100644 index 0000000000000..85014f03fc5e6 --- /dev/null +++ b/tests/baselines/reference/es2021LocalesObjectArgument.types @@ -0,0 +1,63 @@ +//// [tests/cases/conformance/es2021/es2021LocalesObjectArgument.ts] //// + +=== es2021LocalesObjectArgument.ts === +const enUS = new Intl.Locale("en-US"); +>enUS : Intl.Locale +>new Intl.Locale("en-US") : Intl.Locale +>Intl.Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>Intl : typeof Intl +>Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>"en-US" : "en-US" + +const deDE = new Intl.Locale("de-DE"); +>deDE : Intl.Locale +>new Intl.Locale("de-DE") : Intl.Locale +>Intl.Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>Intl : typeof Intl +>Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>"de-DE" : "de-DE" + +const jaJP = new Intl.Locale("ja-JP"); +>jaJP : Intl.Locale +>new Intl.Locale("ja-JP") : Intl.Locale +>Intl.Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>Intl : typeof Intl +>Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>"ja-JP" : "ja-JP" + +new Intl.ListFormat(enUS); +>new Intl.ListFormat(enUS) : Intl.ListFormat +>Intl.ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>Intl : typeof Intl +>ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>enUS : Intl.Locale + +new Intl.ListFormat([deDE, jaJP]); +>new Intl.ListFormat([deDE, jaJP]) : Intl.ListFormat +>Intl.ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>Intl : typeof Intl +>ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +Intl.ListFormat.supportedLocalesOf(enUS); +>Intl.ListFormat.supportedLocalesOf(enUS) : string[] +>Intl.ListFormat.supportedLocalesOf : (locales: Intl.LocalesArgument, options?: Pick) => string[] +>Intl.ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>Intl : typeof Intl +>ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>supportedLocalesOf : (locales: Intl.LocalesArgument, options?: Pick) => string[] +>enUS : Intl.Locale + +Intl.ListFormat.supportedLocalesOf([deDE, jaJP]); +>Intl.ListFormat.supportedLocalesOf([deDE, jaJP]) : string[] +>Intl.ListFormat.supportedLocalesOf : (locales: Intl.LocalesArgument, options?: Pick) => string[] +>Intl.ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>Intl : typeof Intl +>ListFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.ListFormatOptions): Intl.ListFormat; prototype: Intl.ListFormat; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>supportedLocalesOf : (locales: Intl.LocalesArgument, options?: Pick) => string[] +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + diff --git a/tests/baselines/reference/es2022IntlAPIs.types b/tests/baselines/reference/es2022IntlAPIs.types index 74d524e218fba..ac0c770abeb85 100644 --- a/tests/baselines/reference/es2022IntlAPIs.types +++ b/tests/baselines/reference/es2022IntlAPIs.types @@ -20,9 +20,9 @@ for (const zoneName of timezoneNames) { var formatter = new Intl.DateTimeFormat('en-US', { >formatter : Intl.DateTimeFormat >new Intl.DateTimeFormat('en-US', { timeZone: 'America/Los_Angeles', timeZoneName: zoneName, }) : Intl.DateTimeFormat ->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor >Intl : typeof Intl ->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>DateTimeFormat : Intl.DateTimeFormatConstructor >'en-US' : "en-US" >{ timeZone: 'America/Los_Angeles', timeZoneName: zoneName, } : { timeZone: string; timeZoneName: "short" | "long" | "shortOffset" | "longOffset" | "shortGeneric" | "longGeneric"; } diff --git a/tests/baselines/reference/es2022LocalesObjectArgument.js b/tests/baselines/reference/es2022LocalesObjectArgument.js new file mode 100644 index 0000000000000..335b921f8222a --- /dev/null +++ b/tests/baselines/reference/es2022LocalesObjectArgument.js @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/es2022/es2022LocalesObjectArgument.ts] //// + +//// [es2022LocalesObjectArgument.ts] +const enUS = new Intl.Locale("en-US"); +const deDE = new Intl.Locale("de-DE"); +const jaJP = new Intl.Locale("ja-JP"); + +new Intl.Segmenter(enUS); +new Intl.Segmenter([deDE, jaJP]); +Intl.Segmenter.supportedLocalesOf(enUS); +Intl.Segmenter.supportedLocalesOf([deDE, jaJP]); + + +//// [es2022LocalesObjectArgument.js] +const enUS = new Intl.Locale("en-US"); +const deDE = new Intl.Locale("de-DE"); +const jaJP = new Intl.Locale("ja-JP"); +new Intl.Segmenter(enUS); +new Intl.Segmenter([deDE, jaJP]); +Intl.Segmenter.supportedLocalesOf(enUS); +Intl.Segmenter.supportedLocalesOf([deDE, jaJP]); diff --git a/tests/baselines/reference/es2022LocalesObjectArgument.symbols b/tests/baselines/reference/es2022LocalesObjectArgument.symbols new file mode 100644 index 0000000000000..41adb92a2aee8 --- /dev/null +++ b/tests/baselines/reference/es2022LocalesObjectArgument.symbols @@ -0,0 +1,51 @@ +//// [tests/cases/conformance/es2022/es2022LocalesObjectArgument.ts] //// + +=== es2022LocalesObjectArgument.ts === +const enUS = new Intl.Locale("en-US"); +>enUS : Symbol(enUS, Decl(es2022LocalesObjectArgument.ts, 0, 5)) +>Intl.Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 4 more) +>Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) + +const deDE = new Intl.Locale("de-DE"); +>deDE : Symbol(deDE, Decl(es2022LocalesObjectArgument.ts, 1, 5)) +>Intl.Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 4 more) +>Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) + +const jaJP = new Intl.Locale("ja-JP"); +>jaJP : Symbol(jaJP, Decl(es2022LocalesObjectArgument.ts, 2, 5)) +>Intl.Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 4 more) +>Locale : Symbol(Intl.Locale, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) + +new Intl.Segmenter(enUS); +>Intl.Segmenter : Symbol(Intl.Segmenter, Decl(lib.es2022.intl.d.ts, --, --), Decl(lib.es2022.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 4 more) +>Segmenter : Symbol(Intl.Segmenter, Decl(lib.es2022.intl.d.ts, --, --), Decl(lib.es2022.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(es2022LocalesObjectArgument.ts, 0, 5)) + +new Intl.Segmenter([deDE, jaJP]); +>Intl.Segmenter : Symbol(Intl.Segmenter, Decl(lib.es2022.intl.d.ts, --, --), Decl(lib.es2022.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 4 more) +>Segmenter : Symbol(Intl.Segmenter, Decl(lib.es2022.intl.d.ts, --, --), Decl(lib.es2022.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(es2022LocalesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(es2022LocalesObjectArgument.ts, 2, 5)) + +Intl.Segmenter.supportedLocalesOf(enUS); +>Intl.Segmenter.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2022.intl.d.ts, --, --)) +>Intl.Segmenter : Symbol(Intl.Segmenter, Decl(lib.es2022.intl.d.ts, --, --), Decl(lib.es2022.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 4 more) +>Segmenter : Symbol(Intl.Segmenter, Decl(lib.es2022.intl.d.ts, --, --), Decl(lib.es2022.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2022.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(es2022LocalesObjectArgument.ts, 0, 5)) + +Intl.Segmenter.supportedLocalesOf([deDE, jaJP]); +>Intl.Segmenter.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2022.intl.d.ts, --, --)) +>Intl.Segmenter : Symbol(Intl.Segmenter, Decl(lib.es2022.intl.d.ts, --, --), Decl(lib.es2022.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 4 more) +>Segmenter : Symbol(Intl.Segmenter, Decl(lib.es2022.intl.d.ts, --, --), Decl(lib.es2022.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2022.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(es2022LocalesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(es2022LocalesObjectArgument.ts, 2, 5)) + diff --git a/tests/baselines/reference/es2022LocalesObjectArgument.types b/tests/baselines/reference/es2022LocalesObjectArgument.types new file mode 100644 index 0000000000000..caf2b02231698 --- /dev/null +++ b/tests/baselines/reference/es2022LocalesObjectArgument.types @@ -0,0 +1,63 @@ +//// [tests/cases/conformance/es2022/es2022LocalesObjectArgument.ts] //// + +=== es2022LocalesObjectArgument.ts === +const enUS = new Intl.Locale("en-US"); +>enUS : Intl.Locale +>new Intl.Locale("en-US") : Intl.Locale +>Intl.Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>Intl : typeof Intl +>Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>"en-US" : "en-US" + +const deDE = new Intl.Locale("de-DE"); +>deDE : Intl.Locale +>new Intl.Locale("de-DE") : Intl.Locale +>Intl.Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>Intl : typeof Intl +>Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>"de-DE" : "de-DE" + +const jaJP = new Intl.Locale("ja-JP"); +>jaJP : Intl.Locale +>new Intl.Locale("ja-JP") : Intl.Locale +>Intl.Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>Intl : typeof Intl +>Locale : new (tag: string | Intl.Locale, options?: Intl.LocaleOptions) => Intl.Locale +>"ja-JP" : "ja-JP" + +new Intl.Segmenter(enUS); +>new Intl.Segmenter(enUS) : Intl.Segmenter +>Intl.Segmenter : { new (locales?: Intl.LocalesArgument, options?: Intl.SegmenterOptions): Intl.Segmenter; prototype: Intl.Segmenter; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>Intl : typeof Intl +>Segmenter : { new (locales?: Intl.LocalesArgument, options?: Intl.SegmenterOptions): Intl.Segmenter; prototype: Intl.Segmenter; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>enUS : Intl.Locale + +new Intl.Segmenter([deDE, jaJP]); +>new Intl.Segmenter([deDE, jaJP]) : Intl.Segmenter +>Intl.Segmenter : { new (locales?: Intl.LocalesArgument, options?: Intl.SegmenterOptions): Intl.Segmenter; prototype: Intl.Segmenter; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>Intl : typeof Intl +>Segmenter : { new (locales?: Intl.LocalesArgument, options?: Intl.SegmenterOptions): Intl.Segmenter; prototype: Intl.Segmenter; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +Intl.Segmenter.supportedLocalesOf(enUS); +>Intl.Segmenter.supportedLocalesOf(enUS) : string[] +>Intl.Segmenter.supportedLocalesOf : (locales: Intl.LocalesArgument, options?: Pick) => string[] +>Intl.Segmenter : { new (locales?: Intl.LocalesArgument, options?: Intl.SegmenterOptions): Intl.Segmenter; prototype: Intl.Segmenter; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>Intl : typeof Intl +>Segmenter : { new (locales?: Intl.LocalesArgument, options?: Intl.SegmenterOptions): Intl.Segmenter; prototype: Intl.Segmenter; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>supportedLocalesOf : (locales: Intl.LocalesArgument, options?: Pick) => string[] +>enUS : Intl.Locale + +Intl.Segmenter.supportedLocalesOf([deDE, jaJP]); +>Intl.Segmenter.supportedLocalesOf([deDE, jaJP]) : string[] +>Intl.Segmenter.supportedLocalesOf : (locales: Intl.LocalesArgument, options?: Pick) => string[] +>Intl.Segmenter : { new (locales?: Intl.LocalesArgument, options?: Intl.SegmenterOptions): Intl.Segmenter; prototype: Intl.Segmenter; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>Intl : typeof Intl +>Segmenter : { new (locales?: Intl.LocalesArgument, options?: Intl.SegmenterOptions): Intl.Segmenter; prototype: Intl.Segmenter; supportedLocalesOf(locales: Intl.LocalesArgument, options?: Pick): string[]; } +>supportedLocalesOf : (locales: Intl.LocalesArgument, options?: Pick) => string[] +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + diff --git a/tests/baselines/reference/formatToPartsBigInt.types b/tests/baselines/reference/formatToPartsBigInt.types index 57a175802cc2a..3b42619f102e0 100644 --- a/tests/baselines/reference/formatToPartsBigInt.types +++ b/tests/baselines/reference/formatToPartsBigInt.types @@ -8,9 +8,9 @@ new Intl.NumberFormat("fr").formatToParts(3000n); >new Intl.NumberFormat("fr").formatToParts(3000n) : Intl.NumberFormatPart[] >new Intl.NumberFormat("fr").formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] >new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >"fr" : "fr" >formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] >3000n : 3000n @@ -19,9 +19,9 @@ new Intl.NumberFormat("fr").formatToParts(BigInt(123)); >new Intl.NumberFormat("fr").formatToParts(BigInt(123)) : Intl.NumberFormatPart[] >new Intl.NumberFormat("fr").formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] >new Intl.NumberFormat("fr") : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; new (locales?: string | string[], options?: Intl.NumberFormatOptions): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >"fr" : "fr" >formatToParts : (number?: number | bigint) => Intl.NumberFormatPart[] >BigInt(123) : bigint diff --git a/tests/baselines/reference/formatToPartsFractionalSecond.types b/tests/baselines/reference/formatToPartsFractionalSecond.types index 952d5c5144798..f25c5d22c9124 100644 --- a/tests/baselines/reference/formatToPartsFractionalSecond.types +++ b/tests/baselines/reference/formatToPartsFractionalSecond.types @@ -7,9 +7,9 @@ new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractional >new Intl.DateTimeFormat().formatToParts() : Intl.DateTimeFormatPart[] >new Intl.DateTimeFormat().formatToParts : (date?: number | Date) => Intl.DateTimeFormatPart[] >new Intl.DateTimeFormat() : Intl.DateTimeFormat ->Intl.DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor >Intl : typeof Intl ->DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } +>DateTimeFormat : Intl.DateTimeFormatConstructor >formatToParts : (date?: number | Date) => Intl.DateTimeFormatPart[] >find : { (predicate: (value: Intl.DateTimeFormatPart, index: number, obj: Intl.DateTimeFormatPart[]) => value is S, thisArg?: any): S; (predicate: (value: Intl.DateTimeFormatPart, index: number, obj: Intl.DateTimeFormatPart[]) => unknown, thisArg?: any): Intl.DateTimeFormatPart; } >(val) => val.type === 'fractionalSecond' : (val: Intl.DateTimeFormatPart) => boolean diff --git a/tests/baselines/reference/localesObjectArgument.js b/tests/baselines/reference/localesObjectArgument.js index 1136ea6364ebd..59a1ddaa9d370 100644 --- a/tests/baselines/reference/localesObjectArgument.js +++ b/tests/baselines/reference/localesObjectArgument.js @@ -8,6 +8,7 @@ const jaJP = new Intl.Locale("ja-JP"); const now = new Date(); const num = 1000; const bigint = 123456789123456789n; +const str = ""; now.toLocaleString(enUS); now.toLocaleDateString(enUS); @@ -21,6 +22,38 @@ num.toLocaleString([deDE, jaJP]); bigint.toLocaleString(enUS); bigint.toLocaleString([deDE, jaJP]); + +str.toLocaleLowerCase(enUS); +str.toLocaleLowerCase([deDE, jaJP]); +str.toLocaleUpperCase(enUS); +str.toLocaleUpperCase([deDE, jaJP]); +str.localeCompare(str, enUS); +str.localeCompare(str, [deDE, jaJP]); + +new Intl.PluralRules(enUS); +new Intl.PluralRules([deDE, jaJP]); +Intl.PluralRules.supportedLocalesOf(enUS); +Intl.PluralRules.supportedLocalesOf([deDE, jaJP]); + +new Intl.RelativeTimeFormat(enUS); +new Intl.RelativeTimeFormat([deDE, jaJP]); +Intl.RelativeTimeFormat.supportedLocalesOf(enUS); +Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]); + +new Intl.Collator(enUS); +new Intl.Collator([deDE, jaJP]); +Intl.Collator.supportedLocalesOf(enUS); +Intl.Collator.supportedLocalesOf([deDE, jaJP]); + +new Intl.DateTimeFormat(enUS); +new Intl.DateTimeFormat([deDE, jaJP]); +Intl.DateTimeFormat.supportedLocalesOf(enUS); +Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]); + +new Intl.NumberFormat(enUS); +new Intl.NumberFormat([deDE, jaJP]); +Intl.NumberFormat.supportedLocalesOf(enUS); +Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]); //// [localesObjectArgument.js] @@ -30,6 +63,7 @@ const jaJP = new Intl.Locale("ja-JP"); const now = new Date(); const num = 1000; const bigint = 123456789123456789n; +const str = ""; now.toLocaleString(enUS); now.toLocaleDateString(enUS); now.toLocaleTimeString(enUS); @@ -40,3 +74,29 @@ num.toLocaleString(enUS); num.toLocaleString([deDE, jaJP]); bigint.toLocaleString(enUS); bigint.toLocaleString([deDE, jaJP]); +str.toLocaleLowerCase(enUS); +str.toLocaleLowerCase([deDE, jaJP]); +str.toLocaleUpperCase(enUS); +str.toLocaleUpperCase([deDE, jaJP]); +str.localeCompare(str, enUS); +str.localeCompare(str, [deDE, jaJP]); +new Intl.PluralRules(enUS); +new Intl.PluralRules([deDE, jaJP]); +Intl.PluralRules.supportedLocalesOf(enUS); +Intl.PluralRules.supportedLocalesOf([deDE, jaJP]); +new Intl.RelativeTimeFormat(enUS); +new Intl.RelativeTimeFormat([deDE, jaJP]); +Intl.RelativeTimeFormat.supportedLocalesOf(enUS); +Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]); +new Intl.Collator(enUS); +new Intl.Collator([deDE, jaJP]); +Intl.Collator.supportedLocalesOf(enUS); +Intl.Collator.supportedLocalesOf([deDE, jaJP]); +new Intl.DateTimeFormat(enUS); +new Intl.DateTimeFormat([deDE, jaJP]); +Intl.DateTimeFormat.supportedLocalesOf(enUS); +Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]); +new Intl.NumberFormat(enUS); +new Intl.NumberFormat([deDE, jaJP]); +Intl.NumberFormat.supportedLocalesOf(enUS); +Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]); diff --git a/tests/baselines/reference/localesObjectArgument.symbols b/tests/baselines/reference/localesObjectArgument.symbols index 7b8e692cadfd6..c2c21e668249e 100644 --- a/tests/baselines/reference/localesObjectArgument.symbols +++ b/tests/baselines/reference/localesObjectArgument.symbols @@ -29,6 +29,9 @@ const num = 1000; const bigint = 123456789123456789n; >bigint : Symbol(bigint, Decl(localesObjectArgument.ts, 6, 5)) +const str = ""; +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) + now.toLocaleString(enUS); >now.toLocaleString : Symbol(Date.toLocaleString, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.date.d.ts, --, --)) >now : Symbol(now, Decl(localesObjectArgument.ts, 4, 5)) @@ -94,3 +97,194 @@ bigint.toLocaleString([deDE, jaJP]); >deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) >jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) +str.toLocaleLowerCase(enUS); +>str.toLocaleLowerCase : Symbol(String.toLocaleLowerCase, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) +>toLocaleLowerCase : Symbol(String.toLocaleLowerCase, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +str.toLocaleLowerCase([deDE, jaJP]); +>str.toLocaleLowerCase : Symbol(String.toLocaleLowerCase, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) +>toLocaleLowerCase : Symbol(String.toLocaleLowerCase, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +str.toLocaleUpperCase(enUS); +>str.toLocaleUpperCase : Symbol(String.toLocaleUpperCase, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) +>toLocaleUpperCase : Symbol(String.toLocaleUpperCase, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +str.toLocaleUpperCase([deDE, jaJP]); +>str.toLocaleUpperCase : Symbol(String.toLocaleUpperCase, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) +>toLocaleUpperCase : Symbol(String.toLocaleUpperCase, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +str.localeCompare(str, enUS); +>str.localeCompare : Symbol(String.localeCompare, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) +>localeCompare : Symbol(String.localeCompare, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +str.localeCompare(str, [deDE, jaJP]); +>str.localeCompare : Symbol(String.localeCompare, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) +>localeCompare : Symbol(String.localeCompare, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.string.d.ts, --, --)) +>str : Symbol(str, Decl(localesObjectArgument.ts, 7, 5)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +new Intl.PluralRules(enUS); +>Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +new Intl.PluralRules([deDE, jaJP]); +>Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +Intl.PluralRules.supportedLocalesOf(enUS); +>Intl.PluralRules.supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +Intl.PluralRules.supportedLocalesOf([deDE, jaJP]); +>Intl.PluralRules.supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.PluralRulesConstructor.supportedLocalesOf, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +new Intl.RelativeTimeFormat(enUS); +>Intl.RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +new Intl.RelativeTimeFormat([deDE, jaJP]); +>Intl.RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +Intl.RelativeTimeFormat.supportedLocalesOf(enUS); +>Intl.RelativeTimeFormat.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2020.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]); +>Intl.RelativeTimeFormat.supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>RelativeTimeFormat : Symbol(Intl.RelativeTimeFormat, Decl(lib.es2020.intl.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(supportedLocalesOf, Decl(lib.es2020.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +new Intl.Collator(enUS); +>Intl.Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +new Intl.Collator([deDE, jaJP]); +>Intl.Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +Intl.Collator.supportedLocalesOf(enUS); +>Intl.Collator.supportedLocalesOf : Symbol(Intl.CollatorConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.CollatorConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +Intl.Collator.supportedLocalesOf([deDE, jaJP]); +>Intl.Collator.supportedLocalesOf : Symbol(Intl.CollatorConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>Collator : Symbol(Intl.Collator, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.CollatorConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +new Intl.DateTimeFormat(enUS); +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +new Intl.DateTimeFormat([deDE, jaJP]); +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +Intl.DateTimeFormat.supportedLocalesOf(enUS); +>Intl.DateTimeFormat.supportedLocalesOf : Symbol(Intl.DateTimeFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.DateTimeFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]); +>Intl.DateTimeFormat.supportedLocalesOf : Symbol(Intl.DateTimeFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>DateTimeFormat : Symbol(Intl.DateTimeFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.DateTimeFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +new Intl.NumberFormat(enUS); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +new Intl.NumberFormat([deDE, jaJP]); +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + +Intl.NumberFormat.supportedLocalesOf(enUS); +>Intl.NumberFormat.supportedLocalesOf : Symbol(Intl.NumberFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.NumberFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>enUS : Symbol(enUS, Decl(localesObjectArgument.ts, 0, 5)) + +Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]); +>Intl.NumberFormat.supportedLocalesOf : Symbol(Intl.NumberFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 2 more) +>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --)) +>supportedLocalesOf : Symbol(Intl.NumberFormatConstructor.supportedLocalesOf, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.intl.d.ts, --, --)) +>deDE : Symbol(deDE, Decl(localesObjectArgument.ts, 1, 5)) +>jaJP : Symbol(jaJP, Decl(localesObjectArgument.ts, 2, 5)) + diff --git a/tests/baselines/reference/localesObjectArgument.types b/tests/baselines/reference/localesObjectArgument.types index d7e428d179442..075b79567ff01 100644 --- a/tests/baselines/reference/localesObjectArgument.types +++ b/tests/baselines/reference/localesObjectArgument.types @@ -38,6 +38,10 @@ const bigint = 123456789123456789n; >bigint : 123456789123456789n >123456789123456789n : 123456789123456789n +const str = ""; +>str : "" +>"" : "" + now.toLocaleString(enUS); >now.toLocaleString(enUS) : string >now.toLocaleString : { (): string; (locales?: string | string[], options?: Intl.DateTimeFormatOptions): string; (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string; } @@ -118,3 +122,233 @@ bigint.toLocaleString([deDE, jaJP]); >deDE : Intl.Locale >jaJP : Intl.Locale +str.toLocaleLowerCase(enUS); +>str.toLocaleLowerCase(enUS) : string +>str.toLocaleLowerCase : { (locales?: string | string[]): string; (locales?: Intl.LocalesArgument): string; } +>str : "" +>toLocaleLowerCase : { (locales?: string | string[]): string; (locales?: Intl.LocalesArgument): string; } +>enUS : Intl.Locale + +str.toLocaleLowerCase([deDE, jaJP]); +>str.toLocaleLowerCase([deDE, jaJP]) : string +>str.toLocaleLowerCase : { (locales?: string | string[]): string; (locales?: Intl.LocalesArgument): string; } +>str : "" +>toLocaleLowerCase : { (locales?: string | string[]): string; (locales?: Intl.LocalesArgument): string; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +str.toLocaleUpperCase(enUS); +>str.toLocaleUpperCase(enUS) : string +>str.toLocaleUpperCase : { (locales?: string | string[]): string; (locales?: Intl.LocalesArgument): string; } +>str : "" +>toLocaleUpperCase : { (locales?: string | string[]): string; (locales?: Intl.LocalesArgument): string; } +>enUS : Intl.Locale + +str.toLocaleUpperCase([deDE, jaJP]); +>str.toLocaleUpperCase([deDE, jaJP]) : string +>str.toLocaleUpperCase : { (locales?: string | string[]): string; (locales?: Intl.LocalesArgument): string; } +>str : "" +>toLocaleUpperCase : { (locales?: string | string[]): string; (locales?: Intl.LocalesArgument): string; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +str.localeCompare(str, enUS); +>str.localeCompare(str, enUS) : number +>str.localeCompare : { (that: string): number; (that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number; } +>str : "" +>localeCompare : { (that: string): number; (that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number; } +>str : "" +>enUS : Intl.Locale + +str.localeCompare(str, [deDE, jaJP]); +>str.localeCompare(str, [deDE, jaJP]) : number +>str.localeCompare : { (that: string): number; (that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number; } +>str : "" +>localeCompare : { (that: string): number; (that: string, locales?: string | string[], options?: Intl.CollatorOptions): number; (that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number; } +>str : "" +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +new Intl.PluralRules(enUS); +>new Intl.PluralRules(enUS) : Intl.PluralRules +>Intl.PluralRules : Intl.PluralRulesConstructor +>Intl : typeof Intl +>PluralRules : Intl.PluralRulesConstructor +>enUS : Intl.Locale + +new Intl.PluralRules([deDE, jaJP]); +>new Intl.PluralRules([deDE, jaJP]) : Intl.PluralRules +>Intl.PluralRules : Intl.PluralRulesConstructor +>Intl : typeof Intl +>PluralRules : Intl.PluralRulesConstructor +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +Intl.PluralRules.supportedLocalesOf(enUS); +>Intl.PluralRules.supportedLocalesOf(enUS) : string[] +>Intl.PluralRules.supportedLocalesOf : { (locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; (locales: Intl.LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; } +>Intl.PluralRules : Intl.PluralRulesConstructor +>Intl : typeof Intl +>PluralRules : Intl.PluralRulesConstructor +>supportedLocalesOf : { (locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; (locales: Intl.LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; } +>enUS : Intl.Locale + +Intl.PluralRules.supportedLocalesOf([deDE, jaJP]); +>Intl.PluralRules.supportedLocalesOf([deDE, jaJP]) : string[] +>Intl.PluralRules.supportedLocalesOf : { (locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; (locales: Intl.LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; } +>Intl.PluralRules : Intl.PluralRulesConstructor +>Intl : typeof Intl +>PluralRules : Intl.PluralRulesConstructor +>supportedLocalesOf : { (locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; (locales: Intl.LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[]; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +new Intl.RelativeTimeFormat(enUS); +>new Intl.RelativeTimeFormat(enUS) : Intl.RelativeTimeFormat +>Intl.RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } +>Intl : typeof Intl +>RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } +>enUS : Intl.Locale + +new Intl.RelativeTimeFormat([deDE, jaJP]); +>new Intl.RelativeTimeFormat([deDE, jaJP]) : Intl.RelativeTimeFormat +>Intl.RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } +>Intl : typeof Intl +>RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +Intl.RelativeTimeFormat.supportedLocalesOf(enUS); +>Intl.RelativeTimeFormat.supportedLocalesOf(enUS) : string[] +>Intl.RelativeTimeFormat.supportedLocalesOf : (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions) => string[] +>Intl.RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } +>Intl : typeof Intl +>RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } +>supportedLocalesOf : (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions) => string[] +>enUS : Intl.Locale + +Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]); +>Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]) : string[] +>Intl.RelativeTimeFormat.supportedLocalesOf : (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions) => string[] +>Intl.RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } +>Intl : typeof Intl +>RelativeTimeFormat : { new (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): Intl.RelativeTimeFormat; supportedLocalesOf(locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions): string[]; } +>supportedLocalesOf : (locales?: Intl.LocalesArgument, options?: Intl.RelativeTimeFormatOptions) => string[] +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +new Intl.Collator(enUS); +>new Intl.Collator(enUS) : Intl.Collator +>Intl.Collator : Intl.CollatorConstructor +>Intl : typeof Intl +>Collator : Intl.CollatorConstructor +>enUS : Intl.Locale + +new Intl.Collator([deDE, jaJP]); +>new Intl.Collator([deDE, jaJP]) : Intl.Collator +>Intl.Collator : Intl.CollatorConstructor +>Intl : typeof Intl +>Collator : Intl.CollatorConstructor +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +Intl.Collator.supportedLocalesOf(enUS); +>Intl.Collator.supportedLocalesOf(enUS) : string[] +>Intl.Collator.supportedLocalesOf : { (locales: string | string[], options?: Intl.CollatorOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.CollatorOptions): string[]; } +>Intl.Collator : Intl.CollatorConstructor +>Intl : typeof Intl +>Collator : Intl.CollatorConstructor +>supportedLocalesOf : { (locales: string | string[], options?: Intl.CollatorOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.CollatorOptions): string[]; } +>enUS : Intl.Locale + +Intl.Collator.supportedLocalesOf([deDE, jaJP]); +>Intl.Collator.supportedLocalesOf([deDE, jaJP]) : string[] +>Intl.Collator.supportedLocalesOf : { (locales: string | string[], options?: Intl.CollatorOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.CollatorOptions): string[]; } +>Intl.Collator : Intl.CollatorConstructor +>Intl : typeof Intl +>Collator : Intl.CollatorConstructor +>supportedLocalesOf : { (locales: string | string[], options?: Intl.CollatorOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.CollatorOptions): string[]; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +new Intl.DateTimeFormat(enUS); +>new Intl.DateTimeFormat(enUS) : Intl.DateTimeFormat +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +>Intl : typeof Intl +>DateTimeFormat : Intl.DateTimeFormatConstructor +>enUS : Intl.Locale + +new Intl.DateTimeFormat([deDE, jaJP]); +>new Intl.DateTimeFormat([deDE, jaJP]) : Intl.DateTimeFormat +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +>Intl : typeof Intl +>DateTimeFormat : Intl.DateTimeFormatConstructor +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +Intl.DateTimeFormat.supportedLocalesOf(enUS); +>Intl.DateTimeFormat.supportedLocalesOf(enUS) : string[] +>Intl.DateTimeFormat.supportedLocalesOf : { (locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string[]; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +>Intl : typeof Intl +>DateTimeFormat : Intl.DateTimeFormatConstructor +>supportedLocalesOf : { (locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string[]; } +>enUS : Intl.Locale + +Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]); +>Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]) : string[] +>Intl.DateTimeFormat.supportedLocalesOf : { (locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string[]; } +>Intl.DateTimeFormat : Intl.DateTimeFormatConstructor +>Intl : typeof Intl +>DateTimeFormat : Intl.DateTimeFormatConstructor +>supportedLocalesOf : { (locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string[]; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +new Intl.NumberFormat(enUS); +>new Intl.NumberFormat(enUS) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>enUS : Intl.Locale + +new Intl.NumberFormat([deDE, jaJP]); +>new Intl.NumberFormat([deDE, jaJP]) : Intl.NumberFormat +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + +Intl.NumberFormat.supportedLocalesOf(enUS); +>Intl.NumberFormat.supportedLocalesOf(enUS) : string[] +>Intl.NumberFormat.supportedLocalesOf : { (locales: string | string[], options?: Intl.NumberFormatOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string[]; } +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>supportedLocalesOf : { (locales: string | string[], options?: Intl.NumberFormatOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string[]; } +>enUS : Intl.Locale + +Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]); +>Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]) : string[] +>Intl.NumberFormat.supportedLocalesOf : { (locales: string | string[], options?: Intl.NumberFormatOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string[]; } +>Intl.NumberFormat : Intl.NumberFormatConstructor +>Intl : typeof Intl +>NumberFormat : Intl.NumberFormatConstructor +>supportedLocalesOf : { (locales: string | string[], options?: Intl.NumberFormatOptions): string[]; (locales: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string[]; } +>[deDE, jaJP] : Intl.Locale[] +>deDE : Intl.Locale +>jaJP : Intl.Locale + diff --git a/tests/baselines/reference/numberFormatCurrencySign.types b/tests/baselines/reference/numberFormatCurrencySign.types index 50d198deb8539..b61cddf872e5a 100644 --- a/tests/baselines/reference/numberFormatCurrencySign.types +++ b/tests/baselines/reference/numberFormatCurrencySign.types @@ -6,9 +6,9 @@ const str = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format(999999) : string >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).format : { (value: number): string; (value: number | bigint): string; } >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat; new (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions | undefined): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat; new (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions | undefined): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >'en-NZ' : "en-NZ" >{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: string; currency: string; currencySign: string; } >style : string diff --git a/tests/baselines/reference/numberFormatCurrencySignResolved.types b/tests/baselines/reference/numberFormatCurrencySignResolved.types index 054866c57f455..75102f726cb0b 100644 --- a/tests/baselines/reference/numberFormatCurrencySignResolved.types +++ b/tests/baselines/reference/numberFormatCurrencySignResolved.types @@ -6,9 +6,9 @@ const options = new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'N >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions() : Intl.ResolvedNumberFormatOptions >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }).resolvedOptions : { (): Intl.ResolvedNumberFormatOptions; (): Intl.ResolvedNumberFormatOptions; } >new Intl.NumberFormat('en-NZ', { style: 'currency', currency: 'NZD', currencySign: 'accounting' }) : Intl.NumberFormat ->Intl.NumberFormat : { (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat; new (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions | undefined): string[]; readonly prototype: Intl.NumberFormat; } +>Intl.NumberFormat : Intl.NumberFormatConstructor >Intl : typeof Intl ->NumberFormat : { (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat; new (locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined): Intl.NumberFormat; supportedLocalesOf(locales: string | string[], options?: Intl.NumberFormatOptions | undefined): string[]; readonly prototype: Intl.NumberFormat; } +>NumberFormat : Intl.NumberFormatConstructor >'en-NZ' : "en-NZ" >{ style: 'currency', currency: 'NZD', currencySign: 'accounting' } : { style: string; currency: string; currencySign: string; } >style : string diff --git a/tests/cases/conformance/es2020/localesObjectArgument.ts b/tests/cases/conformance/es2020/localesObjectArgument.ts index a89e22ba91de7..37be75f13d6b2 100644 --- a/tests/cases/conformance/es2020/localesObjectArgument.ts +++ b/tests/cases/conformance/es2020/localesObjectArgument.ts @@ -7,6 +7,7 @@ const jaJP = new Intl.Locale("ja-JP"); const now = new Date(); const num = 1000; const bigint = 123456789123456789n; +const str = ""; now.toLocaleString(enUS); now.toLocaleDateString(enUS); @@ -20,3 +21,35 @@ num.toLocaleString([deDE, jaJP]); bigint.toLocaleString(enUS); bigint.toLocaleString([deDE, jaJP]); + +str.toLocaleLowerCase(enUS); +str.toLocaleLowerCase([deDE, jaJP]); +str.toLocaleUpperCase(enUS); +str.toLocaleUpperCase([deDE, jaJP]); +str.localeCompare(str, enUS); +str.localeCompare(str, [deDE, jaJP]); + +new Intl.PluralRules(enUS); +new Intl.PluralRules([deDE, jaJP]); +Intl.PluralRules.supportedLocalesOf(enUS); +Intl.PluralRules.supportedLocalesOf([deDE, jaJP]); + +new Intl.RelativeTimeFormat(enUS); +new Intl.RelativeTimeFormat([deDE, jaJP]); +Intl.RelativeTimeFormat.supportedLocalesOf(enUS); +Intl.RelativeTimeFormat.supportedLocalesOf([deDE, jaJP]); + +new Intl.Collator(enUS); +new Intl.Collator([deDE, jaJP]); +Intl.Collator.supportedLocalesOf(enUS); +Intl.Collator.supportedLocalesOf([deDE, jaJP]); + +new Intl.DateTimeFormat(enUS); +new Intl.DateTimeFormat([deDE, jaJP]); +Intl.DateTimeFormat.supportedLocalesOf(enUS); +Intl.DateTimeFormat.supportedLocalesOf([deDE, jaJP]); + +new Intl.NumberFormat(enUS); +new Intl.NumberFormat([deDE, jaJP]); +Intl.NumberFormat.supportedLocalesOf(enUS); +Intl.NumberFormat.supportedLocalesOf([deDE, jaJP]); diff --git a/tests/cases/conformance/es2021/es2021LocalesObjectArgument.ts b/tests/cases/conformance/es2021/es2021LocalesObjectArgument.ts new file mode 100644 index 0000000000000..00b4bc5ea0548 --- /dev/null +++ b/tests/cases/conformance/es2021/es2021LocalesObjectArgument.ts @@ -0,0 +1,10 @@ +// @target: es2021 + +const enUS = new Intl.Locale("en-US"); +const deDE = new Intl.Locale("de-DE"); +const jaJP = new Intl.Locale("ja-JP"); + +new Intl.ListFormat(enUS); +new Intl.ListFormat([deDE, jaJP]); +Intl.ListFormat.supportedLocalesOf(enUS); +Intl.ListFormat.supportedLocalesOf([deDE, jaJP]); diff --git a/tests/cases/conformance/es2022/es2022LocalesObjectArgument.ts b/tests/cases/conformance/es2022/es2022LocalesObjectArgument.ts new file mode 100644 index 0000000000000..7087ae2eab962 --- /dev/null +++ b/tests/cases/conformance/es2022/es2022LocalesObjectArgument.ts @@ -0,0 +1,10 @@ +// @target: es2022 + +const enUS = new Intl.Locale("en-US"); +const deDE = new Intl.Locale("de-DE"); +const jaJP = new Intl.Locale("ja-JP"); + +new Intl.Segmenter(enUS); +new Intl.Segmenter([deDE, jaJP]); +Intl.Segmenter.supportedLocalesOf(enUS); +Intl.Segmenter.supportedLocalesOf([deDE, jaJP]);