How to import a js library without definition file in typescript file

前端 未结 5 1765
温柔的废话
温柔的废话 2020-12-01 03:23

I want to switch from JavaScript to TypeScript to help with code management as our project gets larger. We utilize, however, lots of libraries as amd Modules, which we do no

5条回答
  •  我在风中等你
    2020-12-01 03:49

    Create a file in lib called errorInfoHandler.d.ts. There, write:

    var noTypeInfoYet: any; // any var name here really
    export = noTypeInfoYet;
    

    Now the alert import will succeed and be of type any.

提交回复
热议问题