You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2345 Argument of type 'HTMLCanvasElement | HTMLImageElement' is not assignable to parameter of type 'HTMLVideoElement'.
Type 'HTMLCanvasElement' is not assignable to type 'HTMLVideoElement'.
But I thought drawImage accepts one of HTMLCanvasElement | HTMLImageElement | HTMLVideoElement, isn't it?
The text was updated successfully, but these errors were encountered:
Unfortunately while drawImage does have 3 overloads which cover the three types you mention, that is not the same as actually accepting a union of those 3 types. See #1805 for some more discussion, these DOM APIs are certainly motivating examples for why we should consider the solution in that issue where we would special case single argument functions.
This code:
fails with error:
But I thought
drawImage
accepts one ofHTMLCanvasElement | HTMLImageElement | HTMLVideoElement
, isn't it?The text was updated successfully, but these errors were encountered: