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
Expected behavior:
compiles correctly.
Does not give an error in IDE (VSCode)
I also feel I should be able to specify as DragEventInit to solve this issue as well.
Actual behavior:
error TS2345: Argument of type '{layerX: number; layerY: number; dataTransfer: DataTransfer; }' is not assignable to parameter of type '{dataTransfer?: DataTransfer;}'.
Object literal may only specify known properties, and 'layerX' does not exist in type '{dataTransfer?: DataTransfer;}'.
TypeScript Version: 2.9.2
Search Terms: DragEventInit, drag event init
Code
Expected behavior:
compiles correctly.
Does not give an error in IDE (VSCode)
I also feel I should be able to specify
as DragEventInit
to solve this issue as well.Actual behavior:
Playground Link: http://www.typescriptlang.org/play/index.html#src=export%20class%20DragEventMock%20%7B%0D%0A%20%20%20%20static%20mockDragEvent(%0D%0A%20%20%20%20%20%20%20%20eventType%3A%20'drag'%7C'dragend'%7C'dragenter'%7C'dragexit'%7C'dragleave'%7C'dragover'%7C'dragstart'%7C'drop'%2C%0D%0A%20%20%20%20%20%20%20%20dataTransfer%3A%20DataTransfer%20%3D%20new%20DataTransfer()%0D%0A%20%20%20%20)%3A%20DragEvent%20%7B%0D%0A%20%20%20%20%20%20%20%20const%20event%20%3D%20new%20DragEvent(eventType%2C%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20layerX%3A%200%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20layerY%3A%200%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20dataTransfer%3A%20dataTransfer%0D%0A%20%20%20%20%20%20%20%20%7D)%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20event%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0ADragEventMock.mockDragEvent('drag'%2C%20new%20DataTransfer())%3B%0D%0A
Related Issues:
Should just be able to add to the lib.dom.d.ts file
And then update:
The text was updated successfully, but these errors were encountered: