Hi all, I have a code below
class C1{
load1(){}
}
class C2{
load2(){}
}
class C3{
load3(){}
}
type clsName = typeof C1 | typeof C2;
const mapper: Record<"c1" | "c2", clsName> = {
"c1": C1,
"c2": C2,
}
When calling new mapper["c1"]().load1() => there is error, how could I invoke a method of a class depending on the input of the Record type