I am using Angular and I would like to add scriptJS to my project in order to load some script dynamically.
I installed scriptjs
npm i scriptjs
npm install -D @types/scriptjs
Now, the types are defined like this
declare module 'scriptjs'{
var $script: $script;
export = $script;
}
but when I do
$script('blabla.js', function () {})
I am prompted with Can't find name $script
.
I already added other @types package to my project and they are correctly found, but I still struggle when using package that extend the global scope.