Given an interface:
interface IAnInterface {
}
How to reference and point to a class type that implements that interface?
Meaning, given a class:
class AClassThatImplmentsAnInterface implements IAnInterface {
}
How to reference the type that is a class type? If it was just classes we could use typeof:
typeof AClassThatImplementsAnInterface
but at the interface level, which point to all the classes that implements the interface:
typeof IAnInterface
gives the error:
'IAnInterface' only refers to a type, but is being used as a value here. (2693)
I want to do something like:
type IClassTypeMapping = {
[names in SomeLiteralStringUnion]: Class<IAnInterface>
}
Of course Class doesn't exist in TypeScript. How to reference the equivalent of Class<IAnInterface>? Is it even possible in TypeScript?