At the moment bytes fields are Uint8Array but that becomes awkward when passing them onwards - for example, we have an RPC that produces an archive to be downloaded in the browser.
const { archive } = client.export({ id });
return new Response(archive, { status: 200, headers: [...] });
This used to be fine, but in TS 5.9 it breaks
Argument of type 'Uint8Array<ArrayBufferLike>' is not assignable to parameter of type 'BodyInit | null | undefined'.
We now have to cast it with archive as Uint8Array<ArrayBuffer>.
It'd be nice if we could generate the code with the bytes fields typed as Uint8Array<ArrayBuffer> to avoid this.
At the moment
bytesfields areUint8Arraybut that becomes awkward when passing them onwards - for example, we have an RPC that produces an archive to be downloaded in the browser.This used to be fine, but in TS 5.9 it breaks
We now have to cast it with
archive as Uint8Array<ArrayBuffer>.It'd be nice if we could generate the code with the
bytesfields typed asUint8Array<ArrayBuffer>to avoid this.