fix: types for `Request` and `Response` (#1271) · webpack/webpack-dev-middleware@eeb8aa8
@@ -165,7 +165,7 @@ type Options<
165165| undefined;
166166writeToDisk?: boolean | ((targetPath: string) => boolean) | undefined;
167167methods?: string | undefined;
168-headers?: Headers<Request, Response>;
168+headers?: Headers<Request_1, Response_1>;
169169publicPath?: NonNullable<Configuration["output"]>["publicPath"];
170170stats?: Configuration["stats"];
171171serverSideRender?: boolean | undefined;
@@ -175,7 +175,8 @@ type Options<
175175type API<
176176Request_1 extends import("http").IncomingMessage,
177177Response_1 extends ServerResponse
178-> = Middleware<Request, Response> & AdditionalMethods<Request, Response>;
178+> = Middleware<Request_1, Response_1> &
179+AdditionalMethods<Request_1, Response_1>;
179180type Schema = import("schema-utils/declarations/validate").Schema;
180181type Configuration = import("webpack").Configuration;
181182type Stats = import("webpack").Stats;
@@ -215,7 +216,7 @@ type Context<
215216state: boolean;
216217stats: Stats | MultiStats | undefined;
217218callbacks: Callback[];
218-options: Options<Request, Response>;
219+options: Options<Request_1, Response_1>;
219220compiler: Compiler | MultiCompiler;
220221watching: Watching | MultiWatching;
221222logger: Logger;
@@ -231,15 +232,15 @@ type Headers<
231232value: 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;
239240type Middleware<
240241Request_1 extends import("http").IncomingMessage,
241242Response_1 extends ServerResponse
242-> = (req: Request, res: Response, next: NextFunction) => Promise<void>;
243+> = (req: Request_1, res: Response_1, next: NextFunction) => Promise<void>;
243244type GetFilenameFromUrl = (url: string) => string | undefined;
244245type WaitUntilValid = (callback: Callback) => any;
245246type Invalidate = (callback: Callback) => any;
@@ -252,5 +253,5 @@ type AdditionalMethods<
252253waitUntilValid: WaitUntilValid;
253254invalidate: Invalidate;
254255close: Close;
255-context: Context<Request, Response>;
256+context: Context<Request_1, Response_1>;
256257};