Replies: 2 comments
-
For now my best bet is to relay the array with a struct: #[derive(serde::Serialize, serde::Deserialize, tsify::Tsify)]
#[tsify(into_wasm_abi)]
pub struct ThingCollection(Vec<Thing>);
pub fn get_numbers() -> ThingCollection {
ThingCollection(vec![Thing(1), Thing(2), Thing(3)])
} This works very well as export type ThingCollection = Thing[]; But it would be even better if we can remove this indirection. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You might want to check out the tsify-next crate. It replaces the currently unmaintained tsify crate and recently added support for returning Vectors and passing them as parameters. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With #111 we can now return a
Vec<T>
ifT
is#[wasm_bindgen]
:But it does not work if
T
is tsified:Beta Was this translation helpful? Give feedback.
All reactions