I am encountering an issue with generating TypeScript code that includes nested namespaces. The specific problem arises when there is a namespace inside of another namespace, causing the inner one to overshadow the outer one.
namespace A {
export type MyType = number
}
namespace B {
const myValue: A.MyType = 6
namespace A {
}
}
To try and resolve this, I attempted to access the root-level 'A' namespace without modifying any names:
namespace A {
export type MyType = number
}
namespace A_root = A //<--not a valid syntax
namespace B {
const myValue: A_root.MyType = 6
namespace A {
}
}
Unfortunately, my attempt was unsuccessful and it seems that accessing the root-level namespace without altering naming conventions may not be possible. If necessary, I might have to resort to adding suffixes to the existing namespace names (e.g. A_0, A_1) even though this solution is less than ideal aesthetically.