We're a place where coders share, stay up-to-date and grow their careers.
There is a way to extend the Window interface and declare the type of your globals so that you don't lose TS's help (using any should always be avoided):in a typings.d.ts file possibly at the root of your source folder, write something like that:
Window
any
declare global { interface Window { myGlobal: string; } }
Elegant. I’ve gone through a few other things. I’ll try it out.
There is a way to extend the
Window
interface and declare the type of your globals so that you don't lose TS's help (usingany
should always be avoided):in a typings.d.ts file possibly at the root of your source folder, write something like that:Elegant. I’ve gone through a few other things. I’ll try it out.