I am trying to set the type of a variable to a property of an object, such as in the code below.
class Foo {
}
const obj = {
Foo,
};
const foo: Foo; // valid
const bar: obj.Foo; // Cannot find namespace 'obj'.
This gives me the error Cannot find namespace 'obj'. Is there a way of setting the type of a variable from an object property, such that foo and bar are of type Foo?