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
Update typings #579
Update typings #579
Conversation
Add generic type to both Promise and Response.
I have reviewed this and this is exactly what I was about to PR. looking forward to this getting released 🌹❤ |
@mzabriskie hi, something wrong with this PR? How can i help you to get this PR done? Happy Holidays! :) |
Is there a reason that these updated Typescript definitions (and the original ones) include their own re-declaration of the This can actually cause issues because you end up with two incompatible Promise types if you directly use the global/polyfilled type elsewhere, which can cause an error like was seen here: #480 (comment) My assumption would be that there's no reason to re-declare Promise at all: for example, see how the fetch API typescript definitions just assume it's available: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/whatwg-fetch/index.d.ts |
@dpoineau i think changing |
And since TypeScript can merge interfaces i doesn't see any problems here http://www.typescriptlang.org/docs/handbook/declaration-merging.html |
Generic type for Promise is important and useful for typescript users. |
@mzabriskie, @rubennorte, @nickuraltsev any update on this really small and useful change? |
https://www.npmjs.com/package/@types/axios There is an types package for axios with Generic type. It's useful and helpful for typescript users. Or I will try to update @types/axios to newest version. |
@Lxxyx this is always solution, but i hope maintainers will accept this PR. Two month from submitting 😕 |
@IRus Yes, I'm ready to write the definition files by myself. |
|
@morlay why? export default works well for me |
@IRus Sorry, I miss this line code |
@mzabriskie, @rubennorte, @nickuraltsev Hi, just want to know is there any problems with this PR |
@mzabriskie, @rubennorte, @nickuraltsev can we merge and release this. It would make types so much better. |
Any progress? cc @nickuraltsev |
Closing in favor of #1061 |
Updating typings.
I used Typescript 2.x
Example of usage before:
Example of usage after:
See also #508