@types/node 12.20.41 → 13.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node v12.20/LICENSE → node/LICENSE +21 -21
- node/README.md +16 -0
- node/assert.d.ts +50 -0
- node/async_hooks.d.ts +132 -0
- node/base.d.ts +41 -0
- node v12.20/buffer.d.ts → node/buffer.d.ts +1 -1
- node v12.20/child_process.d.ts → node/child_process.d.ts +111 -113
- node v12.20/cluster.d.ts → node/cluster.d.ts +25 -19
- node/console.d.ts +3 -0
- node/constants.d.ts +8 -0
- node/crypto.d.ts +615 -0
- node v12.20/dgram.d.ts → node/dgram.d.ts +48 -25
- node v12.20/dns.d.ts → node/dns.d.ts +6 -12
- node v12.20/domain.d.ts → node/domain.d.ts +2 -2
- node/events.d.ts +40 -0
- node v12.20/fs.d.ts → node/fs.d.ts +162 -262
- node v12.20/globals.d.ts → node/globals.d.ts +104 -260
- node v12.20/http.d.ts → node/http.d.ts +102 -177
- node v12.20/http2.d.ts → node/http2.d.ts +82 -87
- node/https.d.ts +53 -0
- node/index.d.ts +83 -0
- node v12.20/inspector.d.ts → node/inspector.d.ts +153 -159
- node/module.d.ts +20 -0
- node v12.20/net.d.ts → node/net.d.ts +37 -47
- node/os.d.ts +231 -0
- node v12.20/package.json → node/package.json +45 -9
- node/path.d.ts +153 -0
- node v12.20/perf_hooks.d.ts → node/perf_hooks.d.ts +76 -31
- node v12.20/process.d.ts → node/process.d.ts +2 -2
- node/punycode.d.ts +12 -0
- node v12.20/querystring.d.ts → node/querystring.d.ts +5 -5
- node v12.20/readline.d.ts → node/readline.d.ts +16 -17
- node v12.20/repl.d.ts → node/repl.d.ts +24 -32
- node v12.20/stream.d.ts → node/stream.d.ts +33 -43
- node v12.20/string_decoder.d.ts → node/string_decoder.d.ts +1 -1
- node v12.20/timers.d.ts → node/timers.d.ts +1 -1
- node v12.20/tls.d.ts → node/tls.d.ts +54 -65
- node v12.20/trace_events.d.ts → node/trace_events.d.ts +1 -1
- node/ts3.2/fs.d.ts +33 -0
- node/ts3.2/globals.d.ts +19 -0
- node/ts3.2/index.d.ts +16 -0
- node/ts3.2/util.d.ts +9 -0
- node v12.20/tty.d.ts → node/tty.d.ts +3 -3
- node v12.20/url.d.ts → node/url.d.ts +17 -24
- node v12.20/util.d.ts → node/util.d.ts +22 -37
- node v12.20/v8.d.ts → node/v8.d.ts +2 -12
- node v12.20/vm.d.ts → node/vm.d.ts +22 -24
- node v12.20/worker_threads.d.ts → node/worker_threads.d.ts +39 -85
- node v12.20/zlib.d.ts → node/zlib.d.ts +134 -138
- node v12.20/README.md +0 -16
- node v12.20/assert.d.ts +0 -117
- node v12.20/async_hooks.d.ts +0 -246
- node v12.20/console.d.ts +0 -3
- node v12.20/constants.d.ts +0 -448
- node v12.20/crypto.d.ts +0 -1159
- node v12.20/events.d.ts +0 -47
- node v12.20/globals.global.d.ts +0 -1
- node v12.20/https.d.ts +0 -156
- node v12.20/index.d.ts +0 -91
- node v12.20/module.d.ts +0 -3
- node v12.20/os.d.ts +0 -263
- node v12.20/path.d.ts +0 -159
- node v12.20/punycode.d.ts +0 -75
- node v12.20/wasi.d.ts +0 -55
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
node/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
> `npm install --save @types/node`
|
|
3
|
+
|
|
4
|
+
# Summary
|
|
5
|
+
This package contains type definitions for Node.js (http://nodejs.org/).
|
|
6
|
+
|
|
7
|
+
# Details
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
|
+
|
|
10
|
+
### Additional Details
|
|
11
|
+
* Last updated: Mon, 30 Dec 2019 17:40:37 GMT
|
|
12
|
+
* Dependencies: none
|
|
13
|
+
* Global values: `Buffer`, `Symbol`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
|
|
14
|
+
|
|
15
|
+
# Credits
|
|
16
|
+
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), Benjamin Toueg (https://github.com/btoueg), Bruno Scheufler (https://github.com/brunoscheufler), Chigozirim C. (https://github.com/smac89), Christian Vaagland Tellnes (https://github.com/tellnes), David Junger (https://github.com/touffy), 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), 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), Marcin Kopacz (https://github.com/chyzwar), Trivikram Kamat (https://github.com/trivikr), Minh Son Nguyen (https://github.com/nguymin4), Junxiao Shi (https://github.com/yoursunny), and Ilia Baryshnikov (https://github.com/qwelias).
|
node/assert.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare module "assert" {
|
|
2
|
+
function internal(value: any, message?: string | Error): void;
|
|
3
|
+
namespace internal {
|
|
4
|
+
class AssertionError implements Error {
|
|
5
|
+
name: string;
|
|
6
|
+
message: string;
|
|
7
|
+
actual: any;
|
|
8
|
+
expected: any;
|
|
9
|
+
operator: string;
|
|
10
|
+
generatedMessage: boolean;
|
|
11
|
+
code: 'ERR_ASSERTION';
|
|
12
|
+
|
|
13
|
+
constructor(options?: {
|
|
14
|
+
message?: string; actual?: any; expected?: any;
|
|
15
|
+
operator?: string; stackStartFn?: Function
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type AssertPredicate = RegExp | (new() => object) | ((thrown: any) => boolean) | object | Error;
|
|
20
|
+
|
|
21
|
+
function fail(message?: string | Error): never;
|
|
22
|
+
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
|
23
|
+
function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
|
|
24
|
+
function ok(value: any, message?: string | Error): void;
|
|
25
|
+
function equal(actual: any, expected: any, message?: string | Error): void;
|
|
26
|
+
function notEqual(actual: any, expected: any, message?: string | Error): void;
|
|
27
|
+
function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
|
28
|
+
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
|
29
|
+
function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
|
30
|
+
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
|
31
|
+
function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
|
32
|
+
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
|
33
|
+
|
|
34
|
+
function throws(block: () => any, message?: string | Error): void;
|
|
35
|
+
function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
|
36
|
+
function doesNotThrow(block: () => any, message?: string | Error): void;
|
|
37
|
+
function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
|
|
38
|
+
|
|
39
|
+
function ifError(value: any): void;
|
|
40
|
+
|
|
41
|
+
function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
|
42
|
+
function rejects(block: (() => Promise<any>) | Promise<any>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
|
43
|
+
function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
|
44
|
+
function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
|
|
45
|
+
|
|
46
|
+
const strict: typeof internal;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export = internal;
|
|
50
|
+
}
|
node/async_hooks.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Async Hooks module: https://nodejs.org/api/async_hooks.html
|
|
3
|
+
*/
|
|
4
|
+
declare module "async_hooks" {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the asyncId of the current execution context.
|
|
7
|
+
*/
|
|
8
|
+
function executionAsyncId(): number;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Returns the ID of the resource responsible for calling the callback that is currently being executed.
|
|
12
|
+
*/
|
|
13
|
+
function triggerAsyncId(): number;
|
|
14
|
+
|
|
15
|
+
interface HookCallbacks {
|
|
16
|
+
/**
|
|
17
|
+
* Called when a class is constructed that has the possibility to emit an asynchronous event.
|
|
18
|
+
* @param asyncId a unique ID for the async resource
|
|
19
|
+
* @param type the type of the async resource
|
|
20
|
+
* @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
|
|
21
|
+
* @param resource reference to the resource representing the async operation, needs to be released during destroy
|
|
22
|
+
*/
|
|
23
|
+
init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* When an asynchronous operation is initiated or completes a callback is called to notify the user.
|
|
27
|
+
* The before callback is called just before said callback is executed.
|
|
28
|
+
* @param asyncId the unique identifier assigned to the resource about to execute the callback.
|
|
29
|
+
*/
|
|
30
|
+
before?(asyncId: number): void;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Called immediately after the callback specified in before is completed.
|
|
34
|
+
* @param asyncId the unique identifier assigned to the resource which has executed the callback.
|
|
35
|
+
*/
|
|
36
|
+
after?(asyncId: number): void;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Called when a promise has resolve() called. This may not be in the same execution id
|
|
40
|
+
* as the promise itself.
|
|
41
|
+
* @param asyncId the unique id for the promise that was resolve()d.
|
|
42
|
+
*/
|
|
43
|
+
promiseResolve?(asyncId: number): void;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Called after the resource corresponding to asyncId is destroyed
|
|
47
|
+
* @param asyncId a unique ID for the async resource
|
|
48
|
+
*/
|
|
49
|
+
destroy?(asyncId: number): void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface AsyncHook {
|
|
53
|
+
/**
|
|
54
|
+
* Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
|
|
55
|
+
*/
|
|
56
|
+
enable(): this;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 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.
|
|
60
|
+
*/
|
|
61
|
+
disable(): this;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Registers functions to be called for different lifetime events of each async operation.
|
|
66
|
+
* @param options the callbacks to register
|
|
67
|
+
* @return an AsyncHooks instance used for disabling and enabling hooks
|
|
68
|
+
*/
|
|
69
|
+
function createHook(options: HookCallbacks): AsyncHook;
|
|
70
|
+
|
|
71
|
+
interface AsyncResourceOptions {
|
|
72
|
+
/**
|
|
73
|
+
* The ID of the execution context that created this async event.
|
|
74
|
+
* Default: `executionAsyncId()`
|
|
75
|
+
*/
|
|
76
|
+
triggerAsyncId?: number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Disables automatic `emitDestroy` when the object is garbage collected.
|
|
80
|
+
* This usually does not need to be set (even if `emitDestroy` is called
|
|
81
|
+
* manually), unless the resource's `asyncId` is retrieved and the
|
|
82
|
+
* sensitive API's `emitDestroy` is called with it.
|
|
83
|
+
* Default: `false`
|
|
84
|
+
*/
|
|
85
|
+
requireManualDestroy?: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The class AsyncResource was designed to be extended by the embedder's async resources.
|
|
90
|
+
* Using this users can easily trigger the lifetime events of their own resources.
|
|
91
|
+
*/
|
|
92
|
+
class AsyncResource {
|
|
93
|
+
/**
|
|
94
|
+
* AsyncResource() is meant to be extended. Instantiating a
|
|
95
|
+
* new AsyncResource() also triggers init. If triggerAsyncId is omitted then
|
|
96
|
+
* async_hook.executionAsyncId() is used.
|
|
97
|
+
* @param type The type of async event.
|
|
98
|
+
* @param triggerAsyncId The ID of the execution context that created
|
|
99
|
+
* this async event (default: `executionAsyncId()`), or an
|
|
100
|
+
* AsyncResourceOptions object (since 9.3)
|
|
101
|
+
*/
|
|
102
|
+
constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Call the provided function with the provided arguments in the
|
|
106
|
+
* execution context of the async resource. This will establish the
|
|
107
|
+
* context, trigger the AsyncHooks before callbacks, call the function,
|
|
108
|
+
* trigger the AsyncHooks after callbacks, and then restore the original
|
|
109
|
+
* execution context.
|
|
110
|
+
* @param fn The function to call in the execution context of this
|
|
111
|
+
* async resource.
|
|
112
|
+
* @param thisArg The receiver to be used for the function call.
|
|
113
|
+
* @param args Optional arguments to pass to the function.
|
|
114
|
+
*/
|
|
115
|
+
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Call AsyncHooks destroy callbacks.
|
|
119
|
+
*/
|
|
120
|
+
emitDestroy(): void;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @return the unique ID assigned to this AsyncResource instance.
|
|
124
|
+
*/
|
|
125
|
+
asyncId(): number;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @return the trigger ID for this AsyncResource instance.
|
|
129
|
+
*/
|
|
130
|
+
triggerAsyncId(): number;
|
|
131
|
+
}
|
|
132
|
+
}
|
node/base.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// base definnitions for all NodeJS modules that are not specific to any version of TypeScript
|
|
2
|
+
/// <reference path="globals.d.ts" />
|
|
3
|
+
/// <reference path="assert.d.ts" />
|
|
4
|
+
/// <reference path="async_hooks.d.ts" />
|
|
5
|
+
/// <reference path="buffer.d.ts" />
|
|
6
|
+
/// <reference path="child_process.d.ts" />
|
|
7
|
+
/// <reference path="cluster.d.ts" />
|
|
8
|
+
/// <reference path="console.d.ts" />
|
|
9
|
+
/// <reference path="constants.d.ts" />
|
|
10
|
+
/// <reference path="crypto.d.ts" />
|
|
11
|
+
/// <reference path="dgram.d.ts" />
|
|
12
|
+
/// <reference path="dns.d.ts" />
|
|
13
|
+
/// <reference path="domain.d.ts" />
|
|
14
|
+
/// <reference path="events.d.ts" />
|
|
15
|
+
/// <reference path="fs.d.ts" />
|
|
16
|
+
/// <reference path="http.d.ts" />
|
|
17
|
+
/// <reference path="http2.d.ts" />
|
|
18
|
+
/// <reference path="https.d.ts" />
|
|
19
|
+
/// <reference path="inspector.d.ts" />
|
|
20
|
+
/// <reference path="module.d.ts" />
|
|
21
|
+
/// <reference path="net.d.ts" />
|
|
22
|
+
/// <reference path="os.d.ts" />
|
|
23
|
+
/// <reference path="path.d.ts" />
|
|
24
|
+
/// <reference path="perf_hooks.d.ts" />
|
|
25
|
+
/// <reference path="process.d.ts" />
|
|
26
|
+
/// <reference path="punycode.d.ts" />
|
|
27
|
+
/// <reference path="querystring.d.ts" />
|
|
28
|
+
/// <reference path="readline.d.ts" />
|
|
29
|
+
/// <reference path="repl.d.ts" />
|
|
30
|
+
/// <reference path="stream.d.ts" />
|
|
31
|
+
/// <reference path="string_decoder.d.ts" />
|
|
32
|
+
/// <reference path="timers.d.ts" />
|
|
33
|
+
/// <reference path="tls.d.ts" />
|
|
34
|
+
/// <reference path="trace_events.d.ts" />
|
|
35
|
+
/// <reference path="tty.d.ts" />
|
|
36
|
+
/// <reference path="url.d.ts" />
|
|
37
|
+
/// <reference path="util.d.ts" />
|
|
38
|
+
/// <reference path="v8.d.ts" />
|
|
39
|
+
/// <reference path="vm.d.ts" />
|
|
40
|
+
/// <reference path="worker_threads.d.ts" />
|
|
41
|
+
/// <reference path="zlib.d.ts" />
|