@eggjs/controller-decorator
Version:
tegg controller decorator
23 lines (22 loc) • 1.99 kB
TypeScript
import { IAdvice } from '@eggjs/tegg-types';
import type { ControllerTypeLike, EggProtoImplClass, MiddlewareFunc } from '@eggjs/tegg-types';
export default class MethodInfoUtil {
static setMethodControllerType(clazz: EggProtoImplClass, methodName: string, controllerType: ControllerTypeLike): void;
static getMethodControllerType(clazz: EggProtoImplClass, methodName: string): ControllerTypeLike | undefined;
static setMethodContextIndexInArgs(index: number, clazz: EggProtoImplClass, methodName: string): void;
static getMethodContextIndex(clazz: EggProtoImplClass, methodName: string): number | undefined;
static addMethodMiddleware(middleware: MiddlewareFunc, clazz: EggProtoImplClass, methodName: string): void;
static getMethodMiddlewares(clazz: EggProtoImplClass, methodName: string): MiddlewareFunc[];
static addMethodAopMiddleware(middleware: EggProtoImplClass<IAdvice>, clazz: EggProtoImplClass, methodName: string): void;
static getMethodAopMiddlewares(clazz: EggProtoImplClass, methodName: string): EggProtoImplClass<IAdvice>[];
static setMethodAcl(code: string | undefined, clazz: EggProtoImplClass, methodName: string): void;
static hasMethodAcl(clazz: EggProtoImplClass, methodName: string): boolean;
static getMethodAcl(clazz: EggProtoImplClass, methodName: string): string | undefined;
static setMethodHosts(hosts: string[], clazz: EggProtoImplClass, methodName: string): void;
static getMethodHosts(clazz: EggProtoImplClass, methodName: string): string[] | undefined;
static getMethods(clazz: EggProtoImplClass): string[];
static shouldRegisterAopMiddlewarePointCut(clazz: EggProtoImplClass, methodName: string): boolean;
static registerAopMiddlewarePointcut(clazz: EggProtoImplClass, methodName: string): void;
static setMethodTimeout(timeout: number, clazz: EggProtoImplClass, methodName: string): void;
static getMethodTimeout(clazz: EggProtoImplClass, methodName: string): number | undefined;
}