Removed optional parameter from Window.createImageBitmap factory #27475
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Help Wanted
You can do this
Milestone
TypeScript Version: 3.1.1
Search Terms:
createImageBitmap
,ImageBitmapOptions
,Image Bitmap
,lib.dom
Code
Expected behavior:
Should compile and create
Promise<ImageBitmap>
in both cases.Actual behavior:
Doesn't compile since last optional options param was removed from
lib.dom.d.ts
between3.0.3
and3.1.0
. AlthoughImageBitmapOptions
are still present inlib.dom.d.ts
.Playground Link:
http://www.typescriptlang.org/play/#src=new%20Promise%3CHTMLImageElement%3E((resolve)%20%3D%3E%20%7B%0D%0A%20%20%20%20const%20image%20%3D%20new%20Image()%0D%0A%20%20%20%20image.src%20%3D%20'http%3A%2F%2Fwww.typescriptlang.org%2Fassets%2Fimages%2Flogo_nocircle.svg'%0D%0A%20%20%20%20image.onload%20%3D%20()%20%3D%3E%20%7B%20resolve(image)%20%7D%0D%0A%7D).then((image)%20%3D%3E%20%7B%0D%0A%20%20%20%20return%20createImageBitmap(image%2C%200%2C%200%2C%20image.width%2C%20image.height%2C%20%7B%0D%0A%20%20%20%20%20%20%20%20premultiplyAlpha%3A%20'none'%0D%0A%20%20%20%20%7D)%0D%0A%7D)
It was removed in commit ee25cde with vendor specific types (even though it's not vendor-specific).
Even though not all browsers supports last optional param, it's still part of living standard.
The text was updated successfully, but these errors were encountered: