Static variables are always available through the class name. A class object acts like an object with properties. The closest you could come is perhaps:
with (MockFamily) { instances.push(this); }
Although I would not recommend it.
Modules are another thing. At run time, their contents are variable in the function area, and can be accessed almost anywhere inside.
module MyModule { var instances: IFamily[] = []; export class MockFamily implements IFamily { constructor (nodeClass: { new (): Node; }, engine: Engine) { instances.push(this); } } }
source share