UNPKG

cis-api-tool

Version:

根据 swagger/yapi/apifox 的接口定义生成 TypeScript/JavaScript 的接口类型及其请求函数代码。

29 lines (28 loc) 767 B
import { OpenAPIV3 } from "openapi-types"; //#region src/utils/apifox.d.ts interface ApifoxExportOptions { scope?: { type?: "ALL" | "FOLDER" | "INTERFACE"; excludedByTags?: string[]; }; options?: { includeApifoxExtensionProperties?: boolean; addFoldersToTags?: boolean; }; oasVersion?: "3.0" | "3.1"; exportFormat?: "JSON" | "YAML"; } interface ApifoxConfig { serverUrl: string; token: string; projectId?: string; exportOptions?: ApifoxExportOptions; } /** * 从 Apifox 获取 OpenAPI 格式的数据 * @param config Apifox 配置 * @returns OpenAPI 文档 */ declare function fetchApifoxOpenAPI(config: ApifoxConfig): Promise<OpenAPIV3.Document>; //#endregion export { ApifoxConfig, ApifoxExportOptions, fetchApifoxOpenAPI };