A project, using Axios+Typescript, I have such a piece of code.
import { AxiosRequestConfig, AxiosResponse } from "axios"
function requestIntercepter(config: AxiosRequestConfig): (AxiosRequestConfig | Promise<AxiosRequestConfig>) {
return config
}
in order to recognize the type of config, I must it"s hard for me to introduce two interface,. Is there any way to identify these two data types without introduction:
tried methods:
- download @ types/axios library (discarded and not maintained)
- added rootType: "node_modules/axios/index.d.ts" to tsconfig.json
- use / < reference path= ".. / node_modules/axios/index.d.ts" > in your type declaration file
none of the above three methods work, is there no way to solve this problem? Obsessive-compulsive disorder looks really uncomfortable.