如何使用.js到.ts的库

时间:2018-06-09 05:05:08

标签: javascript typescript webpack

我无法找到如何在.ts文件中使用该库,该文件在.js中声明。
我有以下情况:

  1. 我有app.js,其中我宣布了
  2. 我的其他文件是用TypeScript编写的,其中我想使用axious
  3. 我试图宣称自己是:

    declare var axios: any;
    

    但是通过这种方式,我失去了IDE的提示。解密文件已存在于库中。它可以合并到我的.d.ts文件中吗? 我将如何使用:

    <html>
    <head>
    ...
    </head>
    <body>
    ...
    <script type="text/javascript" src="app.js"></script>
    <script type="text/javascript" src="app_ts.js"></script>
    </body>
    </html>
    

0 个答案:

没有答案
相关问题