I have the type of a class like here as A_Type?
class A {
constructor(public a: string) {}
}
type A_Type = {new (a: string): A}
And Id like to get the type of the instance of the A_Type constructor, so that I could type this function explicitly
class A {
constructor(public a: number) {}
}
// ** not working **
function f<W extends { new(a: number): A }>(e: W): instanceof W {
return new e(2)
}
let w = f(A)
I am basically searching for the reverse operation of typeof in typescript.