Lately, I've encountered difficulties with creating large TypeScript modules, and there's one thing that has been puzzling me. Specifically, the following scenario doesn't seem to work:
// file A.ts
export = class A {
}
// file main.ts
import A = require('./A');
class B {
a : A; // Cannot find name A
}
However, the situation changes when the code is structured like this:
// file A.ts
export = class A {
}
// file main.ts
import A = require('./A');
class B extends A {
constructor() {
super();
}
}
Why is it that in one instance, it can identify the A
class while in the other instance it cannot? Is there something fundamental about how attributes are defined in classes that I am overlooking?