Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timelock: Research if wasm-pack can map Rust types to TS types and preserve them #15

Open
driemworks opened this issue Nov 22, 2024 · 0 comments

Comments

@driemworks
Copy link
Contributor

  • Currently, the wasm-pack output for the wasm dir contains a generated types file, but all types are any, while the are of type JsValue in Rust (from the serde_wasm_bindgen library)
  • Since all types are any currently, we need to check types in the timelock.ts file. This works, but if the input parameters or return types change in the wasm lib, this could potentially be missed in the typescript
    • it could be verified only at runtime, but it would be optimal to fail at compile time if the types are wrong
  • it would be ideal if the generated types in timelock_wasm_wrapper.d.ts to map the JsValue to a type (probably UInt8Array).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant