plushie/bridge_web

WASM transport for the JavaScript target.

Wraps the plushie-renderer-wasm module’s PlushieApp API. Communication is always JSON (the WASM renderer does not support MessagePack framing). Messages are passed as JSON strings via the PlushieApp constructor and send_message method.

The WASM module must be loaded before creating a transport. In browser contexts, call the wasm-bindgen init() function first. In Node.js, use the appropriate WASM loader.

Usage

import plushie/bridge_web

let assert Ok(transport) =
  bridge_web.create(settings_json, on_event_callback)
bridge_web.send(transport, message_json)
bridge_web.close(transport)

Types

pub type JsBridgeTarget {
  JsBridgeTarget
}

Constructors

  • JsBridgeTarget
Search Document