UNPKG

dinoloop-es8

Version:

A lightweight REST API Library for building scalable Node.js server-side applications powered by Typescript

76 lines (75 loc) 2.98 kB
import { IControllerAttribute, IParseHandler } from '../modules/types'; /** * Decorate on Action Parameters to validate and transform the values * @Throws InvalidArgumentException */ export declare function Parse(cb: IParseHandler, data?: any): (target: any, propertyKey: string, parameterIndex: number) => void; /** * Decorate on Action Parameters to validate and transform the query parameters * @Throws InvalidArgumentException */ export declare function QueryParam(cb?: IParseHandler, data?: any): (target: any, propertyKey: string, parameterIndex: number) => void; /** * Decorate on Action Parameters to transform values to Number */ export declare function BindNumber(): (target: any, propertyKey: string, parameterIndex: number) => void; /** * Decorate on Action Parameters to transform values to Boolean */ export declare function BindBoolean(): (target: any, propertyKey: string, parameterIndex: number) => void; /** * Decorate on Action Parameters to transform values to Integer */ export declare function BindInteger(): (target: any, propertyKey: string, parameterIndex: number) => void; /** * Decorate on Action Parameters to validate against RegExp */ export declare function BindRegExp(regex: RegExp): (target: any, propertyKey: string, parameterIndex: number) => void; /** * Decorate on API actions that sends response using response object */ export declare function SendsResponse(): (target: any, propertyKey: string) => void; /** * Decorate on async API actions */ export declare function Async(): (target: any, propertyKey: string) => void; /** * Responds to HttpGet * @Throws InvalidRouteException */ export declare function HttpGet(route: string | RegExp): (target: any, propertyKey: string) => void; /** * Responds to HttpPost * @Throws InvalidRouteException */ export declare function HttpPost(route: string | RegExp): (target: any, propertyKey: string) => void; /** * Responds to HttpDelete * @Throws InvalidRouteException */ export declare function HttpDelete(route: string | RegExp): (target: any, propertyKey: string) => void; /** * Responds to HttpPatch * @Throws InvalidRouteException */ export declare function HttpPatch(route: string | RegExp): (target: any, propertyKey: string) => void; /** * Responds to HttpPut * @Throws InvalidRouteException */ export declare function HttpPut(route: string | RegExp): (target: any, propertyKey: string) => void; /** * Responds to HttpHead * @Throws InvalidRouteException */ export declare function HttpHead(route: string | RegExp): (target: any, propertyKey: string) => void; /** * Responds to HttpAll * @Throws InvalidRouteException */ export declare function HttpAll(route: string | RegExp): (target: any, propertyKey: string) => void; /** * Decorate on API Controller * @Throws InvalidRouteException */ export declare function Controller(prefix: string, attr?: IControllerAttribute): any;