@types/node 16.4.14 → 16.7.0
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/README.md +1 -1
- node/assert.d.ts +1 -531
- node/async_hooks.d.ts +16 -16
- node/base.d.ts +1 -1
- node/buffer.d.ts +398 -41
- node/child_process.d.ts +1 -1
- node/cluster.d.ts +13 -7
- node/console.d.ts +1 -1
- node/crypto.d.ts +71 -882
- node/dgram.d.ts +17 -8
- node/diagnostics_channel.d.ts +24 -7
- node/dns.d.ts +5 -1
- node/domain.d.ts +2 -2
- node/events.d.ts +183 -4
- node/fs/promises.d.ts +36 -20
- node/fs.d.ts +127 -62
- node/globals.d.ts +24 -13
- node/http.d.ts +67 -13
- node/http2.d.ts +1 -1
- node/https.d.ts +1 -1
- node/index.d.ts +1 -1
- node/inspector.d.ts +4 -5
- node/net.d.ts +2 -2
- node/os.d.ts +1 -1
- node/package.json +3 -3
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +3 -3
- node/process.d.ts +110 -35
- node/punycode.d.ts +2 -3
- node/querystring.d.ts +2 -2
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream/web.d.ts +6 -0
- node/stream.d.ts +2 -2
- node/string_decoder.d.ts +1 -1
- node/timers/promises.d.ts +0 -45
- node/timers.d.ts +1 -1
- node/tls.d.ts +4 -4
- node/trace_events.d.ts +1 -1
- node/ts3.6/base.d.ts +2 -1
- node/tty.d.ts +4 -4
- node/url.d.ts +37 -76
- node/util.d.ts +3 -3
- node/v8.d.ts +1 -1
- node/vm.d.ts +2 -2
- node/wasi.d.ts +4 -24
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
node/async_hooks.d.ts
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
* can be accessed using:
|
|
4
4
|
*
|
|
5
5
|
* ```js
|
|
6
|
-
*
|
|
6
|
+
* import async_hooks from 'async_hooks';
|
|
7
7
|
* ```
|
|
8
8
|
* @experimental
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/async_hooks.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'async_hooks' {
|
|
12
12
|
/**
|
|
13
13
|
* ```js
|
|
14
|
-
*
|
|
14
|
+
* import { executionAsyncId } from 'async_hooks';
|
|
15
15
|
*
|
|
16
|
-
* console.log(
|
|
16
|
+
* console.log(executionAsyncId()); // 1 - bootstrap
|
|
17
17
|
* fs.open(path, 'r', (err, fd) => {
|
|
18
|
-
* console.log(
|
|
18
|
+
* console.log(executionAsyncId()); // 6 - open()
|
|
19
19
|
* });
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
@@ -51,11 +51,11 @@ declare module 'async_hooks' {
|
|
|
51
51
|
* but having an object representing the top-level can be helpful.
|
|
52
52
|
*
|
|
53
53
|
* ```js
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* import { open } from 'fs';
|
|
55
|
+
* import { executionAsyncId, executionAsyncResource } from 'async_hooks';
|
|
56
56
|
*
|
|
57
57
|
* console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
|
|
58
|
-
* open(
|
|
58
|
+
* open(new URL(import.meta.url), 'r', (err, fd) => {
|
|
59
59
|
* console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap
|
|
60
60
|
* });
|
|
61
61
|
* ```
|
|
@@ -64,12 +64,12 @@ declare module 'async_hooks' {
|
|
|
64
64
|
* use of a tracking `Map` to store the metadata:
|
|
65
65
|
*
|
|
66
66
|
* ```js
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* import { createServer } from 'http';
|
|
68
|
+
* import {
|
|
69
69
|
* executionAsyncId,
|
|
70
70
|
* executionAsyncResource,
|
|
71
71
|
* createHook
|
|
72
|
-
* }
|
|
72
|
+
* } from 'async_hooks';
|
|
73
73
|
* const sym = Symbol('state'); // Private symbol to avoid pollution
|
|
74
74
|
*
|
|
75
75
|
* createHook({
|
|
@@ -167,9 +167,9 @@ declare module 'async_hooks' {
|
|
|
167
167
|
* specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
|
|
168
168
|
*
|
|
169
169
|
* ```js
|
|
170
|
-
*
|
|
170
|
+
* import { createHook } from 'async_hooks';
|
|
171
171
|
*
|
|
172
|
-
* const asyncHook =
|
|
172
|
+
* const asyncHook = createHook({
|
|
173
173
|
* init(asyncId, type, triggerAsyncId, resource) { },
|
|
174
174
|
* destroy(asyncId) { }
|
|
175
175
|
* });
|
|
@@ -223,7 +223,7 @@ declare module 'async_hooks' {
|
|
|
223
223
|
* The following is an overview of the `AsyncResource` API.
|
|
224
224
|
*
|
|
225
225
|
* ```js
|
|
226
|
-
*
|
|
226
|
+
* import { AsyncResource, executionAsyncId } from 'async_hooks';
|
|
227
227
|
*
|
|
228
228
|
* // AsyncResource() is meant to be extended. Instantiating a
|
|
229
229
|
* // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
|
|
@@ -331,8 +331,8 @@ declare module 'async_hooks' {
|
|
|
331
331
|
* logged within each request.
|
|
332
332
|
*
|
|
333
333
|
* ```js
|
|
334
|
-
*
|
|
335
|
-
*
|
|
334
|
+
* import http from 'http';
|
|
335
|
+
* import { AsyncLocalStorage } from 'async_hooks';
|
|
336
336
|
*
|
|
337
337
|
* const asyncLocalStorage = new AsyncLocalStorage();
|
|
338
338
|
*
|
node/base.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
|
|
8
8
|
|
|
9
9
|
// Reference required types from the default lib:
|
|
10
|
-
/// <reference lib="
|
|
10
|
+
/// <reference lib="es2020" />
|
|
11
11
|
/// <reference lib="esnext.asynciterable" />
|
|
12
12
|
/// <reference lib="esnext.intl" />
|
|
13
13
|
/// <reference lib="esnext.bigint" />
|