UNPKG

@lonu/stc

Version:

A tool for converting OpenApi/Swagger/Apifox into code.

40 lines 1.36 kB
import type { DefaultConfigOptions, IDefaultObject } from "./swagger.js"; /** * 支持的配置文件名,按查找优先级排序 */ export declare const CONFIG_FILE_NAMES: string[]; /** * 配置文件中支持的选项(与 CLI 选项同名,`plugins` 除外) */ export type IConfigFileOptions = Partial<Omit<DefaultConfigOptions, "plugins">> & IDefaultObject; /** * 查找配置文件 * * @param explicitPath - 通过 `--config` 显式指定的路径 * @returns 配置文件路径,未找到时返回 undefined */ export declare const findConfigFile: (explicitPath?: string) => Promise<string | undefined>; /** * 读取并解析配置文件内容 * * @param path - 配置文件路径 * @returns 配置对象 */ export declare const parseConfigContent: (content: string, path: string) => IDefaultObject; /** * 加载配置文件 * * @param explicitPath - 通过 `--config` 显式指定的路径 * @returns 配置对象,未找到配置文件时返回空对象 */ export declare const loadConfigFile: (explicitPath?: string) => Promise<{ options: IDefaultObject; path?: string; }>; /** * 规范化配置:`filter`、`globalHeader` 支持字符串或字符串数组 * * @param options - 配置对象 */ export declare const normalizeConfig: (options: IDefaultObject) => IDefaultObject; //# sourceMappingURL=config.d.ts.map