UNPKG

@eggjs/controller-decorator

Version:

tegg controller decorator

25 lines (24 loc) 1.38 kB
import type { ControllerMetadata, EggPrototypeName, MiddlewareFunc } from '@eggjs/tegg-types'; import { ControllerType } from '@eggjs/tegg-types'; import { HTTPMethodMeta } from './HTTPMethodMeta'; export declare class HTTPControllerMeta implements ControllerMetadata { readonly protoName: EggPrototypeName; readonly controllerName: string; readonly className: string; readonly type = ControllerType.HTTP; readonly path?: string; readonly middlewares: readonly MiddlewareFunc[]; readonly methods: readonly HTTPMethodMeta[]; readonly needAcl: boolean; readonly aclCode?: string; readonly hosts?: string[]; readonly timeout?: number; constructor(className: string, protoName: EggPrototypeName, controllerName: string, path: string | undefined, middlewares: MiddlewareFunc[], methods: HTTPMethodMeta[], needAcl: boolean, aclCode: string | undefined, hosts: string[] | undefined, timeout: number | undefined); getMethodRealPath(method: HTTPMethodMeta): string; getMethodHosts(method: HTTPMethodMeta): string[] | undefined; getMethodName(method: HTTPMethodMeta): string; getMethodMiddlewares(method: HTTPMethodMeta): MiddlewareFunc[]; hasMethodAcl(method: HTTPMethodMeta): boolean; getMethodAcl(method: HTTPMethodMeta): string | undefined; getMethodTimeout(method: HTTPMethodMeta): number | undefined; }