Multiple Exports and Namespaces
Learn how to import multiple symbols from a module using named imports or the * as syntax for namespace attachment.
We'll cover the following...
We'll cover the following...
Multiple exports
When working with external libraries—that is, libraries that have been published for general consumption—it is common practice for a published library to export all classes, functions, and interfaces from a single module file.
This means that we do not need to know how this library is structured or how complex the class hierarchy is internally; we simply import the entire library from one file.
As an example of this technique, suppose we have a file named modules/MultipleExports.ts, as follows:
- We export two classes from this module file, which are named
MultipleClass1andMultipleClass2.
We can then import both of these classes in our modules_main.ts file as follows:
...