I'm loading a JS file through a <script src="http://.../script.js">
In the JS, there is a namespace "foo", and a method "bar".
I would like to call foo.bar() from my component.
I'd like to add type definitions so that I know what I'm doing while I'm coding. I have the file script.d.ts with type definitions. It looks like this:
export as namespace foo;
export namespace Baz {
interface Qux {
// ...
}
}
export function bar(): Baz.Qux;
I can't figure out how to include this file in the Angular build (using CLI), so that I get type checks during build, but at runtime the namespace and function in the external JS file will be called from my component. Help?