In my project type declaration file, I want to use some Axios types as a part of some of my types, but their declarations are all exported.
I want to use AxiosResponse
and AxiosError
in my declaration file, but there are no dedicated @types
for Axios. And when you look at the Axiox declaration file you can see that all of the interfaces and types have been exported, which make the compiler not automatically use those type no matter how I set up my tsconfig.json
.
Here's my tsconfig:
{
"compilerOptions": {
"target": "es2017",
"outDir": "dist/main",
"rootDir": "src",
"moduleResolution": "node",
"module": "commonjs",
"declaration": true,
"inlineSourceMap": true,
"esModuleInterop": true,
...
"lib": ["es2017"],
"types": ["axios"],
"typeRoots": ["node_modules/@types", "types", "node_modules"]
},
"include": [
"src/**/*"
],
"exclude": [
"./test/**/*"
]
}
I just want to be able to use their interfaces to ensure the types I'm expecting.