How to use external js in typescript

I am creating Angular JS code through Typescript code. In one situation, I need to add an external JS file to my Typescript file and access the classes in the js file.

I am adding this js file as follows.

/// <amd-dependency path="../../vendor/tweenMax.js" />

But the Typescript file cannot identify the objects of this javascript file.

If someone knows a suitable method, add your answer. (I am using the min. Js file)

+3
source share
1 answer

For any TypeScript packages, you need a file .d.ts(TypeScript definition file). Dependency links are only for TypeScript files (not plain js).

https://github.com/borisyankov/DefinitelyTyped

addin .d.ts, interface ( , ).

, - , <any> - ( , , JS):)

+6

Source: https://habr.com/ru/post/1607431/


All Articles