-
Notifications
You must be signed in to change notification settings - Fork 714
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
Why are typings not included in the package? #330
Comments
It also appears that the typings in inversify-dts come from DefinitelyTyped, but since the project is written in TS, why not let TS generate the .d.ts files? You might have a good reason, it just seems backwards to me. See https://github.com/mobxjs/mobx for another example. Written in TS, definitions are generated and included in package.json. |
Hi, Thanks for your feedback. Our problem is that our type definitions have some third party dependencies this means that they contain triple-slash references and for that reason we can't use typings for npm. From the TS docs:
About why not using the auto-generated dts files... when we started the project there was no support for the auto-generation of the dts of UMD modules I think it will be possible in TS 2.0. We have plans to fix these two issues with TypeScript 2.1 becomes available all our Promise based APIs will be migrated using async/await and we will then be able to remove third party dts from bluebird. If you think that you can helps us to improve this we would be happy to accept a PR. |
Are there other third party typings needed except for bluebird? Because I would think it would be pretty easy to create your own typings for a simple promise interface, bluebird is most likely overkill. |
I would actually even think you can just use the typings from lib.es6.d.ts that ships with typescript, and it can automatically output them for you in the definitions, but don't hold me up on that. |
Yes, bluebird is the only one.I think |
I was surprised there were no typings too :D. Thankfully they are available via: Note, any @types modules that needs to be installed by your lib consumers needs to be in |
Hi, I have submit a PR to DefinitelyTyped after it gets merged all the type definitions will be available via |
Hi guys I'm working on this and I have some problems. I'm trying to remove typings and use @types instead for our dev dependencies. I also removed bluebird and replaced with I'm having the following problem:
You can see my changes here. I'm working on a fork. Any help would be much appreciated. Thanks! |
Looks like typings duplication. Did you completely remove old typings folder? |
I'm just copying this link here so I can use it as a reference later... https://basarat.gitbooks.io/typescript/content/docs/types/lib.d.ts.html |
Ok guys so I have good news. The npm module includes now the typings and they are auto-generated. The bad news is that I have to migrate all the other modules and they are not ready yet. There is a new issue to follow the progress on that so I'm closing this issue. Also is interesting to mention that it was possible thanks to an option I wasn't aware. It allows you to target ES5 but use some ES6 features without external libraries. Check "lib Option" in https://basarat.gitbooks.io/typescript/content/docs/types/lib.d.ts.html to find out more. |
I don't quite get why you distribute types in a separate npm package instead of including them in the same package and using the "typings" setting in package.json.
See https://github.com/reactjs/redux/blob/master/package.json#L8 for an example.
The text was updated successfully, but these errors were encountered: