developit/redaxios

Adding Axios like Typescript support

SalahAdDin opened this issue ยท 6 comments

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

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

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!

also AxiosError

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

Any update for this guys?

blkc commented

May be

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

...

response: AxiosResponse<ResponseType>