从 dist 文件夹拉取时的打字稿定义



当你从dist文件夹中提取类时,有没有办法定义类的类型?

又说,有时候我会做...

import MyClass from "dist/classes/myClass.ts";
const instance = new MyClass();

您如何编写也适用于这种情况的.d.ts文件,或者这可能吗?

你如何编写一个也适用于这种情况的 .d.ts 文件,或者这可能吗?

tsconfig.json中使用declaration:true进行编译,并在 package.json 中使用types

更多

快速入门中介绍:https://basarat.gitbooks.io/typescript/content/docs/quick/nodejs.html

相关内容

最新更新