You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
One of the excellent things about typings is that, if a .d.ts is specified in the 'typings' field of the package.json of a node module, users of editors such as VSCode will automatically get intellisense for that module, even if they are directly writing JavaScript, and without needing to explicitly install any types. An example is here, and it works excellently.
I'd like to do the same for the cordova-plugin-code-push module, however the tricky thing is that we'd like to define objects on the global namespace. However, I am unable to get this to work by following the examples, and this page suggests that, using the package.json, we may not add anything to the global scope.
Adding something to global scope is common practice for Cordova plugins, and hence I imagine a commonly desired thing. Is there any way to achieve this scenario, such that the end user does not need to explicitly install any types?
The text was updated successfully, but these errors were encountered:
@Silhouettes Type definitions using typings in package.json can't be global. If you want to mutate globals and use external modules, you should be using declare global.
Okay, so as far as I understand, we always require the developer to make some kind of explicit reference to the module, such as a require(), and as a module developer we can't create type definitions that are 'automatically' loaded. It would have been nice to be able to do so, but this makes sense, thank you!
Description
One of the excellent things about typings is that, if a .d.ts is specified in the 'typings' field of the package.json of a node module, users of editors such as VSCode will automatically get intellisense for that module, even if they are directly writing JavaScript, and without needing to explicitly install any types. An example is here, and it works excellently.
I'd like to do the same for the cordova-plugin-code-push module, however the tricky thing is that we'd like to define objects on the global namespace. However, I am unable to get this to work by following the examples, and this page suggests that, using the package.json, we may not add anything to the global scope.
Adding something to global scope is common practice for Cordova plugins, and hence I imagine a commonly desired thing. Is there any way to achieve this scenario, such that the end user does not need to explicitly install any types?
The text was updated successfully, but these errors were encountered: