@types/node 17.0.45 → 18.0.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 v17.0 → node}/LICENSE +0 -0
- node v17.0/README.md → node/README.md +3 -3
- {node v17.0 → node}/assert/strict.d.ts +0 -0
- node v17.0/assert.d.ts → node/assert.d.ts +7 -8
- node v17.0/async_hooks.d.ts → node/async_hooks.d.ts +2 -2
- node v17.0/buffer.d.ts → node/buffer.d.ts +11 -5
- node v17.0/child_process.d.ts → node/child_process.d.ts +6 -3
- node v17.0/cluster.d.ts → node/cluster.d.ts +14 -18
- node v17.0/console.d.ts → node/console.d.ts +1 -1
- {node v17.0 → node}/constants.d.ts +0 -0
- node v17.0/crypto.d.ts → node/crypto.d.ts +109 -37
- node v17.0/dgram.d.ts → node/dgram.d.ts +2 -2
- node v17.0/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +2 -1
- node v17.0/dns/promises.d.ts → node/dns/promises.d.ts +2 -2
- node v17.0/dns.d.ts → node/dns.d.ts +2 -2
- node v17.0/domain.d.ts → node/domain.d.ts +3 -2
- node v17.0/events.d.ts → node/events.d.ts +17 -27
- node v17.0/fs/promises.d.ts → node/fs/promises.d.ts +40 -17
- node v17.0/fs.d.ts → node/fs.d.ts +33 -44
- {node v17.0 → node}/globals.d.ts +0 -0
- {node v17.0 → node}/globals.global.d.ts +0 -0
- node v17.0/http.d.ts → node/http.d.ts +79 -23
- node v17.0/http2.d.ts → node/http2.d.ts +7 -2
- node v17.0/https.d.ts → node/https.d.ts +11 -1
- node v17.0/index.d.ts → node/index.d.ts +3 -1
- node v17.0/inspector.d.ts → node/inspector.d.ts +10 -13
- {node v17.0 → node}/module.d.ts +0 -0
- node v17.0/net.d.ts → node/net.d.ts +32 -7
- node v17.0/os.d.ts → node/os.d.ts +5 -4
- node v17.0/package.json → node/package.json +7 -2
- node v17.0/path.d.ts → node/path.d.ts +1 -1
- node v17.0/perf_hooks.d.ts → node/perf_hooks.d.ts +10 -2
- node v17.0/process.d.ts → node/process.d.ts +14 -13
- node v17.0/punycode.d.ts → node/punycode.d.ts +1 -1
- node v17.0/querystring.d.ts → node/querystring.d.ts +1 -1
- node v17.0/readline.d.ts → node/readline.d.ts +2 -2
- node v17.0/repl.d.ts → node/repl.d.ts +2 -2
- {node v17.0 → node}/stream/consumers.d.ts +0 -0
- {node v17.0 → node}/stream/promises.d.ts +0 -0
- {node v17.0 → node}/stream/web.d.ts +0 -0
- node v17.0/stream.d.ts → node/stream.d.ts +65 -15
- node v17.0/string_decoder.d.ts → node/string_decoder.d.ts +1 -1
- node/test.d.ts +142 -0
- {node v17.0 → node}/timers/promises.d.ts +0 -0
- node v17.0/timers.d.ts → node/timers.d.ts +3 -3
- node v17.0/tls.d.ts → node/tls.d.ts +18 -10
- node v17.0/trace_events.d.ts → node/trace_events.d.ts +11 -1
- node v17.0/tty.d.ts → node/tty.d.ts +4 -2
- node v17.0/url.d.ts → node/url.d.ts +25 -19
- node v17.0/util.d.ts → node/util.d.ts +20 -9
- node v17.0/v8.d.ts → node/v8.d.ts +19 -1
- node v17.0/vm.d.ts → node/vm.d.ts +5 -3
- node v17.0/wasi.d.ts → node/wasi.d.ts +1 -1
- node v17.0/worker_threads.d.ts → node/worker_threads.d.ts +2 -5
- node v17.0/zlib.d.ts → node/zlib.d.ts +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* ```js
|
|
5
5
|
* const v8 = require('v8');
|
|
6
6
|
* ```
|
|
7
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
7
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/v8.js)
|
|
8
8
|
*/
|
|
9
9
|
declare module 'v8' {
|
|
10
10
|
import { Readable } from 'node:stream';
|
|
@@ -163,6 +163,13 @@ declare module 'v8' {
|
|
|
163
163
|
* Chrome DevTools. The JSON schema is undocumented and specific to the
|
|
164
164
|
* V8 engine. Therefore, the schema may change from one version of V8 to the next.
|
|
165
165
|
*
|
|
166
|
+
* Creating a heap snapshot requires memory about twice the size of the heap at
|
|
167
|
+
* the time the snapshot is created. This results in the risk of OOM killers
|
|
168
|
+
* terminating the process.
|
|
169
|
+
*
|
|
170
|
+
* Generating a snapshot is a synchronous operation which blocks the event loop
|
|
171
|
+
* for a duration depending on the heap size.
|
|
172
|
+
*
|
|
166
173
|
* ```js
|
|
167
174
|
* // Print heap snapshot to the console
|
|
168
175
|
* const v8 = require('v8');
|
|
@@ -182,6 +189,13 @@ declare module 'v8' {
|
|
|
182
189
|
* A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will
|
|
183
190
|
* not contain any information about the workers, and vice versa.
|
|
184
191
|
*
|
|
192
|
+
* Creating a heap snapshot requires memory about twice the size of the heap at
|
|
193
|
+
* the time the snapshot is created. This results in the risk of OOM killers
|
|
194
|
+
* terminating the process.
|
|
195
|
+
*
|
|
196
|
+
* Generating a snapshot is a synchronous operation which blocks the event loop
|
|
197
|
+
* for a duration depending on the heap size.
|
|
198
|
+
*
|
|
185
199
|
* ```js
|
|
186
200
|
* const { writeHeapSnapshot } = require('v8');
|
|
187
201
|
* const {
|
|
@@ -344,6 +358,10 @@ declare module 'v8' {
|
|
|
344
358
|
class DefaultDeserializer extends Deserializer {}
|
|
345
359
|
/**
|
|
346
360
|
* Uses a `DefaultSerializer` to serialize `value` into a buffer.
|
|
361
|
+
*
|
|
362
|
+
* `ERR_BUFFER_TOO_LARGE` will be thrown when trying to
|
|
363
|
+
* serialize a huge object which requires buffer
|
|
364
|
+
* larger than `buffer.constants.MAX_LENGTH`.
|
|
347
365
|
* @since v8.0.0
|
|
348
366
|
*/
|
|
349
367
|
function serialize(value: any): Buffer;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `vm` module enables compiling and running code within V8 Virtual
|
|
3
|
-
* Machine contexts.
|
|
4
|
-
*
|
|
3
|
+
* Machine contexts.
|
|
4
|
+
*
|
|
5
|
+
* **The `vm` module is not a security**
|
|
6
|
+
* **mechanism. Do not use it to run untrusted code.**
|
|
5
7
|
*
|
|
6
8
|
* JavaScript code can be compiled and run immediately or
|
|
7
9
|
* compiled, saved, and run later.
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
*
|
|
33
35
|
* console.log(x); // 1; y is not defined.
|
|
34
36
|
* ```
|
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
37
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/vm.js)
|
|
36
38
|
*/
|
|
37
39
|
declare module 'vm' {
|
|
38
40
|
interface Context extends NodeJS.Dict<any> {}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
* The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
|
|
69
69
|
* example to run.
|
|
70
70
|
* @experimental
|
|
71
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
71
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/wasi.js)
|
|
72
72
|
*/
|
|
73
73
|
declare module 'wasi' {
|
|
74
74
|
interface WASIOptions {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* }
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
|
-
* The above example spawns a Worker thread for each `
|
|
42
|
+
* The above example spawns a Worker thread for each `parseJSAsync()` call. In
|
|
43
43
|
* practice, use a pool of Workers for these kinds of tasks. Otherwise, the
|
|
44
44
|
* overhead of creating Workers would likely exceed their benefit.
|
|
45
45
|
*
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
*
|
|
50
50
|
* Worker threads inherit non-process-specific options by default. Refer to `Worker constructor options` to know how to customize worker thread options,
|
|
51
51
|
* specifically `argv` and `execArgv` options.
|
|
52
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
52
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/worker_threads.js)
|
|
53
53
|
*/
|
|
54
54
|
declare module 'worker_threads' {
|
|
55
55
|
import { Blob } from 'node:buffer';
|
|
@@ -507,7 +507,6 @@ declare module 'worker_threads' {
|
|
|
507
507
|
* }
|
|
508
508
|
* ```
|
|
509
509
|
* @since v15.4.0
|
|
510
|
-
* @experimental
|
|
511
510
|
*/
|
|
512
511
|
class BroadcastChannel {
|
|
513
512
|
readonly name: string;
|
|
@@ -630,14 +629,12 @@ declare module 'worker_threads' {
|
|
|
630
629
|
* }
|
|
631
630
|
* ```
|
|
632
631
|
* @since v15.12.0, v14.18.0
|
|
633
|
-
* @experimental
|
|
634
632
|
* @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
|
|
635
633
|
*/
|
|
636
634
|
function getEnvironmentData(key: Serializable): Serializable;
|
|
637
635
|
/**
|
|
638
636
|
* The `worker.setEnvironmentData()` API sets the content of`worker.getEnvironmentData()` in the current thread and all new `Worker`instances spawned from the current context.
|
|
639
637
|
* @since v15.12.0, v14.18.0
|
|
640
|
-
* @experimental
|
|
641
638
|
* @param key Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
|
|
642
639
|
* @param value Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value
|
|
643
640
|
* for the `key` will be deleted.
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
* });
|
|
89
89
|
* ```
|
|
90
90
|
* @since v0.5.8
|
|
91
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
91
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/zlib.js)
|
|
92
92
|
*/
|
|
93
93
|
declare module 'zlib' {
|
|
94
94
|
import * as stream from 'node:stream';
|