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
26 lines (25 loc) • 2.17 kB
TypeScript
import type { ArraySchemaObject, BinaryArraySchemaObject, ComponentsObject, ISchemaObject, NonArraySchemaObject, OpenAPIObject, OperationObject, ReferenceObject, SchemaObject } from '../type';
import type { ITypeItem } from './type';
export declare function stripDot(str: string): string;
export declare function resolveTypeName(typeName: string): string;
export declare function getRefName(refObject: ReferenceObject | string): string;
export declare function getLastRefName(refPath?: string): string;
export declare function getDefaultType(schemaObject?: ISchemaObject | string, namespace?: string, schemas?: ComponentsObject['schemas']): string;
export declare function getDefaultFileTag(operationObject: OperationObject, apiPath: string): string[];
export declare function handleDuplicateTypeNames(interfaceTPConfigs: Array<Pick<ITypeItem, 'typeName' | 'displayLabelFuncName'>>): void;
export declare function getBasePrefix(paths: string[]): string;
export declare function genDefaultFunctionName(path: string, pathBasePrefix: string): string;
export declare function getFinalFileName(s: string): string;
export declare function replaceDot(s: string): string;
export declare function resolveFunctionName(functionName: string, methodName: string): string;
export declare function markAllowedSchema(schemaStr: string, openAPIData: OpenAPIObject): void;
export declare function isReferenceObject(schema: unknown): schema is ReferenceObject;
export declare function isSchemaObject(schema: unknown): schema is SchemaObject;
export declare function isNonArraySchemaObject(schema: unknown): schema is NonArraySchemaObject;
export declare function isArraySchemaObject(schema: unknown): schema is ArraySchemaObject;
export declare function isBinaryArraySchemaObject(schema: unknown): schema is BinaryArraySchemaObject;
export declare function resolveRefs(obj: OpenAPIObject, fields: string[]): unknown;
export declare function isAllNumeric(arr: any): boolean;
export declare function isAllNumber(arr: any): boolean;
export declare function capitalizeFirstLetter(str: string): string;
export declare const parseDescriptionEnum: (description: string) => Map<number, string>;