import type { AstNode } from './compiler'; import { Surrounding } from '../types/pontConfig'; export declare enum PrimitiveType { number = "number", string = "string", boolean = "boolean" } declare class Contextable { private context; constructor(arg?: {}); getContext(): T; setContext(context: T): void; getDsName(): string; toJSON(): Pick>; } export declare class StandardDataType extends Contextable { typeArgs: StandardDataType[]; /** 例如 number,A(defs.A),Array,Object, '1' | '2' | 'a' 等 */ typeName: string; isDefsType: boolean; /** 指向类的第几个模板,-1 表示没有 */ templateIndex: number; /** 其他的任意参数 */ anyProps: Record; compileTemplateKeyword: string; enum: Array; setEnum(enums?: Array): void; typeProperties: Property[]; constructor(typeArgs?: StandardDataType[], /** 例如 number,A(defs.A),Array,Object, '1' | '2' | 'a' 等 */ typeName?: string, isDefsType?: boolean, /** 指向类的第几个模板,-1 表示没有 */ templateIndex?: number, /** 其他的任意参数 */ anyProps?: Record, compileTemplateKeyword?: string); static constructorWithEnum(enums?: Array): StandardDataType; static constructorFromJSON(dataType: StandardDataType, originName: string, defNames: string[]): StandardDataType; setTemplateIndex(classTemplateArgs: StandardDataType[]): void; getDefNameWithTemplate(): void; generateCodeWithTemplate(): void; getDefName(originName: any): string; getEnumType(): string; /** 生成 Typescript 类型定义的代码 */ generateCode(originName?: string): any; getInitialValue(usingDef?: boolean): string; /** deprecated */ get initialValue(): string; } export declare class Property extends Contextable { dataType: StandardDataType; description?: string; name: string; required: boolean; in: 'query' | 'body' | 'path' | 'formData' | 'header'; setContext(context: any): void; constructor(prop: Partial); toPropertyCode(surrounding?: Surrounding, hasRequired?: boolean, optional?: boolean): string; toPropertyCodeWithInitValue(baseName?: string): string; toBody(): any; } export declare class Interface extends Contextable { consumes: string[]; parameters: Property[]; description: string; response: StandardDataType; method: string; name: string; path: string; get responseType(): any; getParamsCode(className?: string, surrounding?: Surrounding): string; getParamList(): ({ paramKey: string; paramType: any; optional?: undefined; initialValue?: undefined; } | { paramKey: string; optional: boolean; paramType: string; initialValue: string; })[]; getRequestContent(): string; getRequestParams(surrounding?: Surrounding): string; getBodyParamsCode(): any; setContext(context: any): void; constructor(inter: Partial); } export declare class Mod extends Contextable { description: string; interfaces: Interface[]; name: string; setContext(context: any): void; constructor(mod: Partial); } export declare class BaseClass extends Contextable { name: string; description: string; properties: Property[]; templateArgs: StandardDataType[]; setContext(context: any): void; constructor(base: Partial); } export declare class StandardDataSource { name: string; baseClasses: BaseClass[]; mods: Mod[]; reOrder(): void; validate(): string[]; serialize(): string; setContext(): void; constructor(standard: { mods: Mod[]; name: string; baseClasses: BaseClass[]; }, restProps?: Record); static constructorFromLock(localDataObject: StandardDataSource, originName: any): StandardDataSource; } export declare function getDuplicateById(arr: T[], idKey?: string): null | T; /** ast 转换为标准类型 */ export declare function parseAst2StandardDataType(ast: AstNode, defNames: string[], classTemplateArgs?: StandardDataType[]): StandardDataType; export {};