@micro.ts/core
Version:
Microservice framework with Typescript
20 lines (19 loc) • 1.16 kB
TypeScript
import { ControllerOptions } from "./types";
import { AppMiddleware } from "..";
export declare function Controller(options?: ControllerOptions): (target: any) => void;
/**
* Controller where all the data are treated as valid JSON
* @param path Controller path
* @param options Controller Options
*/
export declare function JsonController(path: string, options?: ControllerOptions): (target: any) => void;
/**
* Use this decorator to attach middlewares that are executed before the method middlewares and handler is executed
* @param options List of middlewares to execute before any method of this controller
*/
export declare function BeforeMiddlewares(options: AppMiddleware[]): (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void;
/**
* Use this decorator to attach middlewares to the controller that are executed after successfully handled method , and method middlewares
* @param options List of middlewares to execute
*/
export declare function AfterMiddlewares(options: AppMiddleware[]): (target: any, propertyKey?: string | undefined, descriptor?: PropertyDescriptor | undefined) => void;