Type 'ArrayBufferView' is not assignable to type 'DataView' #38715
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Milestone
TypeScript Version: Nightly
Search Terms:
ArrayBufferView
Expected behavior:
According to MDN, ArrayBufferView is one of these types:
However, in lib.es5.d.ts it's just an interface.
This would be fine if it were used consistently, but it appears that it's used in some places (eg
BodyInit
) but then in others the actual types from above are listed (egcrypto.subtle.digest
). This means, for example, that going fromBodyInit
tocrypto.subtle.digest
(while filtering out incompatible types) is impossible.According to these links:
This code should compile:
Actual behavior:
Code fails to compile with type errors
Related Issues:
Possibly #15402
Code
Output
Compiler Options
Playground Link: Provided
The text was updated successfully, but these errors were encountered: