Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib/es2023.intl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ declare namespace Intl {
formatRange(start: number | bigint | StringNumericLiteral, end: number | bigint | StringNumericLiteral): string;
formatRangeToParts(start: number | bigint | StringNumericLiteral, end: number | bigint | StringNumericLiteral): NumberRangeFormatPart[];
}

interface PluralRules {
selectRange(start: number, end: number): LDMLPluralRule;
}
}
14 changes: 14 additions & 0 deletions tests/baselines/reference/intlPluralRulesSelectRangeES2023.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//// [tests/cases/conformance/es2023/intlPluralRulesSelectRangeES2023.ts] ////

//// [intlPluralRulesSelectRangeES2023.ts]
const pr = new Intl.PluralRules("en-US");
const category = pr.selectRange(1, 2);

const exact: Intl.LDMLPluralRule = category;


//// [intlPluralRulesSelectRangeES2023.js]
"use strict";
const pr = new Intl.PluralRules("en-US");
const category = pr.selectRange(1, 2);
const exact = category;
21 changes: 21 additions & 0 deletions tests/baselines/reference/intlPluralRulesSelectRangeES2023.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//// [tests/cases/conformance/es2023/intlPluralRulesSelectRangeES2023.ts] ////

=== intlPluralRulesSelectRangeES2023.ts ===
const pr = new Intl.PluralRules("en-US");
>pr : Symbol(pr, Decl(intlPluralRulesSelectRangeES2023.ts, 0, 5))
>Intl.PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2023.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 5 more)
>PluralRules : Symbol(Intl.PluralRules, Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --))

const category = pr.selectRange(1, 2);
>category : Symbol(category, Decl(intlPluralRulesSelectRangeES2023.ts, 1, 5))
>pr.selectRange : Symbol(Intl.PluralRules.selectRange, Decl(lib.es2023.intl.d.ts, --, --))
>pr : Symbol(pr, Decl(intlPluralRulesSelectRangeES2023.ts, 0, 5))
>selectRange : Symbol(Intl.PluralRules.selectRange, Decl(lib.es2023.intl.d.ts, --, --))

const exact: Intl.LDMLPluralRule = category;
>exact : Symbol(exact, Decl(intlPluralRulesSelectRangeES2023.ts, 3, 5))
>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 5 more)
>LDMLPluralRule : Symbol(Intl.LDMLPluralRule, Decl(lib.es2018.intl.d.ts, --, --))
>category : Symbol(category, Decl(intlPluralRulesSelectRangeES2023.ts, 1, 5))

41 changes: 41 additions & 0 deletions tests/baselines/reference/intlPluralRulesSelectRangeES2023.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//// [tests/cases/conformance/es2023/intlPluralRulesSelectRangeES2023.ts] ////

=== intlPluralRulesSelectRangeES2023.ts ===
const pr = new Intl.PluralRules("en-US");
>pr : Intl.PluralRules
> : ^^^^^^^^^^^^^^^^
>new Intl.PluralRules("en-US") : Intl.PluralRules
> : ^^^^^^^^^^^^^^^^
>Intl.PluralRules : Intl.PluralRulesConstructor
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Intl : typeof Intl
> : ^^^^^^^^^^^
>PluralRules : Intl.PluralRulesConstructor
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>"en-US" : "en-US"
> : ^^^^^^^

const category = pr.selectRange(1, 2);
>category : Intl.LDMLPluralRule
> : ^^^^^^^^^^^^^^^^^^^
>pr.selectRange(1, 2) : Intl.LDMLPluralRule
> : ^^^^^^^^^^^^^^^^^^^
>pr.selectRange : (start: number, end: number) => Intl.LDMLPluralRule
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^
>pr : Intl.PluralRules
> : ^^^^^^^^^^^^^^^^
>selectRange : (start: number, end: number) => Intl.LDMLPluralRule
> : ^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^
>1 : 1
> : ^
>2 : 2
> : ^

const exact: Intl.LDMLPluralRule = category;
>exact : Intl.LDMLPluralRule
> : ^^^^^^^^^^^^^^^^^^^
>Intl : any
> : ^^^
>category : Intl.LDMLPluralRule
> : ^^^^^^^^^^^^^^^^^^^

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @target: es2022
// @lib: es2022,es2023.intl
// @strict: true

const pr = new Intl.PluralRules("en-US");
const category = pr.selectRange(1, 2);

const exact: Intl.LDMLPluralRule = category;
Loading