mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
[node]: Update assert.fail parameters (#27622)
[assert.fail](https://nodejs.org/api/assert.html#assert_assert_fail_message) has an optional `message` parameter that can be either a `string` or `Error`.
This commit is contained in:
59
types/node/index.d.ts
vendored
59
types/node/index.d.ts
vendored
@@ -26,6 +26,7 @@
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Zane Hannan AU <https://github.com/ZaneHannanAU>
|
||||
// Eugene Y. Q. Shen <https://github.com/eyqs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -6381,7 +6382,7 @@ declare module "util" {
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal(value: any, message?: string): void;
|
||||
function internal(value: any, message?: string | Error): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -6390,46 +6391,42 @@ declare module "assert" {
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(message: string): never;
|
||||
/** @deprecated since v10.0.0 */
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
/** @deprecated use strictEqual() */
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
/** @deprecated use notStrictEqual() */
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
/** @deprecated use deepStrictEqual() */
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
/** @deprecated use notDeepStrictEqual() */
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function fail(message?: string | Error): never;
|
||||
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
||||
export function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
||||
export function equal(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
||||
export function notEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
||||
export function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function throws(block: Function, message?: string | Error): void;
|
||||
export function throws(block: Function, error: RegExp | Function | Object | Error, message?: string | Error): void;
|
||||
export function doesNotThrow(block: Function, message?: string | Error): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string | Error): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
|
||||
export function rejects(block: Function | Promise<any>, message?: string): Promise<void>;
|
||||
export function rejects(block: Function | Promise<any>, error: Function | RegExp | Object | Error, message?: string): Promise<void>;
|
||||
export function doesNotReject(block: Function | Promise<any>, message?: string): Promise<void>;
|
||||
export function doesNotReject(block: Function | Promise<any>, error: Function | RegExp | Object | Error, message?: string): Promise<void>;
|
||||
export function rejects(block: Function | Promise<any>, message?: string | Error): Promise<void>;
|
||||
export function rejects(block: Function | Promise<any>, error: RegExp | Function | Object | Error, message?: string | Error): Promise<void>;
|
||||
export function doesNotReject(block: Function | Promise<any>, message?: string | Error): Promise<void>;
|
||||
export function doesNotReject(block: Function | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
|
||||
|
||||
export var strict: typeof internal;
|
||||
}
|
||||
|
||||
90
types/node/v0/index.d.ts
vendored
90
types/node/v0/index.d.ts
vendored
@@ -573,42 +573,42 @@ declare module "http" {
|
||||
*/
|
||||
export interface ClientResponse extends IncomingMessage { }
|
||||
|
||||
export interface AgentOptions {
|
||||
/**
|
||||
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
||||
*/
|
||||
keepAlive?: boolean;
|
||||
/**
|
||||
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
|
||||
* Only relevant if keepAlive is set to true.
|
||||
*/
|
||||
keepAliveMsecs?: number;
|
||||
/**
|
||||
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
||||
*/
|
||||
maxSockets?: number;
|
||||
/**
|
||||
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
|
||||
*/
|
||||
maxFreeSockets?: number;
|
||||
}
|
||||
export interface AgentOptions {
|
||||
/**
|
||||
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
||||
*/
|
||||
keepAlive?: boolean;
|
||||
/**
|
||||
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
|
||||
* Only relevant if keepAlive is set to true.
|
||||
*/
|
||||
keepAliveMsecs?: number;
|
||||
/**
|
||||
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
||||
*/
|
||||
maxSockets?: number;
|
||||
/**
|
||||
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
|
||||
*/
|
||||
maxFreeSockets?: number;
|
||||
}
|
||||
|
||||
export class Agent {
|
||||
maxFreeSockets: number;
|
||||
maxSockets: number;
|
||||
sockets: any;
|
||||
requests: any;
|
||||
maxFreeSockets: number;
|
||||
maxSockets: number;
|
||||
sockets: any;
|
||||
requests: any;
|
||||
|
||||
constructor(opts?: AgentOptions);
|
||||
constructor(opts?: AgentOptions);
|
||||
|
||||
/**
|
||||
* Destroy any sockets that are currently in use by the agent.
|
||||
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
|
||||
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
|
||||
* sockets may hang open for quite a long time before the server terminates them.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
/**
|
||||
* Destroy any sockets that are currently in use by the agent.
|
||||
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
|
||||
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
|
||||
* sockets may hang open for quite a long time before the server terminates them.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export var METHODS: string[];
|
||||
|
||||
@@ -1858,7 +1858,7 @@ declare module "util" {
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal (value: any, message?: string): void;
|
||||
function internal(value: any, message?: string): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -1868,8 +1868,10 @@ declare module "assert" {
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
|
||||
constructor(options?: {message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function});
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual?: any, expected?: any, message?: string, operator?: string): never;
|
||||
@@ -1877,22 +1879,14 @@ declare module "assert" {
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export var throws: {
|
||||
(block: Function, message?: string): void;
|
||||
(block: Function, error: Function, message?: string): void;
|
||||
(block: Function, error: RegExp, message?: string): void;
|
||||
(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
};
|
||||
|
||||
export var doesNotThrow: {
|
||||
(block: Function, message?: string): void;
|
||||
(block: Function, error: Function, message?: string): void;
|
||||
(block: Function, error: RegExp, message?: string): void;
|
||||
(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
};
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
@@ -179,37 +179,37 @@ function stream_readable_pipe_test() {
|
||||
var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex');
|
||||
|
||||
function crypto_cipher_decipher_string_test() {
|
||||
var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
|
||||
var clearText:string = "This is the clear text.";
|
||||
var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
var cipherText:string = cipher.update(clearText, "utf8", "hex");
|
||||
cipherText += cipher.final("hex");
|
||||
var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
|
||||
var clearText:string = "This is the clear text.";
|
||||
var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
var cipherText:string = cipher.update(clearText, "utf8", "hex");
|
||||
cipherText += cipher.final("hex");
|
||||
|
||||
var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
var clearText2:string = decipher.update(cipherText, "hex", "utf8");
|
||||
clearText2 += decipher.final("utf8");
|
||||
var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
var clearText2:string = decipher.update(cipherText, "hex", "utf8");
|
||||
clearText2 += decipher.final("utf8");
|
||||
|
||||
assert.equal(clearText2, clearText);
|
||||
assert.equal(clearText2, clearText);
|
||||
}
|
||||
|
||||
function crypto_cipher_decipher_buffer_test() {
|
||||
var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
|
||||
var clearText:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]);
|
||||
var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
var cipherBuffers:Buffer[] = [];
|
||||
cipherBuffers.push(cipher.update(clearText));
|
||||
cipherBuffers.push(cipher.final());
|
||||
var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
|
||||
var clearText:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]);
|
||||
var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
var cipherBuffers:Buffer[] = [];
|
||||
cipherBuffers.push(cipher.update(clearText));
|
||||
cipherBuffers.push(cipher.final());
|
||||
|
||||
var cipherText:Buffer = Buffer.concat(cipherBuffers);
|
||||
var cipherText:Buffer = Buffer.concat(cipherBuffers);
|
||||
|
||||
var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
var decipherBuffers:Buffer[] = [];
|
||||
decipherBuffers.push(decipher.update(cipherText));
|
||||
decipherBuffers.push(decipher.final());
|
||||
var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
var decipherBuffers:Buffer[] = [];
|
||||
decipherBuffers.push(decipher.update(cipherText));
|
||||
decipherBuffers.push(decipher.final());
|
||||
|
||||
var clearText2:Buffer = Buffer.concat(decipherBuffers);
|
||||
var clearText2:Buffer = Buffer.concat(decipherBuffers);
|
||||
|
||||
assert.deepEqual(clearText2, clearText);
|
||||
assert.deepEqual(clearText2, clearText);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@@ -242,14 +242,14 @@ namespace http_tests {
|
||||
var codeMessage = http.STATUS_CODES['400'];
|
||||
var codeMessage = http.STATUS_CODES[400];
|
||||
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
|
||||
http.request('http://www.example.com/xyz');
|
||||
}
|
||||
|
||||
19
types/node/v4/index.d.ts
vendored
19
types/node/v4/index.d.ts
vendored
@@ -2440,7 +2440,7 @@ declare module "util" {
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal (value: any, message?: string): void;
|
||||
function internal(value: any, message?: string): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -2450,8 +2450,10 @@ declare module "assert" {
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
|
||||
constructor(options?: {message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function});
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
@@ -2459,21 +2461,16 @@ declare module "assert" {
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
16
types/node/v6/index.d.ts
vendored
16
types/node/v6/index.d.ts
vendored
@@ -3944,30 +3944,26 @@ declare module "assert" {
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function fail(message?: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
@@ -786,13 +786,13 @@ namespace crypto_tests {
|
||||
let clearText: string = "This is the clear text.";
|
||||
let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
let cipherText: string = cipher.update(clearText, "utf8", "hex");
|
||||
cipherText += cipher.final("hex");
|
||||
cipherText += cipher.final("hex");
|
||||
|
||||
let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
let clearText2: string = decipher.update(cipherText, "hex", "utf8");
|
||||
clearText2 += decipher.final("utf8");
|
||||
clearText2 += decipher.final("utf8");
|
||||
|
||||
assert.equal(clearText2, clearText);
|
||||
assert.equal(clearText2, clearText);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -801,19 +801,19 @@ namespace crypto_tests {
|
||||
let clearText: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]);
|
||||
let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
let cipherBuffers: Buffer[] = [];
|
||||
cipherBuffers.push(cipher.update(clearText));
|
||||
cipherBuffers.push(cipher.final());
|
||||
cipherBuffers.push(cipher.update(clearText));
|
||||
cipherBuffers.push(cipher.final());
|
||||
|
||||
let cipherText: Buffer = Buffer.concat(cipherBuffers);
|
||||
|
||||
let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
let decipherBuffers: Buffer[] = [];
|
||||
decipherBuffers.push(decipher.update(cipherText));
|
||||
decipherBuffers.push(decipher.final());
|
||||
decipherBuffers.push(decipher.update(cipherText));
|
||||
decipherBuffers.push(decipher.final());
|
||||
|
||||
let clearText2: Buffer = Buffer.concat(decipherBuffers);
|
||||
|
||||
assert.deepEqual(clearText2, clearText);
|
||||
assert.deepEqual(clearText2, clearText);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -839,8 +839,8 @@ namespace tls_tests {
|
||||
var blah = ctx.context;
|
||||
|
||||
var connOpts: tls.ConnectionOptions = {
|
||||
host: "127.0.0.1",
|
||||
port: 55
|
||||
host: "127.0.0.1",
|
||||
port: 55
|
||||
};
|
||||
var tlsSocket = tls.connect(connOpts);
|
||||
}
|
||||
@@ -1043,14 +1043,14 @@ namespace http_tests {
|
||||
}
|
||||
|
||||
{
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
|
||||
http.request({ agent: false });
|
||||
http.request({ agent: agent });
|
||||
|
||||
16
types/node/v7/index.d.ts
vendored
16
types/node/v7/index.d.ts
vendored
@@ -3988,30 +3988,26 @@ declare module "assert" {
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function fail(message?: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
@@ -1025,14 +1025,14 @@ namespace http_tests {
|
||||
}
|
||||
|
||||
{
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
|
||||
http.request({ agent: false });
|
||||
http.request({ agent: agent });
|
||||
@@ -1056,7 +1056,7 @@ namespace http_tests {
|
||||
request.abort();
|
||||
}
|
||||
|
||||
// http request options
|
||||
// http request options
|
||||
{
|
||||
const requestOpts: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
|
||||
18
types/node/v8/index.d.ts
vendored
18
types/node/v8/index.d.ts
vendored
@@ -5634,34 +5634,30 @@ declare module "assert" {
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(message: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function fail(message?: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
41
types/node/v9/index.d.ts
vendored
41
types/node/v9/index.d.ts
vendored
@@ -25,6 +25,7 @@
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Eugene Y. Q. Shen <https://github.com/eyqs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -5708,7 +5709,7 @@ declare module "util" {
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal(value: any, message?: string): void;
|
||||
function internal(value: any, message?: string | Error): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -5717,34 +5718,30 @@ declare module "assert" {
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(message: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function fail(message?: string | Error): never;
|
||||
export function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string | Error): void;
|
||||
export function equal(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function throws(block: Function, message?: string | Error): void;
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string | Error): void;
|
||||
export function doesNotThrow(block: Function, message?: string | Error): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string | Error): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user