Skip to main content

Crate wasm_js_bridge

Crate wasm_js_bridge 

Source
Expand description

Build tool for packaging Rust crates as npm WASM packages with TypeScript and Flow types.

Produces .js, .d.ts, and .js.flow output files from Rust-defined descriptors, one set per source file stem. Feature-gated: ts for TypeScript/JavaScript, flow for Flow.

Macros§

bundle
wasm_peers
Generate #[test] fn generate_npm_files() that writes .d.ts and/or .js.flow output files depending on enabled features.

Structs§

Interface
An interface not modeled as a Rust struct (e.g. ad-hoc WASM return shapes).
OpaqueType
An opaque type declaration for Flow.
TypeAlias
A type alias (e.g. export type AttrOp = PredicateOp).
WasmFn
A WASM-exported function descriptor.

Functions§

file_to_stem
Convert a file!() path to a camelCase output file stem.
generate_index_dts
Generate {stem}.d.ts content from type declarations and function descriptors.
generate_index_flow
Generate index.js.flow content from type declarations and function descriptors.

Attribute Macros§

wasm_export
Mark a pure Rust function as a wasm-js-bridge WASM export.