UNPKG

decorator-koa-router

Version:

Package to declare koa controllers via decorators

16 lines (15 loc) 500 B
import { MethodTypes } from './ControllerActions'; import { Context, Next } from 'koa'; export declare type ControllerTypes = { target: Object & { name: string; }; route: string; middleware: ((context: Context, next: Next) => Promise<void>)[]; }; export declare const Controllers: ControllerTypes[]; declare type ControllerWithActions = { actions: MethodTypes[]; } & ControllerTypes; export declare const ControllerActionsMapper: () => ControllerWithActions[]; export {};