rustwasm / wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript
https://rustwasm.github.io/docs/wasm-bindgen/
Apache License 2.0
7.83k stars 1.08k forks source link

Hide functions exported with `#[wasm_bindgen]` in generated TS #4271

Open RunDevelopment opened 1 week ago

RunDevelopment commented 1 week ago

Motivation

See this comment.

WBG has an internal ABI that is unstable and should not be relied upon by users. As a consequence, all functions with the #[wasm_bindgen] should not be used directly by users. However, the TS type definitions for WASM modules include these functions, despite them being internal.

Proposed Solution

Don't include internal function in the type definitons.