Apparently, you can say ‘export import xx = module(“xx”)’ in TypeScript.
But what does that mean? I didn’t see that in the spec.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Good observation.
This is a composition technique that makes the entire imported module act like an external module created within the enclosing module. Here is a shortened example:
The export keyword on its own makes a module an external module. In this case, it is making
MyModulean external module of the enclosing module even though it isn’t originally defined inside of the enclosing module.Why?
I guess this is a handy way of re-using modules rather than repeating them in different contexts – making them accessible in more than one place where it seems logical to do so.