mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
.
This commit is contained in:
BIN
node_modules/.DS_Store
generated
vendored
BIN
node_modules/.DS_Store
generated
vendored
Binary file not shown.
1
node_modules/.bin/pbjs
generated
vendored
1
node_modules/.bin/pbjs
generated
vendored
@@ -1 +0,0 @@
|
||||
../protobufjs/bin/pbjs
|
||||
1
node_modules/.bin/pbts
generated
vendored
1
node_modules/.bin/pbts
generated
vendored
@@ -1 +0,0 @@
|
||||
../protobufjs/bin/pbts
|
||||
1
node_modules/.bin/qrcode-terminal
generated
vendored
1
node_modules/.bin/qrcode-terminal
generated
vendored
@@ -1 +0,0 @@
|
||||
../qrcode-terminal/bin/qrcode-terminal.js
|
||||
26
node_modules/@protobufjs/aspromise/LICENSE
generated
vendored
26
node_modules/@protobufjs/aspromise/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
13
node_modules/@protobufjs/aspromise/README.md
generated
vendored
13
node_modules/@protobufjs/aspromise/README.md
generated
vendored
@@ -1,13 +0,0 @@
|
||||
@protobufjs/aspromise
|
||||
=====================
|
||||
[](https://www.npmjs.com/package/@protobufjs/aspromise)
|
||||
|
||||
Returns a promise from a node-style callback function.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **asPromise(fn: `function`, ctx: `Object`, ...params: `*`): `Promise<*>`**<br />
|
||||
Returns a promise from a node-style callback function.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
13
node_modules/@protobufjs/aspromise/index.d.ts
generated
vendored
13
node_modules/@protobufjs/aspromise/index.d.ts
generated
vendored
@@ -1,13 +0,0 @@
|
||||
export = asPromise;
|
||||
|
||||
type asPromiseCallback = (error: Error | null, ...params: any[]) => {};
|
||||
|
||||
/**
|
||||
* Returns a promise from a node-style callback function.
|
||||
* @memberof util
|
||||
* @param {asPromiseCallback} fn Function to call
|
||||
* @param {*} ctx Function context
|
||||
* @param {...*} params Function arguments
|
||||
* @returns {Promise<*>} Promisified function
|
||||
*/
|
||||
declare function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise<any>;
|
||||
52
node_modules/@protobufjs/aspromise/index.js
generated
vendored
52
node_modules/@protobufjs/aspromise/index.js
generated
vendored
@@ -1,52 +0,0 @@
|
||||
"use strict";
|
||||
module.exports = asPromise;
|
||||
|
||||
/**
|
||||
* Callback as used by {@link util.asPromise}.
|
||||
* @typedef asPromiseCallback
|
||||
* @type {function}
|
||||
* @param {Error|null} error Error, if any
|
||||
* @param {...*} params Additional arguments
|
||||
* @returns {undefined}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns a promise from a node-style callback function.
|
||||
* @memberof util
|
||||
* @param {asPromiseCallback} fn Function to call
|
||||
* @param {*} ctx Function context
|
||||
* @param {...*} params Function arguments
|
||||
* @returns {Promise<*>} Promisified function
|
||||
*/
|
||||
function asPromise(fn, ctx/*, varargs */) {
|
||||
var params = new Array(arguments.length - 1),
|
||||
offset = 0,
|
||||
index = 2,
|
||||
pending = true;
|
||||
while (index < arguments.length)
|
||||
params[offset++] = arguments[index++];
|
||||
return new Promise(function executor(resolve, reject) {
|
||||
params[offset] = function callback(err/*, varargs */) {
|
||||
if (pending) {
|
||||
pending = false;
|
||||
if (err)
|
||||
reject(err);
|
||||
else {
|
||||
var params = new Array(arguments.length - 1),
|
||||
offset = 0;
|
||||
while (offset < params.length)
|
||||
params[offset++] = arguments[offset];
|
||||
resolve.apply(null, params);
|
||||
}
|
||||
}
|
||||
};
|
||||
try {
|
||||
fn.apply(ctx || null, params);
|
||||
} catch (err) {
|
||||
if (pending) {
|
||||
pending = false;
|
||||
reject(err);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
25
node_modules/@protobufjs/aspromise/package.json
generated
vendored
25
node_modules/@protobufjs/aspromise/package.json
generated
vendored
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/aspromise",
|
||||
"description": "Returns a promise from a node-style callback function.",
|
||||
"version": "1.1.2",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz"
|
||||
,"_integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78="
|
||||
,"_from": "@protobufjs/aspromise@1.1.2"
|
||||
}
|
||||
130
node_modules/@protobufjs/aspromise/tests/index.js
generated
vendored
130
node_modules/@protobufjs/aspromise/tests/index.js
generated
vendored
@@ -1,130 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var asPromise = require("..");
|
||||
|
||||
tape.test("aspromise", function(test) {
|
||||
|
||||
test.test(this.name + " - resolve", function(test) {
|
||||
|
||||
function fn(arg1, arg2, callback) {
|
||||
test.equal(this, ctx, "function should be called with this = ctx");
|
||||
test.equal(arg1, 1, "function should be called with arg1 = 1");
|
||||
test.equal(arg2, 2, "function should be called with arg2 = 2");
|
||||
callback(null, arg2);
|
||||
}
|
||||
|
||||
var ctx = {};
|
||||
|
||||
var promise = asPromise(fn, ctx, 1, 2);
|
||||
promise.then(function(arg2) {
|
||||
test.equal(arg2, 2, "promise should be resolved with arg2 = 2");
|
||||
test.end();
|
||||
}).catch(function(err) {
|
||||
test.fail("promise should not be rejected (" + err + ")");
|
||||
});
|
||||
});
|
||||
|
||||
test.test(this.name + " - reject", function(test) {
|
||||
|
||||
function fn(arg1, arg2, callback) {
|
||||
test.equal(this, ctx, "function should be called with this = ctx");
|
||||
test.equal(arg1, 1, "function should be called with arg1 = 1");
|
||||
test.equal(arg2, 2, "function should be called with arg2 = 2");
|
||||
callback(arg1);
|
||||
}
|
||||
|
||||
var ctx = {};
|
||||
|
||||
var promise = asPromise(fn, ctx, 1, 2);
|
||||
promise.then(function() {
|
||||
test.fail("promise should not be resolved");
|
||||
}).catch(function(err) {
|
||||
test.equal(err, 1, "promise should be rejected with err = 1");
|
||||
test.end();
|
||||
});
|
||||
});
|
||||
|
||||
test.test(this.name + " - resolve twice", function(test) {
|
||||
|
||||
function fn(arg1, arg2, callback) {
|
||||
test.equal(this, ctx, "function should be called with this = ctx");
|
||||
test.equal(arg1, 1, "function should be called with arg1 = 1");
|
||||
test.equal(arg2, 2, "function should be called with arg2 = 2");
|
||||
callback(null, arg2);
|
||||
callback(null, arg1);
|
||||
}
|
||||
|
||||
var ctx = {};
|
||||
var count = 0;
|
||||
|
||||
var promise = asPromise(fn, ctx, 1, 2);
|
||||
promise.then(function(arg2) {
|
||||
test.equal(arg2, 2, "promise should be resolved with arg2 = 2");
|
||||
if (++count > 1)
|
||||
test.fail("promise should not be resolved twice");
|
||||
test.end();
|
||||
}).catch(function(err) {
|
||||
test.fail("promise should not be rejected (" + err + ")");
|
||||
});
|
||||
});
|
||||
|
||||
test.test(this.name + " - reject twice", function(test) {
|
||||
|
||||
function fn(arg1, arg2, callback) {
|
||||
test.equal(this, ctx, "function should be called with this = ctx");
|
||||
test.equal(arg1, 1, "function should be called with arg1 = 1");
|
||||
test.equal(arg2, 2, "function should be called with arg2 = 2");
|
||||
callback(arg1);
|
||||
callback(arg2);
|
||||
}
|
||||
|
||||
var ctx = {};
|
||||
var count = 0;
|
||||
|
||||
var promise = asPromise(fn, ctx, 1, 2);
|
||||
promise.then(function() {
|
||||
test.fail("promise should not be resolved");
|
||||
}).catch(function(err) {
|
||||
test.equal(err, 1, "promise should be rejected with err = 1");
|
||||
if (++count > 1)
|
||||
test.fail("promise should not be rejected twice");
|
||||
test.end();
|
||||
});
|
||||
});
|
||||
|
||||
test.test(this.name + " - reject error", function(test) {
|
||||
|
||||
function fn(callback) {
|
||||
test.ok(arguments.length === 1 && typeof callback === "function", "function should be called with just a callback");
|
||||
throw 3;
|
||||
}
|
||||
|
||||
var promise = asPromise(fn, null);
|
||||
promise.then(function() {
|
||||
test.fail("promise should not be resolved");
|
||||
}).catch(function(err) {
|
||||
test.equal(err, 3, "promise should be rejected with err = 3");
|
||||
test.end();
|
||||
});
|
||||
});
|
||||
|
||||
test.test(this.name + " - reject and error", function(test) {
|
||||
|
||||
function fn(callback) {
|
||||
callback(3);
|
||||
throw 4;
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
|
||||
var promise = asPromise(fn, null);
|
||||
promise.then(function() {
|
||||
test.fail("promise should not be resolved");
|
||||
}).catch(function(err) {
|
||||
test.equal(err, 3, "promise should be rejected with err = 3");
|
||||
if (++count > 1)
|
||||
test.fail("promise should not be rejected twice");
|
||||
test.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
26
node_modules/@protobufjs/base64/LICENSE
generated
vendored
26
node_modules/@protobufjs/base64/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
19
node_modules/@protobufjs/base64/README.md
generated
vendored
19
node_modules/@protobufjs/base64/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
@protobufjs/base64
|
||||
==================
|
||||
[](https://www.npmjs.com/package/@protobufjs/base64)
|
||||
|
||||
A minimal base64 implementation for number arrays.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **base64.length(string: `string`): `number`**<br />
|
||||
Calculates the byte length of a base64 encoded string.
|
||||
|
||||
* **base64.encode(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**<br />
|
||||
Encodes a buffer to a base64 encoded string.
|
||||
|
||||
* **base64.decode(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**<br />
|
||||
Decodes a base64 encoded string to a buffer.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
32
node_modules/@protobufjs/base64/index.d.ts
generated
vendored
32
node_modules/@protobufjs/base64/index.d.ts
generated
vendored
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Calculates the byte length of a base64 encoded string.
|
||||
* @param {string} string Base64 encoded string
|
||||
* @returns {number} Byte length
|
||||
*/
|
||||
export function length(string: string): number;
|
||||
|
||||
/**
|
||||
* Encodes a buffer to a base64 encoded string.
|
||||
* @param {Uint8Array} buffer Source buffer
|
||||
* @param {number} start Source start
|
||||
* @param {number} end Source end
|
||||
* @returns {string} Base64 encoded string
|
||||
*/
|
||||
export function encode(buffer: Uint8Array, start: number, end: number): string;
|
||||
|
||||
/**
|
||||
* Decodes a base64 encoded string to a buffer.
|
||||
* @param {string} string Source string
|
||||
* @param {Uint8Array} buffer Destination buffer
|
||||
* @param {number} offset Destination offset
|
||||
* @returns {number} Number of bytes written
|
||||
* @throws {Error} If encoding is invalid
|
||||
*/
|
||||
export function decode(string: string, buffer: Uint8Array, offset: number): number;
|
||||
|
||||
/**
|
||||
* Tests if the specified string appears to be base64 encoded.
|
||||
* @param {string} string String to test
|
||||
* @returns {boolean} `true` if it appears to be base64 encoded, otherwise false
|
||||
*/
|
||||
export function test(string: string): boolean;
|
||||
139
node_modules/@protobufjs/base64/index.js
generated
vendored
139
node_modules/@protobufjs/base64/index.js
generated
vendored
@@ -1,139 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A minimal base64 implementation for number arrays.
|
||||
* @memberof util
|
||||
* @namespace
|
||||
*/
|
||||
var base64 = exports;
|
||||
|
||||
/**
|
||||
* Calculates the byte length of a base64 encoded string.
|
||||
* @param {string} string Base64 encoded string
|
||||
* @returns {number} Byte length
|
||||
*/
|
||||
base64.length = function length(string) {
|
||||
var p = string.length;
|
||||
if (!p)
|
||||
return 0;
|
||||
var n = 0;
|
||||
while (--p % 4 > 1 && string.charAt(p) === "=")
|
||||
++n;
|
||||
return Math.ceil(string.length * 3) / 4 - n;
|
||||
};
|
||||
|
||||
// Base64 encoding table
|
||||
var b64 = new Array(64);
|
||||
|
||||
// Base64 decoding table
|
||||
var s64 = new Array(123);
|
||||
|
||||
// 65..90, 97..122, 48..57, 43, 47
|
||||
for (var i = 0; i < 64;)
|
||||
s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;
|
||||
|
||||
/**
|
||||
* Encodes a buffer to a base64 encoded string.
|
||||
* @param {Uint8Array} buffer Source buffer
|
||||
* @param {number} start Source start
|
||||
* @param {number} end Source end
|
||||
* @returns {string} Base64 encoded string
|
||||
*/
|
||||
base64.encode = function encode(buffer, start, end) {
|
||||
var parts = null,
|
||||
chunk = [];
|
||||
var i = 0, // output index
|
||||
j = 0, // goto index
|
||||
t; // temporary
|
||||
while (start < end) {
|
||||
var b = buffer[start++];
|
||||
switch (j) {
|
||||
case 0:
|
||||
chunk[i++] = b64[b >> 2];
|
||||
t = (b & 3) << 4;
|
||||
j = 1;
|
||||
break;
|
||||
case 1:
|
||||
chunk[i++] = b64[t | b >> 4];
|
||||
t = (b & 15) << 2;
|
||||
j = 2;
|
||||
break;
|
||||
case 2:
|
||||
chunk[i++] = b64[t | b >> 6];
|
||||
chunk[i++] = b64[b & 63];
|
||||
j = 0;
|
||||
break;
|
||||
}
|
||||
if (i > 8191) {
|
||||
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
if (j) {
|
||||
chunk[i++] = b64[t];
|
||||
chunk[i++] = 61;
|
||||
if (j === 1)
|
||||
chunk[i++] = 61;
|
||||
}
|
||||
if (parts) {
|
||||
if (i)
|
||||
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
||||
return parts.join("");
|
||||
}
|
||||
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
||||
};
|
||||
|
||||
var invalidEncoding = "invalid encoding";
|
||||
|
||||
/**
|
||||
* Decodes a base64 encoded string to a buffer.
|
||||
* @param {string} string Source string
|
||||
* @param {Uint8Array} buffer Destination buffer
|
||||
* @param {number} offset Destination offset
|
||||
* @returns {number} Number of bytes written
|
||||
* @throws {Error} If encoding is invalid
|
||||
*/
|
||||
base64.decode = function decode(string, buffer, offset) {
|
||||
var start = offset;
|
||||
var j = 0, // goto index
|
||||
t; // temporary
|
||||
for (var i = 0; i < string.length;) {
|
||||
var c = string.charCodeAt(i++);
|
||||
if (c === 61 && j > 1)
|
||||
break;
|
||||
if ((c = s64[c]) === undefined)
|
||||
throw Error(invalidEncoding);
|
||||
switch (j) {
|
||||
case 0:
|
||||
t = c;
|
||||
j = 1;
|
||||
break;
|
||||
case 1:
|
||||
buffer[offset++] = t << 2 | (c & 48) >> 4;
|
||||
t = c;
|
||||
j = 2;
|
||||
break;
|
||||
case 2:
|
||||
buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;
|
||||
t = c;
|
||||
j = 3;
|
||||
break;
|
||||
case 3:
|
||||
buffer[offset++] = (t & 3) << 6 | c;
|
||||
j = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j === 1)
|
||||
throw Error(invalidEncoding);
|
||||
return offset - start;
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests if the specified string appears to be base64 encoded.
|
||||
* @param {string} string String to test
|
||||
* @returns {boolean} `true` if probably base64 encoded, otherwise false
|
||||
*/
|
||||
base64.test = function test(string) {
|
||||
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
|
||||
};
|
||||
25
node_modules/@protobufjs/base64/package.json
generated
vendored
25
node_modules/@protobufjs/base64/package.json
generated
vendored
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/base64",
|
||||
"description": "A minimal base64 implementation for number arrays.",
|
||||
"version": "1.1.2",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz"
|
||||
,"_integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
|
||||
,"_from": "@protobufjs/base64@1.1.2"
|
||||
}
|
||||
46
node_modules/@protobufjs/base64/tests/index.js
generated
vendored
46
node_modules/@protobufjs/base64/tests/index.js
generated
vendored
@@ -1,46 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var base64 = require("..");
|
||||
|
||||
var strings = {
|
||||
"": "",
|
||||
"a": "YQ==",
|
||||
"ab": "YWI=",
|
||||
"abcdefg": "YWJjZGVmZw==",
|
||||
"abcdefgh": "YWJjZGVmZ2g=",
|
||||
"abcdefghi": "YWJjZGVmZ2hp"
|
||||
};
|
||||
|
||||
tape.test("base64", function(test) {
|
||||
|
||||
Object.keys(strings).forEach(function(str) {
|
||||
var enc = strings[str];
|
||||
|
||||
test.equal(base64.test(enc), true, "should detect '" + enc + "' to be base64 encoded");
|
||||
|
||||
var len = base64.length(enc);
|
||||
test.equal(len, str.length, "should calculate '" + enc + "' as " + str.length + " bytes");
|
||||
|
||||
var buf = new Array(len);
|
||||
var len2 = base64.decode(enc, buf, 0);
|
||||
test.equal(len2, len, "should decode '" + enc + "' to " + len + " bytes");
|
||||
|
||||
test.equal(String.fromCharCode.apply(String, buf), str, "should decode '" + enc + "' to '" + str + "'");
|
||||
|
||||
var enc2 = base64.encode(buf, 0, buf.length);
|
||||
test.equal(enc2, enc, "should encode '" + str + "' to '" + enc + "'");
|
||||
|
||||
});
|
||||
|
||||
test.throws(function() {
|
||||
var buf = new Array(10);
|
||||
base64.decode("YQ!", buf, 0);
|
||||
}, Error, "should throw if encoding is invalid");
|
||||
|
||||
test.throws(function() {
|
||||
var buf = new Array(10);
|
||||
base64.decode("Y", buf, 0);
|
||||
}, Error, "should throw if string is truncated");
|
||||
|
||||
test.end();
|
||||
});
|
||||
26
node_modules/@protobufjs/codegen/LICENSE
generated
vendored
26
node_modules/@protobufjs/codegen/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
49
node_modules/@protobufjs/codegen/README.md
generated
vendored
49
node_modules/@protobufjs/codegen/README.md
generated
vendored
@@ -1,49 +0,0 @@
|
||||
@protobufjs/codegen
|
||||
===================
|
||||
[](https://www.npmjs.com/package/@protobufjs/codegen)
|
||||
|
||||
A minimalistic code generation utility.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **codegen([functionParams: `string[]`], [functionName: string]): `Codegen`**<br />
|
||||
Begins generating a function.
|
||||
|
||||
* **codegen.verbose = `false`**<br />
|
||||
When set to true, codegen will log generated code to console. Useful for debugging.
|
||||
|
||||
Invoking **codegen** returns an appender function that appends code to the function's body and returns itself:
|
||||
|
||||
* **Codegen(formatString: `string`, [...formatParams: `any`]): Codegen**<br />
|
||||
Appends code to the function's body. The format string can contain placeholders specifying the types of inserted format parameters:
|
||||
|
||||
* `%d`: Number (integer or floating point value)
|
||||
* `%f`: Floating point value
|
||||
* `%i`: Integer value
|
||||
* `%j`: JSON.stringify'ed value
|
||||
* `%s`: String value
|
||||
* `%%`: Percent sign<br />
|
||||
|
||||
* **Codegen([scope: `Object.<string,*>`]): `Function`**<br />
|
||||
Finishes the function and returns it.
|
||||
|
||||
* **Codegen.toString([functionNameOverride: `string`]): `string`**<br />
|
||||
Returns the function as a string.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
```js
|
||||
var codegen = require("@protobufjs/codegen");
|
||||
|
||||
var add = codegen(["a", "b"], "add") // A function with parameters "a" and "b" named "add"
|
||||
("// awesome comment") // adds the line to the function's body
|
||||
("return a + b - c + %d", 1) // replaces %d with 1 and adds the line to the body
|
||||
({ c: 1 }); // adds "c" with a value of 1 to the function's scope
|
||||
|
||||
console.log(add.toString()); // function add(a, b) { return a + b - c + 1 }
|
||||
console.log(add(1, 2)); // calculates 1 + 2 - 1 + 1 = 3
|
||||
```
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
31
node_modules/@protobufjs/codegen/index.d.ts
generated
vendored
31
node_modules/@protobufjs/codegen/index.d.ts
generated
vendored
@@ -1,31 +0,0 @@
|
||||
export = codegen;
|
||||
|
||||
/**
|
||||
* Appends code to the function's body.
|
||||
* @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any
|
||||
* @param [formatParams] Format parameters
|
||||
* @returns Itself or the generated function if finished
|
||||
* @throws {Error} If format parameter counts do not match
|
||||
*/
|
||||
type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function);
|
||||
|
||||
/**
|
||||
* Begins generating a function.
|
||||
* @param functionParams Function parameter names
|
||||
* @param [functionName] Function name if not anonymous
|
||||
* @returns Appender that appends code to the function's body
|
||||
*/
|
||||
declare function codegen(functionParams: string[], functionName?: string): Codegen;
|
||||
|
||||
/**
|
||||
* Begins generating a function.
|
||||
* @param [functionName] Function name if not anonymous
|
||||
* @returns Appender that appends code to the function's body
|
||||
*/
|
||||
declare function codegen(functionName?: string): Codegen;
|
||||
|
||||
declare namespace codegen {
|
||||
|
||||
/** When set to `true`, codegen will log generated code to console. Useful for debugging. */
|
||||
let verbose: boolean;
|
||||
}
|
||||
99
node_modules/@protobufjs/codegen/index.js
generated
vendored
99
node_modules/@protobufjs/codegen/index.js
generated
vendored
@@ -1,99 +0,0 @@
|
||||
"use strict";
|
||||
module.exports = codegen;
|
||||
|
||||
/**
|
||||
* Begins generating a function.
|
||||
* @memberof util
|
||||
* @param {string[]} functionParams Function parameter names
|
||||
* @param {string} [functionName] Function name if not anonymous
|
||||
* @returns {Codegen} Appender that appends code to the function's body
|
||||
*/
|
||||
function codegen(functionParams, functionName) {
|
||||
|
||||
/* istanbul ignore if */
|
||||
if (typeof functionParams === "string") {
|
||||
functionName = functionParams;
|
||||
functionParams = undefined;
|
||||
}
|
||||
|
||||
var body = [];
|
||||
|
||||
/**
|
||||
* Appends code to the function's body or finishes generation.
|
||||
* @typedef Codegen
|
||||
* @type {function}
|
||||
* @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any
|
||||
* @param {...*} [formatParams] Format parameters
|
||||
* @returns {Codegen|Function} Itself or the generated function if finished
|
||||
* @throws {Error} If format parameter counts do not match
|
||||
*/
|
||||
|
||||
function Codegen(formatStringOrScope) {
|
||||
// note that explicit array handling below makes this ~50% faster
|
||||
|
||||
// finish the function
|
||||
if (typeof formatStringOrScope !== "string") {
|
||||
var source = toString();
|
||||
if (codegen.verbose)
|
||||
console.log("codegen: " + source); // eslint-disable-line no-console
|
||||
source = "return " + source;
|
||||
if (formatStringOrScope) {
|
||||
var scopeKeys = Object.keys(formatStringOrScope),
|
||||
scopeParams = new Array(scopeKeys.length + 1),
|
||||
scopeValues = new Array(scopeKeys.length),
|
||||
scopeOffset = 0;
|
||||
while (scopeOffset < scopeKeys.length) {
|
||||
scopeParams[scopeOffset] = scopeKeys[scopeOffset];
|
||||
scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];
|
||||
}
|
||||
scopeParams[scopeOffset] = source;
|
||||
return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func
|
||||
}
|
||||
return Function(source)(); // eslint-disable-line no-new-func
|
||||
}
|
||||
|
||||
// otherwise append to body
|
||||
var formatParams = new Array(arguments.length - 1),
|
||||
formatOffset = 0;
|
||||
while (formatOffset < formatParams.length)
|
||||
formatParams[formatOffset] = arguments[++formatOffset];
|
||||
formatOffset = 0;
|
||||
formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {
|
||||
var value = formatParams[formatOffset++];
|
||||
switch ($1) {
|
||||
case "d": case "f": return String(Number(value));
|
||||
case "i": return String(Math.floor(value));
|
||||
case "j": return JSON.stringify(value);
|
||||
case "s": return String(value);
|
||||
}
|
||||
return "%";
|
||||
});
|
||||
if (formatOffset !== formatParams.length)
|
||||
throw Error("parameter count mismatch");
|
||||
body.push(formatStringOrScope);
|
||||
return Codegen;
|
||||
}
|
||||
|
||||
function toString(functionNameOverride) {
|
||||
return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
|
||||
}
|
||||
|
||||
Codegen.toString = toString;
|
||||
return Codegen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Begins generating a function.
|
||||
* @memberof util
|
||||
* @function codegen
|
||||
* @param {string} [functionName] Function name if not anonymous
|
||||
* @returns {Codegen} Appender that appends code to the function's body
|
||||
* @variation 2
|
||||
*/
|
||||
|
||||
/**
|
||||
* When set to `true`, codegen will log generated code to console. Useful for debugging.
|
||||
* @name util.codegen.verbose
|
||||
* @type {boolean}
|
||||
*/
|
||||
codegen.verbose = false;
|
||||
17
node_modules/@protobufjs/codegen/package.json
generated
vendored
17
node_modules/@protobufjs/codegen/package.json
generated
vendored
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/codegen",
|
||||
"description": "A minimalistic code generation utility.",
|
||||
"version": "2.0.4",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz"
|
||||
,"_integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
|
||||
,"_from": "@protobufjs/codegen@2.0.4"
|
||||
}
|
||||
13
node_modules/@protobufjs/codegen/tests/index.js
generated
vendored
13
node_modules/@protobufjs/codegen/tests/index.js
generated
vendored
@@ -1,13 +0,0 @@
|
||||
var codegen = require("..");
|
||||
|
||||
// new require("benchmark").Suite().add("add", function() {
|
||||
|
||||
var add = codegen(["a", "b"], "add")
|
||||
("// awesome comment")
|
||||
("return a + b - c + %d", 1)
|
||||
({ c: 1 });
|
||||
|
||||
if (add(1, 2) !== 3)
|
||||
throw Error("failed");
|
||||
|
||||
// }).on("cycle", function(event) { process.stdout.write(String(event.target) + "\n"); }).run();
|
||||
26
node_modules/@protobufjs/eventemitter/LICENSE
generated
vendored
26
node_modules/@protobufjs/eventemitter/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
22
node_modules/@protobufjs/eventemitter/README.md
generated
vendored
22
node_modules/@protobufjs/eventemitter/README.md
generated
vendored
@@ -1,22 +0,0 @@
|
||||
@protobufjs/eventemitter
|
||||
========================
|
||||
[](https://www.npmjs.com/package/@protobufjs/eventemitter)
|
||||
|
||||
A minimal event emitter.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **new EventEmitter()**<br />
|
||||
Constructs a new event emitter instance.
|
||||
|
||||
* **EventEmitter#on(evt: `string`, fn: `function`, [ctx: `Object`]): `EventEmitter`**<br />
|
||||
Registers an event listener.
|
||||
|
||||
* **EventEmitter#off([evt: `string`], [fn: `function`]): `EventEmitter`**<br />
|
||||
Removes an event listener or any matching listeners if arguments are omitted.
|
||||
|
||||
* **EventEmitter#emit(evt: `string`, ...args: `*`): `EventEmitter`**<br />
|
||||
Emits an event by calling its listeners with the specified arguments.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
43
node_modules/@protobufjs/eventemitter/index.d.ts
generated
vendored
43
node_modules/@protobufjs/eventemitter/index.d.ts
generated
vendored
@@ -1,43 +0,0 @@
|
||||
export = EventEmitter;
|
||||
|
||||
/**
|
||||
* Constructs a new event emitter instance.
|
||||
* @classdesc A minimal event emitter.
|
||||
* @memberof util
|
||||
* @constructor
|
||||
*/
|
||||
declare class EventEmitter {
|
||||
|
||||
/**
|
||||
* Constructs a new event emitter instance.
|
||||
* @classdesc A minimal event emitter.
|
||||
* @memberof util
|
||||
* @constructor
|
||||
*/
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param {string} evt Event name
|
||||
* @param {function} fn Listener
|
||||
* @param {*} [ctx] Listener context
|
||||
* @returns {util.EventEmitter} `this`
|
||||
*/
|
||||
on(evt: string, fn: () => any, ctx?: any): EventEmitter;
|
||||
|
||||
/**
|
||||
* Removes an event listener or any matching listeners if arguments are omitted.
|
||||
* @param {string} [evt] Event name. Removes all listeners if omitted.
|
||||
* @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
|
||||
* @returns {util.EventEmitter} `this`
|
||||
*/
|
||||
off(evt?: string, fn?: () => any): EventEmitter;
|
||||
|
||||
/**
|
||||
* Emits an event by calling its listeners with the specified arguments.
|
||||
* @param {string} evt Event name
|
||||
* @param {...*} args Arguments
|
||||
* @returns {util.EventEmitter} `this`
|
||||
*/
|
||||
emit(evt: string, ...args: any[]): EventEmitter;
|
||||
}
|
||||
76
node_modules/@protobufjs/eventemitter/index.js
generated
vendored
76
node_modules/@protobufjs/eventemitter/index.js
generated
vendored
@@ -1,76 +0,0 @@
|
||||
"use strict";
|
||||
module.exports = EventEmitter;
|
||||
|
||||
/**
|
||||
* Constructs a new event emitter instance.
|
||||
* @classdesc A minimal event emitter.
|
||||
* @memberof util
|
||||
* @constructor
|
||||
*/
|
||||
function EventEmitter() {
|
||||
|
||||
/**
|
||||
* Registered listeners.
|
||||
* @type {Object.<string,*>}
|
||||
* @private
|
||||
*/
|
||||
this._listeners = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an event listener.
|
||||
* @param {string} evt Event name
|
||||
* @param {function} fn Listener
|
||||
* @param {*} [ctx] Listener context
|
||||
* @returns {util.EventEmitter} `this`
|
||||
*/
|
||||
EventEmitter.prototype.on = function on(evt, fn, ctx) {
|
||||
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
||||
fn : fn,
|
||||
ctx : ctx || this
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes an event listener or any matching listeners if arguments are omitted.
|
||||
* @param {string} [evt] Event name. Removes all listeners if omitted.
|
||||
* @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.
|
||||
* @returns {util.EventEmitter} `this`
|
||||
*/
|
||||
EventEmitter.prototype.off = function off(evt, fn) {
|
||||
if (evt === undefined)
|
||||
this._listeners = {};
|
||||
else {
|
||||
if (fn === undefined)
|
||||
this._listeners[evt] = [];
|
||||
else {
|
||||
var listeners = this._listeners[evt];
|
||||
for (var i = 0; i < listeners.length;)
|
||||
if (listeners[i].fn === fn)
|
||||
listeners.splice(i, 1);
|
||||
else
|
||||
++i;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Emits an event by calling its listeners with the specified arguments.
|
||||
* @param {string} evt Event name
|
||||
* @param {...*} args Arguments
|
||||
* @returns {util.EventEmitter} `this`
|
||||
*/
|
||||
EventEmitter.prototype.emit = function emit(evt) {
|
||||
var listeners = this._listeners[evt];
|
||||
if (listeners) {
|
||||
var args = [],
|
||||
i = 1;
|
||||
for (; i < arguments.length;)
|
||||
args.push(arguments[i++]);
|
||||
for (i = 0; i < listeners.length;)
|
||||
listeners[i].fn.apply(listeners[i++].ctx, args);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
25
node_modules/@protobufjs/eventemitter/package.json
generated
vendored
25
node_modules/@protobufjs/eventemitter/package.json
generated
vendored
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/eventemitter",
|
||||
"description": "A minimal event emitter.",
|
||||
"version": "1.1.0",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz"
|
||||
,"_integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A="
|
||||
,"_from": "@protobufjs/eventemitter@1.1.0"
|
||||
}
|
||||
47
node_modules/@protobufjs/eventemitter/tests/index.js
generated
vendored
47
node_modules/@protobufjs/eventemitter/tests/index.js
generated
vendored
@@ -1,47 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var EventEmitter = require("..");
|
||||
|
||||
tape.test("eventemitter", function(test) {
|
||||
|
||||
var ee = new EventEmitter();
|
||||
var fn;
|
||||
var ctx = {};
|
||||
|
||||
test.doesNotThrow(function() {
|
||||
ee.emit("a", 1);
|
||||
ee.off();
|
||||
ee.off("a");
|
||||
ee.off("a", function() {});
|
||||
}, "should not throw if no listeners are registered");
|
||||
|
||||
test.equal(ee.on("a", function(arg1) {
|
||||
test.equal(this, ctx, "should be called with this = ctx");
|
||||
test.equal(arg1, 1, "should be called with arg1 = 1");
|
||||
}, ctx), ee, "should return itself when registering events");
|
||||
ee.emit("a", 1);
|
||||
|
||||
ee.off("a");
|
||||
test.same(ee._listeners, { a: [] }, "should remove all listeners of the respective event when calling off(evt)");
|
||||
|
||||
ee.off();
|
||||
test.same(ee._listeners, {}, "should remove all listeners when just calling off()");
|
||||
|
||||
ee.on("a", fn = function(arg1) {
|
||||
test.equal(this, ctx, "should be called with this = ctx");
|
||||
test.equal(arg1, 1, "should be called with arg1 = 1");
|
||||
}, ctx).emit("a", 1);
|
||||
|
||||
ee.off("a", fn);
|
||||
test.same(ee._listeners, { a: [] }, "should remove the exact listener when calling off(evt, fn)");
|
||||
|
||||
ee.on("a", function() {
|
||||
test.equal(this, ee, "should be called with this = ee");
|
||||
}).emit("a");
|
||||
|
||||
test.doesNotThrow(function() {
|
||||
ee.off("a", fn);
|
||||
}, "should not throw if no such listener is found");
|
||||
|
||||
test.end();
|
||||
});
|
||||
26
node_modules/@protobufjs/fetch/LICENSE
generated
vendored
26
node_modules/@protobufjs/fetch/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
13
node_modules/@protobufjs/fetch/README.md
generated
vendored
13
node_modules/@protobufjs/fetch/README.md
generated
vendored
@@ -1,13 +0,0 @@
|
||||
@protobufjs/fetch
|
||||
=================
|
||||
[](https://www.npmjs.com/package/@protobufjs/fetch)
|
||||
|
||||
Fetches the contents of a file accross node and browsers.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **fetch(path: `string`, [options: { binary: boolean } ], [callback: `function(error: ?Error, [contents: string])`]): `Promise<string|Uint8Array>|undefined`**
|
||||
Fetches the contents of a file.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
56
node_modules/@protobufjs/fetch/index.d.ts
generated
vendored
56
node_modules/@protobufjs/fetch/index.d.ts
generated
vendored
@@ -1,56 +0,0 @@
|
||||
export = fetch;
|
||||
|
||||
/**
|
||||
* Node-style callback as used by {@link util.fetch}.
|
||||
* @typedef FetchCallback
|
||||
* @type {function}
|
||||
* @param {?Error} error Error, if any, otherwise `null`
|
||||
* @param {string} [contents] File contents, if there hasn't been an error
|
||||
* @returns {undefined}
|
||||
*/
|
||||
type FetchCallback = (error: Error, contents?: string) => void;
|
||||
|
||||
/**
|
||||
* Options as used by {@link util.fetch}.
|
||||
* @typedef FetchOptions
|
||||
* @type {Object}
|
||||
* @property {boolean} [binary=false] Whether expecting a binary response
|
||||
* @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
|
||||
*/
|
||||
|
||||
interface FetchOptions {
|
||||
binary?: boolean;
|
||||
xhr?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the contents of a file.
|
||||
* @memberof util
|
||||
* @param {string} filename File path or url
|
||||
* @param {FetchOptions} options Fetch options
|
||||
* @param {FetchCallback} callback Callback function
|
||||
* @returns {undefined}
|
||||
*/
|
||||
declare function fetch(filename: string, options: FetchOptions, callback: FetchCallback): void;
|
||||
|
||||
/**
|
||||
* Fetches the contents of a file.
|
||||
* @name util.fetch
|
||||
* @function
|
||||
* @param {string} path File path or url
|
||||
* @param {FetchCallback} callback Callback function
|
||||
* @returns {undefined}
|
||||
* @variation 2
|
||||
*/
|
||||
declare function fetch(path: string, callback: FetchCallback): void;
|
||||
|
||||
/**
|
||||
* Fetches the contents of a file.
|
||||
* @name util.fetch
|
||||
* @function
|
||||
* @param {string} path File path or url
|
||||
* @param {FetchOptions} [options] Fetch options
|
||||
* @returns {Promise<string|Uint8Array>} Promise
|
||||
* @variation 3
|
||||
*/
|
||||
declare function fetch(path: string, options?: FetchOptions): Promise<(string|Uint8Array)>;
|
||||
115
node_modules/@protobufjs/fetch/index.js
generated
vendored
115
node_modules/@protobufjs/fetch/index.js
generated
vendored
@@ -1,115 +0,0 @@
|
||||
"use strict";
|
||||
module.exports = fetch;
|
||||
|
||||
var asPromise = require("@protobufjs/aspromise"),
|
||||
inquire = require("@protobufjs/inquire");
|
||||
|
||||
var fs = inquire("fs");
|
||||
|
||||
/**
|
||||
* Node-style callback as used by {@link util.fetch}.
|
||||
* @typedef FetchCallback
|
||||
* @type {function}
|
||||
* @param {?Error} error Error, if any, otherwise `null`
|
||||
* @param {string} [contents] File contents, if there hasn't been an error
|
||||
* @returns {undefined}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Options as used by {@link util.fetch}.
|
||||
* @typedef FetchOptions
|
||||
* @type {Object}
|
||||
* @property {boolean} [binary=false] Whether expecting a binary response
|
||||
* @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fetches the contents of a file.
|
||||
* @memberof util
|
||||
* @param {string} filename File path or url
|
||||
* @param {FetchOptions} options Fetch options
|
||||
* @param {FetchCallback} callback Callback function
|
||||
* @returns {undefined}
|
||||
*/
|
||||
function fetch(filename, options, callback) {
|
||||
if (typeof options === "function") {
|
||||
callback = options;
|
||||
options = {};
|
||||
} else if (!options)
|
||||
options = {};
|
||||
|
||||
if (!callback)
|
||||
return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this
|
||||
|
||||
// if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.
|
||||
if (!options.xhr && fs && fs.readFile)
|
||||
return fs.readFile(filename, function fetchReadFileCallback(err, contents) {
|
||||
return err && typeof XMLHttpRequest !== "undefined"
|
||||
? fetch.xhr(filename, options, callback)
|
||||
: err
|
||||
? callback(err)
|
||||
: callback(null, options.binary ? contents : contents.toString("utf8"));
|
||||
});
|
||||
|
||||
// use the XHR version otherwise.
|
||||
return fetch.xhr(filename, options, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the contents of a file.
|
||||
* @name util.fetch
|
||||
* @function
|
||||
* @param {string} path File path or url
|
||||
* @param {FetchCallback} callback Callback function
|
||||
* @returns {undefined}
|
||||
* @variation 2
|
||||
*/
|
||||
|
||||
/**
|
||||
* Fetches the contents of a file.
|
||||
* @name util.fetch
|
||||
* @function
|
||||
* @param {string} path File path or url
|
||||
* @param {FetchOptions} [options] Fetch options
|
||||
* @returns {Promise<string|Uint8Array>} Promise
|
||||
* @variation 3
|
||||
*/
|
||||
|
||||
/**/
|
||||
fetch.xhr = function fetch_xhr(filename, options, callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {
|
||||
|
||||
if (xhr.readyState !== 4)
|
||||
return undefined;
|
||||
|
||||
// local cors security errors return status 0 / empty string, too. afaik this cannot be
|
||||
// reliably distinguished from an actually empty file for security reasons. feel free
|
||||
// to send a pull request if you are aware of a solution.
|
||||
if (xhr.status !== 0 && xhr.status !== 200)
|
||||
return callback(Error("status " + xhr.status));
|
||||
|
||||
// if binary data is expected, make sure that some sort of array is returned, even if
|
||||
// ArrayBuffers are not supported. the binary string fallback, however, is unsafe.
|
||||
if (options.binary) {
|
||||
var buffer = xhr.response;
|
||||
if (!buffer) {
|
||||
buffer = [];
|
||||
for (var i = 0; i < xhr.responseText.length; ++i)
|
||||
buffer.push(xhr.responseText.charCodeAt(i) & 255);
|
||||
}
|
||||
return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer);
|
||||
}
|
||||
return callback(null, xhr.responseText);
|
||||
};
|
||||
|
||||
if (options.binary) {
|
||||
// ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers
|
||||
if ("overrideMimeType" in xhr)
|
||||
xhr.overrideMimeType("text/plain; charset=x-user-defined");
|
||||
xhr.responseType = "arraybuffer";
|
||||
}
|
||||
|
||||
xhr.open("GET", filename);
|
||||
xhr.send();
|
||||
};
|
||||
29
node_modules/@protobufjs/fetch/package.json
generated
vendored
29
node_modules/@protobufjs/fetch/package.json
generated
vendored
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/fetch",
|
||||
"description": "Fetches the contents of a file accross node and browsers.",
|
||||
"version": "1.1.0",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@protobufjs/aspromise": "^1.1.1",
|
||||
"@protobufjs/inquire": "^1.1.0"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz"
|
||||
,"_integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU="
|
||||
,"_from": "@protobufjs/fetch@1.1.0"
|
||||
}
|
||||
16
node_modules/@protobufjs/fetch/tests/index.js
generated
vendored
16
node_modules/@protobufjs/fetch/tests/index.js
generated
vendored
@@ -1,16 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var fetch = require("..");
|
||||
|
||||
tape.test("fetch", function(test) {
|
||||
|
||||
if (typeof Promise !== "undefined") {
|
||||
var promise = fetch("NOTFOUND");
|
||||
promise.catch(function() {});
|
||||
test.ok(promise instanceof Promise, "should return a promise if callback has been omitted");
|
||||
}
|
||||
|
||||
// TODO - some way to test this properly?
|
||||
|
||||
test.end();
|
||||
});
|
||||
26
node_modules/@protobufjs/float/LICENSE
generated
vendored
26
node_modules/@protobufjs/float/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
102
node_modules/@protobufjs/float/README.md
generated
vendored
102
node_modules/@protobufjs/float/README.md
generated
vendored
@@ -1,102 +0,0 @@
|
||||
@protobufjs/float
|
||||
=================
|
||||
[](https://www.npmjs.com/package/@protobufjs/float)
|
||||
|
||||
Reads / writes floats / doubles from / to buffers in both modern and ancient browsers. Fast.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **writeFloatLE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />
|
||||
Writes a 32 bit float to a buffer using little endian byte order.
|
||||
|
||||
* **writeFloatBE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />
|
||||
Writes a 32 bit float to a buffer using big endian byte order.
|
||||
|
||||
* **readFloatLE(buf: `Uint8Array`, pos: `number`): `number`**<br />
|
||||
Reads a 32 bit float from a buffer using little endian byte order.
|
||||
|
||||
* **readFloatBE(buf: `Uint8Array`, pos: `number`): `number`**<br />
|
||||
Reads a 32 bit float from a buffer using big endian byte order.
|
||||
|
||||
* **writeDoubleLE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />
|
||||
Writes a 64 bit double to a buffer using little endian byte order.
|
||||
|
||||
* **writeDoubleBE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />
|
||||
Writes a 64 bit double to a buffer using big endian byte order.
|
||||
|
||||
* **readDoubleLE(buf: `Uint8Array`, pos: `number`): `number`**<br />
|
||||
Reads a 64 bit double from a buffer using little endian byte order.
|
||||
|
||||
* **readDoubleBE(buf: `Uint8Array`, pos: `number`): `number`**<br />
|
||||
Reads a 64 bit double from a buffer using big endian byte order.
|
||||
|
||||
Performance
|
||||
-----------
|
||||
There is a simple benchmark included comparing raw read/write performance of this library (float), float's fallback for old browsers, the [ieee754](https://www.npmjs.com/package/ieee754) module and node's [buffer](https://nodejs.org/api/buffer.html). On an i7-2600k running node 6.9.1 it yields:
|
||||
|
||||
```
|
||||
benchmarking writeFloat performance ...
|
||||
|
||||
float x 42,741,625 ops/sec ±1.75% (81 runs sampled)
|
||||
float (fallback) x 11,272,532 ops/sec ±1.12% (85 runs sampled)
|
||||
ieee754 x 8,653,337 ops/sec ±1.18% (84 runs sampled)
|
||||
buffer x 12,412,414 ops/sec ±1.41% (83 runs sampled)
|
||||
buffer (noAssert) x 13,471,149 ops/sec ±1.09% (84 runs sampled)
|
||||
|
||||
float was fastest
|
||||
float (fallback) was 73.5% slower
|
||||
ieee754 was 79.6% slower
|
||||
buffer was 70.9% slower
|
||||
buffer (noAssert) was 68.3% slower
|
||||
|
||||
benchmarking readFloat performance ...
|
||||
|
||||
float x 44,382,729 ops/sec ±1.70% (84 runs sampled)
|
||||
float (fallback) x 20,925,938 ops/sec ±0.86% (87 runs sampled)
|
||||
ieee754 x 17,189,009 ops/sec ±1.01% (87 runs sampled)
|
||||
buffer x 10,518,437 ops/sec ±1.04% (83 runs sampled)
|
||||
buffer (noAssert) x 11,031,636 ops/sec ±1.15% (87 runs sampled)
|
||||
|
||||
float was fastest
|
||||
float (fallback) was 52.5% slower
|
||||
ieee754 was 61.0% slower
|
||||
buffer was 76.1% slower
|
||||
buffer (noAssert) was 75.0% slower
|
||||
|
||||
benchmarking writeDouble performance ...
|
||||
|
||||
float x 38,624,906 ops/sec ±0.93% (83 runs sampled)
|
||||
float (fallback) x 10,457,811 ops/sec ±1.54% (85 runs sampled)
|
||||
ieee754 x 7,681,130 ops/sec ±1.11% (83 runs sampled)
|
||||
buffer x 12,657,876 ops/sec ±1.03% (83 runs sampled)
|
||||
buffer (noAssert) x 13,372,795 ops/sec ±0.84% (85 runs sampled)
|
||||
|
||||
float was fastest
|
||||
float (fallback) was 73.1% slower
|
||||
ieee754 was 80.1% slower
|
||||
buffer was 67.3% slower
|
||||
buffer (noAssert) was 65.3% slower
|
||||
|
||||
benchmarking readDouble performance ...
|
||||
|
||||
float x 40,527,888 ops/sec ±1.05% (84 runs sampled)
|
||||
float (fallback) x 18,696,480 ops/sec ±0.84% (86 runs sampled)
|
||||
ieee754 x 14,074,028 ops/sec ±1.04% (87 runs sampled)
|
||||
buffer x 10,092,367 ops/sec ±1.15% (84 runs sampled)
|
||||
buffer (noAssert) x 10,623,793 ops/sec ±0.96% (84 runs sampled)
|
||||
|
||||
float was fastest
|
||||
float (fallback) was 53.8% slower
|
||||
ieee754 was 65.3% slower
|
||||
buffer was 75.1% slower
|
||||
buffer (noAssert) was 73.8% slower
|
||||
```
|
||||
|
||||
To run it yourself:
|
||||
|
||||
```
|
||||
$> npm run bench
|
||||
```
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
87
node_modules/@protobufjs/float/bench/index.js
generated
vendored
87
node_modules/@protobufjs/float/bench/index.js
generated
vendored
@@ -1,87 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
var float = require(".."),
|
||||
ieee754 = require("ieee754"),
|
||||
newSuite = require("./suite");
|
||||
|
||||
var F32 = Float32Array;
|
||||
var F64 = Float64Array;
|
||||
delete global.Float32Array;
|
||||
delete global.Float64Array;
|
||||
var floatFallback = float({});
|
||||
global.Float32Array = F32;
|
||||
global.Float64Array = F64;
|
||||
|
||||
var buf = new Buffer(8);
|
||||
|
||||
newSuite("writeFloat")
|
||||
.add("float", function() {
|
||||
float.writeFloatLE(0.1, buf, 0);
|
||||
})
|
||||
.add("float (fallback)", function() {
|
||||
floatFallback.writeFloatLE(0.1, buf, 0);
|
||||
})
|
||||
.add("ieee754", function() {
|
||||
ieee754.write(buf, 0.1, 0, true, 23, 4);
|
||||
})
|
||||
.add("buffer", function() {
|
||||
buf.writeFloatLE(0.1, 0);
|
||||
})
|
||||
.add("buffer (noAssert)", function() {
|
||||
buf.writeFloatLE(0.1, 0, true);
|
||||
})
|
||||
.run();
|
||||
|
||||
newSuite("readFloat")
|
||||
.add("float", function() {
|
||||
float.readFloatLE(buf, 0);
|
||||
})
|
||||
.add("float (fallback)", function() {
|
||||
floatFallback.readFloatLE(buf, 0);
|
||||
})
|
||||
.add("ieee754", function() {
|
||||
ieee754.read(buf, 0, true, 23, 4);
|
||||
})
|
||||
.add("buffer", function() {
|
||||
buf.readFloatLE(0);
|
||||
})
|
||||
.add("buffer (noAssert)", function() {
|
||||
buf.readFloatLE(0, true);
|
||||
})
|
||||
.run();
|
||||
|
||||
newSuite("writeDouble")
|
||||
.add("float", function() {
|
||||
float.writeDoubleLE(0.1, buf, 0);
|
||||
})
|
||||
.add("float (fallback)", function() {
|
||||
floatFallback.writeDoubleLE(0.1, buf, 0);
|
||||
})
|
||||
.add("ieee754", function() {
|
||||
ieee754.write(buf, 0.1, 0, true, 52, 8);
|
||||
})
|
||||
.add("buffer", function() {
|
||||
buf.writeDoubleLE(0.1, 0);
|
||||
})
|
||||
.add("buffer (noAssert)", function() {
|
||||
buf.writeDoubleLE(0.1, 0, true);
|
||||
})
|
||||
.run();
|
||||
|
||||
newSuite("readDouble")
|
||||
.add("float", function() {
|
||||
float.readDoubleLE(buf, 0);
|
||||
})
|
||||
.add("float (fallback)", function() {
|
||||
floatFallback.readDoubleLE(buf, 0);
|
||||
})
|
||||
.add("ieee754", function() {
|
||||
ieee754.read(buf, 0, true, 52, 8);
|
||||
})
|
||||
.add("buffer", function() {
|
||||
buf.readDoubleLE(0);
|
||||
})
|
||||
.add("buffer (noAssert)", function() {
|
||||
buf.readDoubleLE(0, true);
|
||||
})
|
||||
.run();
|
||||
46
node_modules/@protobufjs/float/bench/suite.js
generated
vendored
46
node_modules/@protobufjs/float/bench/suite.js
generated
vendored
@@ -1,46 +0,0 @@
|
||||
"use strict";
|
||||
module.exports = newSuite;
|
||||
|
||||
var benchmark = require("benchmark"),
|
||||
chalk = require("chalk");
|
||||
|
||||
var padSize = 27;
|
||||
|
||||
function newSuite(name) {
|
||||
var benches = [];
|
||||
return new benchmark.Suite(name)
|
||||
.on("add", function(event) {
|
||||
benches.push(event.target);
|
||||
})
|
||||
.on("start", function() {
|
||||
process.stdout.write("benchmarking " + name + " performance ...\n\n");
|
||||
})
|
||||
.on("cycle", function(event) {
|
||||
process.stdout.write(String(event.target) + "\n");
|
||||
})
|
||||
.on("complete", function() {
|
||||
if (benches.length > 1) {
|
||||
var fastest = this.filter("fastest"), // eslint-disable-line no-invalid-this
|
||||
fastestHz = getHz(fastest[0]);
|
||||
process.stdout.write("\n" + chalk.white(pad(fastest[0].name, padSize)) + " was " + chalk.green("fastest") + "\n");
|
||||
benches.forEach(function(bench) {
|
||||
if (fastest.indexOf(bench) === 0)
|
||||
return;
|
||||
var hz = hz = getHz(bench);
|
||||
var percent = (1 - hz / fastestHz) * 100;
|
||||
process.stdout.write(chalk.white(pad(bench.name, padSize)) + " was " + chalk.red(percent.toFixed(1) + "% slower") + "\n");
|
||||
});
|
||||
}
|
||||
process.stdout.write("\n");
|
||||
});
|
||||
}
|
||||
|
||||
function getHz(bench) {
|
||||
return 1 / (bench.stats.mean + bench.stats.moe);
|
||||
}
|
||||
|
||||
function pad(str, len, l) {
|
||||
while (str.length < len)
|
||||
str = l ? str + " " : " " + str;
|
||||
return str;
|
||||
}
|
||||
83
node_modules/@protobufjs/float/index.d.ts
generated
vendored
83
node_modules/@protobufjs/float/index.d.ts
generated
vendored
@@ -1,83 +0,0 @@
|
||||
/**
|
||||
* Writes a 32 bit float to a buffer using little endian byte order.
|
||||
* @name writeFloatLE
|
||||
* @function
|
||||
* @param {number} val Value to write
|
||||
* @param {Uint8Array} buf Target buffer
|
||||
* @param {number} pos Target buffer offset
|
||||
* @returns {undefined}
|
||||
*/
|
||||
export function writeFloatLE(val: number, buf: Uint8Array, pos: number): void;
|
||||
|
||||
/**
|
||||
* Writes a 32 bit float to a buffer using big endian byte order.
|
||||
* @name writeFloatBE
|
||||
* @function
|
||||
* @param {number} val Value to write
|
||||
* @param {Uint8Array} buf Target buffer
|
||||
* @param {number} pos Target buffer offset
|
||||
* @returns {undefined}
|
||||
*/
|
||||
export function writeFloatBE(val: number, buf: Uint8Array, pos: number): void;
|
||||
|
||||
/**
|
||||
* Reads a 32 bit float from a buffer using little endian byte order.
|
||||
* @name readFloatLE
|
||||
* @function
|
||||
* @param {Uint8Array} buf Source buffer
|
||||
* @param {number} pos Source buffer offset
|
||||
* @returns {number} Value read
|
||||
*/
|
||||
export function readFloatLE(buf: Uint8Array, pos: number): number;
|
||||
|
||||
/**
|
||||
* Reads a 32 bit float from a buffer using big endian byte order.
|
||||
* @name readFloatBE
|
||||
* @function
|
||||
* @param {Uint8Array} buf Source buffer
|
||||
* @param {number} pos Source buffer offset
|
||||
* @returns {number} Value read
|
||||
*/
|
||||
export function readFloatBE(buf: Uint8Array, pos: number): number;
|
||||
|
||||
/**
|
||||
* Writes a 64 bit double to a buffer using little endian byte order.
|
||||
* @name writeDoubleLE
|
||||
* @function
|
||||
* @param {number} val Value to write
|
||||
* @param {Uint8Array} buf Target buffer
|
||||
* @param {number} pos Target buffer offset
|
||||
* @returns {undefined}
|
||||
*/
|
||||
export function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void;
|
||||
|
||||
/**
|
||||
* Writes a 64 bit double to a buffer using big endian byte order.
|
||||
* @name writeDoubleBE
|
||||
* @function
|
||||
* @param {number} val Value to write
|
||||
* @param {Uint8Array} buf Target buffer
|
||||
* @param {number} pos Target buffer offset
|
||||
* @returns {undefined}
|
||||
*/
|
||||
export function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void;
|
||||
|
||||
/**
|
||||
* Reads a 64 bit double from a buffer using little endian byte order.
|
||||
* @name readDoubleLE
|
||||
* @function
|
||||
* @param {Uint8Array} buf Source buffer
|
||||
* @param {number} pos Source buffer offset
|
||||
* @returns {number} Value read
|
||||
*/
|
||||
export function readDoubleLE(buf: Uint8Array, pos: number): number;
|
||||
|
||||
/**
|
||||
* Reads a 64 bit double from a buffer using big endian byte order.
|
||||
* @name readDoubleBE
|
||||
* @function
|
||||
* @param {Uint8Array} buf Source buffer
|
||||
* @param {number} pos Source buffer offset
|
||||
* @returns {number} Value read
|
||||
*/
|
||||
export function readDoubleBE(buf: Uint8Array, pos: number): number;
|
||||
335
node_modules/@protobufjs/float/index.js
generated
vendored
335
node_modules/@protobufjs/float/index.js
generated
vendored
@@ -1,335 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = factory(factory);
|
||||
|
||||
/**
|
||||
* Reads / writes floats / doubles from / to buffers.
|
||||
* @name util.float
|
||||
* @namespace
|
||||
*/
|
||||
|
||||
/**
|
||||
* Writes a 32 bit float to a buffer using little endian byte order.
|
||||
* @name util.float.writeFloatLE
|
||||
* @function
|
||||
* @param {number} val Value to write
|
||||
* @param {Uint8Array} buf Target buffer
|
||||
* @param {number} pos Target buffer offset
|
||||
* @returns {undefined}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Writes a 32 bit float to a buffer using big endian byte order.
|
||||
* @name util.float.writeFloatBE
|
||||
* @function
|
||||
* @param {number} val Value to write
|
||||
* @param {Uint8Array} buf Target buffer
|
||||
* @param {number} pos Target buffer offset
|
||||
* @returns {undefined}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reads a 32 bit float from a buffer using little endian byte order.
|
||||
* @name util.float.readFloatLE
|
||||
* @function
|
||||
* @param {Uint8Array} buf Source buffer
|
||||
* @param {number} pos Source buffer offset
|
||||
* @returns {number} Value read
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reads a 32 bit float from a buffer using big endian byte order.
|
||||
* @name util.float.readFloatBE
|
||||
* @function
|
||||
* @param {Uint8Array} buf Source buffer
|
||||
* @param {number} pos Source buffer offset
|
||||
* @returns {number} Value read
|
||||
*/
|
||||
|
||||
/**
|
||||
* Writes a 64 bit double to a buffer using little endian byte order.
|
||||
* @name util.float.writeDoubleLE
|
||||
* @function
|
||||
* @param {number} val Value to write
|
||||
* @param {Uint8Array} buf Target buffer
|
||||
* @param {number} pos Target buffer offset
|
||||
* @returns {undefined}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Writes a 64 bit double to a buffer using big endian byte order.
|
||||
* @name util.float.writeDoubleBE
|
||||
* @function
|
||||
* @param {number} val Value to write
|
||||
* @param {Uint8Array} buf Target buffer
|
||||
* @param {number} pos Target buffer offset
|
||||
* @returns {undefined}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reads a 64 bit double from a buffer using little endian byte order.
|
||||
* @name util.float.readDoubleLE
|
||||
* @function
|
||||
* @param {Uint8Array} buf Source buffer
|
||||
* @param {number} pos Source buffer offset
|
||||
* @returns {number} Value read
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reads a 64 bit double from a buffer using big endian byte order.
|
||||
* @name util.float.readDoubleBE
|
||||
* @function
|
||||
* @param {Uint8Array} buf Source buffer
|
||||
* @param {number} pos Source buffer offset
|
||||
* @returns {number} Value read
|
||||
*/
|
||||
|
||||
// Factory function for the purpose of node-based testing in modified global environments
|
||||
function factory(exports) {
|
||||
|
||||
// float: typed array
|
||||
if (typeof Float32Array !== "undefined") (function() {
|
||||
|
||||
var f32 = new Float32Array([ -0 ]),
|
||||
f8b = new Uint8Array(f32.buffer),
|
||||
le = f8b[3] === 128;
|
||||
|
||||
function writeFloat_f32_cpy(val, buf, pos) {
|
||||
f32[0] = val;
|
||||
buf[pos ] = f8b[0];
|
||||
buf[pos + 1] = f8b[1];
|
||||
buf[pos + 2] = f8b[2];
|
||||
buf[pos + 3] = f8b[3];
|
||||
}
|
||||
|
||||
function writeFloat_f32_rev(val, buf, pos) {
|
||||
f32[0] = val;
|
||||
buf[pos ] = f8b[3];
|
||||
buf[pos + 1] = f8b[2];
|
||||
buf[pos + 2] = f8b[1];
|
||||
buf[pos + 3] = f8b[0];
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;
|
||||
/* istanbul ignore next */
|
||||
exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;
|
||||
|
||||
function readFloat_f32_cpy(buf, pos) {
|
||||
f8b[0] = buf[pos ];
|
||||
f8b[1] = buf[pos + 1];
|
||||
f8b[2] = buf[pos + 2];
|
||||
f8b[3] = buf[pos + 3];
|
||||
return f32[0];
|
||||
}
|
||||
|
||||
function readFloat_f32_rev(buf, pos) {
|
||||
f8b[3] = buf[pos ];
|
||||
f8b[2] = buf[pos + 1];
|
||||
f8b[1] = buf[pos + 2];
|
||||
f8b[0] = buf[pos + 3];
|
||||
return f32[0];
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;
|
||||
/* istanbul ignore next */
|
||||
exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;
|
||||
|
||||
// float: ieee754
|
||||
})(); else (function() {
|
||||
|
||||
function writeFloat_ieee754(writeUint, val, buf, pos) {
|
||||
var sign = val < 0 ? 1 : 0;
|
||||
if (sign)
|
||||
val = -val;
|
||||
if (val === 0)
|
||||
writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);
|
||||
else if (isNaN(val))
|
||||
writeUint(2143289344, buf, pos);
|
||||
else if (val > 3.4028234663852886e+38) // +-Infinity
|
||||
writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);
|
||||
else if (val < 1.1754943508222875e-38) // denormal
|
||||
writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);
|
||||
else {
|
||||
var exponent = Math.floor(Math.log(val) / Math.LN2),
|
||||
mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;
|
||||
writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);
|
||||
}
|
||||
}
|
||||
|
||||
exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);
|
||||
exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);
|
||||
|
||||
function readFloat_ieee754(readUint, buf, pos) {
|
||||
var uint = readUint(buf, pos),
|
||||
sign = (uint >> 31) * 2 + 1,
|
||||
exponent = uint >>> 23 & 255,
|
||||
mantissa = uint & 8388607;
|
||||
return exponent === 255
|
||||
? mantissa
|
||||
? NaN
|
||||
: sign * Infinity
|
||||
: exponent === 0 // denormal
|
||||
? sign * 1.401298464324817e-45 * mantissa
|
||||
: sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);
|
||||
}
|
||||
|
||||
exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);
|
||||
exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);
|
||||
|
||||
})();
|
||||
|
||||
// double: typed array
|
||||
if (typeof Float64Array !== "undefined") (function() {
|
||||
|
||||
var f64 = new Float64Array([-0]),
|
||||
f8b = new Uint8Array(f64.buffer),
|
||||
le = f8b[7] === 128;
|
||||
|
||||
function writeDouble_f64_cpy(val, buf, pos) {
|
||||
f64[0] = val;
|
||||
buf[pos ] = f8b[0];
|
||||
buf[pos + 1] = f8b[1];
|
||||
buf[pos + 2] = f8b[2];
|
||||
buf[pos + 3] = f8b[3];
|
||||
buf[pos + 4] = f8b[4];
|
||||
buf[pos + 5] = f8b[5];
|
||||
buf[pos + 6] = f8b[6];
|
||||
buf[pos + 7] = f8b[7];
|
||||
}
|
||||
|
||||
function writeDouble_f64_rev(val, buf, pos) {
|
||||
f64[0] = val;
|
||||
buf[pos ] = f8b[7];
|
||||
buf[pos + 1] = f8b[6];
|
||||
buf[pos + 2] = f8b[5];
|
||||
buf[pos + 3] = f8b[4];
|
||||
buf[pos + 4] = f8b[3];
|
||||
buf[pos + 5] = f8b[2];
|
||||
buf[pos + 6] = f8b[1];
|
||||
buf[pos + 7] = f8b[0];
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;
|
||||
/* istanbul ignore next */
|
||||
exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;
|
||||
|
||||
function readDouble_f64_cpy(buf, pos) {
|
||||
f8b[0] = buf[pos ];
|
||||
f8b[1] = buf[pos + 1];
|
||||
f8b[2] = buf[pos + 2];
|
||||
f8b[3] = buf[pos + 3];
|
||||
f8b[4] = buf[pos + 4];
|
||||
f8b[5] = buf[pos + 5];
|
||||
f8b[6] = buf[pos + 6];
|
||||
f8b[7] = buf[pos + 7];
|
||||
return f64[0];
|
||||
}
|
||||
|
||||
function readDouble_f64_rev(buf, pos) {
|
||||
f8b[7] = buf[pos ];
|
||||
f8b[6] = buf[pos + 1];
|
||||
f8b[5] = buf[pos + 2];
|
||||
f8b[4] = buf[pos + 3];
|
||||
f8b[3] = buf[pos + 4];
|
||||
f8b[2] = buf[pos + 5];
|
||||
f8b[1] = buf[pos + 6];
|
||||
f8b[0] = buf[pos + 7];
|
||||
return f64[0];
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;
|
||||
/* istanbul ignore next */
|
||||
exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;
|
||||
|
||||
// double: ieee754
|
||||
})(); else (function() {
|
||||
|
||||
function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {
|
||||
var sign = val < 0 ? 1 : 0;
|
||||
if (sign)
|
||||
val = -val;
|
||||
if (val === 0) {
|
||||
writeUint(0, buf, pos + off0);
|
||||
writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);
|
||||
} else if (isNaN(val)) {
|
||||
writeUint(0, buf, pos + off0);
|
||||
writeUint(2146959360, buf, pos + off1);
|
||||
} else if (val > 1.7976931348623157e+308) { // +-Infinity
|
||||
writeUint(0, buf, pos + off0);
|
||||
writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);
|
||||
} else {
|
||||
var mantissa;
|
||||
if (val < 2.2250738585072014e-308) { // denormal
|
||||
mantissa = val / 5e-324;
|
||||
writeUint(mantissa >>> 0, buf, pos + off0);
|
||||
writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);
|
||||
} else {
|
||||
var exponent = Math.floor(Math.log(val) / Math.LN2);
|
||||
if (exponent === 1024)
|
||||
exponent = 1023;
|
||||
mantissa = val * Math.pow(2, -exponent);
|
||||
writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);
|
||||
writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);
|
||||
exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);
|
||||
|
||||
function readDouble_ieee754(readUint, off0, off1, buf, pos) {
|
||||
var lo = readUint(buf, pos + off0),
|
||||
hi = readUint(buf, pos + off1);
|
||||
var sign = (hi >> 31) * 2 + 1,
|
||||
exponent = hi >>> 20 & 2047,
|
||||
mantissa = 4294967296 * (hi & 1048575) + lo;
|
||||
return exponent === 2047
|
||||
? mantissa
|
||||
? NaN
|
||||
: sign * Infinity
|
||||
: exponent === 0 // denormal
|
||||
? sign * 5e-324 * mantissa
|
||||
: sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);
|
||||
}
|
||||
|
||||
exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);
|
||||
exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);
|
||||
|
||||
})();
|
||||
|
||||
return exports;
|
||||
}
|
||||
|
||||
// uint helpers
|
||||
|
||||
function writeUintLE(val, buf, pos) {
|
||||
buf[pos ] = val & 255;
|
||||
buf[pos + 1] = val >>> 8 & 255;
|
||||
buf[pos + 2] = val >>> 16 & 255;
|
||||
buf[pos + 3] = val >>> 24;
|
||||
}
|
||||
|
||||
function writeUintBE(val, buf, pos) {
|
||||
buf[pos ] = val >>> 24;
|
||||
buf[pos + 1] = val >>> 16 & 255;
|
||||
buf[pos + 2] = val >>> 8 & 255;
|
||||
buf[pos + 3] = val & 255;
|
||||
}
|
||||
|
||||
function readUintLE(buf, pos) {
|
||||
return (buf[pos ]
|
||||
| buf[pos + 1] << 8
|
||||
| buf[pos + 2] << 16
|
||||
| buf[pos + 3] << 24) >>> 0;
|
||||
}
|
||||
|
||||
function readUintBE(buf, pos) {
|
||||
return (buf[pos ] << 24
|
||||
| buf[pos + 1] << 16
|
||||
| buf[pos + 2] << 8
|
||||
| buf[pos + 3]) >>> 0;
|
||||
}
|
||||
30
node_modules/@protobufjs/float/package.json
generated
vendored
30
node_modules/@protobufjs/float/package.json
generated
vendored
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/float",
|
||||
"description": "Reads / writes floats / doubles from / to buffers in both modern and ancient browsers.",
|
||||
"version": "1.0.2",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"dependencies": {},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"benchmark": "^2.1.4",
|
||||
"chalk": "^1.1.3",
|
||||
"ieee754": "^1.1.8",
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
|
||||
"bench": "node bench"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz"
|
||||
,"_integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E="
|
||||
,"_from": "@protobufjs/float@1.0.2"
|
||||
}
|
||||
100
node_modules/@protobufjs/float/tests/index.js
generated
vendored
100
node_modules/@protobufjs/float/tests/index.js
generated
vendored
@@ -1,100 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var float = require("..");
|
||||
|
||||
tape.test("float", function(test) {
|
||||
|
||||
// default
|
||||
test.test(test.name + " - typed array", function(test) {
|
||||
runTest(float, test);
|
||||
});
|
||||
|
||||
// ieee754
|
||||
test.test(test.name + " - fallback", function(test) {
|
||||
var F32 = global.Float32Array,
|
||||
F64 = global.Float64Array;
|
||||
delete global.Float32Array;
|
||||
delete global.Float64Array;
|
||||
runTest(float({}), test);
|
||||
global.Float32Array = F32;
|
||||
global.Float64Array = F64;
|
||||
});
|
||||
});
|
||||
|
||||
function runTest(float, test) {
|
||||
|
||||
var common = [
|
||||
0,
|
||||
-0,
|
||||
Infinity,
|
||||
-Infinity,
|
||||
0.125,
|
||||
1024.5,
|
||||
-4096.5,
|
||||
NaN
|
||||
];
|
||||
|
||||
test.test(test.name + " - using 32 bits", function(test) {
|
||||
common.concat([
|
||||
3.4028234663852886e+38,
|
||||
1.1754943508222875e-38,
|
||||
1.1754946310819804e-39
|
||||
])
|
||||
.forEach(function(value) {
|
||||
var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString();
|
||||
test.ok(
|
||||
checkValue(value, 4, float.readFloatLE, float.writeFloatLE, Buffer.prototype.writeFloatLE),
|
||||
"should write and read back " + strval + " (32 bit LE)"
|
||||
);
|
||||
test.ok(
|
||||
checkValue(value, 4, float.readFloatBE, float.writeFloatBE, Buffer.prototype.writeFloatBE),
|
||||
"should write and read back " + strval + " (32 bit BE)"
|
||||
);
|
||||
});
|
||||
test.end();
|
||||
});
|
||||
|
||||
test.test(test.name + " - using 64 bits", function(test) {
|
||||
common.concat([
|
||||
1.7976931348623157e+308,
|
||||
2.2250738585072014e-308,
|
||||
2.2250738585072014e-309
|
||||
])
|
||||
.forEach(function(value) {
|
||||
var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString();
|
||||
test.ok(
|
||||
checkValue(value, 8, float.readDoubleLE, float.writeDoubleLE, Buffer.prototype.writeDoubleLE),
|
||||
"should write and read back " + strval + " (64 bit LE)"
|
||||
);
|
||||
test.ok(
|
||||
checkValue(value, 8, float.readDoubleBE, float.writeDoubleBE, Buffer.prototype.writeDoubleBE),
|
||||
"should write and read back " + strval + " (64 bit BE)"
|
||||
);
|
||||
});
|
||||
test.end();
|
||||
});
|
||||
|
||||
test.end();
|
||||
}
|
||||
|
||||
function checkValue(value, size, read, write, write_comp) {
|
||||
var buffer = new Buffer(size);
|
||||
write(value, buffer, 0);
|
||||
var value_comp = read(buffer, 0);
|
||||
var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString();
|
||||
if (value !== value) {
|
||||
if (value_comp === value_comp)
|
||||
return false;
|
||||
} else if (value_comp !== value)
|
||||
return false;
|
||||
|
||||
var buffer_comp = new Buffer(size);
|
||||
write_comp.call(buffer_comp, value, 0);
|
||||
for (var i = 0; i < size; ++i)
|
||||
if (buffer[i] !== buffer_comp[i]) {
|
||||
console.error(">", buffer, buffer_comp);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
3
node_modules/@protobufjs/inquire/.npmignore
generated
vendored
3
node_modules/@protobufjs/inquire/.npmignore
generated
vendored
@@ -1,3 +0,0 @@
|
||||
npm-debug.*
|
||||
node_modules/
|
||||
coverage/
|
||||
26
node_modules/@protobufjs/inquire/LICENSE
generated
vendored
26
node_modules/@protobufjs/inquire/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
13
node_modules/@protobufjs/inquire/README.md
generated
vendored
13
node_modules/@protobufjs/inquire/README.md
generated
vendored
@@ -1,13 +0,0 @@
|
||||
@protobufjs/inquire
|
||||
===================
|
||||
[](https://www.npmjs.com/package/@protobufjs/inquire)
|
||||
|
||||
Requires a module only if available and hides the require call from bundlers.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **inquire(moduleName: `string`): `?Object`**<br />
|
||||
Requires a module only if available.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
9
node_modules/@protobufjs/inquire/index.d.ts
generated
vendored
9
node_modules/@protobufjs/inquire/index.d.ts
generated
vendored
@@ -1,9 +0,0 @@
|
||||
export = inquire;
|
||||
|
||||
/**
|
||||
* Requires a module only if available.
|
||||
* @memberof util
|
||||
* @param {string} moduleName Module to require
|
||||
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
||||
*/
|
||||
declare function inquire(moduleName: string): Object;
|
||||
17
node_modules/@protobufjs/inquire/index.js
generated
vendored
17
node_modules/@protobufjs/inquire/index.js
generated
vendored
@@ -1,17 +0,0 @@
|
||||
"use strict";
|
||||
module.exports = inquire;
|
||||
|
||||
/**
|
||||
* Requires a module only if available.
|
||||
* @memberof util
|
||||
* @param {string} moduleName Module to require
|
||||
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
||||
*/
|
||||
function inquire(moduleName) {
|
||||
try {
|
||||
var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
|
||||
if (mod && (mod.length || Object.keys(mod).length))
|
||||
return mod;
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
return null;
|
||||
}
|
||||
25
node_modules/@protobufjs/inquire/package.json
generated
vendored
25
node_modules/@protobufjs/inquire/package.json
generated
vendored
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/inquire",
|
||||
"description": "Requires a module only if available and hides the require call from bundlers.",
|
||||
"version": "1.1.0",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz"
|
||||
,"_integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik="
|
||||
,"_from": "@protobufjs/inquire@1.1.0"
|
||||
}
|
||||
1
node_modules/@protobufjs/inquire/tests/data/array.js
generated
vendored
1
node_modules/@protobufjs/inquire/tests/data/array.js
generated
vendored
@@ -1 +0,0 @@
|
||||
module.exports = [1];
|
||||
1
node_modules/@protobufjs/inquire/tests/data/emptyArray.js
generated
vendored
1
node_modules/@protobufjs/inquire/tests/data/emptyArray.js
generated
vendored
@@ -1 +0,0 @@
|
||||
module.exports = [];
|
||||
1
node_modules/@protobufjs/inquire/tests/data/emptyObject.js
generated
vendored
1
node_modules/@protobufjs/inquire/tests/data/emptyObject.js
generated
vendored
@@ -1 +0,0 @@
|
||||
module.exports = {};
|
||||
1
node_modules/@protobufjs/inquire/tests/data/object.js
generated
vendored
1
node_modules/@protobufjs/inquire/tests/data/object.js
generated
vendored
@@ -1 +0,0 @@
|
||||
module.exports = { a: 1 };
|
||||
20
node_modules/@protobufjs/inquire/tests/index.js
generated
vendored
20
node_modules/@protobufjs/inquire/tests/index.js
generated
vendored
@@ -1,20 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var inquire = require("..");
|
||||
|
||||
tape.test("inquire", function(test) {
|
||||
|
||||
test.equal(inquire("buffer").Buffer, Buffer, "should be able to require \"buffer\"");
|
||||
|
||||
test.equal(inquire("%invalid"), null, "should not be able to require \"%invalid\"");
|
||||
|
||||
test.equal(inquire("./tests/data/emptyObject"), null, "should return null when requiring a module exporting an empty object");
|
||||
|
||||
test.equal(inquire("./tests/data/emptyArray"), null, "should return null when requiring a module exporting an empty array");
|
||||
|
||||
test.same(inquire("./tests/data/object"), { a: 1 }, "should return the object if a non-empty object");
|
||||
|
||||
test.same(inquire("./tests/data/array"), [ 1 ], "should return the module if a non-empty array");
|
||||
|
||||
test.end();
|
||||
});
|
||||
26
node_modules/@protobufjs/path/LICENSE
generated
vendored
26
node_modules/@protobufjs/path/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
19
node_modules/@protobufjs/path/README.md
generated
vendored
19
node_modules/@protobufjs/path/README.md
generated
vendored
@@ -1,19 +0,0 @@
|
||||
@protobufjs/path
|
||||
================
|
||||
[](https://www.npmjs.com/package/@protobufjs/path)
|
||||
|
||||
A minimal path module to resolve Unix, Windows and URL paths alike.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **path.isAbsolute(path: `string`): `boolean`**<br />
|
||||
Tests if the specified path is absolute.
|
||||
|
||||
* **path.normalize(path: `string`): `string`**<br />
|
||||
Normalizes the specified path.
|
||||
|
||||
* **path.resolve(originPath: `string`, includePath: `string`, [alreadyNormalized=false: `boolean`]): `string`**<br />
|
||||
Resolves the specified include path against the specified origin path.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
22
node_modules/@protobufjs/path/index.d.ts
generated
vendored
22
node_modules/@protobufjs/path/index.d.ts
generated
vendored
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Tests if the specified path is absolute.
|
||||
* @param {string} path Path to test
|
||||
* @returns {boolean} `true` if path is absolute
|
||||
*/
|
||||
export function isAbsolute(path: string): boolean;
|
||||
|
||||
/**
|
||||
* Normalizes the specified path.
|
||||
* @param {string} path Path to normalize
|
||||
* @returns {string} Normalized path
|
||||
*/
|
||||
export function normalize(path: string): string;
|
||||
|
||||
/**
|
||||
* Resolves the specified include path against the specified origin path.
|
||||
* @param {string} originPath Path to the origin file
|
||||
* @param {string} includePath Include path relative to origin path
|
||||
* @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
|
||||
* @returns {string} Path to the include file
|
||||
*/
|
||||
export function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string;
|
||||
65
node_modules/@protobufjs/path/index.js
generated
vendored
65
node_modules/@protobufjs/path/index.js
generated
vendored
@@ -1,65 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A minimal path module to resolve Unix, Windows and URL paths alike.
|
||||
* @memberof util
|
||||
* @namespace
|
||||
*/
|
||||
var path = exports;
|
||||
|
||||
var isAbsolute =
|
||||
/**
|
||||
* Tests if the specified path is absolute.
|
||||
* @param {string} path Path to test
|
||||
* @returns {boolean} `true` if path is absolute
|
||||
*/
|
||||
path.isAbsolute = function isAbsolute(path) {
|
||||
return /^(?:\/|\w+:)/.test(path);
|
||||
};
|
||||
|
||||
var normalize =
|
||||
/**
|
||||
* Normalizes the specified path.
|
||||
* @param {string} path Path to normalize
|
||||
* @returns {string} Normalized path
|
||||
*/
|
||||
path.normalize = function normalize(path) {
|
||||
path = path.replace(/\\/g, "/")
|
||||
.replace(/\/{2,}/g, "/");
|
||||
var parts = path.split("/"),
|
||||
absolute = isAbsolute(path),
|
||||
prefix = "";
|
||||
if (absolute)
|
||||
prefix = parts.shift() + "/";
|
||||
for (var i = 0; i < parts.length;) {
|
||||
if (parts[i] === "..") {
|
||||
if (i > 0 && parts[i - 1] !== "..")
|
||||
parts.splice(--i, 2);
|
||||
else if (absolute)
|
||||
parts.splice(i, 1);
|
||||
else
|
||||
++i;
|
||||
} else if (parts[i] === ".")
|
||||
parts.splice(i, 1);
|
||||
else
|
||||
++i;
|
||||
}
|
||||
return prefix + parts.join("/");
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolves the specified include path against the specified origin path.
|
||||
* @param {string} originPath Path to the origin file
|
||||
* @param {string} includePath Include path relative to origin path
|
||||
* @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
|
||||
* @returns {string} Path to the include file
|
||||
*/
|
||||
path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
|
||||
if (!alreadyNormalized)
|
||||
includePath = normalize(includePath);
|
||||
if (isAbsolute(includePath))
|
||||
return includePath;
|
||||
if (!alreadyNormalized)
|
||||
originPath = normalize(originPath);
|
||||
return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
|
||||
};
|
||||
25
node_modules/@protobufjs/path/package.json
generated
vendored
25
node_modules/@protobufjs/path/package.json
generated
vendored
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/path",
|
||||
"description": "A minimal path module to resolve Unix, Windows and URL paths alike.",
|
||||
"version": "1.1.2",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz"
|
||||
,"_integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0="
|
||||
,"_from": "@protobufjs/path@1.1.2"
|
||||
}
|
||||
60
node_modules/@protobufjs/path/tests/index.js
generated
vendored
60
node_modules/@protobufjs/path/tests/index.js
generated
vendored
@@ -1,60 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var path = require("..");
|
||||
|
||||
tape.test("path", function(test) {
|
||||
|
||||
test.ok(path.isAbsolute("X:\\some\\path\\file.js"), "should identify absolute windows paths");
|
||||
test.ok(path.isAbsolute("/some/path/file.js"), "should identify absolute unix paths");
|
||||
|
||||
test.notOk(path.isAbsolute("some\\path\\file.js"), "should identify relative windows paths");
|
||||
test.notOk(path.isAbsolute("some/path/file.js"), "should identify relative unix paths");
|
||||
|
||||
var paths = [
|
||||
{
|
||||
actual: "X:\\some\\..\\.\\path\\\\file.js",
|
||||
normal: "X:/path/file.js",
|
||||
resolve: {
|
||||
origin: "X:/path/origin.js",
|
||||
expected: "X:/path/file.js"
|
||||
}
|
||||
}, {
|
||||
actual: "some\\..\\.\\path\\\\file.js",
|
||||
normal: "path/file.js",
|
||||
resolve: {
|
||||
origin: "X:/path/origin.js",
|
||||
expected: "X:/path/path/file.js"
|
||||
}
|
||||
}, {
|
||||
actual: "/some/.././path//file.js",
|
||||
normal: "/path/file.js",
|
||||
resolve: {
|
||||
origin: "/path/origin.js",
|
||||
expected: "/path/file.js"
|
||||
}
|
||||
}, {
|
||||
actual: "some/.././path//file.js",
|
||||
normal: "path/file.js",
|
||||
resolve: {
|
||||
origin: "",
|
||||
expected: "path/file.js"
|
||||
}
|
||||
}, {
|
||||
actual: ".././path//file.js",
|
||||
normal: "../path/file.js"
|
||||
}, {
|
||||
actual: "/.././path//file.js",
|
||||
normal: "/path/file.js"
|
||||
}
|
||||
];
|
||||
|
||||
paths.forEach(function(p) {
|
||||
test.equal(path.normalize(p.actual), p.normal, "should normalize " + p.actual);
|
||||
if (p.resolve) {
|
||||
test.equal(path.resolve(p.resolve.origin, p.actual), p.resolve.expected, "should resolve " + p.actual);
|
||||
test.equal(path.resolve(p.resolve.origin, p.normal, true), p.resolve.expected, "should resolve " + p.normal + " (already normalized)");
|
||||
}
|
||||
});
|
||||
|
||||
test.end();
|
||||
});
|
||||
3
node_modules/@protobufjs/pool/.npmignore
generated
vendored
3
node_modules/@protobufjs/pool/.npmignore
generated
vendored
@@ -1,3 +0,0 @@
|
||||
npm-debug.*
|
||||
node_modules/
|
||||
coverage/
|
||||
26
node_modules/@protobufjs/pool/LICENSE
generated
vendored
26
node_modules/@protobufjs/pool/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
13
node_modules/@protobufjs/pool/README.md
generated
vendored
13
node_modules/@protobufjs/pool/README.md
generated
vendored
@@ -1,13 +0,0 @@
|
||||
@protobufjs/pool
|
||||
================
|
||||
[](https://www.npmjs.com/package/@protobufjs/pool)
|
||||
|
||||
A general purpose buffer pool.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **pool(alloc: `function(size: number): Uint8Array`, slice: `function(this: Uint8Array, start: number, end: number): Uint8Array`, [size=8192: `number`]): `function(size: number): Uint8Array`**<br />
|
||||
Creates a pooled allocator.
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
32
node_modules/@protobufjs/pool/index.d.ts
generated
vendored
32
node_modules/@protobufjs/pool/index.d.ts
generated
vendored
@@ -1,32 +0,0 @@
|
||||
export = pool;
|
||||
|
||||
/**
|
||||
* An allocator as used by {@link util.pool}.
|
||||
* @typedef PoolAllocator
|
||||
* @type {function}
|
||||
* @param {number} size Buffer size
|
||||
* @returns {Uint8Array} Buffer
|
||||
*/
|
||||
type PoolAllocator = (size: number) => Uint8Array;
|
||||
|
||||
/**
|
||||
* A slicer as used by {@link util.pool}.
|
||||
* @typedef PoolSlicer
|
||||
* @type {function}
|
||||
* @param {number} start Start offset
|
||||
* @param {number} end End offset
|
||||
* @returns {Uint8Array} Buffer slice
|
||||
* @this {Uint8Array}
|
||||
*/
|
||||
type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;
|
||||
|
||||
/**
|
||||
* A general purpose buffer pool.
|
||||
* @memberof util
|
||||
* @function
|
||||
* @param {PoolAllocator} alloc Allocator
|
||||
* @param {PoolSlicer} slice Slicer
|
||||
* @param {number} [size=8192] Slab size
|
||||
* @returns {PoolAllocator} Pooled allocator
|
||||
*/
|
||||
declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;
|
||||
48
node_modules/@protobufjs/pool/index.js
generated
vendored
48
node_modules/@protobufjs/pool/index.js
generated
vendored
@@ -1,48 +0,0 @@
|
||||
"use strict";
|
||||
module.exports = pool;
|
||||
|
||||
/**
|
||||
* An allocator as used by {@link util.pool}.
|
||||
* @typedef PoolAllocator
|
||||
* @type {function}
|
||||
* @param {number} size Buffer size
|
||||
* @returns {Uint8Array} Buffer
|
||||
*/
|
||||
|
||||
/**
|
||||
* A slicer as used by {@link util.pool}.
|
||||
* @typedef PoolSlicer
|
||||
* @type {function}
|
||||
* @param {number} start Start offset
|
||||
* @param {number} end End offset
|
||||
* @returns {Uint8Array} Buffer slice
|
||||
* @this {Uint8Array}
|
||||
*/
|
||||
|
||||
/**
|
||||
* A general purpose buffer pool.
|
||||
* @memberof util
|
||||
* @function
|
||||
* @param {PoolAllocator} alloc Allocator
|
||||
* @param {PoolSlicer} slice Slicer
|
||||
* @param {number} [size=8192] Slab size
|
||||
* @returns {PoolAllocator} Pooled allocator
|
||||
*/
|
||||
function pool(alloc, slice, size) {
|
||||
var SIZE = size || 8192;
|
||||
var MAX = SIZE >>> 1;
|
||||
var slab = null;
|
||||
var offset = SIZE;
|
||||
return function pool_alloc(size) {
|
||||
if (size < 1 || size > MAX)
|
||||
return alloc(size);
|
||||
if (offset + size > SIZE) {
|
||||
slab = alloc(SIZE);
|
||||
offset = 0;
|
||||
}
|
||||
var buf = slice.call(slab, offset, offset += size);
|
||||
if (offset & 7) // align to 32 bit
|
||||
offset = (offset | 7) + 1;
|
||||
return buf;
|
||||
};
|
||||
}
|
||||
25
node_modules/@protobufjs/pool/package.json
generated
vendored
25
node_modules/@protobufjs/pool/package.json
generated
vendored
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/pool",
|
||||
"description": "A general purpose buffer pool.",
|
||||
"version": "1.1.0",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz"
|
||||
,"_integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q="
|
||||
,"_from": "@protobufjs/pool@1.1.0"
|
||||
}
|
||||
33
node_modules/@protobufjs/pool/tests/index.js
generated
vendored
33
node_modules/@protobufjs/pool/tests/index.js
generated
vendored
@@ -1,33 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var pool = require("..");
|
||||
|
||||
if (typeof Uint8Array !== "undefined")
|
||||
tape.test("pool", function(test) {
|
||||
|
||||
var alloc = pool(function(size) { return new Uint8Array(size); }, Uint8Array.prototype.subarray);
|
||||
|
||||
var buf1 = alloc(0);
|
||||
test.equal(buf1.length, 0, "should allocate a buffer of size 0");
|
||||
|
||||
var buf2 = alloc(1);
|
||||
test.equal(buf2.length, 1, "should allocate a buffer of size 1 (initializes slab)");
|
||||
|
||||
test.notEqual(buf2.buffer, buf1.buffer, "should not reference the same backing buffer if previous buffer had size 0");
|
||||
test.equal(buf2.byteOffset, 0, "should allocate at byteOffset 0 when using a new slab");
|
||||
|
||||
buf1 = alloc(1);
|
||||
test.equal(buf1.buffer, buf2.buffer, "should reference the same backing buffer when allocating a chunk fitting into the slab");
|
||||
test.equal(buf1.byteOffset, 8, "should align slices to 32 bit and this allocate at byteOffset 8");
|
||||
|
||||
var buf3 = alloc(4097);
|
||||
test.notEqual(buf3.buffer, buf2.buffer, "should not reference the same backing buffer when allocating a buffer larger than half the backing buffer's size");
|
||||
|
||||
buf2 = alloc(4096);
|
||||
test.equal(buf2.buffer, buf1.buffer, "should reference the same backing buffer when allocating a buffer smaller or equal than half the backing buffer's size");
|
||||
|
||||
buf1 = alloc(4096);
|
||||
test.notEqual(buf1.buffer, buf2.buffer, "should not reference the same backing buffer when the slab is exhausted (initializes new slab)");
|
||||
|
||||
test.end();
|
||||
});
|
||||
3
node_modules/@protobufjs/utf8/.npmignore
generated
vendored
3
node_modules/@protobufjs/utf8/.npmignore
generated
vendored
@@ -1,3 +0,0 @@
|
||||
npm-debug.*
|
||||
node_modules/
|
||||
coverage/
|
||||
26
node_modules/@protobufjs/utf8/LICENSE
generated
vendored
26
node_modules/@protobufjs/utf8/LICENSE
generated
vendored
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2016, Daniel Wirtz All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of its author, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
20
node_modules/@protobufjs/utf8/README.md
generated
vendored
20
node_modules/@protobufjs/utf8/README.md
generated
vendored
@@ -1,20 +0,0 @@
|
||||
@protobufjs/utf8
|
||||
================
|
||||
[](https://www.npmjs.com/package/@protobufjs/utf8)
|
||||
|
||||
A minimal UTF8 implementation for number arrays.
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
* **utf8.length(string: `string`): `number`**<br />
|
||||
Calculates the UTF8 byte length of a string.
|
||||
|
||||
* **utf8.read(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**<br />
|
||||
Reads UTF8 bytes as a string.
|
||||
|
||||
* **utf8.write(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**<br />
|
||||
Writes a string as UTF8 bytes.
|
||||
|
||||
|
||||
**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|
||||
24
node_modules/@protobufjs/utf8/index.d.ts
generated
vendored
24
node_modules/@protobufjs/utf8/index.d.ts
generated
vendored
@@ -1,24 +0,0 @@
|
||||
/**
|
||||
* Calculates the UTF8 byte length of a string.
|
||||
* @param {string} string String
|
||||
* @returns {number} Byte length
|
||||
*/
|
||||
export function length(string: string): number;
|
||||
|
||||
/**
|
||||
* Reads UTF8 bytes as a string.
|
||||
* @param {Uint8Array} buffer Source buffer
|
||||
* @param {number} start Source start
|
||||
* @param {number} end Source end
|
||||
* @returns {string} String read
|
||||
*/
|
||||
export function read(buffer: Uint8Array, start: number, end: number): string;
|
||||
|
||||
/**
|
||||
* Writes a string as UTF8 bytes.
|
||||
* @param {string} string Source string
|
||||
* @param {Uint8Array} buffer Destination buffer
|
||||
* @param {number} offset Destination offset
|
||||
* @returns {number} Bytes written
|
||||
*/
|
||||
export function write(string: string, buffer: Uint8Array, offset: number): number;
|
||||
105
node_modules/@protobufjs/utf8/index.js
generated
vendored
105
node_modules/@protobufjs/utf8/index.js
generated
vendored
@@ -1,105 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* A minimal UTF8 implementation for number arrays.
|
||||
* @memberof util
|
||||
* @namespace
|
||||
*/
|
||||
var utf8 = exports;
|
||||
|
||||
/**
|
||||
* Calculates the UTF8 byte length of a string.
|
||||
* @param {string} string String
|
||||
* @returns {number} Byte length
|
||||
*/
|
||||
utf8.length = function utf8_length(string) {
|
||||
var len = 0,
|
||||
c = 0;
|
||||
for (var i = 0; i < string.length; ++i) {
|
||||
c = string.charCodeAt(i);
|
||||
if (c < 128)
|
||||
len += 1;
|
||||
else if (c < 2048)
|
||||
len += 2;
|
||||
else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {
|
||||
++i;
|
||||
len += 4;
|
||||
} else
|
||||
len += 3;
|
||||
}
|
||||
return len;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reads UTF8 bytes as a string.
|
||||
* @param {Uint8Array} buffer Source buffer
|
||||
* @param {number} start Source start
|
||||
* @param {number} end Source end
|
||||
* @returns {string} String read
|
||||
*/
|
||||
utf8.read = function utf8_read(buffer, start, end) {
|
||||
var len = end - start;
|
||||
if (len < 1)
|
||||
return "";
|
||||
var parts = null,
|
||||
chunk = [],
|
||||
i = 0, // char offset
|
||||
t; // temporary
|
||||
while (start < end) {
|
||||
t = buffer[start++];
|
||||
if (t < 128)
|
||||
chunk[i++] = t;
|
||||
else if (t > 191 && t < 224)
|
||||
chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
|
||||
else if (t > 239 && t < 365) {
|
||||
t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;
|
||||
chunk[i++] = 0xD800 + (t >> 10);
|
||||
chunk[i++] = 0xDC00 + (t & 1023);
|
||||
} else
|
||||
chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
|
||||
if (i > 8191) {
|
||||
(parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
if (parts) {
|
||||
if (i)
|
||||
parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
|
||||
return parts.join("");
|
||||
}
|
||||
return String.fromCharCode.apply(String, chunk.slice(0, i));
|
||||
};
|
||||
|
||||
/**
|
||||
* Writes a string as UTF8 bytes.
|
||||
* @param {string} string Source string
|
||||
* @param {Uint8Array} buffer Destination buffer
|
||||
* @param {number} offset Destination offset
|
||||
* @returns {number} Bytes written
|
||||
*/
|
||||
utf8.write = function utf8_write(string, buffer, offset) {
|
||||
var start = offset,
|
||||
c1, // character 1
|
||||
c2; // character 2
|
||||
for (var i = 0; i < string.length; ++i) {
|
||||
c1 = string.charCodeAt(i);
|
||||
if (c1 < 128) {
|
||||
buffer[offset++] = c1;
|
||||
} else if (c1 < 2048) {
|
||||
buffer[offset++] = c1 >> 6 | 192;
|
||||
buffer[offset++] = c1 & 63 | 128;
|
||||
} else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {
|
||||
c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);
|
||||
++i;
|
||||
buffer[offset++] = c1 >> 18 | 240;
|
||||
buffer[offset++] = c1 >> 12 & 63 | 128;
|
||||
buffer[offset++] = c1 >> 6 & 63 | 128;
|
||||
buffer[offset++] = c1 & 63 | 128;
|
||||
} else {
|
||||
buffer[offset++] = c1 >> 12 | 224;
|
||||
buffer[offset++] = c1 >> 6 & 63 | 128;
|
||||
buffer[offset++] = c1 & 63 | 128;
|
||||
}
|
||||
}
|
||||
return offset - start;
|
||||
};
|
||||
25
node_modules/@protobufjs/utf8/package.json
generated
vendored
25
node_modules/@protobufjs/utf8/package.json
generated
vendored
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "@protobufjs/utf8",
|
||||
"description": "A minimal UTF8 implementation for number arrays.",
|
||||
"version": "1.1.0",
|
||||
"author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dcodeIO/protobuf.js.git"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"devDependencies": {
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tape tests/*.js",
|
||||
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz"
|
||||
,"_integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
|
||||
,"_from": "@protobufjs/utf8@1.1.0"
|
||||
}
|
||||
216
node_modules/@protobufjs/utf8/tests/data/utf8.txt
generated
vendored
216
node_modules/@protobufjs/utf8/tests/data/utf8.txt
generated
vendored
@@ -1,216 +0,0 @@
|
||||
UTF-8 encoded sample plain-text file
|
||||
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||
|
||||
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY
|
||||
|
||||
|
||||
The ASCII compatible UTF-8 encoding used in this plain-text file
|
||||
is defined in Unicode, ISO 10646-1, and RFC 2279.
|
||||
|
||||
|
||||
Using Unicode/UTF-8, you can write in emails and source code things such as
|
||||
|
||||
Mathematics and sciences:
|
||||
|
||||
∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ⎧⎡⎛┌─────┐⎞⎤⎫
|
||||
⎪⎢⎜│a²+b³ ⎟⎥⎪
|
||||
∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β), ⎪⎢⎜│───── ⎟⎥⎪
|
||||
⎪⎢⎜⎷ c₈ ⎟⎥⎪
|
||||
ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ, ⎨⎢⎜ ⎟⎥⎬
|
||||
⎪⎢⎜ ∞ ⎟⎥⎪
|
||||
⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫), ⎪⎢⎜ ⎲ ⎟⎥⎪
|
||||
⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪
|
||||
2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm ⎩⎣⎝i=1 ⎠⎦⎭
|
||||
|
||||
Linguistics and dictionaries:
|
||||
|
||||
ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn
|
||||
Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ]
|
||||
|
||||
APL:
|
||||
|
||||
((V⍳V)=⍳⍴V)/V←,V ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈
|
||||
|
||||
Nicer typography in plain text files:
|
||||
|
||||
╔══════════════════════════════════════════╗
|
||||
║ ║
|
||||
║ • ‘single’ and “double” quotes ║
|
||||
║ ║
|
||||
║ • Curly apostrophes: “We’ve been here” ║
|
||||
║ ║
|
||||
║ • Latin-1 apostrophe and accents: '´` ║
|
||||
║ ║
|
||||
║ • ‚deutsche‘ „Anführungszeichen“ ║
|
||||
║ ║
|
||||
║ • †, ‡, ‰, •, 3–4, —, −5/+5, ™, … ║
|
||||
║ ║
|
||||
║ • ASCII safety test: 1lI|, 0OD, 8B ║
|
||||
║ ╭─────────╮ ║
|
||||
║ • the euro symbol: │ 14.95 € │ ║
|
||||
║ ╰─────────╯ ║
|
||||
╚══════════════════════════════════════════╝
|
||||
|
||||
Combining characters:
|
||||
|
||||
STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑
|
||||
|
||||
Greek (in Polytonic):
|
||||
|
||||
The Greek anthem:
|
||||
|
||||
Σὲ γνωρίζω ἀπὸ τὴν κόψη
|
||||
τοῦ σπαθιοῦ τὴν τρομερή,
|
||||
σὲ γνωρίζω ἀπὸ τὴν ὄψη
|
||||
ποὺ μὲ βία μετράει τὴ γῆ.
|
||||
|
||||
᾿Απ᾿ τὰ κόκκαλα βγαλμένη
|
||||
τῶν ῾Ελλήνων τὰ ἱερά
|
||||
καὶ σὰν πρῶτα ἀνδρειωμένη
|
||||
χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά!
|
||||
|
||||
From a speech of Demosthenes in the 4th century BC:
|
||||
|
||||
Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι,
|
||||
ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς
|
||||
λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ
|
||||
τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿
|
||||
εἰς τοῦτο προήκοντα, ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ
|
||||
πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν
|
||||
οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι,
|
||||
οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν
|
||||
ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον
|
||||
τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι
|
||||
γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν
|
||||
προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους
|
||||
σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ
|
||||
τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ
|
||||
τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς
|
||||
τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον.
|
||||
|
||||
Δημοσθένους, Γ´ ᾿Ολυνθιακὸς
|
||||
|
||||
Georgian:
|
||||
|
||||
From a Unicode conference invitation:
|
||||
|
||||
გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო
|
||||
კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს,
|
||||
ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს
|
||||
ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი,
|
||||
ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება
|
||||
ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში,
|
||||
ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში.
|
||||
|
||||
Russian:
|
||||
|
||||
From a Unicode conference invitation:
|
||||
|
||||
Зарегистрируйтесь сейчас на Десятую Международную Конференцию по
|
||||
Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии.
|
||||
Конференция соберет широкий круг экспертов по вопросам глобального
|
||||
Интернета и Unicode, локализации и интернационализации, воплощению и
|
||||
применению Unicode в различных операционных системах и программных
|
||||
приложениях, шрифтах, верстке и многоязычных компьютерных системах.
|
||||
|
||||
Thai (UCS Level 2):
|
||||
|
||||
Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese
|
||||
classic 'San Gua'):
|
||||
|
||||
[----------------------------|------------------------]
|
||||
๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช พระปกเกศกองบู๊กู้ขึ้นใหม่
|
||||
สิบสองกษัตริย์ก่อนหน้าแลถัดไป สององค์ไซร้โง่เขลาเบาปัญญา
|
||||
ทรงนับถือขันทีเป็นที่พึ่ง บ้านเมืองจึงวิปริตเป็นนักหนา
|
||||
โฮจิ๋นเรียกทัพทั่วหัวเมืองมา หมายจะฆ่ามดชั่วตัวสำคัญ
|
||||
เหมือนขับไสไล่เสือจากเคหา รับหมาป่าเข้ามาเลยอาสัญ
|
||||
ฝ่ายอ้องอุ้นยุแยกให้แตกกัน ใช้สาวนั้นเป็นชนวนชื่นชวนใจ
|
||||
พลันลิฉุยกุยกีกลับก่อเหตุ ช่างอาเพศจริงหนาฟ้าร้องไห้
|
||||
ต้องรบราฆ่าฟันจนบรรลัย ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ
|
||||
|
||||
(The above is a two-column text. If combining characters are handled
|
||||
correctly, the lines of the second column should be aligned with the
|
||||
| character above.)
|
||||
|
||||
Ethiopian:
|
||||
|
||||
Proverbs in the Amharic language:
|
||||
|
||||
ሰማይ አይታረስ ንጉሥ አይከሰስ።
|
||||
ብላ ካለኝ እንደአባቴ በቆመጠኝ።
|
||||
ጌጥ ያለቤቱ ቁምጥና ነው።
|
||||
ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው።
|
||||
የአፍ ወለምታ በቅቤ አይታሽም።
|
||||
አይጥ በበላ ዳዋ ተመታ።
|
||||
ሲተረጉሙ ይደረግሙ።
|
||||
ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል።
|
||||
ድር ቢያብር አንበሳ ያስር።
|
||||
ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም።
|
||||
እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም።
|
||||
የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ።
|
||||
ሥራ ከመፍታት ልጄን ላፋታት።
|
||||
ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል።
|
||||
የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ።
|
||||
ተንጋሎ ቢተፉ ተመልሶ ባፉ።
|
||||
ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው።
|
||||
እግርህን በፍራሽህ ልክ ዘርጋ።
|
||||
|
||||
Runes:
|
||||
|
||||
ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ
|
||||
|
||||
(Old English, which transcribed into Latin reads 'He cwaeth that he
|
||||
bude thaem lande northweardum with tha Westsae.' and means 'He said
|
||||
that he lived in the northern land near the Western Sea.')
|
||||
|
||||
Braille:
|
||||
|
||||
⡌⠁⠧⠑ ⠼⠁⠒ ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌
|
||||
|
||||
⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞
|
||||
⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎
|
||||
⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂
|
||||
⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙
|
||||
⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑
|
||||
⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲
|
||||
|
||||
⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
|
||||
|
||||
⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹
|
||||
⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞
|
||||
⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕
|
||||
⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹
|
||||
⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎
|
||||
⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎
|
||||
⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳
|
||||
⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞
|
||||
⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
|
||||
|
||||
(The first couple of paragraphs of "A Christmas Carol" by Dickens)
|
||||
|
||||
Compact font selection example text:
|
||||
|
||||
ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
|
||||
abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ
|
||||
–—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд
|
||||
∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi<>⑀₂ἠḂӥẄɐː⍎אԱა
|
||||
|
||||
Greetings in various languages:
|
||||
|
||||
Hello world, Καλημέρα κόσμε, コンニチハ
|
||||
|
||||
Box drawing alignment tests: █
|
||||
▉
|
||||
╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳
|
||||
║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳
|
||||
║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳
|
||||
╠╡ ╳ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
|
||||
║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎
|
||||
║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏
|
||||
╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ ▗▄▖▛▀▜ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█
|
||||
▝▀▘▙▄▟
|
||||
|
||||
Surrogates:
|
||||
|
||||
𠜎 𠜱 𠝹 𠱓 𠱸 𠲖 𠳏 𠳕 𠴕 𠵼 𠵿 𠸎 𠸏 𠹷 𠺝 𠺢 𠻗 𠻹 𠻺 𠼭 𠼮 𠽌 𠾴 𠾼 𠿪 𡁜 𡁯 𡁵 𡁶 𡁻 𡃁
|
||||
𡃉 𡇙 𢃇 𢞵 𢫕 𢭃 𢯊 𢱑 𢱕 𢳂 𢴈 𢵌 𢵧 𢺳 𣲷 𤓓 𤶸 𤷪 𥄫 𦉘 𦟌 𦧲 𦧺 𧨾 𨅝 𨈇 𨋢 𨳊 𨳍 𨳒 𩶘
|
||||
57
node_modules/@protobufjs/utf8/tests/index.js
generated
vendored
57
node_modules/@protobufjs/utf8/tests/index.js
generated
vendored
@@ -1,57 +0,0 @@
|
||||
var tape = require("tape");
|
||||
|
||||
var utf8 = require("..");
|
||||
|
||||
var data = require("fs").readFileSync(require.resolve("./data/utf8.txt")),
|
||||
dataStr = data.toString("utf8");
|
||||
|
||||
tape.test("utf8", function(test) {
|
||||
|
||||
test.test(test.name + " - length", function(test) {
|
||||
test.equal(utf8.length(""), 0, "should return a byte length of zero for an empty string");
|
||||
|
||||
test.equal(utf8.length(dataStr), Buffer.byteLength(dataStr), "should return the same byte length as node buffers");
|
||||
|
||||
test.end();
|
||||
});
|
||||
|
||||
test.test(test.name + " - read", function(test) {
|
||||
var comp = utf8.read([], 0, 0);
|
||||
test.equal(comp, "", "should decode an empty buffer to an empty string");
|
||||
|
||||
comp = utf8.read(data, 0, data.length);
|
||||
test.equal(comp, data.toString("utf8"), "should decode to the same byte data as node buffers");
|
||||
|
||||
var longData = Buffer.concat([data, data, data, data]);
|
||||
comp = utf8.read(longData, 0, longData.length);
|
||||
test.equal(comp, longData.toString("utf8"), "should decode to the same byte data as node buffers (long)");
|
||||
|
||||
var chunkData = new Buffer(data.toString("utf8").substring(0, 8192));
|
||||
comp = utf8.read(chunkData, 0, chunkData.length);
|
||||
test.equal(comp, chunkData.toString("utf8"), "should decode to the same byte data as node buffers (chunk size)");
|
||||
|
||||
test.end();
|
||||
});
|
||||
|
||||
test.test(test.name + " - write", function(test) {
|
||||
var buf = new Buffer(0);
|
||||
test.equal(utf8.write("", buf, 0), 0, "should encode an empty string to an empty buffer");
|
||||
|
||||
var len = utf8.length(dataStr);
|
||||
buf = new Buffer(len);
|
||||
test.equal(utf8.write(dataStr, buf, 0), len, "should encode to exactly " + len + " bytes");
|
||||
|
||||
test.equal(buf.length, data.length, "should encode to a buffer length equal to that of node buffers");
|
||||
|
||||
for (var i = 0; i < buf.length; ++i) {
|
||||
if (buf[i] !== data[i]) {
|
||||
test.fail("should encode to the same buffer data as node buffers (offset " + i + ")");
|
||||
return;
|
||||
}
|
||||
}
|
||||
test.pass("should encode to the same buffer data as node buffers");
|
||||
|
||||
test.end();
|
||||
});
|
||||
|
||||
});
|
||||
21
node_modules/@types/long/LICENSE
generated
vendored
21
node_modules/@types/long/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
16
node_modules/@types/long/README.md
generated
vendored
16
node_modules/@types/long/README.md
generated
vendored
@@ -1,16 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/long`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for long.js (https://github.com/dcodeIO/long.js).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/long.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 22 Jan 2020 19:19:46 GMT
|
||||
* Dependencies: none
|
||||
* Global values: `Long`
|
||||
|
||||
# Credits
|
||||
These definitions were written by Peter Kooijmans (https://github.com/peterkooijmans).
|
||||
389
node_modules/@types/long/index.d.ts
generated
vendored
389
node_modules/@types/long/index.d.ts
generated
vendored
@@ -1,389 +0,0 @@
|
||||
// Type definitions for long.js 4.0.0
|
||||
// Project: https://github.com/dcodeIO/long.js
|
||||
// Definitions by: Peter Kooijmans <https://github.com/peterkooijmans>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Definitions by: Denis Cappellin <https://github.com/cappellin>
|
||||
|
||||
export = Long;
|
||||
export as namespace Long;
|
||||
|
||||
declare const Long: Long.LongConstructor;
|
||||
type Long = Long.Long;
|
||||
declare namespace Long {
|
||||
interface LongConstructor {
|
||||
/**
|
||||
* Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See the from* functions below for more convenient ways of constructing Longs.
|
||||
*/
|
||||
new( low: number, high?: number, unsigned?: boolean ): Long;
|
||||
prototype: Long;
|
||||
/**
|
||||
* Maximum unsigned value.
|
||||
*/
|
||||
MAX_UNSIGNED_VALUE: Long;
|
||||
|
||||
/**
|
||||
* Maximum signed value.
|
||||
*/
|
||||
MAX_VALUE: Long;
|
||||
|
||||
/**
|
||||
* Minimum signed value.
|
||||
*/
|
||||
MIN_VALUE: Long;
|
||||
|
||||
/**
|
||||
* Signed negative one.
|
||||
*/
|
||||
NEG_ONE: Long;
|
||||
|
||||
/**
|
||||
* Signed one.
|
||||
*/
|
||||
ONE: Long;
|
||||
|
||||
/**
|
||||
* Unsigned one.
|
||||
*/
|
||||
UONE: Long;
|
||||
|
||||
/**
|
||||
* Unsigned zero.
|
||||
*/
|
||||
UZERO: Long;
|
||||
|
||||
/**
|
||||
* Signed zero
|
||||
*/
|
||||
ZERO: Long;
|
||||
|
||||
/**
|
||||
* Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is assumed to use 32 bits.
|
||||
*/
|
||||
fromBits( lowBits:number, highBits:number, unsigned?:boolean ): Long;
|
||||
|
||||
/**
|
||||
* Returns a Long representing the given 32 bit integer value.
|
||||
*/
|
||||
fromInt( value: number, unsigned?: boolean ): Long;
|
||||
|
||||
/**
|
||||
* Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
|
||||
*/
|
||||
fromNumber( value: number, unsigned?: boolean ): Long;
|
||||
|
||||
/**
|
||||
* Returns a Long representation of the given string, written using the specified radix.
|
||||
*/
|
||||
fromString( str: string, unsigned?: boolean | number, radix?: number ): Long;
|
||||
|
||||
/**
|
||||
* Creates a Long from its byte representation.
|
||||
*/
|
||||
fromBytes( bytes: number[], unsigned?: boolean, le?: boolean ): Long;
|
||||
|
||||
/**
|
||||
* Creates a Long from its little endian byte representation.
|
||||
*/
|
||||
fromBytesLE( bytes: number[], unsigned?: boolean ): Long;
|
||||
|
||||
/**
|
||||
* Creates a Long from its little endian byte representation.
|
||||
*/
|
||||
fromBytesBE( bytes: number[], unsigned?: boolean ): Long;
|
||||
|
||||
/**
|
||||
* Tests if the specified object is a Long.
|
||||
*/
|
||||
isLong( obj: any ): obj is Long;
|
||||
|
||||
/**
|
||||
* Converts the specified value to a Long.
|
||||
*/
|
||||
fromValue( val: Long | number | string | {low: number, high: number, unsigned: boolean} ): Long;
|
||||
}
|
||||
interface Long
|
||||
{
|
||||
/**
|
||||
* The high 32 bits as a signed value.
|
||||
*/
|
||||
high: number;
|
||||
|
||||
/**
|
||||
* The low 32 bits as a signed value.
|
||||
*/
|
||||
low: number;
|
||||
|
||||
/**
|
||||
* Whether unsigned or not.
|
||||
*/
|
||||
unsigned: boolean;
|
||||
|
||||
/**
|
||||
* Returns the sum of this and the specified Long.
|
||||
*/
|
||||
add( addend: number | Long | string ): Long;
|
||||
|
||||
/**
|
||||
* Returns the bitwise AND of this Long and the specified.
|
||||
*/
|
||||
and( other: Long | number | string ): Long;
|
||||
|
||||
/**
|
||||
* Compares this Long's value with the specified's.
|
||||
*/
|
||||
compare( other: Long | number | string ): number;
|
||||
|
||||
/**
|
||||
* Compares this Long's value with the specified's.
|
||||
*/
|
||||
comp( other: Long | number | string ): number;
|
||||
|
||||
/**
|
||||
* Returns this Long divided by the specified.
|
||||
*/
|
||||
divide( divisor: Long | number | string ): Long;
|
||||
|
||||
/**
|
||||
* Returns this Long divided by the specified.
|
||||
*/
|
||||
div( divisor: Long | number | string ): Long;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value equals the specified's.
|
||||
*/
|
||||
equals( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value equals the specified's.
|
||||
*/
|
||||
eq( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Gets the high 32 bits as a signed integer.
|
||||
*/
|
||||
getHighBits(): number;
|
||||
|
||||
/**
|
||||
* Gets the high 32 bits as an unsigned integer.
|
||||
*/
|
||||
getHighBitsUnsigned(): number;
|
||||
|
||||
/**
|
||||
* Gets the low 32 bits as a signed integer.
|
||||
*/
|
||||
getLowBits(): number;
|
||||
|
||||
/**
|
||||
* Gets the low 32 bits as an unsigned integer.
|
||||
*/
|
||||
getLowBitsUnsigned(): number;
|
||||
|
||||
/**
|
||||
* Gets the number of bits needed to represent the absolute value of this Long.
|
||||
*/
|
||||
getNumBitsAbs(): number;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is greater than the specified's.
|
||||
*/
|
||||
greaterThan( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is greater than the specified's.
|
||||
*/
|
||||
gt( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is greater than or equal the specified's.
|
||||
*/
|
||||
greaterThanOrEqual( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is greater than or equal the specified's.
|
||||
*/
|
||||
gte( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is even.
|
||||
*/
|
||||
isEven(): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is negative.
|
||||
*/
|
||||
isNegative(): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is odd.
|
||||
*/
|
||||
isOdd(): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is positive.
|
||||
*/
|
||||
isPositive(): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value equals zero.
|
||||
*/
|
||||
isZero(): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is less than the specified's.
|
||||
*/
|
||||
lessThan( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is less than the specified's.
|
||||
*/
|
||||
lt( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is less than or equal the specified's.
|
||||
*/
|
||||
lessThanOrEqual( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value is less than or equal the specified's.
|
||||
*/
|
||||
lte( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Returns this Long modulo the specified.
|
||||
*/
|
||||
modulo( other: Long | number | string ): Long;
|
||||
|
||||
/**
|
||||
* Returns this Long modulo the specified.
|
||||
*/
|
||||
mod( other: Long | number | string ): Long;
|
||||
|
||||
/**
|
||||
* Returns the product of this and the specified Long.
|
||||
*/
|
||||
multiply( multiplier: Long | number | string ): Long;
|
||||
|
||||
/**
|
||||
* Returns the product of this and the specified Long.
|
||||
*/
|
||||
mul( multiplier: Long | number | string ): Long;
|
||||
|
||||
/**
|
||||
* Negates this Long's value.
|
||||
*/
|
||||
negate(): Long;
|
||||
|
||||
/**
|
||||
* Negates this Long's value.
|
||||
*/
|
||||
neg(): Long;
|
||||
|
||||
/**
|
||||
* Returns the bitwise NOT of this Long.
|
||||
*/
|
||||
not(): Long;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value differs from the specified's.
|
||||
*/
|
||||
notEquals( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Tests if this Long's value differs from the specified's.
|
||||
*/
|
||||
neq( other: Long | number | string ): boolean;
|
||||
|
||||
/**
|
||||
* Returns the bitwise OR of this Long and the specified.
|
||||
*/
|
||||
or( other: Long | number | string ): Long;
|
||||
|
||||
/**
|
||||
* Returns this Long with bits shifted to the left by the given amount.
|
||||
*/
|
||||
shiftLeft( numBits: number | Long ): Long;
|
||||
|
||||
/**
|
||||
* Returns this Long with bits shifted to the left by the given amount.
|
||||
*/
|
||||
shl( numBits: number | Long ): Long;
|
||||
|
||||
/**
|
||||
* Returns this Long with bits arithmetically shifted to the right by the given amount.
|
||||
*/
|
||||
shiftRight( numBits: number | Long ): Long;
|
||||
|
||||
/**
|
||||
* Returns this Long with bits arithmetically shifted to the right by the given amount.
|
||||
*/
|
||||
shr( numBits: number | Long ): Long;
|
||||
|
||||
/**
|
||||
* Returns this Long with bits logically shifted to the right by the given amount.
|
||||
*/
|
||||
shiftRightUnsigned( numBits: number | Long ): Long;
|
||||
|
||||
/**
|
||||
* Returns this Long with bits logically shifted to the right by the given amount.
|
||||
*/
|
||||
shru( numBits: number | Long ): Long;
|
||||
|
||||
/**
|
||||
* Returns the difference of this and the specified Long.
|
||||
*/
|
||||
subtract( subtrahend: number | Long | string ): Long;
|
||||
|
||||
/**
|
||||
* Returns the difference of this and the specified Long.
|
||||
*/
|
||||
sub( subtrahend: number | Long |string ): Long;
|
||||
|
||||
/**
|
||||
* Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.
|
||||
*/
|
||||
toInt(): number;
|
||||
|
||||
/**
|
||||
* Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).
|
||||
*/
|
||||
toNumber(): number;
|
||||
|
||||
/**
|
||||
* Converts this Long to its byte representation.
|
||||
*/
|
||||
|
||||
toBytes( le?: boolean ): number[];
|
||||
|
||||
/**
|
||||
* Converts this Long to its little endian byte representation.
|
||||
*/
|
||||
|
||||
toBytesLE(): number[];
|
||||
|
||||
/**
|
||||
* Converts this Long to its big endian byte representation.
|
||||
*/
|
||||
|
||||
toBytesBE(): number[];
|
||||
|
||||
/**
|
||||
* Converts this Long to signed.
|
||||
*/
|
||||
toSigned(): Long;
|
||||
|
||||
/**
|
||||
* Converts the Long to a string written in the specified radix.
|
||||
*/
|
||||
toString( radix?: number ): string;
|
||||
|
||||
/**
|
||||
* Converts this Long to unsigned.
|
||||
*/
|
||||
toUnsigned(): Long;
|
||||
|
||||
/**
|
||||
* Returns the bitwise XOR of this Long and the given one.
|
||||
*/
|
||||
xor( other: Long | number | string ): Long;
|
||||
}
|
||||
}
|
||||
28
node_modules/@types/long/package.json
generated
vendored
28
node_modules/@types/long/package.json
generated
vendored
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"name": "@types/long",
|
||||
"version": "4.0.1",
|
||||
"description": "TypeScript definitions for long.js",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Peter Kooijmans",
|
||||
"url": "https://github.com/peterkooijmans",
|
||||
"githubUsername": "peterkooijmans"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/long"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "5a2ae1424989c49d7303e1f5cc510288bfab1e71e0e2143cdcb9d24ff1c3dc8e",
|
||||
"typeScriptVersion": "2.8"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz"
|
||||
,"_integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="
|
||||
,"_from": "@types/long@4.0.1"
|
||||
}
|
||||
21
node_modules/@types/node/LICENSE
generated
vendored
21
node_modules/@types/node/LICENSE
generated
vendored
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
16
node_modules/@types/node/README.md
generated
vendored
16
node_modules/@types/node/README.md
generated
vendored
@@ -1,16 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/node`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for Node.js (http://nodejs.org/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v10.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Fri, 28 Feb 2020 18:57:47 GMT
|
||||
* Dependencies: none
|
||||
* Global values: `Buffer`, `NodeJS`, `Symbol`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `require`, `setImmediate`, `setInterval`, `setTimeout`
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alexander T.](https://github.com/a-tarasyuk), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Bruno Scheufler](https://github.com/brunoscheufler), [Chigozirim C.](https://github.com/smac89), [Christian Vaagland Tellnes](https://github.com/tellnes), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Flarna](https://github.com/Flarna), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nicolas Voigt](https://github.com/octo-sniffle), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Zane Hannan AU](https://github.com/ZaneHannanAU), [Jeremie Rodriguez](https://github.com/jeremiergz), [Samuel Ainsworth](https://github.com/samuela), [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), and [ExE Boss](https://github.com/ExE-Boss).
|
||||
52
node_modules/@types/node/assert.d.ts
generated
vendored
52
node_modules/@types/node/assert.d.ts
generated
vendored
@@ -1,52 +0,0 @@
|
||||
declare module "assert" {
|
||||
function internal(value: any, message?: string | Error): void;
|
||||
namespace internal {
|
||||
class AssertionError implements Error {
|
||||
name: string;
|
||||
message: string;
|
||||
actual: any;
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
function fail(message?: string | Error): never;
|
||||
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
||||
function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
|
||||
function ok(value: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
||||
function equal(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
||||
function notEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
||||
function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
||||
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
|
||||
function throws(block: Function, message?: string | Error): void;
|
||||
function throws(block: Function, error: RegExp | Function | Object | Error, message?: string | Error): void;
|
||||
function doesNotThrow(block: Function, message?: string | Error): void;
|
||||
function doesNotThrow(block: Function, error: RegExp | Function, message?: string | Error): void;
|
||||
|
||||
function ifError(value: any): void;
|
||||
|
||||
function rejects(block: Function | Promise<any>, message?: string | Error): Promise<void>;
|
||||
function rejects(block: Function | Promise<any>, error: RegExp | Function | Object | Error, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(block: Function | Promise<any>, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(block: Function | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
|
||||
|
||||
const strict: typeof internal;
|
||||
}
|
||||
|
||||
export = internal;
|
||||
}
|
||||
144
node_modules/@types/node/async_hooks.d.ts
generated
vendored
144
node_modules/@types/node/async_hooks.d.ts
generated
vendored
@@ -1,144 +0,0 @@
|
||||
/**
|
||||
* Async Hooks module: https://nodejs.org/api/async_hooks.html
|
||||
*/
|
||||
declare module "async_hooks" {
|
||||
/**
|
||||
* Returns the asyncId of the current execution context.
|
||||
*/
|
||||
function executionAsyncId(): number;
|
||||
|
||||
/**
|
||||
* Returns the ID of the resource responsible for calling the callback that is currently being executed.
|
||||
*/
|
||||
function triggerAsyncId(): number;
|
||||
|
||||
interface HookCallbacks {
|
||||
/**
|
||||
* Called when a class is constructed that has the possibility to emit an asynchronous event.
|
||||
* @param asyncId a unique ID for the async resource
|
||||
* @param type the type of the async resource
|
||||
* @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
|
||||
* @param resource reference to the resource representing the async operation, needs to be released during destroy
|
||||
*/
|
||||
init?(asyncId: number, type: string, triggerAsyncId: number, resource: Object): void;
|
||||
|
||||
/**
|
||||
* When an asynchronous operation is initiated or completes a callback is called to notify the user.
|
||||
* The before callback is called just before said callback is executed.
|
||||
* @param asyncId the unique identifier assigned to the resource about to execute the callback.
|
||||
*/
|
||||
before?(asyncId: number): void;
|
||||
|
||||
/**
|
||||
* Called immediately after the callback specified in before is completed.
|
||||
* @param asyncId the unique identifier assigned to the resource which has executed the callback.
|
||||
*/
|
||||
after?(asyncId: number): void;
|
||||
|
||||
/**
|
||||
* Called when a promise has resolve() called. This may not be in the same execution id
|
||||
* as the promise itself.
|
||||
* @param asyncId the unique id for the promise that was resolve()d.
|
||||
*/
|
||||
promiseResolve?(asyncId: number): void;
|
||||
|
||||
/**
|
||||
* Called after the resource corresponding to asyncId is destroyed
|
||||
* @param asyncId a unique ID for the async resource
|
||||
*/
|
||||
destroy?(asyncId: number): void;
|
||||
}
|
||||
|
||||
interface AsyncHook {
|
||||
/**
|
||||
* Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
|
||||
*/
|
||||
enable(): this;
|
||||
|
||||
/**
|
||||
* Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
|
||||
*/
|
||||
disable(): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers functions to be called for different lifetime events of each async operation.
|
||||
* @param options the callbacks to register
|
||||
* @return an AsyncHooks instance used for disabling and enabling hooks
|
||||
*/
|
||||
function createHook(options: HookCallbacks): AsyncHook;
|
||||
|
||||
interface AsyncResourceOptions {
|
||||
/**
|
||||
* The ID of the execution context that created this async event.
|
||||
* Default: `executionAsyncId()`
|
||||
*/
|
||||
triggerAsyncId?: number;
|
||||
|
||||
/**
|
||||
* Disables automatic `emitDestroy` when the object is garbage collected.
|
||||
* This usually does not need to be set (even if `emitDestroy` is called
|
||||
* manually), unless the resource's `asyncId` is retrieved and the
|
||||
* sensitive API's `emitDestroy` is called with it.
|
||||
* Default: `false`
|
||||
*/
|
||||
requireManualDestroy?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class AsyncResource was designed to be extended by the embedder's async resources.
|
||||
* Using this users can easily trigger the lifetime events of their own resources.
|
||||
*/
|
||||
class AsyncResource {
|
||||
/**
|
||||
* AsyncResource() is meant to be extended. Instantiating a
|
||||
* new AsyncResource() also triggers init. If triggerAsyncId is omitted then
|
||||
* async_hook.executionAsyncId() is used.
|
||||
* @param type The type of async event.
|
||||
* @param triggerAsyncId The ID of the execution context that created
|
||||
* this async event (default: `executionAsyncId()`), or an
|
||||
* AsyncResourceOptions object (since 9.3)
|
||||
*/
|
||||
constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
|
||||
|
||||
/**
|
||||
* Call AsyncHooks before callbacks.
|
||||
* @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead.
|
||||
*/
|
||||
emitBefore(): void;
|
||||
|
||||
/**
|
||||
* Call AsyncHooks after callbacks.
|
||||
* @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead.
|
||||
*/
|
||||
emitAfter(): void;
|
||||
|
||||
/**
|
||||
* Call the provided function with the provided arguments in the
|
||||
* execution context of the async resource. This will establish the
|
||||
* context, trigger the AsyncHooks before callbacks, call the function,
|
||||
* trigger the AsyncHooks after callbacks, and then restore the original
|
||||
* execution context.
|
||||
* @param fn The function to call in the execution context of this
|
||||
* async resource.
|
||||
* @param thisArg The receiver to be used for the function call.
|
||||
* @param args Optional arguments to pass to the function.
|
||||
*/
|
||||
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
|
||||
|
||||
/**
|
||||
* Call AsyncHooks destroy callbacks.
|
||||
*/
|
||||
emitDestroy(): void;
|
||||
|
||||
/**
|
||||
* @return the unique ID assigned to this AsyncResource instance.
|
||||
*/
|
||||
asyncId(): number;
|
||||
|
||||
/**
|
||||
* @return the trigger ID for this AsyncResource instance.
|
||||
*/
|
||||
triggerAsyncId(): number;
|
||||
}
|
||||
}
|
||||
41
node_modules/@types/node/base.d.ts
generated
vendored
41
node_modules/@types/node/base.d.ts
generated
vendored
@@ -1,41 +0,0 @@
|
||||
// base definnitions for all NodeJS modules that are not specific to any version of TypeScript
|
||||
/// <reference path="globals.d.ts" />
|
||||
/// <reference path="assert.d.ts" />
|
||||
/// <reference path="async_hooks.d.ts" />
|
||||
/// <reference path="buffer.d.ts" />
|
||||
/// <reference path="child_process.d.ts" />
|
||||
/// <reference path="cluster.d.ts" />
|
||||
/// <reference path="console.d.ts" />
|
||||
/// <reference path="constants.d.ts" />
|
||||
/// <reference path="crypto.d.ts" />
|
||||
/// <reference path="dgram.d.ts" />
|
||||
/// <reference path="dns.d.ts" />
|
||||
/// <reference path="domain.d.ts" />
|
||||
/// <reference path="events.d.ts" />
|
||||
/// <reference path="fs.d.ts" />
|
||||
/// <reference path="http.d.ts" />
|
||||
/// <reference path="http2.d.ts" />
|
||||
/// <reference path="https.d.ts" />
|
||||
/// <reference path="inspector.d.ts" />
|
||||
/// <reference path="module.d.ts" />
|
||||
/// <reference path="net.d.ts" />
|
||||
/// <reference path="os.d.ts" />
|
||||
/// <reference path="path.d.ts" />
|
||||
/// <reference path="perf_hooks.d.ts" />
|
||||
/// <reference path="process.d.ts" />
|
||||
/// <reference path="punycode.d.ts" />
|
||||
/// <reference path="querystring.d.ts" />
|
||||
/// <reference path="readline.d.ts" />
|
||||
/// <reference path="repl.d.ts" />
|
||||
/// <reference path="stream.d.ts" />
|
||||
/// <reference path="string_decoder.d.ts" />
|
||||
/// <reference path="timers.d.ts" />
|
||||
/// <reference path="tls.d.ts" />
|
||||
/// <reference path="trace_events.d.ts" />
|
||||
/// <reference path="tty.d.ts" />
|
||||
/// <reference path="url.d.ts" />
|
||||
/// <reference path="util.d.ts" />
|
||||
/// <reference path="v8.d.ts" />
|
||||
/// <reference path="vm.d.ts" />
|
||||
/// <reference path="worker_threads.d.ts" />
|
||||
/// <reference path="zlib.d.ts" />
|
||||
16
node_modules/@types/node/buffer.d.ts
generated
vendored
16
node_modules/@types/node/buffer.d.ts
generated
vendored
@@ -1,16 +0,0 @@
|
||||
declare module "buffer" {
|
||||
export const INSPECT_MAX_BYTES: number;
|
||||
const BuffType: typeof Buffer;
|
||||
|
||||
export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
|
||||
|
||||
export function transcode(source: Buffer | Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
|
||||
|
||||
export const SlowBuffer: {
|
||||
/** @deprecated since v6.0.0, use Buffer.allocUnsafeSlow() */
|
||||
new(size: number): Buffer;
|
||||
prototype: Buffer;
|
||||
};
|
||||
|
||||
export { BuffType as Buffer };
|
||||
}
|
||||
366
node_modules/@types/node/child_process.d.ts
generated
vendored
366
node_modules/@types/node/child_process.d.ts
generated
vendored
@@ -1,366 +0,0 @@
|
||||
declare module "child_process" {
|
||||
import * as events from "events";
|
||||
import * as stream from "stream";
|
||||
import * as net from "net";
|
||||
|
||||
interface ChildProcess extends events.EventEmitter {
|
||||
stdin: stream.Writable;
|
||||
stdout: stream.Readable;
|
||||
stderr: stream.Readable;
|
||||
readonly channel?: stream.Pipe | null;
|
||||
stdio: [stream.Writable, stream.Readable, stream.Readable];
|
||||
killed: boolean;
|
||||
pid: number;
|
||||
kill(signal?: string): void;
|
||||
send(message: any, callback?: (error: Error) => void): boolean;
|
||||
send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error) => void): boolean;
|
||||
send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error) => void): boolean;
|
||||
connected: boolean;
|
||||
disconnect(): void;
|
||||
unref(): void;
|
||||
ref(): void;
|
||||
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. close
|
||||
* 2. disconnect
|
||||
* 3. error
|
||||
* 4. exit
|
||||
* 5. message
|
||||
*/
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "close", listener: (code: number, signal: string) => void): this;
|
||||
addListener(event: "disconnect", listener: () => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
|
||||
addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "close", code: number, signal: string): boolean;
|
||||
emit(event: "disconnect"): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
emit(event: "exit", code: number | null, signal: string | null): boolean;
|
||||
emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "close", listener: (code: number, signal: string) => void): this;
|
||||
on(event: "disconnect", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
|
||||
on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "close", listener: (code: number, signal: string) => void): this;
|
||||
once(event: "disconnect", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
once(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
|
||||
once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "close", listener: (code: number, signal: string) => void): this;
|
||||
prependListener(event: "disconnect", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
|
||||
prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this;
|
||||
prependOnceListener(event: "disconnect", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
|
||||
prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
|
||||
}
|
||||
|
||||
interface MessageOptions {
|
||||
keepOpen?: boolean;
|
||||
}
|
||||
|
||||
type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | "inherit" | stream.Stream | number | null | undefined)>;
|
||||
|
||||
interface SpawnOptions {
|
||||
cwd?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
argv0?: string;
|
||||
stdio?: StdioOptions;
|
||||
detached?: boolean;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
shell?: boolean | string;
|
||||
windowsVerbatimArguments?: boolean;
|
||||
windowsHide?: boolean;
|
||||
}
|
||||
|
||||
function spawn(command: string, options?: SpawnOptions): ChildProcess;
|
||||
function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptions): ChildProcess;
|
||||
|
||||
interface ExecOptions {
|
||||
cwd?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
shell?: string;
|
||||
timeout?: number;
|
||||
maxBuffer?: number;
|
||||
killSignal?: string;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
windowsHide?: boolean;
|
||||
}
|
||||
|
||||
interface ExecOptionsWithStringEncoding extends ExecOptions {
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
|
||||
interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
||||
encoding: string | null; // specify `null`.
|
||||
}
|
||||
|
||||
interface ExecException extends Error {
|
||||
cmd?: string;
|
||||
killed?: boolean;
|
||||
code?: number;
|
||||
signal?: string;
|
||||
}
|
||||
|
||||
// no `options` definitely means stdout/stderr are `string`.
|
||||
function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
|
||||
|
||||
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
||||
function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
|
||||
|
||||
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
||||
function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
|
||||
|
||||
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
||||
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
||||
function exec(command: string, options: { encoding: string } & ExecOptions, callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
|
||||
|
||||
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
||||
function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
|
||||
|
||||
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
||||
function exec(
|
||||
command: string,
|
||||
options: ({ encoding?: string | null } & ExecOptions) | undefined | null,
|
||||
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
||||
): ChildProcess;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
namespace exec {
|
||||
function __promisify__(command: string): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): Promise<{ stdout: Buffer, stderr: Buffer }>;
|
||||
function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(command: string, options: ExecOptions): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(command: string, options?: ({ encoding?: string | null } & ExecOptions) | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
}
|
||||
|
||||
interface ExecFileOptions {
|
||||
cwd?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
timeout?: number;
|
||||
maxBuffer?: number;
|
||||
killSignal?: string;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
windowsHide?: boolean;
|
||||
windowsVerbatimArguments?: boolean;
|
||||
shell?: boolean | string;
|
||||
}
|
||||
interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
||||
encoding: 'buffer' | null;
|
||||
}
|
||||
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
|
||||
encoding: string;
|
||||
}
|
||||
|
||||
function execFile(file: string): ChildProcess;
|
||||
function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
|
||||
function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
|
||||
function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
|
||||
|
||||
// no `options` definitely means stdout/stderr are `string`.
|
||||
function execFile(file: string, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
|
||||
function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
|
||||
|
||||
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
||||
function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: ReadonlyArray<string> | undefined | null,
|
||||
options: ExecFileOptionsWithBufferEncoding,
|
||||
callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
|
||||
): ChildProcess;
|
||||
|
||||
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
|
||||
function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: ReadonlyArray<string> | undefined | null,
|
||||
options: ExecFileOptionsWithStringEncoding,
|
||||
callback: (error: ExecException | null, stdout: string, stderr: string) => void,
|
||||
): ChildProcess;
|
||||
|
||||
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
||||
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
||||
function execFile(
|
||||
file: string,
|
||||
options: ExecFileOptionsWithOtherEncoding,
|
||||
callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
||||
): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: ReadonlyArray<string> | undefined | null,
|
||||
options: ExecFileOptionsWithOtherEncoding,
|
||||
callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
||||
): ChildProcess;
|
||||
|
||||
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
||||
function execFile(file: string, options: ExecFileOptions, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: ReadonlyArray<string> | undefined | null,
|
||||
options: ExecFileOptions,
|
||||
callback: (error: ExecException | null, stdout: string, stderr: string) => void
|
||||
): ChildProcess;
|
||||
|
||||
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
||||
function execFile(
|
||||
file: string,
|
||||
options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null,
|
||||
callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
|
||||
): ChildProcess;
|
||||
function execFile(
|
||||
file: string,
|
||||
args: ReadonlyArray<string> | undefined | null,
|
||||
options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null,
|
||||
callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
|
||||
): ChildProcess;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
namespace execFile {
|
||||
function __promisify__(file: string): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>;
|
||||
function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
function __promisify__(file: string, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
args: string[] | undefined | null,
|
||||
options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null,
|
||||
): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
}
|
||||
|
||||
interface ForkOptions {
|
||||
cwd?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
execPath?: string;
|
||||
execArgv?: string[];
|
||||
silent?: boolean;
|
||||
stdio?: StdioOptions;
|
||||
detached?: boolean;
|
||||
windowsVerbatimArguments?: boolean;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
}
|
||||
function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;
|
||||
|
||||
interface SpawnSyncOptions {
|
||||
argv0?: string; // Not specified in the docs
|
||||
cwd?: string;
|
||||
input?: string | Buffer | NodeJS.TypedArray | DataView;
|
||||
stdio?: StdioOptions;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
timeout?: number;
|
||||
killSignal?: string | number;
|
||||
maxBuffer?: number;
|
||||
encoding?: string;
|
||||
shell?: boolean | string;
|
||||
windowsVerbatimArguments?: boolean;
|
||||
windowsHide?: boolean;
|
||||
}
|
||||
interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
|
||||
encoding: string; // specify `null`.
|
||||
}
|
||||
interface SpawnSyncReturns<T> {
|
||||
pid: number;
|
||||
output: string[];
|
||||
stdout: T;
|
||||
stderr: T;
|
||||
status: number | null;
|
||||
signal: string | null;
|
||||
error?: Error;
|
||||
}
|
||||
function spawnSync(command: string): SpawnSyncReturns<Buffer>;
|
||||
function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
||||
function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
||||
function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
|
||||
function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
|
||||
function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
|
||||
function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
|
||||
|
||||
interface ExecSyncOptions {
|
||||
cwd?: string;
|
||||
input?: string | Buffer | Uint8Array;
|
||||
stdio?: StdioOptions;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
shell?: string;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
timeout?: number;
|
||||
killSignal?: string | number;
|
||||
maxBuffer?: number;
|
||||
encoding?: string;
|
||||
windowsHide?: boolean;
|
||||
}
|
||||
interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
|
||||
encoding: string; // specify `null`.
|
||||
}
|
||||
function execSync(command: string): Buffer;
|
||||
function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
|
||||
function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
|
||||
function execSync(command: string, options?: ExecSyncOptions): Buffer;
|
||||
|
||||
interface ExecFileSyncOptions {
|
||||
cwd?: string;
|
||||
input?: string | Buffer | NodeJS.TypedArray | DataView;
|
||||
stdio?: StdioOptions;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
timeout?: number;
|
||||
killSignal?: string | number;
|
||||
maxBuffer?: number;
|
||||
encoding?: string;
|
||||
windowsHide?: boolean;
|
||||
shell?: boolean | string;
|
||||
}
|
||||
interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
|
||||
encoding: BufferEncoding;
|
||||
}
|
||||
interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
||||
encoding: string; // specify `null`.
|
||||
}
|
||||
function execFileSync(command: string): Buffer;
|
||||
function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
|
||||
function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
||||
function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
|
||||
function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithStringEncoding): string;
|
||||
function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
|
||||
function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): Buffer;
|
||||
}
|
||||
260
node_modules/@types/node/cluster.d.ts
generated
vendored
260
node_modules/@types/node/cluster.d.ts
generated
vendored
@@ -1,260 +0,0 @@
|
||||
declare module "cluster" {
|
||||
import * as child from "child_process";
|
||||
import * as events from "events";
|
||||
import * as net from "net";
|
||||
|
||||
// interfaces
|
||||
interface ClusterSettings {
|
||||
execArgv?: string[]; // default: process.execArgv
|
||||
exec?: string;
|
||||
args?: string[];
|
||||
silent?: boolean;
|
||||
stdio?: any[];
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
inspectPort?: number | (() => number);
|
||||
}
|
||||
|
||||
interface Address {
|
||||
address: string;
|
||||
port: number;
|
||||
addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
|
||||
}
|
||||
|
||||
class Worker extends events.EventEmitter {
|
||||
id: number;
|
||||
process: child.ChildProcess;
|
||||
send(message: any, sendHandle?: any, callback?: (error: Error) => void): boolean;
|
||||
kill(signal?: string): void;
|
||||
destroy(signal?: string): void;
|
||||
disconnect(): void;
|
||||
isConnected(): boolean;
|
||||
isDead(): boolean;
|
||||
exitedAfterDisconnect: boolean;
|
||||
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. disconnect
|
||||
* 2. error
|
||||
* 3. exit
|
||||
* 4. listening
|
||||
* 5. message
|
||||
* 6. online
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "disconnect", listener: () => void): this;
|
||||
addListener(event: "error", listener: (error: Error) => void): this;
|
||||
addListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
addListener(event: "listening", listener: (address: Address) => void): this;
|
||||
addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
addListener(event: "online", listener: () => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "disconnect"): boolean;
|
||||
emit(event: "error", error: Error): boolean;
|
||||
emit(event: "exit", code: number, signal: string): boolean;
|
||||
emit(event: "listening", address: Address): boolean;
|
||||
emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
|
||||
emit(event: "online"): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "disconnect", listener: () => void): this;
|
||||
on(event: "error", listener: (error: Error) => void): this;
|
||||
on(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
on(event: "listening", listener: (address: Address) => void): this;
|
||||
on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
on(event: "online", listener: () => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "disconnect", listener: () => void): this;
|
||||
once(event: "error", listener: (error: Error) => void): this;
|
||||
once(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
once(event: "listening", listener: (address: Address) => void): this;
|
||||
once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
once(event: "online", listener: () => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "disconnect", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (error: Error) => void): this;
|
||||
prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
prependListener(event: "listening", listener: (address: Address) => void): this;
|
||||
prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependListener(event: "online", listener: () => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "disconnect", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
||||
prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
prependOnceListener(event: "listening", listener: (address: Address) => void): this;
|
||||
prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependOnceListener(event: "online", listener: () => void): this;
|
||||
}
|
||||
|
||||
interface Cluster extends events.EventEmitter {
|
||||
Worker: Worker;
|
||||
disconnect(callback?: Function): void;
|
||||
fork(env?: any): Worker;
|
||||
isMaster: boolean;
|
||||
isWorker: boolean;
|
||||
// TODO: cluster.schedulingPolicy
|
||||
settings: ClusterSettings;
|
||||
setupMaster(settings?: ClusterSettings): void;
|
||||
worker?: Worker;
|
||||
workers?: {
|
||||
[index: string]: Worker | undefined
|
||||
};
|
||||
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. disconnect
|
||||
* 2. exit
|
||||
* 3. fork
|
||||
* 4. listening
|
||||
* 5. message
|
||||
* 6. online
|
||||
* 7. setup
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
addListener(event: "fork", listener: (worker: Worker) => void): this;
|
||||
addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
addListener(event: "online", listener: (worker: Worker) => void): this;
|
||||
addListener(event: "setup", listener: (settings: any) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "disconnect", worker: Worker): boolean;
|
||||
emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
|
||||
emit(event: "fork", worker: Worker): boolean;
|
||||
emit(event: "listening", worker: Worker, address: Address): boolean;
|
||||
emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
||||
emit(event: "online", worker: Worker): boolean;
|
||||
emit(event: "setup", settings: any): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
on(event: "fork", listener: (worker: Worker) => void): this;
|
||||
on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
on(event: "online", listener: (worker: Worker) => void): this;
|
||||
on(event: "setup", listener: (settings: any) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
once(event: "fork", listener: (worker: Worker) => void): this;
|
||||
once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
once(event: "online", listener: (worker: Worker) => void): this;
|
||||
once(event: "setup", listener: (settings: any) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
||||
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
||||
prependListener(event: "setup", listener: (settings: any) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
|
||||
prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: "setup", listener: (settings: any) => void): this;
|
||||
}
|
||||
|
||||
function disconnect(callback?: Function): void;
|
||||
function fork(env?: any): Worker;
|
||||
const isMaster: boolean;
|
||||
const isWorker: boolean;
|
||||
// TODO: cluster.schedulingPolicy
|
||||
const settings: ClusterSettings;
|
||||
function setupMaster(settings?: ClusterSettings): void;
|
||||
const worker: Worker;
|
||||
const workers: {
|
||||
[index: string]: Worker | undefined
|
||||
};
|
||||
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. disconnect
|
||||
* 2. exit
|
||||
* 3. fork
|
||||
* 4. listening
|
||||
* 5. message
|
||||
* 6. online
|
||||
* 7. setup
|
||||
*/
|
||||
function addListener(event: string, listener: (...args: any[]) => void): Cluster;
|
||||
function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
||||
function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
||||
function addListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
||||
function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
|
||||
function addListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
||||
function addListener(event: "setup", listener: (settings: any) => void): Cluster;
|
||||
|
||||
function emit(event: string | symbol, ...args: any[]): boolean;
|
||||
function emit(event: "disconnect", worker: Worker): boolean;
|
||||
function emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
|
||||
function emit(event: "fork", worker: Worker): boolean;
|
||||
function emit(event: "listening", worker: Worker, address: Address): boolean;
|
||||
function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
||||
function emit(event: "online", worker: Worker): boolean;
|
||||
function emit(event: "setup", settings: any): boolean;
|
||||
|
||||
function on(event: string, listener: (...args: any[]) => void): Cluster;
|
||||
function on(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
||||
function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
||||
function on(event: "fork", listener: (worker: Worker) => void): Cluster;
|
||||
function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
||||
function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
function on(event: "online", listener: (worker: Worker) => void): Cluster;
|
||||
function on(event: "setup", listener: (settings: any) => void): Cluster;
|
||||
|
||||
function once(event: string, listener: (...args: any[]) => void): Cluster;
|
||||
function once(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
||||
function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
||||
function once(event: "fork", listener: (worker: Worker) => void): Cluster;
|
||||
function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
||||
function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
function once(event: "online", listener: (worker: Worker) => void): Cluster;
|
||||
function once(event: "setup", listener: (settings: any) => void): Cluster;
|
||||
|
||||
function removeListener(event: string, listener: (...args: any[]) => void): Cluster;
|
||||
function removeAllListeners(event?: string): Cluster;
|
||||
function setMaxListeners(n: number): Cluster;
|
||||
function getMaxListeners(): number;
|
||||
function listeners(event: string): Function[];
|
||||
function listenerCount(type: string): number;
|
||||
|
||||
function prependListener(event: string, listener: (...args: any[]) => void): Cluster;
|
||||
function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
||||
function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
||||
function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
||||
function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
|
||||
function prependListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
||||
function prependListener(event: "setup", listener: (settings: any) => void): Cluster;
|
||||
|
||||
function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster;
|
||||
function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
|
||||
function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
|
||||
function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster;
|
||||
function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
|
||||
function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster;
|
||||
function prependOnceListener(event: "setup", listener: (settings: any) => void): Cluster;
|
||||
|
||||
function eventNames(): string[];
|
||||
}
|
||||
3
node_modules/@types/node/console.d.ts
generated
vendored
3
node_modules/@types/node/console.d.ts
generated
vendored
@@ -1,3 +0,0 @@
|
||||
declare module "console" {
|
||||
export = console;
|
||||
}
|
||||
449
node_modules/@types/node/constants.d.ts
generated
vendored
449
node_modules/@types/node/constants.d.ts
generated
vendored
@@ -1,449 +0,0 @@
|
||||
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
|
||||
declare module "constants" {
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.E2BIG` instead. */
|
||||
const E2BIG: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EACCES` instead. */
|
||||
const EACCES: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EADDRINUSE` instead. */
|
||||
const EADDRINUSE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EADDRNOTAVAIL` instead. */
|
||||
const EADDRNOTAVAIL: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EAFNOSUPPORT` instead. */
|
||||
const EAFNOSUPPORT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EAGAIN` instead. */
|
||||
const EAGAIN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EALREADY` instead. */
|
||||
const EALREADY: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EBADF` instead. */
|
||||
const EBADF: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EBADMSG` instead. */
|
||||
const EBADMSG: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EBUSY` instead. */
|
||||
const EBUSY: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ECANCELED` instead. */
|
||||
const ECANCELED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ECHILD` instead. */
|
||||
const ECHILD: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ECONNABORTED` instead. */
|
||||
const ECONNABORTED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ECONNREFUSED` instead. */
|
||||
const ECONNREFUSED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ECONNRESET` instead. */
|
||||
const ECONNRESET: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EDEADLK` instead. */
|
||||
const EDEADLK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EDESTADDRREQ` instead. */
|
||||
const EDESTADDRREQ: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EDOM` instead. */
|
||||
const EDOM: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EEXIST` instead. */
|
||||
const EEXIST: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EFAULT` instead. */
|
||||
const EFAULT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EFBIG` instead. */
|
||||
const EFBIG: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EHOSTUNREACH` instead. */
|
||||
const EHOSTUNREACH: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EIDRM` instead. */
|
||||
const EIDRM: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EILSEQ` instead. */
|
||||
const EILSEQ: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EINPROGRESS` instead. */
|
||||
const EINPROGRESS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EINTR` instead. */
|
||||
const EINTR: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EINVAL` instead. */
|
||||
const EINVAL: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EIO` instead. */
|
||||
const EIO: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EISCONN` instead. */
|
||||
const EISCONN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EISDIR` instead. */
|
||||
const EISDIR: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ELOOP` instead. */
|
||||
const ELOOP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EMFILE` instead. */
|
||||
const EMFILE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EMLINK` instead. */
|
||||
const EMLINK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EMSGSIZE` instead. */
|
||||
const EMSGSIZE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENAMETOOLONG` instead. */
|
||||
const ENAMETOOLONG: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENETDOWN` instead. */
|
||||
const ENETDOWN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENETRESET` instead. */
|
||||
const ENETRESET: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENETUNREACH` instead. */
|
||||
const ENETUNREACH: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENFILE` instead. */
|
||||
const ENFILE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOBUFS` instead. */
|
||||
const ENOBUFS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENODATA` instead. */
|
||||
const ENODATA: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENODEV` instead. */
|
||||
const ENODEV: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOENT` instead. */
|
||||
const ENOENT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOEXEC` instead. */
|
||||
const ENOEXEC: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOLCK` instead. */
|
||||
const ENOLCK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOLINK` instead. */
|
||||
const ENOLINK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOMEM` instead. */
|
||||
const ENOMEM: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOMSG` instead. */
|
||||
const ENOMSG: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOPROTOOPT` instead. */
|
||||
const ENOPROTOOPT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOSPC` instead. */
|
||||
const ENOSPC: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOSR` instead. */
|
||||
const ENOSR: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOSTR` instead. */
|
||||
const ENOSTR: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOSYS` instead. */
|
||||
const ENOSYS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTCONN` instead. */
|
||||
const ENOTCONN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTDIR` instead. */
|
||||
const ENOTDIR: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTEMPTY` instead. */
|
||||
const ENOTEMPTY: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTSOCK` instead. */
|
||||
const ENOTSOCK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTSUP` instead. */
|
||||
const ENOTSUP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTTY` instead. */
|
||||
const ENOTTY: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ENXIO` instead. */
|
||||
const ENXIO: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EOPNOTSUPP` instead. */
|
||||
const EOPNOTSUPP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EOVERFLOW` instead. */
|
||||
const EOVERFLOW: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EPERM` instead. */
|
||||
const EPERM: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EPIPE` instead. */
|
||||
const EPIPE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EPROTO` instead. */
|
||||
const EPROTO: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EPROTONOSUPPORT` instead. */
|
||||
const EPROTONOSUPPORT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EPROTOTYPE` instead. */
|
||||
const EPROTOTYPE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ERANGE` instead. */
|
||||
const ERANGE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EROFS` instead. */
|
||||
const EROFS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ESPIPE` instead. */
|
||||
const ESPIPE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ESRCH` instead. */
|
||||
const ESRCH: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ETIME` instead. */
|
||||
const ETIME: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ETIMEDOUT` instead. */
|
||||
const ETIMEDOUT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.ETXTBSY` instead. */
|
||||
const ETXTBSY: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EWOULDBLOCK` instead. */
|
||||
const EWOULDBLOCK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.EXDEV` instead. */
|
||||
const EXDEV: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINTR` instead. */
|
||||
const WSAEINTR: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEBADF` instead. */
|
||||
const WSAEBADF: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEACCES` instead. */
|
||||
const WSAEACCES: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEFAULT` instead. */
|
||||
const WSAEFAULT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINVAL` instead. */
|
||||
const WSAEINVAL: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEMFILE` instead. */
|
||||
const WSAEMFILE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEWOULDBLOCK` instead. */
|
||||
const WSAEWOULDBLOCK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINPROGRESS` instead. */
|
||||
const WSAEINPROGRESS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEALREADY` instead. */
|
||||
const WSAEALREADY: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOTSOCK` instead. */
|
||||
const WSAENOTSOCK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEDESTADDRREQ` instead. */
|
||||
const WSAEDESTADDRREQ: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEMSGSIZE` instead. */
|
||||
const WSAEMSGSIZE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPROTOTYPE` instead. */
|
||||
const WSAEPROTOTYPE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOPROTOOPT` instead. */
|
||||
const WSAENOPROTOOPT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPROTONOSUPPORT` instead. */
|
||||
const WSAEPROTONOSUPPORT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAESOCKTNOSUPPORT` instead. */
|
||||
const WSAESOCKTNOSUPPORT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEOPNOTSUPP` instead. */
|
||||
const WSAEOPNOTSUPP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPFNOSUPPORT` instead. */
|
||||
const WSAEPFNOSUPPORT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEAFNOSUPPORT` instead. */
|
||||
const WSAEAFNOSUPPORT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEADDRINUSE` instead. */
|
||||
const WSAEADDRINUSE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEADDRNOTAVAIL` instead. */
|
||||
const WSAEADDRNOTAVAIL: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENETDOWN` instead. */
|
||||
const WSAENETDOWN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENETUNREACH` instead. */
|
||||
const WSAENETUNREACH: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENETRESET` instead. */
|
||||
const WSAENETRESET: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAECONNABORTED` instead. */
|
||||
const WSAECONNABORTED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAECONNRESET` instead. */
|
||||
const WSAECONNRESET: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOBUFS` instead. */
|
||||
const WSAENOBUFS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEISCONN` instead. */
|
||||
const WSAEISCONN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOTCONN` instead. */
|
||||
const WSAENOTCONN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAESHUTDOWN` instead. */
|
||||
const WSAESHUTDOWN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAETOOMANYREFS` instead. */
|
||||
const WSAETOOMANYREFS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAETIMEDOUT` instead. */
|
||||
const WSAETIMEDOUT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAECONNREFUSED` instead. */
|
||||
const WSAECONNREFUSED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAELOOP` instead. */
|
||||
const WSAELOOP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENAMETOOLONG` instead. */
|
||||
const WSAENAMETOOLONG: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEHOSTDOWN` instead. */
|
||||
const WSAEHOSTDOWN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEHOSTUNREACH` instead. */
|
||||
const WSAEHOSTUNREACH: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOTEMPTY` instead. */
|
||||
const WSAENOTEMPTY: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPROCLIM` instead. */
|
||||
const WSAEPROCLIM: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEUSERS` instead. */
|
||||
const WSAEUSERS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEDQUOT` instead. */
|
||||
const WSAEDQUOT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAESTALE` instead. */
|
||||
const WSAESTALE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEREMOTE` instead. */
|
||||
const WSAEREMOTE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSASYSNOTREADY` instead. */
|
||||
const WSASYSNOTREADY: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAVERNOTSUPPORTED` instead. */
|
||||
const WSAVERNOTSUPPORTED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSANOTINITIALISED` instead. */
|
||||
const WSANOTINITIALISED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEDISCON` instead. */
|
||||
const WSAEDISCON: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOMORE` instead. */
|
||||
const WSAENOMORE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAECANCELLED` instead. */
|
||||
const WSAECANCELLED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINVALIDPROCTABLE` instead. */
|
||||
const WSAEINVALIDPROCTABLE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINVALIDPROVIDER` instead. */
|
||||
const WSAEINVALIDPROVIDER: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPROVIDERFAILEDINIT` instead. */
|
||||
const WSAEPROVIDERFAILEDINIT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSASYSCALLFAILURE` instead. */
|
||||
const WSASYSCALLFAILURE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSASERVICE_NOT_FOUND` instead. */
|
||||
const WSASERVICE_NOT_FOUND: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSATYPE_NOT_FOUND` instead. */
|
||||
const WSATYPE_NOT_FOUND: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSA_E_NO_MORE` instead. */
|
||||
const WSA_E_NO_MORE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSA_E_CANCELLED` instead. */
|
||||
const WSA_E_CANCELLED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEREFUSED` instead. */
|
||||
const WSAEREFUSED: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGHUP` instead. */
|
||||
const SIGHUP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGINT` instead. */
|
||||
const SIGINT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGILL` instead. */
|
||||
const SIGILL: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGABRT` instead. */
|
||||
const SIGABRT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGFPE` instead. */
|
||||
const SIGFPE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGKILL` instead. */
|
||||
const SIGKILL: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGSEGV` instead. */
|
||||
const SIGSEGV: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTERM` instead. */
|
||||
const SIGTERM: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGBREAK` instead. */
|
||||
const SIGBREAK: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGWINCH` instead. */
|
||||
const SIGWINCH: number;
|
||||
const SSL_OP_ALL: number;
|
||||
const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
|
||||
const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
|
||||
const SSL_OP_CISCO_ANYCONNECT: number;
|
||||
const SSL_OP_COOKIE_EXCHANGE: number;
|
||||
const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
|
||||
const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
|
||||
const SSL_OP_EPHEMERAL_RSA: number;
|
||||
const SSL_OP_LEGACY_SERVER_CONNECT: number;
|
||||
const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
|
||||
const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
|
||||
const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
|
||||
const SSL_OP_NETSCAPE_CA_DN_BUG: number;
|
||||
const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
|
||||
const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
|
||||
const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
|
||||
const SSL_OP_NO_COMPRESSION: number;
|
||||
const SSL_OP_NO_QUERY_MTU: number;
|
||||
const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
|
||||
const SSL_OP_NO_SSLv2: number;
|
||||
const SSL_OP_NO_SSLv3: number;
|
||||
const SSL_OP_NO_TICKET: number;
|
||||
const SSL_OP_NO_TLSv1: number;
|
||||
const SSL_OP_NO_TLSv1_1: number;
|
||||
const SSL_OP_NO_TLSv1_2: number;
|
||||
const SSL_OP_PKCS1_CHECK_1: number;
|
||||
const SSL_OP_PKCS1_CHECK_2: number;
|
||||
const SSL_OP_SINGLE_DH_USE: number;
|
||||
const SSL_OP_SINGLE_ECDH_USE: number;
|
||||
const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
|
||||
const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
|
||||
const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
|
||||
const SSL_OP_TLS_D5_BUG: number;
|
||||
const SSL_OP_TLS_ROLLBACK_BUG: number;
|
||||
const ENGINE_METHOD_DSA: number;
|
||||
const ENGINE_METHOD_DH: number;
|
||||
const ENGINE_METHOD_RAND: number;
|
||||
const ENGINE_METHOD_ECDH: number;
|
||||
const ENGINE_METHOD_ECDSA: number;
|
||||
const ENGINE_METHOD_CIPHERS: number;
|
||||
const ENGINE_METHOD_DIGESTS: number;
|
||||
const ENGINE_METHOD_STORE: number;
|
||||
const ENGINE_METHOD_PKEY_METHS: number;
|
||||
const ENGINE_METHOD_PKEY_ASN1_METHS: number;
|
||||
const ENGINE_METHOD_ALL: number;
|
||||
const ENGINE_METHOD_NONE: number;
|
||||
const DH_CHECK_P_NOT_SAFE_PRIME: number;
|
||||
const DH_CHECK_P_NOT_PRIME: number;
|
||||
const DH_UNABLE_TO_CHECK_GENERATOR: number;
|
||||
const DH_NOT_SUITABLE_GENERATOR: number;
|
||||
const NPN_ENABLED: number;
|
||||
const RSA_PKCS1_PADDING: number;
|
||||
const RSA_SSLV23_PADDING: number;
|
||||
const RSA_NO_PADDING: number;
|
||||
const RSA_PKCS1_OAEP_PADDING: number;
|
||||
const RSA_X931_PADDING: number;
|
||||
const RSA_PKCS1_PSS_PADDING: number;
|
||||
const POINT_CONVERSION_COMPRESSED: number;
|
||||
const POINT_CONVERSION_UNCOMPRESSED: number;
|
||||
const POINT_CONVERSION_HYBRID: number;
|
||||
const O_RDONLY: number;
|
||||
const O_WRONLY: number;
|
||||
const O_RDWR: number;
|
||||
const S_IFMT: number;
|
||||
const S_IFREG: number;
|
||||
const S_IFDIR: number;
|
||||
const S_IFCHR: number;
|
||||
const S_IFBLK: number;
|
||||
const S_IFIFO: number;
|
||||
const S_IFSOCK: number;
|
||||
const S_IRWXU: number;
|
||||
const S_IRUSR: number;
|
||||
const S_IWUSR: number;
|
||||
const S_IXUSR: number;
|
||||
const S_IRWXG: number;
|
||||
const S_IRGRP: number;
|
||||
const S_IWGRP: number;
|
||||
const S_IXGRP: number;
|
||||
const S_IRWXO: number;
|
||||
const S_IROTH: number;
|
||||
const S_IWOTH: number;
|
||||
const S_IXOTH: number;
|
||||
const S_IFLNK: number;
|
||||
const O_CREAT: number;
|
||||
const O_EXCL: number;
|
||||
const O_NOCTTY: number;
|
||||
const O_DIRECTORY: number;
|
||||
const O_NOATIME: number;
|
||||
const O_NOFOLLOW: number;
|
||||
const O_SYNC: number;
|
||||
const O_DSYNC: number;
|
||||
const O_SYMLINK: number;
|
||||
const O_DIRECT: number;
|
||||
const O_NONBLOCK: number;
|
||||
const O_TRUNC: number;
|
||||
const O_APPEND: number;
|
||||
const F_OK: number;
|
||||
const R_OK: number;
|
||||
const W_OK: number;
|
||||
const X_OK: number;
|
||||
const COPYFILE_EXCL: number;
|
||||
const COPYFILE_FICLONE: number;
|
||||
const COPYFILE_FICLONE_FORCE: number;
|
||||
const UV_UDP_REUSEADDR: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGQUIT` instead. */
|
||||
const SIGQUIT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTRAP` instead. */
|
||||
const SIGTRAP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGIOT` instead. */
|
||||
const SIGIOT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGBUS` instead. */
|
||||
const SIGBUS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGUSR1` instead. */
|
||||
const SIGUSR1: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGUSR2` instead. */
|
||||
const SIGUSR2: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGPIPE` instead. */
|
||||
const SIGPIPE: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGALRM` instead. */
|
||||
const SIGALRM: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGCHLD` instead. */
|
||||
const SIGCHLD: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGSTKFLT` instead. */
|
||||
const SIGSTKFLT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGCONT` instead. */
|
||||
const SIGCONT: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGSTOP` instead. */
|
||||
const SIGSTOP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTSTP` instead. */
|
||||
const SIGTSTP: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTTIN` instead. */
|
||||
const SIGTTIN: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTTOU` instead. */
|
||||
const SIGTTOU: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGURG` instead. */
|
||||
const SIGURG: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGXCPU` instead. */
|
||||
const SIGXCPU: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGXFSZ` instead. */
|
||||
const SIGXFSZ: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGVTALRM` instead. */
|
||||
const SIGVTALRM: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGPROF` instead. */
|
||||
const SIGPROF: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGIO` instead. */
|
||||
const SIGIO: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGPOLL` instead. */
|
||||
const SIGPOLL: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGPWR` instead. */
|
||||
const SIGPWR: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGSYS` instead. */
|
||||
const SIGSYS: number;
|
||||
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGUNUSED` instead. */
|
||||
const SIGUNUSED: number;
|
||||
const defaultCoreCipherList: string;
|
||||
const defaultCipherList: string;
|
||||
const ENGINE_METHOD_RSA: number;
|
||||
const ALPN_ENABLED: number;
|
||||
}
|
||||
371
node_modules/@types/node/crypto.d.ts
generated
vendored
371
node_modules/@types/node/crypto.d.ts
generated
vendored
@@ -1,371 +0,0 @@
|
||||
declare module "crypto" {
|
||||
import * as stream from "stream";
|
||||
|
||||
interface Certificate {
|
||||
exportChallenge(spkac: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
exportPublicKey(spkac: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
verifySpkac(spkac: Buffer | NodeJS.TypedArray | DataView): boolean;
|
||||
}
|
||||
const Certificate: {
|
||||
new(): Certificate;
|
||||
(): Certificate;
|
||||
};
|
||||
|
||||
/** @deprecated since v10.0.0 */
|
||||
const fips: boolean;
|
||||
|
||||
interface CredentialDetails {
|
||||
pfx: string;
|
||||
key: string;
|
||||
passphrase: string;
|
||||
cert: string;
|
||||
ca: string | string[];
|
||||
crl: string | string[];
|
||||
ciphers: string;
|
||||
}
|
||||
/** @deprecated since v0.11.13 - use tls.SecureContext instead. */
|
||||
interface Credentials { context?: any; }
|
||||
/** @deprecated since v0.11.13 - use tls.createSecureContext instead. */
|
||||
function createCredentials(details: CredentialDetails): Credentials;
|
||||
function createHash(algorithm: string, options?: stream.TransformOptions): Hash;
|
||||
function createHmac(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Hmac;
|
||||
|
||||
type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
|
||||
type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
|
||||
type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary";
|
||||
type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
|
||||
type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
|
||||
|
||||
interface Hash extends stream.Transform {
|
||||
update(data: string | Buffer | NodeJS.TypedArray | DataView): Hash;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
|
||||
digest(): Buffer;
|
||||
digest(encoding: HexBase64Latin1Encoding): string;
|
||||
}
|
||||
interface Hmac extends stream.Transform {
|
||||
update(data: string | Buffer | NodeJS.TypedArray | DataView): Hmac;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
|
||||
digest(): Buffer;
|
||||
digest(encoding: HexBase64Latin1Encoding): string;
|
||||
}
|
||||
type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm';
|
||||
type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
|
||||
interface CipherCCMOptions extends stream.TransformOptions {
|
||||
authTagLength: number;
|
||||
}
|
||||
interface CipherGCMOptions extends stream.TransformOptions {
|
||||
authTagLength?: number;
|
||||
}
|
||||
/** @deprecated since v10.0.0 use createCipheriv() */
|
||||
function createCipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM;
|
||||
/** @deprecated since v10.0.0 use createCipheriv() */
|
||||
function createCipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): CipherGCM;
|
||||
/** @deprecated since v10.0.0 use createCipheriv() */
|
||||
function createCipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher;
|
||||
|
||||
function createCipheriv(algorithm: CipherCCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): CipherCCM;
|
||||
function createCipheriv(algorithm: CipherGCMTypes, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): CipherGCM;
|
||||
function createCipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Cipher;
|
||||
|
||||
interface Cipher extends stream.Transform {
|
||||
update(data: string | Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
|
||||
update(data: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64BinaryEncoding): string;
|
||||
update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;
|
||||
// second arg ignored
|
||||
update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;
|
||||
final(): Buffer;
|
||||
final(output_encoding: string): string;
|
||||
setAutoPadding(auto_padding?: boolean): this;
|
||||
// getAuthTag(): Buffer;
|
||||
// setAAD(buffer: Buffer): this; // docs only say buffer
|
||||
}
|
||||
interface CipherCCM extends Cipher {
|
||||
setAAD(buffer: Buffer, options: { plaintextLength: number }): this;
|
||||
getAuthTag(): Buffer;
|
||||
}
|
||||
interface CipherGCM extends Cipher {
|
||||
setAAD(buffer: Buffer, options?: { plaintextLength: number }): this;
|
||||
getAuthTag(): Buffer;
|
||||
}
|
||||
/** @deprecated since v10.0.0 use createDecipheriv() */
|
||||
function createDecipher(algorithm: CipherCCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options: CipherCCMOptions): DecipherCCM;
|
||||
/** @deprecated since v10.0.0 use createDecipheriv() */
|
||||
function createDecipher(algorithm: CipherGCMTypes, password: string | Buffer | NodeJS.TypedArray | DataView, options?: CipherGCMOptions): DecipherGCM;
|
||||
/** @deprecated since v10.0.0 use createDecipheriv() */
|
||||
function createDecipher(algorithm: string, password: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher;
|
||||
|
||||
function createDecipheriv(
|
||||
algorithm: CipherCCMTypes,
|
||||
key: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
iv: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
options: CipherCCMOptions,
|
||||
): DecipherCCM;
|
||||
function createDecipheriv(
|
||||
algorithm: CipherGCMTypes,
|
||||
key: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
iv: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
options?: CipherGCMOptions,
|
||||
): DecipherGCM;
|
||||
function createDecipheriv(algorithm: string, key: string | Buffer | NodeJS.TypedArray | DataView, iv: string | Buffer | NodeJS.TypedArray | DataView, options?: stream.TransformOptions): Decipher;
|
||||
|
||||
interface Decipher extends stream.Transform {
|
||||
update(data: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
|
||||
update(data: Buffer | NodeJS.TypedArray | DataView, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
|
||||
// second arg is ignored
|
||||
update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;
|
||||
final(): Buffer;
|
||||
final(output_encoding: string): string;
|
||||
setAutoPadding(auto_padding?: boolean): this;
|
||||
// setAuthTag(tag: Buffer | NodeJS.TypedArray | DataView): this;
|
||||
// setAAD(buffer: Buffer | NodeJS.TypedArray | DataView): this;
|
||||
}
|
||||
interface DecipherCCM extends Decipher {
|
||||
setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView): this;
|
||||
setAAD(buffer: Buffer | NodeJS.TypedArray | DataView, options: { plaintextLength: number }): this;
|
||||
}
|
||||
interface DecipherGCM extends Decipher {
|
||||
setAuthTag(buffer: Buffer | NodeJS.TypedArray | DataView): this;
|
||||
setAAD(buffer: Buffer | NodeJS.TypedArray | DataView, options?: { plaintextLength: number }): this;
|
||||
}
|
||||
|
||||
function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
|
||||
interface Signer extends NodeJS.WritableStream {
|
||||
update(data: string | Buffer | NodeJS.TypedArray | DataView): Signer;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
|
||||
sign(private_key: string | { key: string; passphrase?: string, padding?: number, saltLength?: number }): Buffer;
|
||||
sign(private_key: string | { key: string; passphrase?: string, padding?: number, saltLength?: number }, output_format: HexBase64Latin1Encoding): string;
|
||||
}
|
||||
function createVerify(algorith: string, options?: stream.WritableOptions): Verify;
|
||||
interface Verify extends NodeJS.WritableStream {
|
||||
update(data: string | Buffer | NodeJS.TypedArray | DataView): Verify;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
|
||||
verify(object: string | Object, signature: Buffer | NodeJS.TypedArray | DataView): boolean;
|
||||
verify(object: string | Object, signature: string, signature_format: HexBase64Latin1Encoding): boolean;
|
||||
// https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
|
||||
// The signature field accepts a TypedArray type, but it is only available starting ES2017
|
||||
}
|
||||
function createDiffieHellman(prime_length: number, generator?: number | Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
|
||||
function createDiffieHellman(prime: Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer | NodeJS.TypedArray | DataView): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
||||
interface DiffieHellman {
|
||||
generateKeys(): Buffer;
|
||||
generateKeys(encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
|
||||
computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
|
||||
getPrime(): Buffer;
|
||||
getPrime(encoding: HexBase64Latin1Encoding): string;
|
||||
getGenerator(): Buffer;
|
||||
getGenerator(encoding: HexBase64Latin1Encoding): string;
|
||||
getPublicKey(): Buffer;
|
||||
getPublicKey(encoding: HexBase64Latin1Encoding): string;
|
||||
getPrivateKey(): Buffer;
|
||||
getPrivateKey(encoding: HexBase64Latin1Encoding): string;
|
||||
setPublicKey(public_key: Buffer | NodeJS.TypedArray | DataView): void;
|
||||
setPublicKey(public_key: string, encoding: string): void;
|
||||
setPrivateKey(private_key: Buffer | NodeJS.TypedArray | DataView): void;
|
||||
setPrivateKey(private_key: string, encoding: string): void;
|
||||
verifyError: number;
|
||||
}
|
||||
function getDiffieHellman(group_name: string): DiffieHellman;
|
||||
function pbkdf2(
|
||||
password: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
salt: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
iterations: number,
|
||||
keylen: number,
|
||||
digest: string,
|
||||
callback: (err: Error | null, derivedKey: Buffer) => any,
|
||||
): void;
|
||||
function pbkdf2Sync(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, iterations: number, keylen: number, digest: string): Buffer;
|
||||
|
||||
function randomBytes(size: number): Buffer;
|
||||
function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
function pseudoRandomBytes(size: number): Buffer;
|
||||
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
|
||||
function randomFillSync<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset?: number, size?: number): T;
|
||||
function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
|
||||
function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
|
||||
function randomFill<T extends Buffer | NodeJS.TypedArray | DataView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
|
||||
|
||||
interface ScryptOptions {
|
||||
N?: number;
|
||||
r?: number;
|
||||
p?: number;
|
||||
maxmem?: number;
|
||||
}
|
||||
function scrypt(
|
||||
password: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
salt: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void,
|
||||
): void;
|
||||
function scrypt(
|
||||
password: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
salt: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
keylen: number,
|
||||
options: ScryptOptions,
|
||||
callback: (err: Error | null, derivedKey: Buffer) => void,
|
||||
): void;
|
||||
function scryptSync(password: string | Buffer | NodeJS.TypedArray | DataView, salt: string | Buffer | NodeJS.TypedArray | DataView, keylen: number, options?: ScryptOptions): Buffer;
|
||||
|
||||
interface RsaPublicKey {
|
||||
key: string;
|
||||
padding?: number;
|
||||
}
|
||||
interface RsaPrivateKey {
|
||||
key: string;
|
||||
passphrase?: string;
|
||||
padding?: number;
|
||||
}
|
||||
function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
function getCiphers(): string[];
|
||||
function getCurves(): string[];
|
||||
function getHashes(): string[];
|
||||
class ECDH {
|
||||
static convertKey(
|
||||
key: string | Buffer | NodeJS.TypedArray | DataView,
|
||||
curve: string,
|
||||
inputEncoding?: HexBase64Latin1Encoding,
|
||||
outputEncoding?: "latin1" | "hex" | "base64",
|
||||
format?: "uncompressed" | "compressed" | "hybrid",
|
||||
): Buffer | string;
|
||||
generateKeys(): Buffer;
|
||||
generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
|
||||
computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView): Buffer;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
|
||||
computeSecret(other_public_key: Buffer | NodeJS.TypedArray | DataView, output_encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
|
||||
getPrivateKey(): Buffer;
|
||||
getPrivateKey(encoding: HexBase64Latin1Encoding): string;
|
||||
getPublicKey(): Buffer;
|
||||
getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
|
||||
setPrivateKey(private_key: Buffer | NodeJS.TypedArray | DataView): void;
|
||||
setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
|
||||
}
|
||||
function createECDH(curve_name: string): ECDH;
|
||||
function timingSafeEqual(a: Buffer | NodeJS.TypedArray | DataView, b: Buffer | NodeJS.TypedArray | DataView): boolean;
|
||||
/** @deprecated since v10.0.0 */
|
||||
const DEFAULT_ENCODING: string;
|
||||
|
||||
export type KeyType = 'rsa' | 'dsa' | 'ec';
|
||||
export type KeyFormat = 'pem' | 'der';
|
||||
|
||||
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
||||
format: T;
|
||||
cipher?: string;
|
||||
passphrase?: string;
|
||||
}
|
||||
|
||||
interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
||||
/**
|
||||
* Key size in bits
|
||||
*/
|
||||
modulusLength: number;
|
||||
/**
|
||||
* @default 0x10001
|
||||
*/
|
||||
publicExponent?: number;
|
||||
|
||||
publicKeyEncoding: {
|
||||
type: 'pkcs1' | 'spki';
|
||||
format: PubF;
|
||||
};
|
||||
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
||||
type: 'pkcs1' | 'pkcs8';
|
||||
};
|
||||
}
|
||||
|
||||
interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
||||
/**
|
||||
* Key size in bits
|
||||
*/
|
||||
modulusLength: number;
|
||||
/**
|
||||
* Size of q in bits
|
||||
*/
|
||||
divisorLength: number;
|
||||
|
||||
publicKeyEncoding: {
|
||||
type: 'spki';
|
||||
format: PubF;
|
||||
};
|
||||
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
||||
type: 'pkcs8';
|
||||
};
|
||||
}
|
||||
|
||||
interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
||||
/**
|
||||
* Name of the curve to use.
|
||||
*/
|
||||
namedCurve: string;
|
||||
|
||||
publicKeyEncoding: {
|
||||
type: 'pkcs1' | 'spki';
|
||||
format: PubF;
|
||||
};
|
||||
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
||||
type: 'sec1' | 'pkcs8';
|
||||
};
|
||||
}
|
||||
|
||||
interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
|
||||
publicKey: T1;
|
||||
privateKey: T2;
|
||||
}
|
||||
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
||||
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
||||
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
||||
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
||||
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
||||
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
||||
|
||||
namespace generateKeyPair {
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
||||
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
||||
|
||||
function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
||||
function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
||||
function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
||||
function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
||||
}
|
||||
}
|
||||
97
node_modules/@types/node/dgram.d.ts
generated
vendored
97
node_modules/@types/node/dgram.d.ts
generated
vendored
@@ -1,97 +0,0 @@
|
||||
declare module "dgram" {
|
||||
import { AddressInfo } from "net";
|
||||
import * as dns from "dns";
|
||||
import * as events from "events";
|
||||
|
||||
interface RemoteInfo {
|
||||
address: string;
|
||||
family: string;
|
||||
port: number;
|
||||
}
|
||||
|
||||
interface BindOptions {
|
||||
port: number;
|
||||
address?: string;
|
||||
exclusive?: boolean;
|
||||
}
|
||||
|
||||
type SocketType = "udp4" | "udp6";
|
||||
|
||||
interface SocketOptions {
|
||||
type: SocketType;
|
||||
reuseAddr?: boolean;
|
||||
recvBufferSize?: number;
|
||||
sendBufferSize?: number;
|
||||
lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
|
||||
}
|
||||
|
||||
function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
|
||||
class Socket extends events.EventEmitter {
|
||||
send(msg: Buffer | string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||
send(msg: Buffer | string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||
bind(port?: number, address?: string, callback?: () => void): void;
|
||||
bind(port?: number, callback?: () => void): void;
|
||||
bind(callback?: () => void): void;
|
||||
bind(options: BindOptions, callback?: Function): void;
|
||||
close(callback?: () => void): void;
|
||||
address(): AddressInfo | string;
|
||||
setBroadcast(flag: boolean): void;
|
||||
setTTL(ttl: number): void;
|
||||
setMulticastTTL(ttl: number): void;
|
||||
setMulticastInterface(multicastInterface: string): void;
|
||||
setMulticastLoopback(flag: boolean): void;
|
||||
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||
dropMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||
ref(): this;
|
||||
unref(): this;
|
||||
setRecvBufferSize(size: number): void;
|
||||
setSendBufferSize(size: number): void;
|
||||
getRecvBufferSize(): number;
|
||||
getSendBufferSize(): number;
|
||||
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. close
|
||||
* 2. error
|
||||
* 3. listening
|
||||
* 4. message
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "listening", listener: () => void): this;
|
||||
addListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "close"): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
emit(event: "listening"): boolean;
|
||||
emit(event: "message", msg: Buffer, rinfo: AddressInfo): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "listening", listener: () => void): this;
|
||||
on(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
once(event: "listening", listener: () => void): this;
|
||||
once(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependListener(event: "listening", listener: () => void): this;
|
||||
prependListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "listening", listener: () => void): this;
|
||||
prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;
|
||||
}
|
||||
}
|
||||
366
node_modules/@types/node/dns.d.ts
generated
vendored
366
node_modules/@types/node/dns.d.ts
generated
vendored
@@ -1,366 +0,0 @@
|
||||
declare module "dns" {
|
||||
// Supported getaddrinfo flags.
|
||||
const ADDRCONFIG: number;
|
||||
const V4MAPPED: number;
|
||||
|
||||
interface LookupOptions {
|
||||
family?: number;
|
||||
hints?: number;
|
||||
all?: boolean;
|
||||
verbatim?: boolean;
|
||||
}
|
||||
|
||||
interface LookupOneOptions extends LookupOptions {
|
||||
all?: false;
|
||||
}
|
||||
|
||||
interface LookupAllOptions extends LookupOptions {
|
||||
all: true;
|
||||
}
|
||||
|
||||
interface LookupAddress {
|
||||
address: string;
|
||||
family: number;
|
||||
}
|
||||
|
||||
function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
||||
function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
||||
function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
|
||||
function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
|
||||
function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
namespace lookup {
|
||||
function __promisify__(hostname: string, options: LookupAllOptions): Promise<{ address: LookupAddress[] }>;
|
||||
function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<{ address: string, family: number }>;
|
||||
function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
|
||||
}
|
||||
|
||||
function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
|
||||
|
||||
namespace lookupService {
|
||||
function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
||||
}
|
||||
|
||||
interface ResolveOptions {
|
||||
ttl: boolean;
|
||||
}
|
||||
|
||||
interface ResolveWithTtlOptions extends ResolveOptions {
|
||||
ttl: true;
|
||||
}
|
||||
|
||||
interface RecordWithTtl {
|
||||
address: string;
|
||||
ttl: number;
|
||||
}
|
||||
|
||||
/** @deprecated Use AnyARecord or AnyAaaaRecord instead. */
|
||||
type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
|
||||
|
||||
interface AnyARecord extends RecordWithTtl {
|
||||
type: "A";
|
||||
}
|
||||
|
||||
interface AnyAaaaRecord extends RecordWithTtl {
|
||||
type: "AAAA";
|
||||
}
|
||||
|
||||
interface MxRecord {
|
||||
priority: number;
|
||||
exchange: string;
|
||||
}
|
||||
|
||||
interface AnyMxRecord extends MxRecord {
|
||||
type: "MX";
|
||||
}
|
||||
|
||||
interface NaptrRecord {
|
||||
flags: string;
|
||||
service: string;
|
||||
regexp: string;
|
||||
replacement: string;
|
||||
order: number;
|
||||
preference: number;
|
||||
}
|
||||
|
||||
interface AnyNaptrRecord extends NaptrRecord {
|
||||
type: "NAPTR";
|
||||
}
|
||||
|
||||
interface SoaRecord {
|
||||
nsname: string;
|
||||
hostmaster: string;
|
||||
serial: number;
|
||||
refresh: number;
|
||||
retry: number;
|
||||
expire: number;
|
||||
minttl: number;
|
||||
}
|
||||
|
||||
interface AnySoaRecord extends SoaRecord {
|
||||
type: "SOA";
|
||||
}
|
||||
|
||||
interface SrvRecord {
|
||||
priority: number;
|
||||
weight: number;
|
||||
port: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface AnySrvRecord extends SrvRecord {
|
||||
type: "SRV";
|
||||
}
|
||||
|
||||
interface AnyTxtRecord {
|
||||
type: "TXT";
|
||||
entries: string[];
|
||||
}
|
||||
|
||||
interface AnyNsRecord {
|
||||
type: "NS";
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface AnyPtrRecord {
|
||||
type: "PTR";
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface AnyCnameRecord {
|
||||
type: "CNAME";
|
||||
value: string;
|
||||
}
|
||||
|
||||
type AnyRecord = AnyARecord |
|
||||
AnyAaaaRecord |
|
||||
AnyCnameRecord |
|
||||
AnyMxRecord |
|
||||
AnyNaptrRecord |
|
||||
AnyNsRecord |
|
||||
AnyPtrRecord |
|
||||
AnySoaRecord |
|
||||
AnySrvRecord |
|
||||
AnyTxtRecord;
|
||||
|
||||
function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
|
||||
function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
||||
function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
||||
function resolve(
|
||||
hostname: string,
|
||||
rrtype: string,
|
||||
callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void,
|
||||
): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
namespace resolve {
|
||||
function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
||||
function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
||||
function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
||||
function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
||||
function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||
}
|
||||
|
||||
function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
|
||||
function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
namespace resolve4 {
|
||||
function __promisify__(hostname: string): Promise<string[]>;
|
||||
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||
function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||
}
|
||||
|
||||
function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
|
||||
function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
namespace resolve6 {
|
||||
function __promisify__(hostname: string): Promise<string[]>;
|
||||
function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||
function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||
}
|
||||
|
||||
function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
namespace resolveCname {
|
||||
function __promisify__(hostname: string): Promise<string[]>;
|
||||
}
|
||||
|
||||
function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
|
||||
namespace resolveMx {
|
||||
function __promisify__(hostname: string): Promise<MxRecord[]>;
|
||||
}
|
||||
|
||||
function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
|
||||
namespace resolveNaptr {
|
||||
function __promisify__(hostname: string): Promise<NaptrRecord[]>;
|
||||
}
|
||||
|
||||
function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
namespace resolveNs {
|
||||
function __promisify__(hostname: string): Promise<string[]>;
|
||||
}
|
||||
|
||||
function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
|
||||
namespace resolvePtr {
|
||||
function __promisify__(hostname: string): Promise<string[]>;
|
||||
}
|
||||
|
||||
function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
|
||||
namespace resolveSoa {
|
||||
function __promisify__(hostname: string): Promise<SoaRecord>;
|
||||
}
|
||||
|
||||
function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
|
||||
namespace resolveSrv {
|
||||
function __promisify__(hostname: string): Promise<SrvRecord[]>;
|
||||
}
|
||||
|
||||
function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
|
||||
namespace resolveTxt {
|
||||
function __promisify__(hostname: string): Promise<string[][]>;
|
||||
}
|
||||
|
||||
function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
|
||||
namespace resolveAny {
|
||||
function __promisify__(hostname: string): Promise<AnyRecord[]>;
|
||||
}
|
||||
|
||||
function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
|
||||
function setServers(servers: ReadonlyArray<string>): void;
|
||||
function getServers(): string[];
|
||||
|
||||
// Error codes
|
||||
const NODATA: string;
|
||||
const FORMERR: string;
|
||||
const SERVFAIL: string;
|
||||
const NOTFOUND: string;
|
||||
const NOTIMP: string;
|
||||
const REFUSED: string;
|
||||
const BADQUERY: string;
|
||||
const BADNAME: string;
|
||||
const BADFAMILY: string;
|
||||
const BADRESP: string;
|
||||
const CONNREFUSED: string;
|
||||
const TIMEOUT: string;
|
||||
const EOF: string;
|
||||
const FILE: string;
|
||||
const NOMEM: string;
|
||||
const DESTRUCTION: string;
|
||||
const BADSTR: string;
|
||||
const BADFLAGS: string;
|
||||
const NONAME: string;
|
||||
const BADHINTS: string;
|
||||
const NOTINITIALIZED: string;
|
||||
const LOADIPHLPAPI: string;
|
||||
const ADDRGETNETWORKPARAMS: string;
|
||||
const CANCELLED: string;
|
||||
|
||||
class Resolver {
|
||||
getServers: typeof getServers;
|
||||
setServers: typeof setServers;
|
||||
resolve: typeof resolve;
|
||||
resolve4: typeof resolve4;
|
||||
resolve6: typeof resolve6;
|
||||
resolveAny: typeof resolveAny;
|
||||
resolveCname: typeof resolveCname;
|
||||
resolveMx: typeof resolveMx;
|
||||
resolveNaptr: typeof resolveNaptr;
|
||||
resolveNs: typeof resolveNs;
|
||||
resolvePtr: typeof resolvePtr;
|
||||
resolveSoa: typeof resolveSoa;
|
||||
resolveSrv: typeof resolveSrv;
|
||||
resolveTxt: typeof resolveTxt;
|
||||
reverse: typeof reverse;
|
||||
cancel(): void;
|
||||
}
|
||||
|
||||
namespace promises {
|
||||
function getServers(): string[];
|
||||
|
||||
function lookup(hostname: string, family: number): Promise<LookupAddress>;
|
||||
function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
|
||||
function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
|
||||
function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
|
||||
function lookup(hostname: string): Promise<LookupAddress>;
|
||||
|
||||
function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>;
|
||||
|
||||
function resolve(hostname: string): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
||||
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
||||
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
||||
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
||||
function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
|
||||
|
||||
function resolve4(hostname: string): Promise<string[]>;
|
||||
function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||
function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||
|
||||
function resolve6(hostname: string): Promise<string[]>;
|
||||
function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
|
||||
function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
|
||||
|
||||
function resolveAny(hostname: string): Promise<AnyRecord[]>;
|
||||
|
||||
function resolveCname(hostname: string): Promise<string[]>;
|
||||
|
||||
function resolveMx(hostname: string): Promise<MxRecord[]>;
|
||||
|
||||
function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
|
||||
|
||||
function resolveNs(hostname: string): Promise<string[]>;
|
||||
|
||||
function resolvePtr(hostname: string): Promise<string[]>;
|
||||
|
||||
function resolveSoa(hostname: string): Promise<SoaRecord>;
|
||||
|
||||
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
||||
|
||||
function resolveTxt(hostname: string): Promise<string[][]>;
|
||||
|
||||
function reverse(ip: string): Promise<string[]>;
|
||||
|
||||
function setServers(servers: ReadonlyArray<string>): void;
|
||||
|
||||
class Resolver {
|
||||
getServers: typeof getServers;
|
||||
resolve: typeof resolve;
|
||||
resolve4: typeof resolve4;
|
||||
resolve6: typeof resolve6;
|
||||
resolveAny: typeof resolveAny;
|
||||
resolveCname: typeof resolveCname;
|
||||
resolveMx: typeof resolveMx;
|
||||
resolveNaptr: typeof resolveNaptr;
|
||||
resolveNs: typeof resolveNs;
|
||||
resolvePtr: typeof resolvePtr;
|
||||
resolveSoa: typeof resolveSoa;
|
||||
resolveSrv: typeof resolveSrv;
|
||||
resolveTxt: typeof resolveTxt;
|
||||
reverse: typeof reverse;
|
||||
setServers: typeof setServers;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
node_modules/@types/node/domain.d.ts
generated
vendored
16
node_modules/@types/node/domain.d.ts
generated
vendored
@@ -1,16 +0,0 @@
|
||||
declare module "domain" {
|
||||
import * as events from "events";
|
||||
|
||||
class Domain extends events.EventEmitter implements NodeJS.Domain {
|
||||
run(fn: Function): void;
|
||||
add(emitter: events.EventEmitter): void;
|
||||
remove(emitter: events.EventEmitter): void;
|
||||
bind(cb: (err: Error, data: any) => any): any;
|
||||
intercept(cb: (data: any) => any): any;
|
||||
members: any[];
|
||||
enter(): void;
|
||||
exit(): void;
|
||||
}
|
||||
|
||||
function create(): Domain;
|
||||
}
|
||||
39
node_modules/@types/node/events.d.ts
generated
vendored
39
node_modules/@types/node/events.d.ts
generated
vendored
@@ -1,39 +0,0 @@
|
||||
declare module "events" {
|
||||
class internal extends NodeJS.EventEmitter { }
|
||||
|
||||
interface NodeEventTarget {
|
||||
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
}
|
||||
|
||||
interface DOMEventTarget {
|
||||
addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
|
||||
}
|
||||
|
||||
namespace internal {
|
||||
function once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
|
||||
function once(emitter: DOMEventTarget, event: string): Promise<any[]>;
|
||||
class EventEmitter extends internal {
|
||||
/** @deprecated since v4.0.0 */
|
||||
static listenerCount(emitter: EventEmitter, event: string | symbol): number;
|
||||
static defaultMaxListeners: number;
|
||||
|
||||
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
removeAllListeners(event?: string | symbol): this;
|
||||
setMaxListeners(n: number): this;
|
||||
getMaxListeners(): number;
|
||||
listeners(event: string | symbol): Function[];
|
||||
rawListeners(event: string | symbol): Function[];
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
eventNames(): Array<string | symbol>;
|
||||
listenerCount(type: string | symbol): number;
|
||||
}
|
||||
}
|
||||
|
||||
export = internal;
|
||||
}
|
||||
2302
node_modules/@types/node/fs.d.ts
generated
vendored
2302
node_modules/@types/node/fs.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
1006
node_modules/@types/node/globals.d.ts
generated
vendored
1006
node_modules/@types/node/globals.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
269
node_modules/@types/node/http.d.ts
generated
vendored
269
node_modules/@types/node/http.d.ts
generated
vendored
@@ -1,269 +0,0 @@
|
||||
declare module "http" {
|
||||
import * as events from "events";
|
||||
import * as net from "net";
|
||||
import * as stream from "stream";
|
||||
import { URL } from "url";
|
||||
|
||||
// incoming headers will never contain number
|
||||
interface IncomingHttpHeaders {
|
||||
'accept-patch'?: string;
|
||||
'accept-ranges'?: string;
|
||||
'accept'?: string;
|
||||
'access-control-allow-credentials'?: string;
|
||||
'access-control-allow-headers'?: string;
|
||||
'access-control-allow-methods'?: string;
|
||||
'access-control-allow-origin'?: string;
|
||||
'access-control-expose-headers'?: string;
|
||||
'access-control-max-age'?: string;
|
||||
'age'?: string;
|
||||
'allow'?: string;
|
||||
'alt-svc'?: string;
|
||||
'authorization'?: string;
|
||||
'cache-control'?: string;
|
||||
'connection'?: string;
|
||||
'content-disposition'?: string;
|
||||
'content-encoding'?: string;
|
||||
'content-language'?: string;
|
||||
'content-length'?: string;
|
||||
'content-location'?: string;
|
||||
'content-range'?: string;
|
||||
'content-type'?: string;
|
||||
'cookie'?: string;
|
||||
'date'?: string;
|
||||
'expect'?: string;
|
||||
'expires'?: string;
|
||||
'forwarded'?: string;
|
||||
'from'?: string;
|
||||
'host'?: string;
|
||||
'if-match'?: string;
|
||||
'if-modified-since'?: string;
|
||||
'if-none-match'?: string;
|
||||
'if-unmodified-since'?: string;
|
||||
'last-modified'?: string;
|
||||
'location'?: string;
|
||||
'pragma'?: string;
|
||||
'proxy-authenticate'?: string;
|
||||
'proxy-authorization'?: string;
|
||||
'public-key-pins'?: string;
|
||||
'range'?: string;
|
||||
'referer'?: string;
|
||||
'retry-after'?: string;
|
||||
'set-cookie'?: string[];
|
||||
'strict-transport-security'?: string;
|
||||
'tk'?: string;
|
||||
'trailer'?: string;
|
||||
'transfer-encoding'?: string;
|
||||
'upgrade'?: string;
|
||||
'user-agent'?: string;
|
||||
'vary'?: string;
|
||||
'via'?: string;
|
||||
'warning'?: string;
|
||||
'www-authenticate'?: string;
|
||||
[header: string]: string | string[] | undefined;
|
||||
}
|
||||
|
||||
// outgoing headers allows numbers (as they are converted internally to strings)
|
||||
interface OutgoingHttpHeaders {
|
||||
[header: string]: number | string | string[] | undefined;
|
||||
}
|
||||
|
||||
interface ClientRequestArgs {
|
||||
protocol?: string;
|
||||
host?: string;
|
||||
hostname?: string;
|
||||
family?: number;
|
||||
port?: number | string;
|
||||
defaultPort?: number | string;
|
||||
localAddress?: string;
|
||||
socketPath?: string;
|
||||
method?: string;
|
||||
path?: string;
|
||||
headers?: OutgoingHttpHeaders;
|
||||
auth?: string;
|
||||
agent?: Agent | boolean;
|
||||
_defaultAgent?: Agent;
|
||||
timeout?: number;
|
||||
setHost?: boolean;
|
||||
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
|
||||
createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: net.Socket) => void) => net.Socket;
|
||||
}
|
||||
|
||||
interface ServerOptions {
|
||||
IncomingMessage?: typeof IncomingMessage;
|
||||
ServerResponse?: typeof ServerResponse;
|
||||
}
|
||||
|
||||
type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
|
||||
|
||||
class Server extends net.Server {
|
||||
constructor(requestListener?: RequestListener);
|
||||
constructor(options: ServerOptions, requestListener?: RequestListener);
|
||||
|
||||
setTimeout(msecs?: number, callback?: () => void): this;
|
||||
setTimeout(callback: () => void): this;
|
||||
/**
|
||||
* Limits maximum incoming headers count. If set to 0, no limit will be applied.
|
||||
* @default 2000
|
||||
* {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
|
||||
*/
|
||||
maxHeadersCount: number | null;
|
||||
timeout: number;
|
||||
/**
|
||||
* Limit the amount of time the parser will wait to receive the complete HTTP headers.
|
||||
* @default 40000
|
||||
* {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
|
||||
*/
|
||||
headersTimeout: number;
|
||||
keepAliveTimeout: number;
|
||||
}
|
||||
|
||||
// https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js
|
||||
class OutgoingMessage extends stream.Writable {
|
||||
upgrading: boolean;
|
||||
chunkedEncoding: boolean;
|
||||
shouldKeepAlive: boolean;
|
||||
useChunkedEncodingByDefault: boolean;
|
||||
sendDate: boolean;
|
||||
finished: boolean;
|
||||
headersSent: boolean;
|
||||
connection: net.Socket;
|
||||
|
||||
constructor();
|
||||
|
||||
setTimeout(msecs: number, callback?: () => void): this;
|
||||
setHeader(name: string, value: number | string | string[]): void;
|
||||
getHeader(name: string): number | string | string[] | undefined;
|
||||
getHeaders(): OutgoingHttpHeaders;
|
||||
getHeaderNames(): string[];
|
||||
hasHeader(name: string): boolean;
|
||||
removeHeader(name: string): void;
|
||||
addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void;
|
||||
flushHeaders(): void;
|
||||
}
|
||||
|
||||
// https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256
|
||||
class ServerResponse extends OutgoingMessage {
|
||||
statusCode: number;
|
||||
statusMessage: string;
|
||||
|
||||
constructor(req: IncomingMessage);
|
||||
|
||||
assignSocket(socket: net.Socket): void;
|
||||
detachSocket(socket: net.Socket): void;
|
||||
// https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
|
||||
// no args in writeContinue callback
|
||||
writeContinue(callback?: () => void): void;
|
||||
writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): void;
|
||||
writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void;
|
||||
}
|
||||
|
||||
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
|
||||
class ClientRequest extends OutgoingMessage {
|
||||
connection: net.Socket;
|
||||
socket: net.Socket;
|
||||
aborted: number;
|
||||
|
||||
constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
||||
|
||||
method: string;
|
||||
path: string;
|
||||
abort(): void;
|
||||
onSocket(socket: net.Socket): void;
|
||||
setTimeout(timeout: number, callback?: () => void): this;
|
||||
setNoDelay(noDelay?: boolean): void;
|
||||
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
|
||||
}
|
||||
|
||||
class IncomingMessage extends stream.Readable {
|
||||
constructor(socket: net.Socket);
|
||||
|
||||
httpVersion: string;
|
||||
httpVersionMajor: number;
|
||||
httpVersionMinor: number;
|
||||
connection: net.Socket;
|
||||
headers: IncomingHttpHeaders;
|
||||
rawHeaders: string[];
|
||||
trailers: { [key: string]: string | undefined };
|
||||
rawTrailers: string[];
|
||||
setTimeout(msecs: number, callback?: () => void): this;
|
||||
/**
|
||||
* Only valid for request obtained from http.Server.
|
||||
*/
|
||||
method?: string;
|
||||
/**
|
||||
* Only valid for request obtained from http.Server.
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* Only valid for response obtained from http.ClientRequest.
|
||||
*/
|
||||
statusCode?: number;
|
||||
/**
|
||||
* Only valid for response obtained from http.ClientRequest.
|
||||
*/
|
||||
statusMessage?: string;
|
||||
socket: net.Socket;
|
||||
destroy(error?: Error): void;
|
||||
}
|
||||
|
||||
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;
|
||||
/**
|
||||
* Socket timeout in milliseconds. This will set the timeout after the socket is connected.
|
||||
*/
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
class Agent {
|
||||
maxFreeSockets: number;
|
||||
maxSockets: number;
|
||||
sockets: any;
|
||||
requests: any;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
const METHODS: string[];
|
||||
|
||||
const STATUS_CODES: {
|
||||
[errorCode: number]: string | undefined;
|
||||
[errorCode: string]: string | undefined;
|
||||
};
|
||||
|
||||
function createServer(requestListener?: RequestListener): Server;
|
||||
function createServer(options: ServerOptions, requestListener?: RequestListener): Server;
|
||||
function createClient(port?: number, host?: string): any;
|
||||
|
||||
// although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
|
||||
// create interface RequestOptions would make the naming more clear to developers
|
||||
interface RequestOptions extends ClientRequestArgs { }
|
||||
function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
||||
let globalAgent: Agent;
|
||||
}
|
||||
859
node_modules/@types/node/http2.d.ts
generated
vendored
859
node_modules/@types/node/http2.d.ts
generated
vendored
@@ -1,859 +0,0 @@
|
||||
declare module "http2" {
|
||||
import * as events from "events";
|
||||
import * as fs from "fs";
|
||||
import * as net from "net";
|
||||
import * as stream from "stream";
|
||||
import * as tls from "tls";
|
||||
import * as url from "url";
|
||||
|
||||
import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders } from "http";
|
||||
export { OutgoingHttpHeaders } from "http";
|
||||
|
||||
export interface IncomingHttpStatusHeader {
|
||||
":status"?: number;
|
||||
}
|
||||
|
||||
export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
|
||||
":path"?: string;
|
||||
":method"?: string;
|
||||
":authority"?: string;
|
||||
":scheme"?: string;
|
||||
}
|
||||
|
||||
// Http2Stream
|
||||
|
||||
export interface StreamPriorityOptions {
|
||||
exclusive?: boolean;
|
||||
parent?: number;
|
||||
weight?: number;
|
||||
silent?: boolean;
|
||||
}
|
||||
|
||||
export interface StreamState {
|
||||
localWindowSize?: number;
|
||||
state?: number;
|
||||
streamLocalClose?: number;
|
||||
streamRemoteClose?: number;
|
||||
sumDependencyWeight?: number;
|
||||
weight?: number;
|
||||
}
|
||||
|
||||
export interface ServerStreamResponseOptions {
|
||||
endStream?: boolean;
|
||||
waitForTrailers?: boolean;
|
||||
}
|
||||
|
||||
export interface StatOptions {
|
||||
offset: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export interface ServerStreamFileResponseOptions {
|
||||
statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean;
|
||||
getTrailers?: (trailers: OutgoingHttpHeaders) => void;
|
||||
offset?: number;
|
||||
length?: number;
|
||||
}
|
||||
|
||||
export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
|
||||
onError?: (err: NodeJS.ErrnoException) => void;
|
||||
}
|
||||
|
||||
export interface Http2Stream extends stream.Duplex {
|
||||
readonly aborted: boolean;
|
||||
readonly closed: boolean;
|
||||
readonly destroyed: boolean;
|
||||
readonly pending: boolean;
|
||||
readonly rstCode: number;
|
||||
readonly sentHeaders: OutgoingHttpHeaders;
|
||||
readonly sentInfoHeaders?: OutgoingHttpHeaders[];
|
||||
readonly sentTrailers?: OutgoingHttpHeaders;
|
||||
readonly session: Http2Session;
|
||||
readonly state: StreamState;
|
||||
/**
|
||||
* Set the true if the END_STREAM flag was set in the request or response HEADERS frame received,
|
||||
* indicating that no additional data should be received and the readable side of the Http2Stream will be closed.
|
||||
*/
|
||||
readonly endAfterHeaders: boolean;
|
||||
close(code?: number, callback?: () => void): void;
|
||||
priority(options: StreamPriorityOptions): void;
|
||||
setTimeout(msecs: number, callback?: () => void): void;
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "aborted", listener: () => void): this;
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
||||
addListener(event: "drain", listener: () => void): this;
|
||||
addListener(event: "end", listener: () => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "finish", listener: () => void): this;
|
||||
addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
||||
addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
|
||||
addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
||||
addListener(event: "streamClosed", listener: (code: number) => void): this;
|
||||
addListener(event: "timeout", listener: () => void): this;
|
||||
addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
addListener(event: "wantTrailers", listener: () => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "aborted"): boolean;
|
||||
emit(event: "close"): boolean;
|
||||
emit(event: "data", chunk: Buffer | string): boolean;
|
||||
emit(event: "drain"): boolean;
|
||||
emit(event: "end"): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
emit(event: "finish"): boolean;
|
||||
emit(event: "frameError", frameType: number, errorCode: number): boolean;
|
||||
emit(event: "pipe", src: stream.Readable): boolean;
|
||||
emit(event: "unpipe", src: stream.Readable): boolean;
|
||||
emit(event: "streamClosed", code: number): boolean;
|
||||
emit(event: "timeout"): boolean;
|
||||
emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean;
|
||||
emit(event: "wantTrailers"): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "aborted", listener: () => void): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "data", listener: (chunk: Buffer | string) => void): this;
|
||||
on(event: "drain", listener: () => void): this;
|
||||
on(event: "end", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "finish", listener: () => void): this;
|
||||
on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
||||
on(event: "pipe", listener: (src: stream.Readable) => void): this;
|
||||
on(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
||||
on(event: "streamClosed", listener: (code: number) => void): this;
|
||||
on(event: "timeout", listener: () => void): this;
|
||||
on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
on(event: "wantTrailers", listener: () => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "aborted", listener: () => void): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "data", listener: (chunk: Buffer | string) => void): this;
|
||||
once(event: "drain", listener: () => void): this;
|
||||
once(event: "end", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
once(event: "finish", listener: () => void): this;
|
||||
once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
||||
once(event: "pipe", listener: (src: stream.Readable) => void): this;
|
||||
once(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
||||
once(event: "streamClosed", listener: (code: number) => void): this;
|
||||
once(event: "timeout", listener: () => void): this;
|
||||
once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
once(event: "wantTrailers", listener: () => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "aborted", listener: () => void): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
||||
prependListener(event: "drain", listener: () => void): this;
|
||||
prependListener(event: "end", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependListener(event: "finish", listener: () => void): this;
|
||||
prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
||||
prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
|
||||
prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
||||
prependListener(event: "streamClosed", listener: (code: number) => void): this;
|
||||
prependListener(event: "timeout", listener: () => void): this;
|
||||
prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependListener(event: "wantTrailers", listener: () => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "aborted", listener: () => void): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
|
||||
prependOnceListener(event: "drain", listener: () => void): this;
|
||||
prependOnceListener(event: "end", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "finish", listener: () => void): this;
|
||||
prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
|
||||
prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
|
||||
prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
|
||||
prependOnceListener(event: "streamClosed", listener: (code: number) => void): this;
|
||||
prependOnceListener(event: "timeout", listener: () => void): this;
|
||||
prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependOnceListener(event: "wantTrailers", listener: () => void): this;
|
||||
|
||||
sendTrailers(headers: OutgoingHttpHeaders): this;
|
||||
}
|
||||
|
||||
export interface ClientHttp2Stream extends Http2Stream {
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
||||
emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean;
|
||||
emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
}
|
||||
|
||||
export interface ServerHttp2Stream extends Http2Stream {
|
||||
additionalHeaders(headers: OutgoingHttpHeaders): void;
|
||||
readonly headersSent: boolean;
|
||||
readonly pushAllowed: boolean;
|
||||
pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
|
||||
pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
|
||||
respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
|
||||
respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
|
||||
respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void;
|
||||
}
|
||||
|
||||
// Http2Session
|
||||
|
||||
export interface Settings {
|
||||
headerTableSize?: number;
|
||||
enablePush?: boolean;
|
||||
initialWindowSize?: number;
|
||||
maxFrameSize?: number;
|
||||
maxConcurrentStreams?: number;
|
||||
maxHeaderListSize?: number;
|
||||
}
|
||||
|
||||
export interface ClientSessionRequestOptions {
|
||||
endStream?: boolean;
|
||||
exclusive?: boolean;
|
||||
parent?: number;
|
||||
weight?: number;
|
||||
getTrailers?: (trailers: OutgoingHttpHeaders, flags: number) => void;
|
||||
}
|
||||
|
||||
export interface SessionState {
|
||||
effectiveLocalWindowSize?: number;
|
||||
effectiveRecvDataLength?: number;
|
||||
nextStreamID?: number;
|
||||
localWindowSize?: number;
|
||||
lastProcStreamID?: number;
|
||||
remoteWindowSize?: number;
|
||||
outboundQueueSize?: number;
|
||||
deflateDynamicTableSize?: number;
|
||||
inflateDynamicTableSize?: number;
|
||||
}
|
||||
|
||||
export interface Http2Session extends events.EventEmitter {
|
||||
readonly alpnProtocol?: string;
|
||||
close(callback?: () => void): void;
|
||||
readonly closed: boolean;
|
||||
readonly connecting: boolean;
|
||||
destroy(error?: Error, code?: number): void;
|
||||
readonly destroyed: boolean;
|
||||
readonly encrypted?: boolean;
|
||||
goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView | NodeJS.TypedArray): void;
|
||||
readonly localSettings: Settings;
|
||||
readonly originSet?: string[];
|
||||
readonly pendingSettingsAck: boolean;
|
||||
ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
|
||||
ping(payload: Buffer | DataView | NodeJS.TypedArray , callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
|
||||
ref(): void;
|
||||
readonly remoteSettings: Settings;
|
||||
rstStream(stream: Http2Stream, code?: number): void;
|
||||
setTimeout(msecs: number, callback?: () => void): void;
|
||||
readonly socket: net.Socket | tls.TLSSocket;
|
||||
readonly state: SessionState;
|
||||
priority(stream: Http2Stream, options: StreamPriorityOptions): void;
|
||||
settings(settings: Settings): void;
|
||||
readonly type: number;
|
||||
unref(): void;
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
||||
addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
||||
addListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
||||
addListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
||||
addListener(event: "timeout", listener: () => void): this;
|
||||
addListener(event: "ping", listener: () => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "close"): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean;
|
||||
emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean;
|
||||
emit(event: "localSettings", settings: Settings): boolean;
|
||||
emit(event: "remoteSettings", settings: Settings): boolean;
|
||||
emit(event: "timeout"): boolean;
|
||||
emit(event: "ping"): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
||||
on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
||||
on(event: "localSettings", listener: (settings: Settings) => void): this;
|
||||
on(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
||||
on(event: "timeout", listener: () => void): this;
|
||||
on(event: "ping", listener: () => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
||||
once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
||||
once(event: "localSettings", listener: (settings: Settings) => void): this;
|
||||
once(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
||||
once(event: "timeout", listener: () => void): this;
|
||||
once(event: "ping", listener: () => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
||||
prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
||||
prependListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
||||
prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
||||
prependListener(event: "timeout", listener: () => void): this;
|
||||
prependListener(event: "ping", listener: () => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
|
||||
prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
|
||||
prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this;
|
||||
prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
|
||||
prependOnceListener(event: "timeout", listener: () => void): this;
|
||||
prependOnceListener(event: "ping", listener: () => void): this;
|
||||
}
|
||||
|
||||
export interface ClientHttp2Session extends Http2Session {
|
||||
request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
|
||||
emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
||||
emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
|
||||
prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
|
||||
}
|
||||
|
||||
export interface AlternativeServiceOptions {
|
||||
origin: number | string | url.URL;
|
||||
}
|
||||
|
||||
export interface ServerHttp2Session extends Http2Session {
|
||||
altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
|
||||
readonly server: Http2Server | Http2SecureServer;
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
||||
emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
|
||||
prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
}
|
||||
|
||||
// Http2Server
|
||||
|
||||
export interface SessionOptions {
|
||||
maxDeflateDynamicTableSize?: number;
|
||||
maxReservedRemoteStreams?: number;
|
||||
maxSendHeaderBlockLength?: number;
|
||||
paddingStrategy?: number;
|
||||
peerMaxConcurrentStreams?: number;
|
||||
selectPadding?: (frameLen: number, maxFrameLen: number) => number;
|
||||
settings?: Settings;
|
||||
createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex;
|
||||
}
|
||||
|
||||
export type ClientSessionOptions = SessionOptions;
|
||||
export type ServerSessionOptions = SessionOptions;
|
||||
|
||||
export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { }
|
||||
export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { }
|
||||
|
||||
export interface ServerOptions extends ServerSessionOptions { }
|
||||
|
||||
export interface SecureServerOptions extends SecureServerSessionOptions {
|
||||
allowHTTP1?: boolean;
|
||||
}
|
||||
|
||||
export interface Http2Server extends net.Server {
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
addListener(event: "sessionError", listener: (err: Error) => void): this;
|
||||
addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
addListener(event: "timeout", listener: () => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
||||
emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
||||
emit(event: "sessionError", err: Error): boolean;
|
||||
emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
||||
emit(event: "timeout"): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
on(event: "sessionError", listener: (err: Error) => void): this;
|
||||
on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
on(event: "timeout", listener: () => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
once(event: "sessionError", listener: (err: Error) => void): this;
|
||||
once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
once(event: "timeout", listener: () => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
prependListener(event: "sessionError", listener: (err: Error) => void): this;
|
||||
prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependListener(event: "timeout", listener: () => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependOnceListener(event: "timeout", listener: () => void): this;
|
||||
}
|
||||
|
||||
export interface Http2SecureServer extends tls.Server {
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
addListener(event: "sessionError", listener: (err: Error) => void): this;
|
||||
addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
addListener(event: "timeout", listener: () => void): this;
|
||||
addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
||||
emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
|
||||
emit(event: "sessionError", err: Error): boolean;
|
||||
emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
|
||||
emit(event: "timeout"): boolean;
|
||||
emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
on(event: "sessionError", listener: (err: Error) => void): this;
|
||||
on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
on(event: "timeout", listener: () => void): this;
|
||||
on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
once(event: "sessionError", listener: (err: Error) => void): this;
|
||||
once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
once(event: "timeout", listener: () => void): this;
|
||||
once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
prependListener(event: "sessionError", listener: (err: Error) => void): this;
|
||||
prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependListener(event: "timeout", listener: () => void): this;
|
||||
prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
|
||||
prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
|
||||
prependOnceListener(event: "timeout", listener: () => void): this;
|
||||
prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
|
||||
}
|
||||
|
||||
export class Http2ServerRequest extends stream.Readable {
|
||||
private constructor();
|
||||
headers: IncomingHttpHeaders;
|
||||
httpVersion: string;
|
||||
method: string;
|
||||
rawHeaders: string[];
|
||||
rawTrailers: string[];
|
||||
setTimeout(msecs: number, callback?: () => void): void;
|
||||
socket: net.Socket | tls.TLSSocket;
|
||||
stream: ServerHttp2Stream;
|
||||
trailers: IncomingHttpHeaders;
|
||||
url: string;
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "aborted", hadError: boolean, code: number): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
}
|
||||
|
||||
export class Http2ServerResponse extends stream.Stream {
|
||||
private constructor();
|
||||
addTrailers(trailers: OutgoingHttpHeaders): void;
|
||||
connection: net.Socket | tls.TLSSocket;
|
||||
end(callback?: () => void): void;
|
||||
end(data?: string | Buffer, callback?: () => void): void;
|
||||
end(data?: string | Buffer, encoding?: string, callback?: () => void): void;
|
||||
readonly finished: boolean;
|
||||
getHeader(name: string): string;
|
||||
getHeaderNames(): string[];
|
||||
getHeaders(): OutgoingHttpHeaders;
|
||||
hasHeader(name: string): boolean;
|
||||
readonly headersSent: boolean;
|
||||
removeHeader(name: string): void;
|
||||
sendDate: boolean;
|
||||
setHeader(name: string, value: number | string | string[]): void;
|
||||
setTimeout(msecs: number, callback?: () => void): void;
|
||||
socket: net.Socket | tls.TLSSocket;
|
||||
statusCode: number;
|
||||
statusMessage: '';
|
||||
stream: ServerHttp2Stream;
|
||||
write(chunk: string | Buffer, callback?: (err: Error) => void): boolean;
|
||||
write(chunk: string | Buffer, encoding?: string, callback?: (err: Error) => void): boolean;
|
||||
writeContinue(): void;
|
||||
writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void;
|
||||
writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders): void;
|
||||
createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void;
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
addListener(event: "drain", listener: () => void): this;
|
||||
addListener(event: "error", listener: (error: Error) => void): this;
|
||||
addListener(event: "finish", listener: () => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "aborted", hadError: boolean, code: number): boolean;
|
||||
emit(event: "close"): boolean;
|
||||
emit(event: "drain"): boolean;
|
||||
emit(event: "error", error: Error): boolean;
|
||||
emit(event: "finish"): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "drain", listener: () => void): this;
|
||||
on(event: "error", listener: (error: Error) => void): this;
|
||||
on(event: "finish", listener: () => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "drain", listener: () => void): this;
|
||||
once(event: "error", listener: (error: Error) => void): this;
|
||||
once(event: "finish", listener: () => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "drain", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (error: Error) => void): this;
|
||||
prependListener(event: "finish", listener: () => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "drain", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
||||
prependOnceListener(event: "finish", listener: () => void): this;
|
||||
}
|
||||
|
||||
// Public API
|
||||
|
||||
export namespace constants {
|
||||
const NGHTTP2_SESSION_SERVER: number;
|
||||
const NGHTTP2_SESSION_CLIENT: number;
|
||||
const NGHTTP2_STREAM_STATE_IDLE: number;
|
||||
const NGHTTP2_STREAM_STATE_OPEN: number;
|
||||
const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number;
|
||||
const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number;
|
||||
const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number;
|
||||
const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number;
|
||||
const NGHTTP2_STREAM_STATE_CLOSED: number;
|
||||
const NGHTTP2_NO_ERROR: number;
|
||||
const NGHTTP2_PROTOCOL_ERROR: number;
|
||||
const NGHTTP2_INTERNAL_ERROR: number;
|
||||
const NGHTTP2_FLOW_CONTROL_ERROR: number;
|
||||
const NGHTTP2_SETTINGS_TIMEOUT: number;
|
||||
const NGHTTP2_STREAM_CLOSED: number;
|
||||
const NGHTTP2_FRAME_SIZE_ERROR: number;
|
||||
const NGHTTP2_REFUSED_STREAM: number;
|
||||
const NGHTTP2_CANCEL: number;
|
||||
const NGHTTP2_COMPRESSION_ERROR: number;
|
||||
const NGHTTP2_CONNECT_ERROR: number;
|
||||
const NGHTTP2_ENHANCE_YOUR_CALM: number;
|
||||
const NGHTTP2_INADEQUATE_SECURITY: number;
|
||||
const NGHTTP2_HTTP_1_1_REQUIRED: number;
|
||||
const NGHTTP2_ERR_FRAME_SIZE_ERROR: number;
|
||||
const NGHTTP2_FLAG_NONE: number;
|
||||
const NGHTTP2_FLAG_END_STREAM: number;
|
||||
const NGHTTP2_FLAG_END_HEADERS: number;
|
||||
const NGHTTP2_FLAG_ACK: number;
|
||||
const NGHTTP2_FLAG_PADDED: number;
|
||||
const NGHTTP2_FLAG_PRIORITY: number;
|
||||
const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number;
|
||||
const DEFAULT_SETTINGS_ENABLE_PUSH: number;
|
||||
const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number;
|
||||
const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number;
|
||||
const MAX_MAX_FRAME_SIZE: number;
|
||||
const MIN_MAX_FRAME_SIZE: number;
|
||||
const MAX_INITIAL_WINDOW_SIZE: number;
|
||||
const NGHTTP2_DEFAULT_WEIGHT: number;
|
||||
const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number;
|
||||
const NGHTTP2_SETTINGS_ENABLE_PUSH: number;
|
||||
const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number;
|
||||
const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number;
|
||||
const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number;
|
||||
const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number;
|
||||
const PADDING_STRATEGY_NONE: number;
|
||||
const PADDING_STRATEGY_MAX: number;
|
||||
const PADDING_STRATEGY_CALLBACK: number;
|
||||
const HTTP2_HEADER_STATUS: string;
|
||||
const HTTP2_HEADER_METHOD: string;
|
||||
const HTTP2_HEADER_AUTHORITY: string;
|
||||
const HTTP2_HEADER_SCHEME: string;
|
||||
const HTTP2_HEADER_PATH: string;
|
||||
const HTTP2_HEADER_ACCEPT_CHARSET: string;
|
||||
const HTTP2_HEADER_ACCEPT_ENCODING: string;
|
||||
const HTTP2_HEADER_ACCEPT_LANGUAGE: string;
|
||||
const HTTP2_HEADER_ACCEPT_RANGES: string;
|
||||
const HTTP2_HEADER_ACCEPT: string;
|
||||
const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string;
|
||||
const HTTP2_HEADER_AGE: string;
|
||||
const HTTP2_HEADER_ALLOW: string;
|
||||
const HTTP2_HEADER_AUTHORIZATION: string;
|
||||
const HTTP2_HEADER_CACHE_CONTROL: string;
|
||||
const HTTP2_HEADER_CONNECTION: string;
|
||||
const HTTP2_HEADER_CONTENT_DISPOSITION: string;
|
||||
const HTTP2_HEADER_CONTENT_ENCODING: string;
|
||||
const HTTP2_HEADER_CONTENT_LANGUAGE: string;
|
||||
const HTTP2_HEADER_CONTENT_LENGTH: string;
|
||||
const HTTP2_HEADER_CONTENT_LOCATION: string;
|
||||
const HTTP2_HEADER_CONTENT_MD5: string;
|
||||
const HTTP2_HEADER_CONTENT_RANGE: string;
|
||||
const HTTP2_HEADER_CONTENT_TYPE: string;
|
||||
const HTTP2_HEADER_COOKIE: string;
|
||||
const HTTP2_HEADER_DATE: string;
|
||||
const HTTP2_HEADER_ETAG: string;
|
||||
const HTTP2_HEADER_EXPECT: string;
|
||||
const HTTP2_HEADER_EXPIRES: string;
|
||||
const HTTP2_HEADER_FROM: string;
|
||||
const HTTP2_HEADER_HOST: string;
|
||||
const HTTP2_HEADER_IF_MATCH: string;
|
||||
const HTTP2_HEADER_IF_MODIFIED_SINCE: string;
|
||||
const HTTP2_HEADER_IF_NONE_MATCH: string;
|
||||
const HTTP2_HEADER_IF_RANGE: string;
|
||||
const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string;
|
||||
const HTTP2_HEADER_LAST_MODIFIED: string;
|
||||
const HTTP2_HEADER_LINK: string;
|
||||
const HTTP2_HEADER_LOCATION: string;
|
||||
const HTTP2_HEADER_MAX_FORWARDS: string;
|
||||
const HTTP2_HEADER_PREFER: string;
|
||||
const HTTP2_HEADER_PROXY_AUTHENTICATE: string;
|
||||
const HTTP2_HEADER_PROXY_AUTHORIZATION: string;
|
||||
const HTTP2_HEADER_RANGE: string;
|
||||
const HTTP2_HEADER_REFERER: string;
|
||||
const HTTP2_HEADER_REFRESH: string;
|
||||
const HTTP2_HEADER_RETRY_AFTER: string;
|
||||
const HTTP2_HEADER_SERVER: string;
|
||||
const HTTP2_HEADER_SET_COOKIE: string;
|
||||
const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string;
|
||||
const HTTP2_HEADER_TRANSFER_ENCODING: string;
|
||||
const HTTP2_HEADER_TE: string;
|
||||
const HTTP2_HEADER_UPGRADE: string;
|
||||
const HTTP2_HEADER_USER_AGENT: string;
|
||||
const HTTP2_HEADER_VARY: string;
|
||||
const HTTP2_HEADER_VIA: string;
|
||||
const HTTP2_HEADER_WWW_AUTHENTICATE: string;
|
||||
const HTTP2_HEADER_HTTP2_SETTINGS: string;
|
||||
const HTTP2_HEADER_KEEP_ALIVE: string;
|
||||
const HTTP2_HEADER_PROXY_CONNECTION: string;
|
||||
const HTTP2_METHOD_ACL: string;
|
||||
const HTTP2_METHOD_BASELINE_CONTROL: string;
|
||||
const HTTP2_METHOD_BIND: string;
|
||||
const HTTP2_METHOD_CHECKIN: string;
|
||||
const HTTP2_METHOD_CHECKOUT: string;
|
||||
const HTTP2_METHOD_CONNECT: string;
|
||||
const HTTP2_METHOD_COPY: string;
|
||||
const HTTP2_METHOD_DELETE: string;
|
||||
const HTTP2_METHOD_GET: string;
|
||||
const HTTP2_METHOD_HEAD: string;
|
||||
const HTTP2_METHOD_LABEL: string;
|
||||
const HTTP2_METHOD_LINK: string;
|
||||
const HTTP2_METHOD_LOCK: string;
|
||||
const HTTP2_METHOD_MERGE: string;
|
||||
const HTTP2_METHOD_MKACTIVITY: string;
|
||||
const HTTP2_METHOD_MKCALENDAR: string;
|
||||
const HTTP2_METHOD_MKCOL: string;
|
||||
const HTTP2_METHOD_MKREDIRECTREF: string;
|
||||
const HTTP2_METHOD_MKWORKSPACE: string;
|
||||
const HTTP2_METHOD_MOVE: string;
|
||||
const HTTP2_METHOD_OPTIONS: string;
|
||||
const HTTP2_METHOD_ORDERPATCH: string;
|
||||
const HTTP2_METHOD_PATCH: string;
|
||||
const HTTP2_METHOD_POST: string;
|
||||
const HTTP2_METHOD_PRI: string;
|
||||
const HTTP2_METHOD_PROPFIND: string;
|
||||
const HTTP2_METHOD_PROPPATCH: string;
|
||||
const HTTP2_METHOD_PUT: string;
|
||||
const HTTP2_METHOD_REBIND: string;
|
||||
const HTTP2_METHOD_REPORT: string;
|
||||
const HTTP2_METHOD_SEARCH: string;
|
||||
const HTTP2_METHOD_TRACE: string;
|
||||
const HTTP2_METHOD_UNBIND: string;
|
||||
const HTTP2_METHOD_UNCHECKOUT: string;
|
||||
const HTTP2_METHOD_UNLINK: string;
|
||||
const HTTP2_METHOD_UNLOCK: string;
|
||||
const HTTP2_METHOD_UPDATE: string;
|
||||
const HTTP2_METHOD_UPDATEREDIRECTREF: string;
|
||||
const HTTP2_METHOD_VERSION_CONTROL: string;
|
||||
const HTTP_STATUS_CONTINUE: number;
|
||||
const HTTP_STATUS_SWITCHING_PROTOCOLS: number;
|
||||
const HTTP_STATUS_PROCESSING: number;
|
||||
const HTTP_STATUS_OK: number;
|
||||
const HTTP_STATUS_CREATED: number;
|
||||
const HTTP_STATUS_ACCEPTED: number;
|
||||
const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number;
|
||||
const HTTP_STATUS_NO_CONTENT: number;
|
||||
const HTTP_STATUS_RESET_CONTENT: number;
|
||||
const HTTP_STATUS_PARTIAL_CONTENT: number;
|
||||
const HTTP_STATUS_MULTI_STATUS: number;
|
||||
const HTTP_STATUS_ALREADY_REPORTED: number;
|
||||
const HTTP_STATUS_IM_USED: number;
|
||||
const HTTP_STATUS_MULTIPLE_CHOICES: number;
|
||||
const HTTP_STATUS_MOVED_PERMANENTLY: number;
|
||||
const HTTP_STATUS_FOUND: number;
|
||||
const HTTP_STATUS_SEE_OTHER: number;
|
||||
const HTTP_STATUS_NOT_MODIFIED: number;
|
||||
const HTTP_STATUS_USE_PROXY: number;
|
||||
const HTTP_STATUS_TEMPORARY_REDIRECT: number;
|
||||
const HTTP_STATUS_PERMANENT_REDIRECT: number;
|
||||
const HTTP_STATUS_BAD_REQUEST: number;
|
||||
const HTTP_STATUS_UNAUTHORIZED: number;
|
||||
const HTTP_STATUS_PAYMENT_REQUIRED: number;
|
||||
const HTTP_STATUS_FORBIDDEN: number;
|
||||
const HTTP_STATUS_NOT_FOUND: number;
|
||||
const HTTP_STATUS_METHOD_NOT_ALLOWED: number;
|
||||
const HTTP_STATUS_NOT_ACCEPTABLE: number;
|
||||
const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number;
|
||||
const HTTP_STATUS_REQUEST_TIMEOUT: number;
|
||||
const HTTP_STATUS_CONFLICT: number;
|
||||
const HTTP_STATUS_GONE: number;
|
||||
const HTTP_STATUS_LENGTH_REQUIRED: number;
|
||||
const HTTP_STATUS_PRECONDITION_FAILED: number;
|
||||
const HTTP_STATUS_PAYLOAD_TOO_LARGE: number;
|
||||
const HTTP_STATUS_URI_TOO_LONG: number;
|
||||
const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number;
|
||||
const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number;
|
||||
const HTTP_STATUS_EXPECTATION_FAILED: number;
|
||||
const HTTP_STATUS_TEAPOT: number;
|
||||
const HTTP_STATUS_MISDIRECTED_REQUEST: number;
|
||||
const HTTP_STATUS_UNPROCESSABLE_ENTITY: number;
|
||||
const HTTP_STATUS_LOCKED: number;
|
||||
const HTTP_STATUS_FAILED_DEPENDENCY: number;
|
||||
const HTTP_STATUS_UNORDERED_COLLECTION: number;
|
||||
const HTTP_STATUS_UPGRADE_REQUIRED: number;
|
||||
const HTTP_STATUS_PRECONDITION_REQUIRED: number;
|
||||
const HTTP_STATUS_TOO_MANY_REQUESTS: number;
|
||||
const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number;
|
||||
const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number;
|
||||
const HTTP_STATUS_INTERNAL_SERVER_ERROR: number;
|
||||
const HTTP_STATUS_NOT_IMPLEMENTED: number;
|
||||
const HTTP_STATUS_BAD_GATEWAY: number;
|
||||
const HTTP_STATUS_SERVICE_UNAVAILABLE: number;
|
||||
const HTTP_STATUS_GATEWAY_TIMEOUT: number;
|
||||
const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number;
|
||||
const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number;
|
||||
const HTTP_STATUS_INSUFFICIENT_STORAGE: number;
|
||||
const HTTP_STATUS_LOOP_DETECTED: number;
|
||||
const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number;
|
||||
const HTTP_STATUS_NOT_EXTENDED: number;
|
||||
const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number;
|
||||
}
|
||||
|
||||
export function getDefaultSettings(): Settings;
|
||||
export function getPackedSettings(settings: Settings): Settings;
|
||||
export function getUnpackedSettings(buf: Buffer | Uint8Array): Settings;
|
||||
|
||||
export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
|
||||
export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
|
||||
|
||||
export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
|
||||
export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
|
||||
|
||||
export function connect(authority: string | url.URL, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
|
||||
export function connect(
|
||||
authority: string | url.URL,
|
||||
options?: ClientSessionOptions | SecureClientSessionOptions,
|
||||
listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
|
||||
): ClientHttp2Session;
|
||||
}
|
||||
51
node_modules/@types/node/https.d.ts
generated
vendored
51
node_modules/@types/node/https.d.ts
generated
vendored
@@ -1,51 +0,0 @@
|
||||
declare module "https" {
|
||||
import * as tls from "tls";
|
||||
import * as events from "events";
|
||||
import * as http from "http";
|
||||
import { URL } from "url";
|
||||
|
||||
type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
|
||||
|
||||
type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
|
||||
rejectUnauthorized?: boolean; // Defaults to true
|
||||
servername?: string; // SNI TLS Extension
|
||||
};
|
||||
|
||||
interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
||||
rejectUnauthorized?: boolean;
|
||||
maxCachedSessions?: number;
|
||||
}
|
||||
|
||||
class Agent extends http.Agent {
|
||||
constructor(options?: AgentOptions);
|
||||
options: AgentOptions;
|
||||
}
|
||||
|
||||
class Server extends tls.Server {
|
||||
constructor(options: ServerOptions, requestListener?: http.RequestListener);
|
||||
|
||||
setTimeout(callback: () => void): this;
|
||||
setTimeout(msecs?: number, callback?: () => void): this;
|
||||
/**
|
||||
* Limits maximum incoming headers count. If set to 0, no limit will be applied.
|
||||
* @default 2000
|
||||
* {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
|
||||
*/
|
||||
maxHeadersCount: number | null;
|
||||
timeout: number;
|
||||
/**
|
||||
* Limit the amount of time the parser will wait to receive the complete HTTP headers.
|
||||
* @default 40000
|
||||
* {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
|
||||
*/
|
||||
headersTimeout: number;
|
||||
keepAliveTimeout: number;
|
||||
}
|
||||
|
||||
function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
|
||||
function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
|
||||
let globalAgent: Agent;
|
||||
}
|
||||
93
node_modules/@types/node/index.d.ts
generated
vendored
93
node_modules/@types/node/index.d.ts
generated
vendored
@@ -1,93 +0,0 @@
|
||||
// Type definitions for Node.js 10.17
|
||||
// Project: http://nodejs.org/
|
||||
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
||||
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
||||
// Alberto Schiabel <https://github.com/jkomyno>
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Alvis HT Tang <https://github.com/alvis>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Bruno Scheufler <https://github.com/brunoscheufler>
|
||||
// Chigozirim C. <https://github.com/smac89>
|
||||
// Christian Vaagland Tellnes <https://github.com/tellnes>
|
||||
// Deividas Bakanas <https://github.com/DeividasBakanas>
|
||||
// Eugene Y. Q. Shen <https://github.com/eyqs>
|
||||
// Flarna <https://github.com/Flarna>
|
||||
// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Huw <https://github.com/hoo29>
|
||||
// Kelvin Jin <https://github.com/kjin>
|
||||
// Klaus Meinhardt <https://github.com/ajafff>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
|
||||
// Mohsen Azimi <https://github.com/mohsen1>
|
||||
// Nicolas Even <https://github.com/n-e>
|
||||
// Nicolas Voigt <https://github.com/octo-sniffle>
|
||||
// Nikita Galkin <https://github.com/galkin>
|
||||
// Parambir Singh <https://github.com/parambirs>
|
||||
// Sebastian Silbermann <https://github.com/eps1lon>
|
||||
// Simon Schick <https://github.com/SimonSchick>
|
||||
// Thomas den Hollander <https://github.com/ThomasdenH>
|
||||
// Wilco Bakker <https://github.com/WilcoBakker>
|
||||
// wwwy3y3 <https://github.com/wwwy3y3>
|
||||
// Zane Hannan AU <https://github.com/ZaneHannanAU>
|
||||
// Jeremie Rodriguez <https://github.com/jeremiergz>
|
||||
// Samuel Ainsworth <https://github.com/samuela>
|
||||
// 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>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.1.
|
||||
|
||||
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
||||
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
||||
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
|
||||
// - ~/ts3.1/index.d.ts - Definitions specific to TypeScript 3.1
|
||||
|
||||
// NOTE: Augmentations for TypeScript 3.1 and later should use individual files for overrides
|
||||
// within the respective ~/ts3.1 (or later) folder. However, this is disallowed for versions
|
||||
// prior to TypeScript 3.1, so the older definitions will be found here.
|
||||
|
||||
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
||||
/// <reference path="base.d.ts" />
|
||||
|
||||
// TypeScript 2.1-specific augmentations:
|
||||
|
||||
// Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
|
||||
interface MapConstructor { }
|
||||
interface WeakMapConstructor { }
|
||||
interface SetConstructor { }
|
||||
interface WeakSetConstructor { }
|
||||
interface Set<T> {}
|
||||
interface ReadonlySet<T> {}
|
||||
interface IteratorResult<T> { }
|
||||
interface Iterable<T> { }
|
||||
interface Iterator<T> {
|
||||
next(value?: any): IteratorResult<T>;
|
||||
}
|
||||
interface IterableIterator<T> { }
|
||||
interface AsyncIterableIterator<T> {}
|
||||
interface SymbolConstructor {
|
||||
readonly iterator: symbol;
|
||||
readonly asyncIterator: symbol;
|
||||
}
|
||||
declare var Symbol: SymbolConstructor;
|
||||
interface SharedArrayBuffer {
|
||||
readonly byteLength: number;
|
||||
slice(begin?: number, end?: number): SharedArrayBuffer;
|
||||
}
|
||||
|
||||
declare module "util" {
|
||||
namespace inspect {
|
||||
const custom: symbol;
|
||||
}
|
||||
namespace promisify {
|
||||
const custom: symbol;
|
||||
}
|
||||
namespace types {
|
||||
function isBigInt64Array(value: any): boolean;
|
||||
function isBigUint64Array(value: any): boolean;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user