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
getContext() returns type NodeCanvasRenderingContext2D. NodeCanvasRenderingContext2D extends CanvasRenderingContext2D, which has the canvas field.
canvas field has type HTMLCanvasElement. But as far as i know this library doesn't work with DOM. Furthermore HTMLCanvasElement can't be explicitly converted to Canvas.
Steps to Reproduce
import{Canvas}from'canvas'constcanvas=newCanvas(100,100)constctx=canvas.getContext("2d")// cts.canvas is HTMLCanvasElement accoring to typings.// but it should be Canvas.// HTMLCanvasElement has the "toBlob" method// TypeError: ctx.canvas.toBlob is not a functionctx.canvas.toBlob(()=>{})// This one won't compile.ctx.canvas.toBuffer()// This one works fine.;(ctx.canvasasunknownasCanvas).toBuffer()
Issue
Possibly part of #1656
getContext() returns type NodeCanvasRenderingContext2D. NodeCanvasRenderingContext2D extends CanvasRenderingContext2D, which has the canvas field.
canvas field has type HTMLCanvasElement. But as far as i know this library doesn't work with DOM. Furthermore HTMLCanvasElement can't be explicitly converted to Canvas.
Steps to Reproduce
Your Environment
The text was updated successfully, but these errors were encountered: