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

前端 未结 3 477
猫巷女王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:14

    If you want to create the declaration file only, without producing other .js files, you can run the compiler with the emitDeclarationOnly option

    tsc --emitDeclarationOnly
    

    Here is a full list of available compiler options.

提交回复
热议问题