Skip to main content

wasm_object_abi

Macro wasm_object_abi 

Source
macro_rules! wasm_object_abi {
    ($ty:ident, $typescript_type:literal) => { ... };
}
Expand description

Gives a type the wasm ABI to be returned to JS as an object, keeping its own name in the generated .d.ts — so a #[wasm_bindgen] fn returning it needs no unchecked_return_type.

The value is converted with serde_wasm_bindgen, so the type must impl Serialize/Deserialize (whose human-readable form is that object) and declare its TS shape with a typescript_custom_section (export type <Type> = …).