TypeScript merging declarations for nested namespaces

There is an external module declaration with the form:

declare module "external-module" {
  namespace SomeNS {
    namespace SubNS {
      // some functions.
      function someFunc(): void;
    }
  }
  exports = SomeNS;
}

I can perform some functions like SomeNS.subNS.someFunc(). But now I found one method function methodMissingDefinition() {}, skipping its definition, and I want to fix it correctly in my code without changing a third-party declaration.

Are there any tricks that let me do this?

Or is it impossible to do, and the only way is to convince the author to correct the ad?

+4
source share

Source: https://habr.com/ru/post/1648226/


All Articles