Closed andreidev1 closed 5 months ago
I believe this is not the correct solution...
This is the correct solution. There are two ways of doing this. One by binding rust generated types and another is by using this approach. Rust generated types are very inflexible (you can't have Address[] | string[] bounds to a single type). Due to that inflexibility we had to use JsValue with run-time analysis of arguments. JsValue comes across as 'any'. So we are gradually working to re-seat all WASM32 bindings across the entire project onto TS-declared type definitions.
The problem presented itself when developers started to integrate bindings into TypeScript projects. Our examples were built in JS assuming that TS will just work (which it does) but the lack of TS types is problematic, hence this refactoring is gradually taking place across multiple branches.
Also in case of RPC that uses serde-wasm-bindgen typing is not possible in any other way than this.
This was folded into #349. Closing.
At this moment most of the rust bindings that have been already implemented point to Nodejs. By default these types are declared as being
any
. The purpose of this PR is to create rust bindings for TypeScript so other developers will not get confused anymore.