I have some classes with a static variable indicating their type. I want to create a union type based on thoses static variables
class Foo {
static typeId = 'i-am-foo';
}
class Bar {
static typeId = 'i-am-bar';
}
type MyUnionType = Foo.typeId | Bar.typeId;
Unfortunately this is not possible, I get the error
'Foo' only refers to a type, but is being used as a namespace here.
Is it possible to use static variables for type definitions?