bevy-remote-wasm-types
v0.1.0
Published
TypeScript type definitions for Bevy Remote Wasm
Maintainers
Readme
Bevy Remote Wasm Types
This package provides TypeScript type definitions for the Bevy Remote Protocol (BRP) and the bevy-remote-wasm Rust crate. It is intended to be used as a development dependency in JavaScript/TypeScript projects that interact with BRP over WebAssembly. Rust projects using bevy-remote-wasm and wasm-bindgen also contain these types embedded directly in the generated .d.ts files.
Usage
To use the types in your TypeScript project, install the package from npm:
npm install --save-dev bevy-remote-wasm-typesThen you can import the types as needed:
import type { BrpBridge } from 'bevy-remote-wasm-types';
const bridge: BrpBridge = await getBridge();
const result = await bridge.main['my_method']({ some: 'data' });If your Wasm module includes the built-in BRP types via the embedded wasm-bindgen section, you can also use the built-in types:
import type { BuiltInBrpBridge } from 'bevy-remote-wasm-types';
const bridge = await getBridge() as BuiltInBrpBridge;
const result = await bridge.main['world.query']({ data: { option: 'all' } });Development
- Check the types with
npm run check. - The version of this package does not need to match the version of
bevy-remote-wasm.
