Use same type for next function in middleware as koa main project (#10785)

This commit is contained in:
Alejandro Sánchez
2016-09-07 19:23:52 +09:00
committed by Masahiro Wakame
parent 938158616b
commit 0e267a89f1
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -23,11 +23,11 @@ router
.put('/users/:id', function (ctx, next) {
ctx.body = ctx.params.id;
})
.del('/users/:id', function (ctx, next) {
.del('/users/:id', function () {
// ...
});
router.get('user', '/users/:id', function (ctx, next) {
router.get('user', '/users/:id', function (ctx) {
ctx.body = "sdsd";
});
+2 -2
View File
@@ -49,11 +49,11 @@ declare module "koa-router" {
}
export interface IMiddleware {
(ctx: Router.IRouterContext, next?: () => any): any;
(ctx: Router.IRouterContext, next: () => Promise<any>): any;
}
export interface IParamMiddleware {
(param: string, ctx: Router.IRouterContext, next?: () => any): any;
(param: string, ctx: Router.IRouterContext, next: () => Promise<any>): any;
}
export interface IRouterAllowedMethodsOptions {