I have downloaded the type definition of a module, let's say ModuleA, from @types/module-a
.
The module-a.d.ts file looks like
declare module "module-a" {
export = moda;
}
declare namespace moda {
interface MODAPromise<T> {
isResolved(): boolean;
....;
}
}
Now, in my application, I find that I need to extend these types with some additional specifications.
Following advice received earlier, I build in my src directory a file module-a.augmented.d.ts such at this
declare module "module-a" {
export interface MODAPromise {
myNewProperty: any;
}
}
If I do so though, TypeScript signals an error "An export assignment cannot be used in a module with other exported elements." in line
export = moda;
of module-a.d.ts. Is there a way to extend such type of declaration without having to touch the original module-a.d.ts file?