重新:
Cannot augment module 'angular' with value exports because it resolves to a non-module entity.
因为角度类型的定义是:
declare var angular: angular.IAngularStatic;
export = angular;
不能再定义表单中的任何项
angular.foo.bar
在运行时存在的,例如
qextras.PromiseState
,因为他们会与
angular
qextras.承诺状态
而且它的常量在运行时并不是由angular-q-extras在这个名称下定义的(也许它们在另一个名称下?我不明白这些棱角分明的东西是怎么工作的),所以用这种方式来声明它们是误导人的。您可以做的一件事是只声明一个类型而不是枚举:
type PromiseState = 'fulfilled' | 'rejected';
你可能认为你可以使用
const enum
常量枚举
以及
角度的
编译时的变量。(编辑:
confirmed by the TypeScript team
.)
看起来像是
IPromise
declare module 'angular'
没有通过。
你没有问这个问题,但在我看来你还需要删除
namespace angular
IQService
. AIUI,即使角度类型声明有
命名空间角度
,扩展的根是角度类型声明指定为导出的内容,即
命名空间角度
,所以你不应该再筑巢
命名空间角度
.