If you want to export a module from a file but want it split into multiple segements you can do the following :
module Foo {
export var DEBUG = false;
}
module Foo.Utils {
export function fooFunc() : void { if(Foo.DEBUG) doIt() }
}
export = Foo;
That said. You don't need to use internal modules if you are using external modules. Here's the difference : https://www.youtube.com/watch?v=KDrWLMUY0R0&hd=1