SheetXL - v1.0.2
    Preparing search index...

    Function instantiateWasmBindgen

    • Instantiates a wasm-bindgen --target web module from its binary carried as base64, and returns the glue's exports, ready to call.

      Type Parameters

      Parameters

      • glue: G

        The glue module, import * as glue from './<name>.js'.

      • wasmBase64: string

        The <name>_bg.wasm bytes as base64, the default export of the module scripts/build-wasm.mjs writes beside the glue.

      Returns Promise<WasmBindgenExports<G>>

      Each package that ships a binding keeps a module of its own that does nothing but import its glue and its base64 and call this: a bundler makes a lazy chunk only from a literal import() path, so those two imports cannot live here. The bytes are decoded rather than fetched as a data: URL, which a Content Security Policy may forbid and Node's fetch cannot read.

      import * as glue from '../.generated/wasm/sdk.js';
      import wasmBase64 from '../.generated/wasm/sdk_bg.inline.js';
      export const wasm = await instantiateWasmBindgen(glue, wasmBase64);