Closed raphael10-collab closed 1 year ago
I opened this issue: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/66156#discussion-5434066 : TS2769 : [@typescript/electron] Argument of type '"wheel-event"' is not assignable to parameter of type '"will-resize"
But actually the @types are not defined in a separated @types/electron but "embedded" within electron
In main process :
main
SearchWindow.on("wheel-event", (event, args) => { console.log("SearchWindow.on-wheel-event-args: ", args) })
In the renderer process:
renderer
let propertiesToClone = ['deltaX', 'deltaY', 'metaKey', 'ctrlKey', 'defaultPrevented', 'clientX', 'clientY'] function cloneEvent (e) { let obj = {} for (let i = 0; i < propertiesToClone.length; i++) { obj[propertiesToClone[i]] = e[propertiesToClone[i]] } return JSON.stringify(obj) } setTimeout(function () { window.addEventListener('wheel', function (e) { window.api.electronIpcSend('wheel-event', cloneEvent(e)) }) let scrollTimeout = null window.addEventListener('scroll', function () { clearTimeout(scrollTimeout) scrollTimeout = setTimeout(function () { window.api.electronIpcSend('scroll-position-change', Math.round(window.scrollY)) }, 200) }) }, 0)
People in the Electron Discord Forum say it's a typescript issue.
electron: 25.3.1 typescript: 4.5.4
Would you be so kind in helping find the root cause of the problem, in order to solve it?
I opened this issue: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/66156#discussion-5434066 : TS2769 : [@typescript/electron] Argument of type '"wheel-event"' is not assignable to parameter of type '"will-resize"
But actually the @types are not defined in a separated @types/electron but "embedded" within electron
In
main
process :In the
renderer
process:People in the Electron Discord Forum say it's a typescript issue.
Would you be so kind in helping find the root cause of the problem, in order to solve it?