import { Context } from 'egg'; import { RouteType } from './type'; import { SchemaObject } from 'openapi3-ts'; export declare type ParamGetterType = (ctx: Context, name: string, type: any) => any; export declare type ParamSourceEnum = 'Any' | 'Query' | 'Body' | 'Param' | 'Header'; export interface ParamInfoType { /** 函数参数名 */ name: string; /** 请求参数名 */ paramName: string; getter?: ParamGetterType; /** 参数类型 */ type: any; /** 参数来源 */ source: ParamSourceEnum; hidden?: boolean; /** * @deprecated 使用 schema 替代 * 增强参数类型,ts-metadata * */ validateType?: any; /** 使用 OAS3 定义 */ schema?: SchemaObject; /** 是否必选 */ required?: boolean; } export declare function getMethodRules(target: any, key: string): { param: { [index: string]: ParamGetterType; }; config: { [name: string]: { paramName: string; hidden?: boolean; source?: ParamSourceEnum; }; }; }; export declare function FromCustom(custom: ParamGetterType, paramName?: string, config?: { hidden?: boolean; source?: ParamSourceEnum; }): ParameterDecorator; export declare function FromBody(paramName?: string): ParameterDecorator; export declare function FromParam(paramName?: string): ParameterDecorator; export declare function FromQuery(paramName?: string): ParameterDecorator; export declare function FromHeader(paramName?: string): ParameterDecorator; export declare function getParamData(ctx: Context, typeInfo?: RouteType): Promise; export declare function getParamDataObj(ctx: Context, typeInfo: RouteType): Promise;