From afeac2b7eb267f3a84b605edb4e161e7705676b3 Mon Sep 17 00:00:00 2001 From: Satana Charuwichitratana Date: Sun, 3 Jun 2018 19:46:45 +0700 Subject: [PATCH] Fix #24495 missing req.res, req.next and res.req --- types/express-serve-static-core/index.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index f7c081fb74..f4e4b5379c 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -455,6 +455,13 @@ export interface Request extends http.IncomingMessage, Express.Request { baseUrl: string; app: Application; + + /** + * After middleware.init executed, Request will contain res and next properties + * See: express/lib/middleware/init.js + */ + res?: Response; + next?: NextFunction; } export interface MediaType { @@ -833,6 +840,12 @@ export interface Response extends http.ServerResponse, Express.Response { * @since 4.11.0 */ append(field: string, value?: string[]|string): Response; + + /** + * After middleware.init executed, Response will contain req property + * See: express/lib/middleware/init.js + */ + req?: Request; } export interface Handler extends RequestHandler { }