Skip to content

Commit

Permalink
feat(printer): 添加新导入类型以支持更丰富的模式
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Jul 19, 2024
1 parent 4dff5e9 commit 6c9f9cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/printer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,17 @@ export class Printer {

return [
//
'/* eslint-disable @typescript-eslint/ban-ts-comment */',
'/* eslint-disable @typescript-eslint/no-explicit-any */',
'',
axiosNamedImport
? // 具名导入
`import {${axiosImportName}} from "${importPath}";`
: // 默认导入
`import ${axiosImportName} from "${importPath}";`,
`import type {${axiosRequestConfigTypeName}, ${axiosResponseTypeName}} from "${importPath}";`,
`import type {OneOf, AllOf, AnyOf, AnyObject, AnyArray} from "${pkgName}/client";`,
`import {resolveURL} from "${pkgName}/client";`,
`import type {OneOf} from "${pkgName}/client";`,
'',
`const BASE_URL=${JSON.stringify(BASE_URL)};`,
].join('\n');
Expand Down

0 comments on commit 6c9f9cd

Please sign in to comment.