From 81e954f94ce3b79a5e9d5876c420aac47c5b5207 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Fri, 18 Oct 2024 19:53:20 +0200 Subject: [PATCH 1/4] Fixed invalid type annotation for multivalue returns --- crates/cli-support/src/wasm2es6js.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cli-support/src/wasm2es6js.rs b/crates/cli-support/src/wasm2es6js.rs index 36298fdd54e..a163d7b2ec4 100644 --- a/crates/cli-support/src/wasm2es6js.rs +++ b/crates/cli-support/src/wasm2es6js.rs @@ -99,7 +99,7 @@ pub fn interface(module: &Module) -> Result { ret = match ty.results().len() { 0 => "void", 1 => "number", - _ => "Array", + _ => "any[]", }, )); } @@ -147,7 +147,7 @@ pub fn typescript(module: &Module) -> Result { ret = match ty.results().len() { 0 => "void", 1 => "number", - _ => "Array", + _ => "any[]", }, )); } From 720fa5f7b5bdff5bee9dbd54daede914135f5661 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Fri, 18 Oct 2024 19:56:10 +0200 Subject: [PATCH 2/4] number[] --- crates/cli-support/src/wasm2es6js.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cli-support/src/wasm2es6js.rs b/crates/cli-support/src/wasm2es6js.rs index a163d7b2ec4..bdf6f020f68 100644 --- a/crates/cli-support/src/wasm2es6js.rs +++ b/crates/cli-support/src/wasm2es6js.rs @@ -99,7 +99,7 @@ pub fn interface(module: &Module) -> Result { ret = match ty.results().len() { 0 => "void", 1 => "number", - _ => "any[]", + _ => "number[]", }, )); } @@ -147,7 +147,7 @@ pub fn typescript(module: &Module) -> Result { ret = match ty.results().len() { 0 => "void", 1 => "number", - _ => "any[]", + _ => "number[]", }, )); } From 550aec0396b70ade4422171eeb494752827a80d4 Mon Sep 17 00:00:00 2001 From: RunDevelopment Date: Fri, 18 Oct 2024 20:30:30 +0200 Subject: [PATCH 3/4] Trigger CI From f65bb1da172a42fb84800af55511c93e7839b796 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Thu, 31 Oct 2024 14:11:53 +0100 Subject: [PATCH 4/4] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc3bdba01b..3acfc5e262c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,9 @@ * Fixed generated types when a static getter/setter has the same name as an instance getter/setter. [#4202](https://github.com/rustwasm/wasm-bindgen/pull/4202) +* Fixed invalid TypeScript return types for multivalue signatures. + [#4210](https://github.com/rustwasm/wasm-bindgen/pull/4210) + -------------------------------------------------------------------------------- ## [0.2.95](https://github.com/rustwasm/wasm-bindgen/compare/0.2.94...0.2.95)