-
Notifications
You must be signed in to change notification settings - Fork 10
ES2015 Collection Type Definitions #2
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
Comments
Things get tricky here, since it's technically provided by TypeScript if you enable One thing I'm interested in is whether we want something that works with pure |
I think that would be ideal, as it's unlikely Node will perfectly fit into an ECMAscript standard in the near future. As far as I'm aware, it's not possible to use I'll have an experiment with trying to merge the modular ES2015 lib definitions into |
So the problem we have here, which is the reason why this will probably be done in a separate version/variation of the node typings and not the main one, is that you might get conflicts and break things for users who would use It's the same issue when using I'd love to see typescript allowing conflicts like that, but in the mean time, this will have to be in a separate declarations file probably called We can still Related: #1 |
That's a good point and it probably means this won't be fully solvable until microsoft/TypeScript#4692 is complete, to allow targetting platforms between ES versions in the TS compiler. However, that issue is still at proposal stage and doesn't have a milestone release target, so I believe it would be useful to have an intermediate solution. My thoughts are, if you are developing for Node.JS 4.3, you should target ES5 (the highest fully supported ES version, without any harmony options). You then use a node env definition to help fill in the gaps between ES5 and Node 4.3 (e.g., polyfills, collections). As harmony options become core features across different minor versions, these definitions would need to target minor versions, as opposed to just targeting 4.x. I'm not sure whether this solution belongs in this particular repository though, or in a repository called Any thoughts on this idea? |
I know the problem with TS now, and why Everything in I've added interfaces for |
Actually, I found a workaround. |
We should also add |
Node.JS has used a V8 engine which has supported ES2015 Map/Set constructors since 2.0.0 so it would be useful if their definitions could be added to the [email protected] definition.
The definitions themselves can probably be based on the definition in lib.es6.d.ts.
The text was updated successfully, but these errors were encountered: