[express-serve-static-core] Correct overload for Response.download() (#35043)

* [express-serve-static-core] Correct overload for Response.download()

* [express-serve-static-core] Unify res.sendFile and res.download overloads
This commit is contained in:
Marcus Cemes
2019-04-28 23:18:13 -07:00
committed by Wesley Wigham
parent 53230a10b3
commit 4344efdf84
+5 -9
View File
@@ -575,10 +575,8 @@ export interface Response extends http.ServerResponse, Express.Response {
*
* @api public
*/
sendFile(path: string): void;
sendFile(path: string, options: any): void;
sendFile(path: string, fn: Errback): void;
sendFile(path: string, options: any, fn: Errback): void;
sendFile(path: string, fn?: Errback): void;
sendFile(path: string, options: any, fn?: Errback): void;
/**
* @deprecated Use sendFile instead.
@@ -610,11 +608,9 @@ export interface Response extends http.ServerResponse, Express.Response {
*
* This method uses `res.sendfile()`.
*/
download(path: string): void;
download(path: string, filename: string): void;
download(path: string, fn: Errback): void;
download(path: string, filename: string, fn: Errback): void;
download(path: string, filename: string, options: any, fn: Errback): void;
download(path: string, fn?: Errback): void;
download(path: string, filename: string, fn?: Errback): void;
download(path: string, filename: string, options: any, fn?: Errback): void;
/**
* Set _Content-Type_ response header with `type` through `mime.lookup()`