In WebAssembly,we have i32 A 32-bit signed integer,if we load this wasm ,so we can check the type of i32?If cannot check i32 by javascirpt/typescirpt ,is there another way to check the value of wasm ?
So I try to build the wasm,the typeof return a "number"
main.js
WebAssembly.instantiateStreaming(fetch("../out/main.wasm"), {
main: {
sayHello() {
console.log("Hello from WebAssembly!");
}
},
env: {
abort(_msg, _file, line, column) {
console.error("abort called at main.ts:" + line + ":" + column);
}
},
}).then(result => {
const exports = result.instance.exports;
const addResult = exports.add(19, 23);
document.getElementById("container").textContent = "Result: " + exports.add(19, 23) + "Type:" + (typeof addResult);
}).catch(console.error);
So,is there another way to check the value of wasm ?