-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HashMap<_, u32>
is Record not Map
#200
Comments
By using #[derive(Serialize)]
#[typeshare]
pub struct FooParent {
#[typeshare(serialized_as = "Map<Foo, u32>")]
foos: HashMap<Foo, u32>;
} The types can be generated like export interface FooParent {
foos: Map<Foo, number>
}; |
|
@kjvalencik Thanks for the reply. I was also looking into the option of serializing as an object, by stringifying the complex key type, but I couldn't get that to work as in the serializer it needed the key to have a However the Map type is just as useful to me in the code so I went back to changing typeshare and got it working like the above. I guess I have 2 questions:
|
The default is unlikely to change. The default align with
Configure serde_wasm_bindgen to use |
Hi, I have something similar to the rust code below. What I'm seeing at runtime compared to the typeshare generated types don't match up. Is this supported? is there an annotation that needs to be used for this? or a bug?
wasm-bindgen returns
typeshare returns
The text was updated successfully, but these errors were encountered: