import { IWebApiContext, IWebApiDefinded, SchemaProps } from "../../../typings/api"; import ApiGroup from "../domain/api-group"; export declare function resSchemaModify(schema: SchemaProps, apiItem: IWebApiDefinded, context: IWebApiContext, wrapper?: string): SchemaProps; export declare function addDef2List(definitions: { [defName: string]: SchemaProps; }, schema: SchemaProps | SchemaProps[]): void; export declare function findAllRefType(definitions: { [defName: string]: SchemaProps; }, obj: any, refs?: string[]): SchemaProps[]; export interface ITag { name: string; description: string; } export interface IResponseDef { description: string; schema: SchemaProps; } export interface ISwaggerInfo { description: string; version: string; title: string; contact: { name: string; url: string; email: string; }; } export interface IMethodDefinded { tags: string[]; summary: string; operationId: string; produces: string[]; parameters: any[]; responses: { [status: string]: IResponseDef; }; deprecated: boolean; } export interface IApiDefinded { get?: IMethodDefinded; post?: IMethodDefinded; [methodType: string]: IMethodDefinded; } export interface ISwaggerApisDocs { swagger: string; host: string; basePath: string; info: ISwaggerInfo; tags: ITag[]; paths: { [apiUrl: string]: IApiDefinded; }; definitions: { [defName: string]: SchemaProps; }; } export interface OnError { (param: { level: "warn" | "error"; message: string; }): void; } /** * 转换项目 * @param {ISwaggerApisDocs} apiDocs * @returns {ApiGroup[]} */ export declare function transfer(apiDocs: ISwaggerApisDocs, onError?: OnError): ApiGroup[];