@squareys/webdecks-sdk - v0.0.0
    Preparing search index...

    Class DocumentModule

    A loaded WebDocs engine module, driven through its stable, versioned C ABI (wdoc_sdk_*). DocumentModule.attach is the single entry point: it asserts the ABI version, forwards any license token, shares a host device if given, and installs the device-lifecycle hooks. The document facade is DocumentModule.documents.

    const wasm = await createDocumentsEngine();        // the host loads the Emscripten factory
    const engine = await DocumentModule.attach(wasm);
    const doc = await engine.documents.open();
    const viewport = (await engine.createViewport(canvas)).start();

    Implements

    Index
    device: GpuDevice

    The engine's WebGPU device, adapter, queue, and readiness lifecycle.

    poisonDestroyed: boolean

    Whether destroyed wrappers are poisoned (see AttachOptions.poisonDestroyed).

    • Attach the SDK to a loaded WebDocs engine module. Asserts the ABI version (a hard failure on mismatch — there is no downgrade), forwards a license token if given, shares a host device if given, and installs the device-lifecycle hooks.

      Parameters

      Returns Promise<DocumentModule>

    • Close the document, detach every viewport, and restore the global device hooks.

      Returns void