【发布时间】:2020-05-05 07:05:09
【问题描述】:
new BaseListState<BrandCriteria, Brand>()
这是有效的,我添加了
export type BrandListState = BaseListState<BrandCriteria, Brand>;
然后
new BrandListState()
这是不允许的。有什么办法可以解决这个问题?
【问题讨论】:
-
你只声明了一个类型。要
new它,你也需要一个构造函数。查看 RxJS 代码库中的错误“类”。他们既有类型又有演员:github.com/ReactiveX/rxjs/blob/…
标签: typescript typescript-typings type-alias