Set http IncomingMessage setTimeout callback as optional param (#38514)

* Set http incoming message setTimeout callback as optional param

* Add test for http IncomingMessage

* Update Definitions by
This commit is contained in:
Minh Son Nguyen
2019-09-24 09:01:35 -07:00
committed by Ben Lichtman
parent 6fa32aafe7
commit f844a93e8c
7 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -277,7 +277,7 @@ declare module "http" {
rawHeaders: string[];
trailers: { [key: string]: string | undefined };
rawTrailers: string[];
setTimeout(msecs: number, callback: () => void): this;
setTimeout(msecs: number, callback?: () => void): this;
/**
* Only valid for request obtained from http.Server.
*/
+1
View File
@@ -38,6 +38,7 @@
// Thanik Bhongbhibhat <https://github.com/bhongy>
// Marcin Kopacz <https://github.com/chyzwar>
// Trivikram Kamat <https://github.com/trivikr>
// Minh Son Nguyen <https://github.com/nguymin4>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// NOTE: These definitions support NodeJS and TypeScript 3.2.
+1
View File
@@ -43,6 +43,7 @@ import * as net from 'net';
const incoming: http.IncomingMessage = new http.IncomingMessage(new net.Socket());
incoming.setEncoding('utf8');
incoming.setTimeout(1000).setTimeout(100, () => {});
// stream
incoming.pause();
+1 -1
View File
@@ -184,7 +184,7 @@ declare module "http" {
rawHeaders: string[];
trailers: { [key: string]: string | undefined };
rawTrailers: string[];
setTimeout(msecs: number, callback: () => void): this;
setTimeout(msecs: number, callback?: () => void): this;
/**
* Only valid for request obtained from http.Server.
*/
+1
View File
@@ -35,6 +35,7 @@
// Kyle Uehlein <https://github.com/kuehlein>
// Jordi Oliveras Rovira <https://github.com/j-oliveras>
// Thanik Bhongbhibhat <https://github.com/bhongy>
// Minh Son Nguyen <https://github.com/nguymin4>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// NOTE: These definitions support NodeJS and TypeScript 3.1.
+1 -1
View File
@@ -186,7 +186,7 @@ declare module "http" {
rawHeaders: string[];
trailers: { [key: string]: string | undefined };
rawTrailers: string[];
setTimeout(msecs: number, callback: () => void): this;
setTimeout(msecs: number, callback?: () => void): this;
/**
* Only valid for request obtained from http.Server.
*/
+1
View File
@@ -38,6 +38,7 @@
// Jordi Oliveras Rovira <https://github.com/j-oliveras>
// Thanik Bhongbhibhat <https://github.com/bhongy>
// Ivan Sieder <https://github.com/ivansieder>
// Minh Son Nguyen <https://github.com/nguymin4>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// NOTE: These definitions support NodeJS and TypeScript 3.2.