This allows the file to be checked by tsc, which would have caught
some of the missing type aliases sooner (now added to Native.ts.in).
Strictly speaking the behavior is slightly different: we have returned
to exporting many items individually instead of collecting them on a
single object.
Co-authored-by: Alex Bakon <akonradi@signal.org>
Exceptions:
- Buffers decoding from strings (usually for tests)
- Buffer.concat, if immediately fed into libsignal, which we know
won't rely on the diverging behavior of slice()
- Encoding GroupIdentifier to base64
Everywhere else, Uint8Array was nearly a drop-in replacement. Places
where it wasn't:
- For tests, use assertArrayEquals more, which converts to hex first
(better diffs anyway)
- Use TextEncoder and TextDecoder for going back and forth between
strings and UTF-8 buffers *not* in the tests
Without this, two ByteArray types without any additional operations
are structurally equivalent, and so TypeScript permits passing one as
the other. (Thanks, Fedor!)