TypeScript Version: 3.7.5
Code
const canvas = document.createElement("canvas")
const offscreenCanvas = canvas.transferControlToOffscreen()
const worker = new Worker(URL.createObjectURL(new Blob([``],{type: "text/javascript"})))
worker.postMessage(offscreenCanvas,[offscreenCanvas])
Expected behavior:
https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas
See "Asynchronous display of frames produced by an OffscreenCanvas" of this document.
Actual behavior:
Compile error:Type 'OffscreenCanvas' is not assignable to type 'Transferable'.