import { ControllerMetadata } from "./ControllerMetadata"; import { BeforeAfterFilterType } from "./enum/BeforeAfterFilterType"; import { FilterOptions } from "./FilterOptions"; export declare class ControllerRegistry { private static _controllers; static controllers: Map; static getRoutes(type?: Function): Map; /** * used to register a class as a Controller or RestController * * for example: * * @RestController("/api/v1/") * class ATestController { * } * * @Controller() * class BTestController { * } * * type * is the controller class, in this example: ATestController or BTestController * * baseUrl * is the controller base url, in this example: "/api/v1/" * if don't provide baseUrl in the decorator, then it would be blank string: "" * * isRest * is the flag indicate whether is a RestController or not * RestController default render the result as JSON * Controller default render the data into the template * * @param type * @param baseUrl * @param isRest */ static registerController(type: Function, baseUrl: string, isRest: boolean): void; /** * used to register a controller action, an action used to handle http request * * for example * * @RestController() * class ATestController { * * @Get("/") * public indexAction(request: Express.Request) { * return "Hello world"; * } * } * * type * is the controller class, in this example: ATestController * * actionName * is the action name, in this example: "indexAction" * * httpMethod * is the http request method for the action to handle, in this example: "get", * all the supported http methods * TODO: support all the express methods * please refer to https://expressjs.com/en/4x/api.html#app.METHOD * * path * is the http request path for the action to handle, in this example: "/" * * @param type * @param actionName * @param httpMethod * @param path */ static registerAction(type: Function, actionName: string, httpMethod: string, path: string | RegExp): void; static registerFilter(controllerType: Function, filterType: Function, beforeOrAfterFilter: BeforeAfterFilterType, options?: FilterOptions): void; /** * safe get controller * * @param type * @returns {ControllerMetadata} */ private static getController(type); }