import { Application } from "egg"; import "reflect-metadata"; import { MiddlewaresType } from "./routeMetadata"; /** 装饰器,get请求 可选path,若无,则以方法名为path,但需控制器上提供前缀 */ export declare function get(path?: string | string[], middlewares?: MiddlewaresType): (prototypeObj: any, name: string, descriptor: PropertyDescriptor) => void; export declare const Get: typeof get; /** 装饰器,post请求 */ export declare function post(path?: string | string[], middlewares?: MiddlewaresType): (prototypeObj: any, name: string, descriptor: PropertyDescriptor) => void; export declare const Post: typeof post; /** 装饰器,put请求 */ export declare function put(path?: string | string[], middlewares?: MiddlewaresType): (prototypeObj: any, name: string, descriptor: PropertyDescriptor) => void; export declare const Put: typeof put; /** 装饰器,del请求 */ export declare function del(path?: string | string[], middlewares?: MiddlewaresType): (prototypeObj: any, name: string, descriptor: PropertyDescriptor) => void; export declare const Delete: typeof del; /** 装饰器,patch请求 */ export declare function patch(path?: string | string[], middlewares?: MiddlewaresType): (prototypeObj: any, name: string, descriptor: PropertyDescriptor) => void; export declare const Patch: typeof patch; /** * 装饰在控制器类上 * - 实现控制器提供路由前缀能力 * - 方法装饰器上的路由必须不带/开头,才会拼接,否则该路由是直接注册 */ export declare function Controller(opt: { mapping?: string[]; [key: string]: any; }): (constructor: Function) => void; /** * @deprecated 请使用Controller */ export declare const controller: typeof Controller; /** 在router.ts中调用,绑定装饰器提供的路由 * 遍历所有的控制器方法然后绑定 */ export declare function bindRouter(app: Application): void;