Argument of type 'ImageBitmap' is not assignable to parameter of type 'HTMLCanvasElement | HTMLImageElement | HTMLVideoElement' #25468
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Fixed
A PR has been merged for this issue
Help Wanted
You can do this
Milestone
Hello! I am a very huge fan of typescript, and I'm sure adding
ImageBitmap
to the d.ts file responsible for canvas definitions should work.Just to be clear, MDN lists the following things for
CanvasRenderingContext2D.protortype.createPattern
TypeScript Version: 2.9.2
Search Terms: Canvas. ImageBitmap, createPattern
Code
Expected behavior:
Well I expect typescript to not report this as a problem.
Actual behavior:
Currently reported like this in my IDE.
Playground Link:
http://www.typescriptlang.org/play/#src=%0D%0Afetch("path%2Fto%2Fimg.png")%0D%0A%20%20%20%20.then(e%20%3D>%20e.blob())%0D%0A%20%20%20%20.then(e%20%3D>%20createImageBitmap(e))%0D%0A%20%20%20%20.then(e%20%3D>%20document.createElement("canvas")%0D%0A%20%20%20%20%20%20%20%20.getContext("2d")%0D%0A%20%20%20%20%20%20%20%20.createPattern(e%2C%20"repeat-x"))%3B%0D%0A%0D%0A
Related Issues: There are a few issues that involve definitions, not sure where to put this.
The text was updated successfully, but these errors were encountered: