I generated a .d.ts file from an OpenAPI specification. At the top of the generated file is this:
import type {
OpenAPIClient,
Parameters,
UnknownParamsObject,
OperationResponse,
AxiosRequestConfig,
} from 'openapi-client-axios';
For the last imported thing, Visual Studio Code shows a red line under the identifier AxiosRequestConfig. Further, compiling this with TypeScript generates this error:
src/openadr-3.d.ts:6:3 - error TS2724: '"openapi-client-axios"' has no exported member named 'AxiosRequestConfig'. Did you mean 'RequestConfig'?
6 AxiosRequestConfig,
~~~~~~~~~~~~~~~~~~
The OpenAPI file is for the OpenADR v3 protocol. In case that makes a difference, I can supply a copy.
My setup is -- I have one directory (builder) with a package.json that has scripts for building code into another directory (package) that I'm intending to publish as an npm package.
In builder/package.json here is the relevant code:
In other words, I'm using the CLI tool in openapi-client-axios-typegen, and used it exactly as documented. I also tried the openapicmd typegen tool, as follows, and got exactly the same error.
Grepping for this, I found AxiosRequestConfig mentioned a few times in the axios package, FWIW.
UPDATE: The above error message does not appear alone. Rethinking this, the other error, printed immediately before the above, which is:
node_modules/openapi-client-axios/index.d.ts:3:15 - error TS2498: Module '"/home/david/Projects/openadr/openadr-3-ts-types/package/node_modules/axios/index"' uses 'export =' and cannot be used with 'export *'.
3 export * from 'axios';
~~~~~~~
I generated a
.d.ts
file from an OpenAPI specification. At the top of the generated file is this:For the last imported thing, Visual Studio Code shows a red line under the identifier
AxiosRequestConfig
. Further, compiling this with TypeScript generates this error:The OpenAPI file is for the OpenADR v3 protocol. In case that makes a difference, I can supply a copy.
My setup is -- I have one directory (
builder
) with apackage.json
that has scripts for building code into another directory (package
) that I'm intending to publish as an npm package.In
builder/package.json
here is the relevant code:In other words, I'm using the CLI tool in
openapi-client-axios-typegen
, and used it exactly as documented. I also tried theopenapicmd typegen
tool, as follows, and got exactly the same error.Grepping for this, I found
AxiosRequestConfig
mentioned a few times in theaxios
package, FWIW.UPDATE: The above error message does not appear alone. Rethinking this, the other error, printed immediately before the above, which is: