Reputation: 10613
A runnable demonstration of the issue is here:
https://github.com/chriseppstein/typescript_module_augmentation_bug
Basically, it seems like if you have an interface that is in an npm module, it can only be augmented if it is defined in the primary export of that module. I can't find any syntax that allows for declaring an augmentation to the sub module of the package from outside that package.
Upvotes: 2
Views: 141
Reputation: 10613
This is a known limitation. The solution is to move whatever interfaces and code that depends on them into the main export of your module.
https://github.com/Microsoft/TypeScript/issues/18877#issuecomment-333403450
Upvotes: 2