Skip to content

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

@driemworks

Description

@driemworks
  • 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions