You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
Environment
Additional context/Screenshots
n/a
The text was updated successfully, but these errors were encountered: