It's not possible to add class local interfaces and type declarations like so:
class Foo {
interface Bar {}
private bar: Bar;
}
Up till now, I've been putting everything inside a module:
module Foo {
export interface Bar {}
export class Foo {
private bar: Bar;
}
}
However, I recently found out that you can create class/module "hybrids" so to speak.
class Foo {
private bar: Foo.Bar;
}
module Foo {
export interface Bar {}
}
The compiler does not complain about this and the type checker seems to do everything right. Is this a bad idea? Will it break in the future?