Title: Removed optional parameter from Window.createImageBitmap factory · Issue #27475 · microsoft/TypeScript · GitHub
Open Graph Title: Removed optional parameter from Window.createImageBitmap factory · Issue #27475 · microsoft/TypeScript
X Title: Removed optional parameter from Window.createImageBitmap factory · Issue #27475 · microsoft/TypeScript
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.he...
Open Graph Description: TypeScript Version: 3.1.1 Search Terms: createImageBitmap, ImageBitmapOptions, Image Bitmap, lib.dom Code const bitmap1 = createImageBitmap(img, { premultiplyAlpha: 'none' }) const bitmap2 = create...
X Description: TypeScript Version: 3.1.1 Search Terms: createImageBitmap, ImageBitmapOptions, Image Bitmap, lib.dom Code const bitmap1 = createImageBitmap(img, { premultiplyAlpha: 'none' }) const bitmap2 ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/27475
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Removed optional parameter from Window.createImageBitmap factory","articleBody":"\u003c!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->\r\n**TypeScript Version:** 3.1.1\r\n\r\n\u003c!-- Search terms you tried before logging this (so others can find this issue more easily) -->\r\n**Search Terms:**\r\n`createImageBitmap`, `ImageBitmapOptions`, `Image Bitmap`, `lib.dom`\r\n\r\n**Code**\r\n```ts\r\nconst bitmap1 = createImageBitmap(img, { premultiplyAlpha: 'none' })\r\nconst bitmap2 = createImageBitmap(img, 0, 0, img.width, img.height, { premultiplyAlpha: 'none' })\r\n```\r\n\r\n**Expected behavior:**\r\nShould compile and create `Promise\u003cImageBitmap>` in both cases.\r\n\r\n**Actual behavior:**\r\nDoesn'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`.\r\n\r\n**Playground Link:**\r\nhttp://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)\r\n\r\nIt was removed in commit https://github.com/Microsoft/TypeScript/commit/ee25cdecbca49b2b5a290ecd65224f425b1d6a9c with vendor specific types (even though it's not vendor-specific).\r\nEven though not all browsers supports last optional param, it's still part of [living standard](https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-createimagebitmap).\r\n","author":{"url":"https://github.com/Mirovsky","@type":"Person","name":"Mirovsky"},"datePublished":"2018-10-01T12:19:14Z","url":"https://github.com/microsoft/TypeScript/issues/27475"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:442c6c41-0ec5-50cc-3f97-daeb0ffb1802 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 902C:1D86C4:2E0E188:3A8AA45:6B01BC7E |
| html-safe-nonce | c8ee607137d0257e094d64e01ec9fc0b8b97d3cea009eaec670d8935a7517d7a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDJDOjFEODZDNDoyRTBFMTg4OjNBOEFBNDU6NkIwMUJDN0UiLCJ2aXNpdG9yX2lkIjoiMzYyMDA5MDE3ODgxMjYyMzk5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7d1393eb34def989a01cbd3a0ed60006045aa3f29a55ad8264087bd0ee9729df |
| hovercard-subject-tag | issue:365434891 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/27475/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8f87264c87e443c0a141a83bd34a3c7ad10ea61787b7bef2f2643e6e4b1a7426/microsoft/TypeScript/issues/27475 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8f87264c87e443c0a141a83bd34a3c7ad10ea61787b7bef2f2643e6e4b1a7426/microsoft/TypeScript/issues/27475 |
| og:image:alt | TypeScript Version: 3.1.1 Search Terms: createImageBitmap, ImageBitmapOptions, Image Bitmap, lib.dom Code const bitmap1 = createImageBitmap(img, { premultiplyAlpha: 'none' }) const bitmap2 = create... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Mirovsky |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width