在 TypeScript 中描述类和实例

function create(c: {new(): T; }): T {
    return new c();
}

其中 { new(): T } 就代表了 T 的构造 Class

你可能感兴趣的:(在 TypeScript 中描述类和实例)