Re:TypeScript support in Electron
by mattmanser on Friday June 02, 2017 @08:28PM
(#14474213)
In the rare cases we find a library that doesn't have a typescript definition, we just do:
declare var Thing : any;
In a global definition file.
Pro tip. We've got a lot of mixed js and ts at the moment and when you're really lazy you can take advantage of how every object is a dictionary in js and just do something like `window["notification"]` instead of window.notification, which resolves to an 'any' type in ts.
Obviously you should try and minimise that usage, but it's a useful trick to know.
Pro tip. We've got a lot of mixed js and ts at the moment and when you're really lazy you can take advantage of how every object is a dictionary in js and just do something like `window["notification"]` instead of window.notification, which resolves to an 'any' type in ts.
Obviously you should try and minimise that usage, but it's a useful trick to know.