I'm having a specific typings file which has a modern shape like this.
// something.d.ts
declare function something(...): ...;
declare namespace something {
interface A { ... }
interface B { ... }
}
export = something;
export as namespace something;
I'm trying to consume this module in file which is not a module, so the official module augmentation doesn't work. My task would be to add another function to the something namespace root, and another to the A interface.
I've tried to utilize namespace merging, but it seems like it's not working because instead of merging it thinks that my declaration is the only one, so the original stuff coming from the typings file is not visible at all.
// myGlobalFile.ts
declare namespace something {
function extraFunction();
interface A {
extraFunctionOnA();
}
}
As far as the interface augmentation goes, I've also tried the silly syntax like
// myGlobalFile.ts
interface something.A {
extraFunctionOnA();
}
But of course that's a syntax error so no way it could work, but it represents half of my goal quite well.
How could I augment this module in a file working on the global scope?