如何在 TypeScript 中创建具有类型别名的对象?

How to create object with type alias in TypeScript?

new BaseListState<BrandCriteria, Brand>()

这是有效的,我添加

export type BrandListState = BaseListState<BrandCriteria, Brand>;

然后

new BrandListState()

这是不允许的。有什么办法可以解决这个问题?

您使用的类型别名 (see doco here) 没有构造函数,因此无法使用 new 创建。您需要为此

创建 class
class BrandListState extends BaseListState<BrandCriteria, Brand> {}