I am currently working on a project that requires me to export typings for two separate Java libraries, each with its own unique class hierarchy.
libName
`-namespace1
`-Class1 // full class Name: (libName.namespace1.Class1)
-Class2 // full class Name: (libName.namespace1.Class2)
and the other library:
org
`-libName
`namespace123
`-Class1 // full class Name: (org.libName.namespace123)
`public method1(param0: libName.namespace1.Class1): void
The base.d.ts file has the following structure:
declare module libName {
export module namespace1 {
export class Class1 {
/* omitted for brevity */
}
export class Class2 {
/* omitted for brevity */
}
}
}
declare module org {
export module libName {
export class Class1 {
public method1(param0: libName.namespace1.Class1): void
}
}
}
However, when I try to compile the above code, I encounter an error TS2305, stating "Module 'org.libName' has no exported member 'namespace1'". This happens because TypeScript Compiler assumes that I want to use the module declared in the same scope.
Does anyone know of a workaround for this limitation? Your help is greatly appreciated!