mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
Use same type for next function in middleware as koa main project (#10785)
This commit is contained in:
committed by
Masahiro Wakame
parent
938158616b
commit
0e267a89f1
@@ -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";
|
||||
});
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user