Made the 'version' string an exported property#2245
Conversation
|
👍 |
|
It would also be great if we add a comment about the version and what means and on the services version and why it is different ". |
There was a problem hiding this comment.
Why do you need this namespace qualifier? You should have access to all the exports in the ts module.
There was a problem hiding this comment.
I don't NEED it, I just LIKE it 😄
The main reason however, is that 'version' is a really common identifier throughout our code base. I just wanted to make it clear this was the top-level module property, and not some local or closure reference.
|
Updated with the comments per Mohamed's suggestion. I used JsDoc to ensure this is exported to the .d.ts files, as this is what most projects will be referencing when consuming these properties, and thus the comments will show in intellisense. |
Made the 'version' string an exported property
I put this in program.ts rather than core.ts as core.ts doesn't contribute to typescript.d.ts, and this should be a publicly exported property.
Exposing a 'version' property is pretty standard in JavaScript libraries. This will be accessible as "ts.version" in both tsc.js and typescriptServices.js.