TypeScript disambiguates between instantiated namespaces (ValueModule) and non-instantiated (NamespaceModule), see TypeScript/src/compiler/binder.ts:getModuleInstanceStateWorker. The former is visible in the emitted JS, the latter is fully erased.
In C++, we have namespace and class. The former, in some sense, may only contain static functions and variables. It may be a good idea to emit some namespaces to namespace instead of js_ref<> so using namespace works and variable declarations do not. However, we have to disambiguate them manually and generate slightly different code for namespace and class.
A class in JavaScript is a special constructor function which should be called with a new Foo() syntax instead of Foo(). Moreover, any function is an object itself, and an object may have any properties it want. So, a class may have nested classes. TypeScript will see it as Class | ValueModule:
Similarly, it's possible to have Interface | ValueModule, but it will be emitted to JS as a simple namespace, because interfaces are not emitted.