Skip to content

Replace number[] with Uint8Array #3306

@JonasKruckenberg

Description

@JonasKruckenberg

Our api functions that deal with binary data currently have the type number[] which serializes to the correct JSON, but has sub-par DX when used with other JavaScript tools and libraries.
The attached PR replaces all occurrences of number[] with Uint8Array the correct Vec<u8> equivalent.

This is a breaking change though, as functions no longer accept plain number arrays. Typescript users will get correct errors, but non-ts users will receive invalid type: map, expected a sequence

This change will only affect the user facing interface, as Uint8Arrays will be converted into number[] under the hood to get preserve the correct serialization

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: api.jsThe @tauri-apps/api npm package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions