我为我的服务结果创建了一个TypeScript
接口。现在我想为里面的两个函数定义一个基本的功能。问题是,我得到一个错误:在TypeScript中实现接口的原型
The property 'ServiceResult' does not exist on value of type 'Support'.
我用WebStorm
发展(VS2012
让我很紧张,因为对大项目冻结 - 等待更好的整合:P)。
这里是我如何做到这一点:
module Support {
export interface ServiceResult extends Object {
Error?: ServiceError;
Check?(): void;
GetErrorMessage?(): string;
}
}
Support.ServiceResult.prototype.Check =() => {
// (...)
};
Support.ServiceResult.prototype.GetErrorMessage =() => {
// (...)
};
我也试图在我的原型移动到模块,但同样的错误还是......(当然我删除Support.
前缀)。