Skip to content

@celox-sim/celox / index / createWasmSimulatorBridge

Function: createWasmSimulatorBridge()

createWasmSimulatorBridge(raw): WasmBridgeResult

Defined in: packages/celox/src/wasm-bridge.ts:108

Create a NativeSimulatorHandle-compatible wrapper from a wasm32-compiled NAPI handle.

  1. Reads metadata (layout, events, sizes) from the raw handle.
  2. Creates a WebAssembly.Memory large enough for the simulation state.
  3. Synchronously compiles and instantiates the combinational and event WASM modules, importing the shared memory.
  4. Returns a handle whose tick() / evalComb() drive the WASM instances.

Parameters

raw

RawWasmSimulatorHandle

Returns

WasmBridgeResult

A bridge result with the wrapped handle and shared memory view.