TS 5.6 has Uint8Array, while TS 5.9+ made it generic Uint8Array<ArrayBuffer>.
We can't use specific return type, because TS 5.6 will error.
We can't use generic return type, because most TS 5.9 software will expect specific type.
Maps typed-array input leaves to broad forms.
These are compatibility adapters, not ownership guarantees.
TArg keeps byte inputs broad.
TRet marks byte outputs for TS 5.6 and TS 5.9+ compatibility.
Bytes API type helpers for old + new TypeScript.
TS 5.6 has
Uint8Array, while TS 5.9+ made it genericUint8Array<ArrayBuffer>. We can't use specific return type, because TS 5.6 will error. We can't use generic return type, because most TS 5.9 software will expect specific type.Maps typed-array input leaves to broad forms. These are compatibility adapters, not ownership guarantees.
TArgkeeps byte inputs broad.TRetmarks byte outputs for TS 5.6 and TS 5.9+ compatibility.