I have a compact TypeScript library that is exported as UMD, and I generate the *.d.ts file automatically by setting "declaration": true
in my tsconfig.
The exported file contains:
export class Blue {
alert(): void {
console.log('alerted');
}
}
When using the exported UMD module, it declares a window.myLib
variable.
The d.ts file is structured as follows:
export declare class Blue {
alert(): void;
}
Now, whether through webpack or an undiscovered TypeScript configuration, I am looking for a way to automatically add the following line to the d.ts file:
export as namespace myLib;
Is there a method to achieve this? Appreciate any guidance.