From 64a51e8e289e5f30f7ae5abd67bbfe64f2c20b92 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 7 Jul 2025 19:03:18 +0000 Subject: [PATCH 1/7] Initial plan From 5de28dbf4d53e12427f86ae68fe69d356aef90f0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 7 Jul 2025 19:09:35 +0000 Subject: [PATCH 2/7] Add approximatelySign to NumberFormatPartTypeRegistry for ES2023 Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- src/lib/es2023.intl.d.ts | 22 ++-- .../reference/intlNumberFormatES2023.js | 24 ++++ .../reference/intlNumberFormatES2023.symbols | 45 ++++++++ .../reference/intlNumberFormatES2023.types | 103 ++++++++++++++++++ .../es2023/intlNumberFormatES2023.ts | 27 +++-- 5 files changed, 205 insertions(+), 16 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 91d29c3d04e30..76847858f2d21 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -1,12 +1,16 @@ -declare namespace Intl { - interface NumberFormatOptionsUseGroupingRegistry { - min2: never; - auto: never; - always: never; - } - - interface NumberFormatOptionsSignDisplayRegistry { - negative: never; +declare namespace Intl { + interface NumberFormatOptionsUseGroupingRegistry { + min2: never; + auto: never; + always: never; + } + + interface NumberFormatOptionsSignDisplayRegistry { + negative: never; + } + + interface NumberFormatPartTypeRegistry { + approximatelySign: never; } interface NumberFormatOptions { diff --git a/tests/baselines/reference/intlNumberFormatES2023.js b/tests/baselines/reference/intlNumberFormatES2023.js index 983fe0ff00305..788f4fd755aad 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.js +++ b/tests/baselines/reference/intlNumberFormatES2023.js @@ -31,6 +31,19 @@ new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); new Intl.NumberFormat('en-GB').format('Infinity'); new Intl.NumberFormat('en-GB').format('-Infinity'); new Intl.NumberFormat('en-GB').format('+Infinity'); + +// Test approximatelySign part type +const nf = new Intl.NumberFormat("en-US", { + style: "currency", + currency: "EUR", + maximumFractionDigits: 0, +}); + +nf + .formatRangeToParts(100, 100) + .filter((part) => part.type !== "approximatelySign") + .map((part) => part.value) + .join(""); //// [intlNumberFormatES2023.js] @@ -59,3 +72,14 @@ new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); new Intl.NumberFormat('en-GB').format('Infinity'); new Intl.NumberFormat('en-GB').format('-Infinity'); new Intl.NumberFormat('en-GB').format('+Infinity'); +// Test approximatelySign part type +const nf = new Intl.NumberFormat("en-US", { + style: "currency", + currency: "EUR", + maximumFractionDigits: 0, +}); +nf + .formatRangeToParts(100, 100) + .filter((part) => part.type !== "approximatelySign") + .map((part) => part.value) + .join(""); diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols index ade51253237e2..c9657d57e65cc 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.symbols +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -130,3 +130,48 @@ new Intl.NumberFormat('en-GB').format('+Infinity'); >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, --, --), Decl(lib.es2023.intl.d.ts, --, --)) >format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --)) +// Test approximatelySign part type +const nf = new Intl.NumberFormat("en-US", { +>nf : Symbol(nf, Decl(intlNumberFormatES2023.ts, 32, 5)) +>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, --, --), 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) +>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, --, --), Decl(lib.es2023.intl.d.ts, --, --)) + + style: "currency", +>style : Symbol(style, Decl(intlNumberFormatES2023.ts, 32, 43)) + + currency: "EUR", +>currency : Symbol(currency, Decl(intlNumberFormatES2023.ts, 33, 20)) + + maximumFractionDigits: 0, +>maximumFractionDigits : Symbol(maximumFractionDigits, Decl(intlNumberFormatES2023.ts, 34, 18)) + +}); + +nf +>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) +>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>nf .formatRangeToParts(100, 100) .filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>nf .formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) +>nf : Symbol(nf, Decl(intlNumberFormatES2023.ts, 32, 5)) + + .formatRangeToParts(100, 100) +>formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --)) + + .filter((part) => part.type !== "approximatelySign") +>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>part : Symbol(part, Decl(intlNumberFormatES2023.ts, 40, 11)) +>part.type : Symbol(Intl.NumberFormatPart.type, Decl(lib.es2018.intl.d.ts, --, --)) +>part : Symbol(part, Decl(intlNumberFormatES2023.ts, 40, 11)) +>type : Symbol(Intl.NumberFormatPart.type, Decl(lib.es2018.intl.d.ts, --, --)) + + .map((part) => part.value) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>part : Symbol(part, Decl(intlNumberFormatES2023.ts, 41, 8)) +>part.value : Symbol(Intl.NumberFormatPart.value, Decl(lib.es2018.intl.d.ts, --, --)) +>part : Symbol(part, Decl(intlNumberFormatES2023.ts, 41, 8)) +>value : Symbol(Intl.NumberFormatPart.value, Decl(lib.es2018.intl.d.ts, --, --)) + + .join(""); +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types index 4063a0dcbec95..a05fed5f24e4e 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.types +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -376,3 +376,106 @@ new Intl.NumberFormat('en-GB').format('+Infinity'); >'+Infinity' : "+Infinity" > : ^^^^^^^^^^^ +// Test approximatelySign part type +const nf = new Intl.NumberFormat("en-US", { +>nf : Intl.NumberFormat +> : ^^^^^^^^^^^^^^^^^ +>new Intl.NumberFormat("en-US", { style: "currency", currency: "EUR", maximumFractionDigits: 0,}) : Intl.NumberFormat +> : ^^^^^^^^^^^^^^^^^ +>Intl.NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Intl : typeof Intl +> : ^^^^^^^^^^^ +>NumberFormat : Intl.NumberFormatConstructor +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"en-US" : "en-US" +> : ^^^^^^^ +>{ style: "currency", currency: "EUR", maximumFractionDigits: 0,} : { style: "currency"; currency: string; maximumFractionDigits: number; } +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + style: "currency", +>style : "currency" +> : ^^^^^^^^^^ +>"currency" : "currency" +> : ^^^^^^^^^^ + + currency: "EUR", +>currency : string +> : ^^^^^^ +>"EUR" : "EUR" +> : ^^^^^ + + maximumFractionDigits: 0, +>maximumFractionDigits : number +> : ^^^^^^ +>0 : 0 +> : ^ + +}); + +nf +>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join("") : string +> : ^^^^^^ +>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) : string[] +> : ^^^^^^^^ +>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map : (callbackfn: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") : Intl.NumberRangeFormatPart[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>nf .formatRangeToParts(100, 100) .filter : { (predicate: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => value is S, thisArg?: any): S[]; (predicate: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => unknown, thisArg?: any): Intl.NumberRangeFormatPart[]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>nf .formatRangeToParts(100, 100) : Intl.NumberRangeFormatPart[] +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>nf .formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[] +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>nf : Intl.NumberFormat +> : ^^^^^^^^^^^^^^^^^ + + .formatRangeToParts(100, 100) +>formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[] +> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>100 : 100 +> : ^^^ +>100 : 100 +> : ^^^ + + .filter((part) => part.type !== "approximatelySign") +>filter : { (predicate: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => value is S, thisArg?: any): S[]; (predicate: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => unknown, thisArg?: any): Intl.NumberRangeFormatPart[]; } +> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(part) => part.type !== "approximatelySign" : (part: Intl.NumberRangeFormatPart) => boolean +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>part : Intl.NumberRangeFormatPart +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>part.type !== "approximatelySign" : boolean +> : ^^^^^^^ +>part.type : keyof Intl.NumberFormatPartTypeRegistry +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>part : Intl.NumberRangeFormatPart +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : keyof Intl.NumberFormatPartTypeRegistry +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>"approximatelySign" : "approximatelySign" +> : ^^^^^^^^^^^^^^^^^^^ + + .map((part) => part.value) +>map : (callbackfn: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => U, thisArg?: any) => U[] +> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^ +>(part) => part.value : (part: Intl.NumberRangeFormatPart) => string +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>part : Intl.NumberRangeFormatPart +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>part.value : string +> : ^^^^^^ +>part : Intl.NumberRangeFormatPart +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^ +>value : string +> : ^^^^^^ + + .join(""); +>join : (separator?: string) => string +> : ^ ^^^ ^^^^^ +>"" : "" +> : ^^ + diff --git a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts index 1255f41968994..a2f7c282baf70 100644 --- a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts +++ b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts @@ -25,10 +25,23 @@ new Intl.NumberFormat('en-GB').formatRange(10n, 1000n); new Intl.NumberFormat('en-GB').formatRangeToParts(10, 1000)[0]; new Intl.NumberFormat('en-GB').formatRangeToParts(10n, 1000n)[0]; -// Arbitrary-precision string arguments -new Intl.NumberFormat('en-GB').format('-12.3E-4'); -new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); -new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); -new Intl.NumberFormat('en-GB').format('Infinity'); -new Intl.NumberFormat('en-GB').format('-Infinity'); -new Intl.NumberFormat('en-GB').format('+Infinity'); +// Arbitrary-precision string arguments +new Intl.NumberFormat('en-GB').format('-12.3E-4'); +new Intl.NumberFormat('en-GB').formatRange('123.4', '567.8'); +new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8'); +new Intl.NumberFormat('en-GB').format('Infinity'); +new Intl.NumberFormat('en-GB').format('-Infinity'); +new Intl.NumberFormat('en-GB').format('+Infinity'); + +// Test approximatelySign part type +const nf = new Intl.NumberFormat("en-US", { + style: "currency", + currency: "EUR", + maximumFractionDigits: 0, +}); + +nf + .formatRangeToParts(100, 100) + .filter((part) => part.type !== "approximatelySign") + .map((part) => part.value) + .join(""); From 894046694be139e9cae997acac63fd8fc5b05da1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 7 Jul 2025 19:10:58 +0000 Subject: [PATCH 3/7] Apply formatting to es2023.intl.d.ts --- src/lib/es2023.intl.d.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 76847858f2d21..9d580ed448c1d 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -1,16 +1,16 @@ -declare namespace Intl { - interface NumberFormatOptionsUseGroupingRegistry { - min2: never; - auto: never; - always: never; - } - - interface NumberFormatOptionsSignDisplayRegistry { - negative: never; - } - - interface NumberFormatPartTypeRegistry { - approximatelySign: never; +declare namespace Intl { + interface NumberFormatOptionsUseGroupingRegistry { + min2: never; + auto: never; + always: never; + } + + interface NumberFormatOptionsSignDisplayRegistry { + negative: never; + } + + interface NumberFormatPartTypeRegistry { + approximatelySign: never; } interface NumberFormatOptions { From 78102886ea6fbed3a4ab0b99dbdff1054be52847 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 05:58:36 +0000 Subject: [PATCH 4/7] Merge main and fix eslint issues in harnessGlobals.ts Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- src/harness/harnessGlobals.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/harness/harnessGlobals.ts b/src/harness/harnessGlobals.ts index 05193e79f17f6..87831e80f66d5 100644 --- a/src/harness/harnessGlobals.ts +++ b/src/harness/harnessGlobals.ts @@ -5,11 +5,11 @@ import * as ts from "./_namespaces/ts.js"; // this will work in the browser via browserify declare global { // Module transform: converted from ambient declaration - var assert: typeof chai.assert; + var assert: typeof chai.assert; // eslint-disable-line no-var } declare global { // Module transform: converted from ambient declaration - var expect: typeof chai.expect; + var expect: typeof chai.expect; // eslint-disable-line no-var } globalThis.assert = chai.assert; { From ab5e89f10a34b88bc8a5af2ec71f308dbc3af8e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 06:12:38 +0000 Subject: [PATCH 5/7] Revert eslint changes and assign test result to variable Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- src/harness/harnessGlobals.ts | 4 ++-- .../reference/intlNumberFormatES2023.js | 4 ++-- .../reference/intlNumberFormatES2023.symbols | 3 ++- .../reference/intlNumberFormatES2023.types | 4 +++- .../es2023/intlNumberFormatES2023.ts | 22 +++++++++---------- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/harness/harnessGlobals.ts b/src/harness/harnessGlobals.ts index 87831e80f66d5..05193e79f17f6 100644 --- a/src/harness/harnessGlobals.ts +++ b/src/harness/harnessGlobals.ts @@ -5,11 +5,11 @@ import * as ts from "./_namespaces/ts.js"; // this will work in the browser via browserify declare global { // Module transform: converted from ambient declaration - var assert: typeof chai.assert; // eslint-disable-line no-var + var assert: typeof chai.assert; } declare global { // Module transform: converted from ambient declaration - var expect: typeof chai.expect; // eslint-disable-line no-var + var expect: typeof chai.expect; } globalThis.assert = chai.assert; { diff --git a/tests/baselines/reference/intlNumberFormatES2023.js b/tests/baselines/reference/intlNumberFormatES2023.js index 788f4fd755aad..e8af110f8afc9 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.js +++ b/tests/baselines/reference/intlNumberFormatES2023.js @@ -39,7 +39,7 @@ const nf = new Intl.NumberFormat("en-US", { maximumFractionDigits: 0, }); -nf +const filtered = nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) @@ -78,7 +78,7 @@ const nf = new Intl.NumberFormat("en-US", { currency: "EUR", maximumFractionDigits: 0, }); -nf +const filtered = nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols index c9657d57e65cc..79a196aa972f7 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.symbols +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -148,7 +148,8 @@ const nf = new Intl.NumberFormat("en-US", { }); -nf +const filtered = nf +>filtered : Symbol(filtered, Decl(intlNumberFormatES2023.ts, 38, 5)) >nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) >nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >nf .formatRangeToParts(100, 100) .filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types index a05fed5f24e4e..3b9017e0c6b73 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.types +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -413,7 +413,9 @@ const nf = new Intl.NumberFormat("en-US", { }); -nf +const filtered = nf +>filtered : string +> : ^^^^^^ >nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join("") : string > : ^^^^^^ >nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join : (separator?: string) => string diff --git a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts index a2f7c282baf70..b8c13428491f7 100644 --- a/tests/cases/conformance/es2023/intlNumberFormatES2023.ts +++ b/tests/cases/conformance/es2023/intlNumberFormatES2023.ts @@ -33,15 +33,15 @@ new Intl.NumberFormat('en-GB').format('Infinity'); new Intl.NumberFormat('en-GB').format('-Infinity'); new Intl.NumberFormat('en-GB').format('+Infinity'); -// Test approximatelySign part type -const nf = new Intl.NumberFormat("en-US", { - style: "currency", - currency: "EUR", - maximumFractionDigits: 0, -}); - -nf - .formatRangeToParts(100, 100) - .filter((part) => part.type !== "approximatelySign") - .map((part) => part.value) +// Test approximatelySign part type +const nf = new Intl.NumberFormat("en-US", { + style: "currency", + currency: "EUR", + maximumFractionDigits: 0, +}); + +const filtered = nf + .formatRangeToParts(100, 100) + .filter((part) => part.type !== "approximatelySign") + .map((part) => part.value) .join(""); From ad3bf4a9ea9823520d2e87f64d7486b05c68d986 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 06:19:09 +0000 Subject: [PATCH 6/7] Move approximatelySign to NumberFormatRangePartTypeRegistry Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- src/lib/es2023.intl.d.ts | 5 ++++- tests/baselines/reference/intlNumberFormatES2023.symbols | 4 ++-- tests/baselines/reference/intlNumberFormatES2023.types | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index 9d580ed448c1d..d1b532cb4f325 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -9,10 +9,12 @@ declare namespace Intl { negative: never; } - interface NumberFormatPartTypeRegistry { + interface NumberFormatRangePartTypeRegistry extends NumberFormatPartTypeRegistry { approximatelySign: never; } + type NumberFormatRangePartTypes = keyof NumberFormatRangePartTypeRegistry; + interface NumberFormatOptions { roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined; roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined; @@ -28,6 +30,7 @@ declare namespace Intl { } interface NumberRangeFormatPart extends NumberFormatPart { + type: NumberFormatRangePartTypes; source: "startRange" | "endRange" | "shared"; } diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols index 79a196aa972f7..37d66641b04b0 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.symbols +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -162,9 +162,9 @@ const filtered = nf .filter((part) => part.type !== "approximatelySign") >filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >part : Symbol(part, Decl(intlNumberFormatES2023.ts, 40, 11)) ->part.type : Symbol(Intl.NumberFormatPart.type, Decl(lib.es2018.intl.d.ts, --, --)) +>part.type : Symbol(Intl.NumberRangeFormatPart.type, Decl(lib.es2023.intl.d.ts, --, --)) >part : Symbol(part, Decl(intlNumberFormatES2023.ts, 40, 11)) ->type : Symbol(Intl.NumberFormatPart.type, Decl(lib.es2018.intl.d.ts, --, --)) +>type : Symbol(Intl.NumberRangeFormatPart.type, Decl(lib.es2023.intl.d.ts, --, --)) .map((part) => part.value) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/intlNumberFormatES2023.types b/tests/baselines/reference/intlNumberFormatES2023.types index 3b9017e0c6b73..29d36e7ddb1f2 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.types +++ b/tests/baselines/reference/intlNumberFormatES2023.types @@ -452,12 +452,12 @@ const filtered = nf > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ >part.type !== "approximatelySign" : boolean > : ^^^^^^^ ->part.type : keyof Intl.NumberFormatPartTypeRegistry -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>part.type : keyof Intl.NumberFormatRangePartTypeRegistry +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >part : Intl.NumberRangeFormatPart > : ^^^^^^^^^^^^^^^^^^^^^^^^^^ ->type : keyof Intl.NumberFormatPartTypeRegistry -> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>type : keyof Intl.NumberFormatRangePartTypeRegistry +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"approximatelySign" : "approximatelySign" > : ^^^^^^^^^^^^^^^^^^^ From 2c5e16b7cc4188e3bc7b7fb863350ff67e982ca0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Feb 2026 19:22:30 +0000 Subject: [PATCH 7/7] Fix NumberRangeFormatPart to not extend NumberFormatPart Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- src/lib/es2023.intl.d.ts | 3 ++- tests/baselines/reference/intlNumberFormatES2023.symbols | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/es2023.intl.d.ts b/src/lib/es2023.intl.d.ts index d1b532cb4f325..240601d93da13 100644 --- a/src/lib/es2023.intl.d.ts +++ b/src/lib/es2023.intl.d.ts @@ -29,8 +29,9 @@ declare namespace Intl { trailingZeroDisplay: "auto" | "stripIfInteger"; } - interface NumberRangeFormatPart extends NumberFormatPart { + interface NumberRangeFormatPart { type: NumberFormatRangePartTypes; + value: string; source: "startRange" | "endRange" | "shared"; } diff --git a/tests/baselines/reference/intlNumberFormatES2023.symbols b/tests/baselines/reference/intlNumberFormatES2023.symbols index 37d66641b04b0..27890c135e926 100644 --- a/tests/baselines/reference/intlNumberFormatES2023.symbols +++ b/tests/baselines/reference/intlNumberFormatES2023.symbols @@ -169,9 +169,9 @@ const filtered = nf .map((part) => part.value) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >part : Symbol(part, Decl(intlNumberFormatES2023.ts, 41, 8)) ->part.value : Symbol(Intl.NumberFormatPart.value, Decl(lib.es2018.intl.d.ts, --, --)) +>part.value : Symbol(Intl.NumberRangeFormatPart.value, Decl(lib.es2023.intl.d.ts, --, --)) >part : Symbol(part, Decl(intlNumberFormatES2023.ts, 41, 8)) ->value : Symbol(Intl.NumberFormatPart.value, Decl(lib.es2018.intl.d.ts, --, --)) +>value : Symbol(Intl.NumberRangeFormatPart.value, Decl(lib.es2023.intl.d.ts, --, --)) .join(""); >join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --))