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

Axios class typings are incorrect in v0.22.0 #4131

Closed
gstamac opened this issue Oct 4, 2021 · 2 comments
Closed

Axios class typings are incorrect in v0.22.0 #4131

gstamac opened this issue Oct 4, 2021 · 2 comments

Comments

@gstamac
Copy link

gstamac commented Oct 4, 2021

Describe the bug

Typing definitions in v0.22.0 are incorrect for Axios class methods. Request (eg. https://github.com/axios/axios/blob/master/index.d.ts#L146) methods typings indicate request data and response should be the same type. That is not correct.

To Reproduce

Use any request method in typescript and define data property of the config object. It will expect the response to be of the same type.

Expected behavior

Types should be something like this

export class Axios {
.......
  request<T = never, R = AxiosResponse<T>, RC = any> (config: AxiosRequestConfig<RC>): Promise<R>;
.......
}

Environment

  • Axios Version 0.22.0

Additional context/Screenshots

n/a

@TheVaan
Copy link

TheVaan commented Oct 4, 2021

Duplicate to #4109

@jasonsaayman
Copy link
Member

Closing please see #4109

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 a pull request may close this issue.

3 participants