UNPKG

ts-router

Version:

koa router middleware, typescript fully supported, jersey like coding

25 lines (24 loc) 1.97 kB
import Controller from './controller'; import { MediaType } from './util'; import 'reflect-metadata'; export declare function Before(target: Controller, key: string): void; export declare function After(target: Controller, key: string): void; export declare function GET(target: Controller, key: string): void; export declare function POST(target: Controller, key: string): void; export declare function PUT(target: Controller, key: string): void; export declare function DELETE(target: Controller, key: string): void; export declare function Inject(func: Function): (target: Controller, key: string) => void; export declare function Path(path: string): (target: Controller | (new () => Controller), key?: string) => void; export declare function Produce(type: MediaType): (target: Controller, key: string) => void; export declare function Consume(type: MediaType): (target: Controller, key: string) => void; export declare function QueryParam(param: string): (target: Controller, key: string, index?: number) => void; export declare function PathParam(param: string): (target: Controller, key: string, index?: number) => void; export declare function BodyParam(param: string): (target: Controller, key: string, index?: number) => void; export declare function HeaderParam(param: string): (target: Controller, key: string, index?: number) => void; export declare function Query(target: Controller, key: string, index?: number): void; export declare function Params(target: Controller, key: string, index?: number): void; export declare function Body(target: Controller, key: string, index?: number): void; export declare function Headers(target: Controller, key: string, index?: number): void; export declare function AppContext(target: Controller, key: string, index?: number): void; export declare function HttpContext(target: Controller, key: string, index?: number): void; export declare function RouteResponse(target: Controller, key: string, index: number): void;