【发布时间】:2017-03-02 11:50:18
【问题描述】:
我正在开发图书馆 surveyjs
它使用 gulp+webpack 来构建 umd 包。
我想创建用于 typescript 项目的类型定义包(或者可能只是多个 d.ts 文件)。我想要这样的东西:
import * as Survey from 'surveyjs';
Survey.* 的所有内容如下所述: https://github.com/dmitrykurmanov/surveyjs/blob/master/src/entries/ko.ts
我曾尝试使用:github.com/SitePen/dts-generator 和 github.com/TypeStrong/dts-bundle 但没有成功,有人可以展示一下吗我的方向正确吗?
【问题讨论】:
-
uhm.. 你可以在 tscconfig.json 中配置 tsc 以输出声明以及使用 declaration 标志。
-
最后我们用 dts-bundle 实现了它
标签: typescript webpack definitelytyped umd