UNPKG

openapi-ts-request

Version:

Swagger2/OpenAPI3/Apifox to TypeScript/JavaScript, request client(support any client), request mock service, enum and enum translation, react-query/vue-query, type field label, JSON Schemas

23 lines (22 loc) 1.43 kB
import type { OpenAPI } from 'openapi-types'; import type { OpenAPIObject } from './type'; import { type GetSchemaByApifoxProps } from './type'; export declare const getImportStatement: (requestLibPath: string) => string; export declare const getOpenAPIConfigByApifox: (props: GetSchemaByApifoxProps) => Promise<OpenAPI.Document<{}>>; export declare const getOpenAPIConfig: (schemaPath: string, authorization?: string, timeout?: number) => Promise<OpenAPI.Document<{}>>; export declare function parseSwaggerOrOpenapi(content: string | OpenAPI.Document): Promise<OpenAPI.Document<{}>>; export declare function translateChineseModuleNodeToEnglish(openAPI: OpenAPIObject): Promise<boolean | Record<string, string>>; /** * Converts a string to camelCase format, with an option to capitalize the first letter. * 将字符串转换为驼峰格式,并可以选择将首字母大写。 * * @param {string} str - The string to convert. * @param {string} str - 要转换的字符串。 * * @param {boolean} [upper=false] - Whether to capitalize the first letter of the resulting string. * @param {boolean} [upper=false] - 是否将结果字符串的首字母大写。 * * @returns {string} The camelCase formatted string, optionally with a capitalized first letter. * @returns {string} 返回驼峰格式的字符串,可选择首字母大写。 */ export declare const camelCase: (str: string, upper?: boolean) => string;