svelte
svelte copied to clipboard
[chore] Add HTMLCanvasElement to global
Compiler is not recognizing this name. See #6643 where HTMLElement was added to the globals.
This way will eventually register all of interfaces of lib.dom.d.ts, but should we go this way?
https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts
#7768 is a bit similar to this, and could benefit with some script that automates reading lib.dom.d.ts and adding those as known globals 🤔 It won't be futureproof though but might be the easier way to reach correctness.
Reading lib.dom.d.ts sounds like a good idea. I tried to write a script from scratch to read the global from the same source as lib.d.ts but turn out to be quite complex and output a lot of globals that are neither in chromium nor firefox.
Close in favor of https://github.com/sveltejs/svelte/pull/7786
Thank you for your contribution @elamje !