【发布时间】:2016-08-30 03:30:37
【问题描述】:
尝试从旧的 tsd.json 迁移到 typings.json。以前我的.d.ts 有:
declare var modname: modname.modname;
declare module modname {
export interface modname {
new (): modname;
}
export interface foo {
bar: string;
}
}
declare module "mod-name" {
export = modname;
}
然后由于错误,我将第一行更改为:
declare var modname: modname.modname;
declare namespace modname {
然后得到:
TS2665:模块扩充无法在顶级范围内引入新名称。
也许我打算以不同的方式安装 Typings? - 我注意到奇怪的脚手架被自动添加到我的定义文件中,这些文件是通过以下方式安装的:
typings install github:user/typ/mod-name/mod-name.d.ts --save
【问题讨论】:
标签: syntax typescript tsc typescript1.8 tsd