class Foo {}
const classType: typeof Foo = Foo; // classType is of type 'typeof Foo'
const someVar = Foo; // someVar is of type 'typeof Foo'
const instance = new classType(); // You can create an instance of Foo using classType
console.log(`classType: ${classType}`); //
console.log(`someVar: ${someVar}`);
console.log(`classType === someVar: ${classType === someVar}`); // classType === someVar: true
console.log(`classType: ${classType}`); // classType: class Foo {}
console.log(`typeof Foo: ${typeof Foo}`); // typeof Foo: function
console.log(`typeof classType: ${typeof classType}`); // typeof classType: function
For now, ts-morph returns typeof Foo for the type of someVar -- that seems a strange Type in a Famix model. Perhaps Java has a similar thing? @nicolasanquetil
Consider the following:
For now, ts-morph returns
typeof Foo
for the type ofsomeVar
-- that seems a strange Type in a Famix model. Perhaps Java has a similar thing? @nicolasanquetil