fix: types for `Request` and `Response` (#1271) · webpack/webpack-dev-middleware@eeb8aa8

@@ -165,7 +165,7 @@ type Options<

165165

| undefined;

166166

writeToDisk?: boolean | ((targetPath: string) => boolean) | undefined;

167167

methods?: string | undefined;

168-

headers?: Headers<Request, Response>;

168+

headers?: Headers<Request_1, Response_1>;

169169

publicPath?: NonNullable<Configuration["output"]>["publicPath"];

170170

stats?: Configuration["stats"];

171171

serverSideRender?: boolean | undefined;

@@ -175,7 +175,8 @@ type Options<

175175

type API<

176176

Request_1 extends import("http").IncomingMessage,

177177

Response_1 extends ServerResponse

178-

> = Middleware<Request, Response> & AdditionalMethods<Request, Response>;

178+

> = Middleware<Request_1, Response_1> &

179+

AdditionalMethods<Request_1, Response_1>;

179180

type Schema = import("schema-utils/declarations/validate").Schema;

180181

type Configuration = import("webpack").Configuration;

181182

type Stats = import("webpack").Stats;

@@ -215,7 +216,7 @@ type Context<

215216

state: boolean;

216217

stats: Stats | MultiStats | undefined;

217218

callbacks: Callback[];

218-

options: Options<Request, Response>;

219+

options: Options<Request_1, Response_1>;

219220

compiler: Compiler | MultiCompiler;

220221

watching: Watching | MultiWatching;

221222

logger: Logger;

@@ -231,15 +232,15 @@ type Headers<

231232

value: number | string;

232233

}[]

233234

| ((

234-

req: Request,

235-

res: Response,

236-

context: Context<Request, Response>

235+

req: Request_1,

236+

res: Response_1,

237+

context: Context<Request_1, Response_1>

237238

) => void | undefined | Record<string, string | number>)

238239

| undefined;

239240

type Middleware<

240241

Request_1 extends import("http").IncomingMessage,

241242

Response_1 extends ServerResponse

242-

> = (req: Request, res: Response, next: NextFunction) => Promise<void>;

243+

> = (req: Request_1, res: Response_1, next: NextFunction) => Promise<void>;

243244

type GetFilenameFromUrl = (url: string) => string | undefined;

244245

type WaitUntilValid = (callback: Callback) => any;

245246

type Invalidate = (callback: Callback) => any;

@@ -252,5 +253,5 @@ type AdditionalMethods<

252253

waitUntilValid: WaitUntilValid;

253254

invalidate: Invalidate;

254255

close: Close;

255-

context: Context<Request, Response>;

256+

context: Context<Request_1, Response_1>;

256257

};