Generic and typeof T in the parameters
You can use this type of constructors: { new (): ClassType }. class MyManager<T> { private cls: { new(): T }; constructor(cls: { new(): T }) { this.cls = cls; } createInstance(): T { return new this.cls(); } } class MyClass {} let test = new MyManager(MyClass); let a = test.createInstance(); console.log(a instanceof MyClass); // … Read more