Skip to content

Add TypeScript typings#31

Closed
resynth1943 wants to merge 9 commits intodevelopit:masterfrom
resynth1943:master
Closed

Add TypeScript typings#31
resynth1943 wants to merge 9 commits intodevelopit:masterfrom
resynth1943:master

Conversation

@resynth1943
Copy link
Copy Markdown

Hey there! I don't use this library, but I noticed people were asking for TypeScript typings: #22, so I thought I would help out and add them. If there's anything you're not happy with, hit me up :-)

@googlebot
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@resynth1943
Copy link
Copy Markdown
Author

@googlebot I signed it!

@googlebot
Copy link
Copy Markdown
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@resynth1943
Copy link
Copy Markdown
Author

/cc @developit

@developit
Copy link
Copy Markdown
Owner

developit commented May 11, 2020

@resynth1943 - these look good! I'm wondering if it would be possible to somehow re-export Axios's original typings though? That would mean folks could move between the two libraries without causing any type errors.

I'm not super knowledgeable about TypeScript, so I might be suggesting something that is totally impossible 😂

resynth1943 and others added 2 commits May 12, 2020 19:23
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
@resynth1943
Copy link
Copy Markdown
Author

resynth1943 commented May 17, 2020

these look good! I'm wondering if it would be possible to somehow re-export Axios's original typings though? That would mean folks could move between the two libraries without causing any type errors.

Hmm, not sure... I'll try and look into it.

Co-authored-by: Ryan Christian <33403762+RyanChristian4427@users.noreply.github.com>
@googlebot
Copy link
Copy Markdown
Collaborator

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@resynth1943
Copy link
Copy Markdown
Author

Oh my god, not this again.

@rschristian
Copy link
Copy Markdown

@googlebot I fixed it.

@googlebot
Copy link
Copy Markdown
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@developit
Copy link
Copy Markdown
Owner

developit commented Jul 15, 2020

Hiya @resynth1943! This looks pretty nice, and it's clear there's more type safety possible by moving the types into a dedicated declaration file like you have done here. Any ideas for how we could combine this with the JSDoc tweaks from #33?I was thinking maybe we could have the declaration be where all the interfaces are kept, and then use JSDoc to associate those in the library code (mainly as a development aide). Too weird?

@resynth1943
Copy link
Copy Markdown
Author

resynth1943 commented Jul 30, 2020

Oh dang, I've never had to maintain JSDoc alongside TypeScript (I personally dislike JSDoc). I can look into it though, if you want ...?

@gianpaj
Copy link
Copy Markdown

gianpaj commented Oct 5, 2020

could somebody by any chance add TS types to this repo or create a @types/redaxios? 🙏

@resynth1943
Copy link
Copy Markdown
Author

Oh shit this is still open?

@samwhiteiv
Copy link
Copy Markdown

possible to merge this? would be greatly appreciated!

also, could somebody please add TS types to this repo or create a @types/redaxios? thank you

@rschristian
Copy link
Copy Markdown

@samwhiteiv Types are already shipped, and have been for quite a while. They're just generated from JSDoc rather than authored directly. See #33

@samwhiteiv
Copy link
Copy Markdown

noted. thanks @rschristian

@kitsune7
Copy link
Copy Markdown

kitsune7 commented Feb 7, 2022

If types have already been shipped for this, should we close this PR?

@developit
Copy link
Copy Markdown
Owner

Yep, sorry about that. There might still be some improvements to be had in the JSDoc types though.

@developit developit closed this Apr 29, 2022
@SalahAdDin
Copy link
Copy Markdown

Well, it seems there is no update on this issue, so bad.

I can't get import axios, { AxiosInstance, AxiosRequestConfig } from 'redaxios'; working:

Module '"redaxios"' has no exported member 'AxiosInstance'. Did you mean to use 'import AxiosInstance from "redaxios"' instead?

@rschristian
Copy link
Copy Markdown

Well, it seems there is no update on this issue, so bad.

bad?

I can't get import axios, { AxiosInstance, AxiosRequestConfig } from 'redaxios'; working:

That's correct behavior for now, as neither type exists. Mind creating a new issue for adding these types? Comments in a closed PR aren't great for tracking potential hiccups for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants