【发布时间】:2015-01-26 21:30:56
【问题描述】:
我尝试使用手册“Difference between static/instance side of class”部分下的技巧为类的静态端(即函数)指定接口:
export interface StaticInterface {
info: string;
}
class _X {
static info = 'something';
...
}
export var X: StaticInterface = _X;
但是当我尝试在另一个文件中 extend theModule.X 时,编译器会说:
error TS2305: Module '"..."' has no exported member 'X'.
【问题讨论】:
-
您能否分享一个更完整的代码示例,以便我了解您要执行的操作?
标签: typescript