How to specify any newable type in TypeScript?
You can use { new(...args: any[]): any; }
to allow any object with a constructor with any arguments.
class A {
}
class B {
public Foo(newable: typeof A):void {
}
public Bar(newable: { new(...args: any[]): any; }):void {
}
}
var b = new B();
b.Foo(A);
b.Bar(A); // no error
b.Bar({}); // error