When you write a class A
in Typescript, the type A
is not actually the type of what the identifier A
refers to in Javascript. A
is the type of the instances of A
. So, what is the type of A
?
Take this example :
class A {}
const B: ? = A;
const a = new B();
If we were to type B explicitly, what should we write to make this code compile ?