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

responseEncoding is missing from typescript definitions #1866

Closed
stropitek opened this issue Nov 3, 2018 · 7 comments
Closed

responseEncoding is missing from typescript definitions #1866

stropitek opened this issue Nov 3, 2018 · 7 comments

Comments

@stropitek
Copy link

stropitek commented Nov 3, 2018

Summary

the responseEncoding property of the axios config is missing from the AxiosRequestConfig typescript definitions.

Context

The property is documented in the README but not present in the typescript definitions.

  • axios version: v0.18.0
  • Environment: node v11.1.0
@stefanpl
Copy link

Still an issue with v 0.19.0

@lixaotec
Copy link

Any workaround?

@Dr-Xperience
Copy link

It's been over 2 years and I am bit suprise to see no maintainer added a single line to the interface.

@XLCYun
Copy link

XLCYun commented Aug 7, 2020

Related to PR #2619 .

@jasonsaayman
Copy link
Member

Please look at #2619, it this does not resolve the issue please open a new issue.

@JavierPAYTEF
Copy link

This is still not resolved yet. The PR pointed in the last comment was closed without resolution also.

In case anyone else finds this issue, a workaround to at least be able to compile, is to create a .d.ts in your source and add the following code:

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import AxiosRequestConfig from "axios";

declare module "axios" {
  export interface AxiosRequestConfig {
    responseEncoding?: string;
  }
}

Of course this is not the best "typing" but at least it works until the issue with the types is resolved.

@jasonsaayman
Copy link
Member

Please see #4141

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.

8 participants