0

I'm trying to make the code cleaner by creating namespaces in different directories and then exporting them all through one namespace.

Here's what I'm doing that works:

export namespace Main {
    export namespace Foo { // <-- this works
        
    }
}

But importing Foo from another file and exporting it to Main does not work: ie

// foo.ts
export namespace Foo {
}

// main.ts
import { Foo } from './foo.ts'
export namespace Main {
    export namespace Foo = Foo; // <- invalid syntax
}

I've googled so much and I just can't find the syntax how do I export Foo if it exists in another file.

Thank you in advance.

tosi
  • 611
  • 9
  • 24
  • actually https://stackoverflow.com/questions/30357634/how-do-i-use-namespaces-with-typescript-external-modules but that doesn't answer the question on how to assing namespace – Dimava Dec 09 '22 at 11:36
  • I don't see anything inside that question that solves my problem – tosi Dec 09 '22 at 11:47
  • @TanekLoc Yes it does – tosi Dec 11 '22 at 12:07

0 Answers0