mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-15 05:51:23 +00:00
Implement JsCast
for all imported types
This commit implements the `JsCast` trait automatically for all imported types in `#[wasm_bindgen] extern { ... }` blocks. The main change here was to generate an `instanceof` shim for all imported types in case it's needed. All imported types now also implement `AsRef<JsValue>` and `AsMut<JsValue>`
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
pub const SCHEMA_VERSION: &str = "7";
|
||||
pub const SCHEMA_VERSION: &str = "8";
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct ProgramOnlySchema {
|
||||
@ -81,7 +81,10 @@ pub struct ImportStatic {
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct ImportType {}
|
||||
pub struct ImportType {
|
||||
pub name: String,
|
||||
pub instanceof_shim: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct ImportEnum {}
|
||||
|
Reference in New Issue
Block a user