From fb2e78984b7076eda628892770a4314d618ac0d7 Mon Sep 17 00:00:00 2001 From: Kenji-Imamura Date: Tue, 22 Mar 2016 12:58:42 +0900 Subject: [PATCH] fix express.NextFunction --- express-serve-static-core/express-serve-static-core.d.ts | 3 +-- express/express-tests.ts | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/express-serve-static-core/express-serve-static-core.d.ts b/express-serve-static-core/express-serve-static-core.d.ts index 8bb4863c6..70817018a 100644 --- a/express-serve-static-core/express-serve-static-core.d.ts +++ b/express-serve-static-core/express-serve-static-core.d.ts @@ -783,8 +783,7 @@ declare module "express-serve-static-core" { } interface NextFunction { - (): void; - (err: any): void; + (err?: any): void; } interface ErrorRequestHandler { diff --git a/express/express-tests.ts b/express/express-tests.ts index d344dc6eb..11f8fd44f 100644 --- a/express/express-tests.ts +++ b/express/express-tests.ts @@ -68,3 +68,6 @@ app.use((req, res, next) => { app.use(router); app.listen(3000); + +const next: express.NextFunction = () => {}; +const nextWithArgument: express.NextFunction = (err: any) => {};