You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type returned for parser includes the generic version of Uint8Array which basically mean that anything depending on this export must also be at least on version 5.7.
When importing this in a project using TypeScript 5.6 we get an error:
TS(2315): Type 'Uint8Array' is not generic.
π Expected behavior
The type returned for parser should be Parser<Uint8Array> and notParser<Uint8Array<ArrayBufferLink>>
Doesn't seem like a bug, per se, since I assume whenever TS adds or modifies types in its libraries, the emitted code might be incompatible with older versions of TS (like, I'm guessing when TS added Awaited, things that produced that stopped being compatible with prev versions, etc). Maybe you could work around it like
π Search Terms
typed array
Uint8Array
ArrayBufferLike
π Version & Regression Information
β― Playground Link
No response
π» Code
This is a very simple file that exports a
Uint8Array
parser created by a factory method:π Actual behavior
The resulting
.d.ts
file looks as follows:The type returned for
parser
includes the generic version ofUint8Array
which basically mean that anything depending on this export must also be at least on version 5.7.When importing this in a project using TypeScript 5.6 we get an error:
π Expected behavior
The type returned for
parser
should beParser<Uint8Array>
and notParser<Uint8Array<ArrayBufferLink>>
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: