svelte icon indicating copy to clipboard operation
svelte copied to clipboard

[chore] Add HTMLCanvasElement to global

Open elamje opened this issue 3 years ago • 3 comments

Compiler is not recognizing this name. See #6643 where HTMLElement was added to the globals.

elamje avatar Aug 07 '22 20:08 elamje

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

baseballyama avatar Aug 08 '22 06:08 baseballyama

#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.

bluwy avatar Aug 10 '22 05:08 bluwy

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.

jasonlyu123 avatar Aug 10 '22 07:08 jasonlyu123

Close in favor of https://github.com/sveltejs/svelte/pull/7786

Thank you for your contribution @elamje !

baseballyama avatar Sep 04 '22 04:09 baseballyama