Skip to content
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

Adding Axios like Typescript support #86

Open
SalahAdDin opened this issue Jun 8, 2022 · 6 comments
Open

Adding Axios like Typescript support #86

SalahAdDin opened this issue Jun 8, 2022 · 6 comments

Comments

@SalahAdDin
Copy link

Testing this package with Typescript, we are getting this:
import axios, { AxiosInstance, AxiosRequestConfig } from 'redaxios';

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

As far as we understand, there is a simple typing support, so, we don't understand why this package does not include the standard axios types.

Thank you

@junodluk
Copy link

junodluk commented Aug 2, 2022

Yes, this alone made me revert to axios, since I can't type my requests the right way without the AxiosResponse type.

@SalahAdDin
Copy link
Author

Yes, this alone made me revert to axios, since I can't type my requests the right way without the AxiosResponse type.

Actually, that's my case too!

@mrlectus
Copy link

mrlectus commented Jul 5, 2023

also AxiosError

@VitAndrGuid
Copy link

Possible workaround
import axios, { Options as AxiosRequestConfig } from "redaxios";

@safeimuslim
Copy link

Any update for this guys?

@blkc
Copy link

blkc commented Oct 27, 2023

May be

import type {
  Options as AxiosRequestConfig,
  Response as AxiosResponse,
} from 'redaxios'

...

response: AxiosResponse<ResponseType>

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

No branches or pull requests

6 participants