How to generate “*.d.ts” in TypeScript?

前端 未结 3 585
猫巷女王i
猫巷女王i 2021-01-24 07:52

How to generate “*.d.ts” in typescript or creates and import @types? Is there any way to create d.ts for jquery plugin or plain javascript library?

3条回答
  •  遇见更好的自我
    2021-01-24 08:24

    File .d.ts is a declaration file.For details see.

    To create .d.ts from a ts file.You only need to add the -d or --declaration parameter during compile using tsc.

    Example:

    tsc -d your_ts_file.ts
    

提交回复
热议问题