-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic resolution of internal Typescript modules in separate files? #220
Comments
With NodeJS one needs to use CommonJS, not internal modules. Does that make sense? |
Yes. I guess my issue is at this point in time there is poor support for the concept of a single external module split across multiple files. How do I implement private/internal classes that help a module do its job? |
Yes, that's right. See microsoft/TypeScript#17
The only option for a truly private class is to have it in the same file. We don't normally do this, preferring instead to defining "internal" type classes externally and importing them into the main class. |
I appreciate your responses Noel. Do we have to wait for ECMA6 before we have a robust modular pattern for TS, or does ECMA5 have the necessary semantics? |
TS already supports ES6 modules (as of 1.5). It's an improvement on the old module system, but I don't think there's anything in the pipeline for solving multi-file external modules. Probably the best bet is to close this issue and raise a question on the TS forum. |
Or better still on typescript gitter: https://gitter.im/Microsoft/TypeScript |
I have a ASP.net project that uses TS with internal modules and has a file per class. As long as the module name is the same in the file, all exported members can be seen in all files automatically without needing to use the old
///<reference..../>
convention.This does not seem work when using a nodejs application template.
I am trying to confirm that this does not work, and I am not doing something wrong.
The text was updated successfully, but these errors were encountered: