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
The DOM definition of ImageData right now includes a new field called colorSpace which is not present in the current definition of ImageData of node-canvas. As a result when I compile the jest test which uses node-canvas I get the following erro in typescript:
"Argument of type 'import(\"/..../node_modules/canvas/types/index\").ImageData' is not assignable to parameter of type 'ImageData'.\n Property 'colorSpace' is missing in type 'import(\"/.../node_modules/canvas/types/index\").ImageData' but required in type 'ImageData'."
under the src folder create cropImage.test.ts as follow:
importcropImagefrom'./cropImage'import{ImageData}from'canvas';describe('cropImage',()=>{test('shall crop the image',()=>{constimgData=newImageData(10,10);constresData=cropImage(imgData);expect(resData).not.toBeNull();})});
in Visual Studio code the editor will highlight imgData as invalid type (but the test passes):
Your Environment
Version of node-canvas (output of npm list canvas or yarn list canvas):
Issue
The DOM definition of
ImageData
right now includes a new field called colorSpace which is not present in the current definition ofImageData
of node-canvas. As a result when I compile the jest test which uses node-canvas I get the following erro in typescript:Steps to Reproduce
npx create-react-app my-app --template typescript
npm i -D canvas
src
folder createcropImage.ts
as follow:src
folder createcropImage.test.ts
as follow:imgData
as invalid type (but the test passes):Your Environment
npm list canvas
oryarn list canvas
):The text was updated successfully, but these errors were encountered: