2024-09-28 16:04:12 +00:00
|
|
|
import "../lib/wasm.js";
|
|
|
|
|
2024-09-28 16:09:31 +00:00
|
|
|
// @ts-expect-error: no types
|
2024-09-28 16:04:12 +00:00
|
|
|
const go = new Go();
|
2024-09-28 16:09:31 +00:00
|
|
|
|
2024-09-28 16:04:12 +00:00
|
|
|
const code =
|
|
|
|
await (await fetch(import.meta.url.replace("/mod.ts", "/mod.wasm")))
|
|
|
|
.arrayBuffer();
|
|
|
|
const wasmMmodule = await WebAssembly.instantiate(code, go.importObject);
|
|
|
|
const wasm = wasmMmodule.instance;
|
|
|
|
go.run(wasm);
|
2024-09-28 16:09:31 +00:00
|
|
|
export default wasm.exports as Record<string, (...args: unknown[])=> unknown>;
|