Closed
Description
TypeScript Version: 3.1.1
Search Terms:
createImageBitmap
, ImageBitmapOptions
, Image Bitmap
, lib.dom
Code
const bitmap1 = createImageBitmap(img, { premultiplyAlpha: 'none' })
const bitmap2 = createImageBitmap(img, 0, 0, img.width, img.height, { premultiplyAlpha: 'none' })
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
between 3.0.3
and 3.1.0
. Although ImageBitmapOptions
are still present in lib.dom.d.ts
.
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.