Node: add timeout member to http.RequestOptions interface (#13865)

* Start typings for Node 7

* Add timeout member to RequestOptions.
This commit is contained in:
Rogier Schouten
2017-01-11 00:30:17 +01:00
committed by Sheetal Nandi
parent 5e640e9f20
commit 8928fc6a3d
5 changed files with 6230 additions and 2 deletions

5
node/index.d.ts vendored
View File

@@ -1,11 +1,11 @@
// Type definitions for Node.js v6.x
// Type definitions for Node.js v7.x
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/DefinitelyTyped/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/************************************************
* *
* Node.js v6.x API *
* Node.js v7.x API *
* *
************************************************/
@@ -622,6 +622,7 @@ declare module "http" {
headers?: { [key: string]: any };
auth?: string;
agent?: Agent | boolean;
timeout?: number;
}
export interface Server extends net.Server {

View File

@@ -846,6 +846,10 @@ namespace http_tests {
request.setNoDelay(true);
request.abort();
}
const options: http.RequestOptions = {
timeout: 30000
};
}
//////////////////////////////////////////////////////

4121
node/v6/index.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

2082
node/v6/node-tests.ts Normal file

File diff suppressed because it is too large Load Diff

20
node/v6/tsconfig.json Normal file
View File

@@ -0,0 +1,20 @@
{
"files": [
"index.d.ts",
"node-tests.ts"
],
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
}
}