Replies: 2 comments
-
Browsing source code on github I find that others struggle exactly like me:
|
Beta Was this translation helpful? Give feedback.
-
Same here :-) using WebStorm with JS (not TS) in Vue, Vitest and HappyDOM. I have tsconfig configured for other libs to simplfy my life in the IDE, but HappyDOM somehow interferes. I have not added its types anyplace I am aware of other than for the tests ( This is likely more a problem with the IDE, but it'd be helpful if somebody knows how to fix/repair this behaviour. I don't know enough about TS and typedef resolution to tackle this. WebStorm apparently finds the type definitions of HappyDOM overriding it's own built in DOM and Browser types and then claims things like "Initializer type IElement is not assignable to variable type HTMLElement" for every native method like /** @type {HTMLElement} */
const eltApp = document.getElementById('app'); I didn't realize at first that Any ideas and solutions are welcome. |
Beta Was this translation helpful? Give feedback.
-
I was maybe a bit fast with opening this issue: #1227
I have a typescript based web framework, that utilises the types in lib.dom.d.ts - the obvious reference. I wonder why happy-dom exposes its interface with own types that are perfectly unrelated with these "public" types. For that reason I used jsdom instead of happy-dom, jsdom exposes the public types. I would like happy-dom to also use the public types, like HTMLElement and so on.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions