import { Action } from "../Action"; import { ActionMetadataArgs } from "../metadata-args/ActionMetadataArgs"; import { ActionType } from "../types/ActionType"; import { ClassTransformOptions } from "class-transformer"; import { ControllerMetadata } from "./ControllerMetadata"; import { ParamMetadata } from "./ParamMetadata"; import { ResponseHandlerMetadata } from "./ResponseHandleMetadata"; import { TypeStackOptions } from "../TypeStackOptions"; import { UseMetadata } from "./UseMetadata"; /** * Action metadata. */ export declare class ActionMetadata { private options; /** * Action's controller. */ controllerMetadata: ControllerMetadata; /** * Action's parameters. */ params: ParamMetadata[]; /** * Action's use metadatas. */ uses: UseMetadata[]; /** * Action's use interceptors. */ interceptors: Function[]; /** * Class on which's method this action is attached. */ target: Function; /** * Object's method that will be executed on this action. */ method: string; /** * Action type represents http method used for the registered route. Can be one of the value defined in ActionTypes * class. */ type: ActionType; /** * Route to be registered for the action. */ route: string | RegExp; /** * Full route to this action (includes controller base route). */ fullRoute: string | RegExp; /** * Indicates if this action uses Body. */ isBodyUsed: boolean; /** * Indicates if this action uses Uploaded File. */ isFileUsed: boolean; /** * Indicates if this action uses Uploaded Files. */ isFilesUsed: boolean; /** * Indicates if controller of this action is json-typed. */ isJsonTyped: boolean; /** * Indicates if this action uses Authorized decorator. */ isAuthorizedUsed: boolean; /** * Class-transformer options for the action response content. */ responseClassTransformOptions: ClassTransformOptions; /** * Http code to be used on undefined action returned content. */ undefinedResultCode: number | Function; /** * Http code to be used on null action returned content. */ nullResultCode: number | Function; /** * Http code to be set on successful response. */ successHttpCode: number; /** * Specifies redirection url for this action. */ redirect: string; /** * Rendered template to be used for this controller action. */ renderedTemplate: string; /** * Response headers to be set. */ headers: { [name: string]: any; }; /** * Extra options used by @Body decorator. */ bodyExtraOptions: any; /** * Roles set by @Authorized decorator. */ authorizedRoles: any[]; /** * Handles all action parameters. */ parametersHandler?: (action: Action, params: any[]) => any[]; interceptorFns: Function[]; useFns: Function[]; middlewareFns: Function[]; /** * Indicates if transaction is set for this action. */ hasTransaction?: boolean; constructor(controllerMetadata: ControllerMetadata, args: ActionMetadataArgs, options: TypeStackOptions); /** * Builds everything action metadata needs. * Action metadata can be used only after its build. */ build(responseHandlers: ResponseHandlerMetadata[]): void; /** * Builds full action route. */ private buildFullRoute(); /** * Builds action response headers. */ private buildHeaders(responseHandlers); /** * Appends base route to a given regexp route. */ static appendBaseRoute(baseRoute: string, route: RegExp | string): string | RegExp; }