@types/node 16.9.2 → 16.9.6
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 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +3 -3
- node/child_process.d.ts +30 -20
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +34 -18
- node/dgram.d.ts +2 -2
- node/diagnostics_channel.d.ts +1 -1
- node/dns/promises.d.ts +1 -1
- node/dns.d.ts +2 -2
- node/domain.d.ts +1 -1
- node/events.d.ts +2 -2
- node/fs/promises.d.ts +17 -10
- node/fs.d.ts +44 -21
- node/http.d.ts +1 -1
- node/http2.d.ts +2 -2
- node/https.d.ts +1 -1
- node/inspector.d.ts +2 -2
- node/net.d.ts +1 -1
- node/os.d.ts +5 -5
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +3 -3
- node/process.d.ts +3 -3
- node/punycode.d.ts +3 -3
- node/querystring.d.ts +9 -9
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream.d.ts +12 -1
- node/string_decoder.d.ts +1 -1
- node/timers.d.ts +1 -1
- node/tls.d.ts +6 -6
- node/trace_events.d.ts +2 -2
- node/tty.d.ts +1 -1
- node/url.d.ts +1 -1
- node/util.d.ts +11 -12
- node/v8.d.ts +2 -2
- node/vm.d.ts +3 -4
- node/wasi.d.ts +9 -4
- node/worker_threads.d.ts +4 -4
- node/zlib.d.ts +1 -1
node/util.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* ```js
|
|
7
7
|
* const util = require('util');
|
|
8
8
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/util.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'util' {
|
|
12
12
|
import * as types from 'node:util/types';
|
|
@@ -145,7 +145,6 @@ declare module 'util' {
|
|
|
145
145
|
* Returns the `string` after replacing any surrogate code points
|
|
146
146
|
* (or equivalently, any unpaired surrogate code units) with the
|
|
147
147
|
* Unicode "replacement character" U+FFFD.
|
|
148
|
-
*
|
|
149
148
|
* @since v16.8.0
|
|
150
149
|
*/
|
|
151
150
|
export function toUSVString(string: string): string;
|
|
@@ -253,7 +252,7 @@ declare module 'util' {
|
|
|
253
252
|
* The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and
|
|
254
253
|
* [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
|
|
255
254
|
* inspected. If there are more entries than `maxArrayLength`, there is no
|
|
256
|
-
* guarantee which entries are displayed. That means retrieving the same[`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
|
|
255
|
+
* guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may
|
|
257
256
|
* result in different output. Furthermore, entries
|
|
258
257
|
* with no remaining strong references may be garbage collected at any time.
|
|
259
258
|
*
|
|
@@ -965,7 +964,7 @@ declare module 'util' {
|
|
|
965
964
|
const custom: unique symbol;
|
|
966
965
|
}
|
|
967
966
|
/**
|
|
968
|
-
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/)`TextDecoder` API.
|
|
967
|
+
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API.
|
|
969
968
|
*
|
|
970
969
|
* ```js
|
|
971
970
|
* const decoder = new TextDecoder('shift_jis');
|
|
@@ -1027,7 +1026,7 @@ declare module 'util' {
|
|
|
1027
1026
|
}
|
|
1028
1027
|
export { types };
|
|
1029
1028
|
/**
|
|
1030
|
-
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/)`TextEncoder` API. All
|
|
1029
|
+
* An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All
|
|
1031
1030
|
* instances of `TextEncoder` only support UTF-8 encoding.
|
|
1032
1031
|
*
|
|
1033
1032
|
* ```js
|
|
@@ -1071,8 +1070,8 @@ declare module 'util/types' {
|
|
|
1071
1070
|
declare module 'util/types' {
|
|
1072
1071
|
import { KeyObject, webcrypto } from 'node:crypto';
|
|
1073
1072
|
/**
|
|
1074
|
-
* Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
|
|
1075
|
-
*
|
|
1073
|
+
* Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or
|
|
1074
|
+
* [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance.
|
|
1076
1075
|
*
|
|
1077
1076
|
* See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`.
|
|
1078
1077
|
*
|
|
@@ -1107,9 +1106,9 @@ declare module 'util/types' {
|
|
|
1107
1106
|
*/
|
|
1108
1107
|
function isArrayBuffer(object: unknown): object is ArrayBuffer;
|
|
1109
1108
|
/**
|
|
1110
|
-
* Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)views, such as typed
|
|
1111
|
-
* objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent
|
|
1112
|
-
*
|
|
1109
|
+
* Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed
|
|
1110
|
+
* array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to
|
|
1111
|
+
* [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView).
|
|
1113
1112
|
*
|
|
1114
1113
|
* ```js
|
|
1115
1114
|
* util.types.isArrayBufferView(new Int8Array()); // true
|
|
@@ -1337,7 +1336,7 @@ declare module 'util/types' {
|
|
|
1337
1336
|
*/
|
|
1338
1337
|
function isMap<T>(object: T | {}): object is T extends ReadonlyMap<any, any> ? (unknown extends T ? never : ReadonlyMap<any, any>) : Map<unknown, unknown>;
|
|
1339
1338
|
/**
|
|
1340
|
-
* Returns `true` if the value is an iterator returned for a built-in[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
|
|
1339
|
+
* Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance.
|
|
1341
1340
|
*
|
|
1342
1341
|
* ```js
|
|
1343
1342
|
* const map = new Map();
|
|
@@ -1423,7 +1422,7 @@ declare module 'util/types' {
|
|
|
1423
1422
|
*/
|
|
1424
1423
|
function isSet<T>(object: T | {}): object is T extends ReadonlySet<any> ? (unknown extends T ? never : ReadonlySet<any>) : Set<unknown>;
|
|
1425
1424
|
/**
|
|
1426
|
-
* Returns `true` if the value is an iterator returned for a built-in[`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
|
|
1425
|
+
* Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance.
|
|
1427
1426
|
*
|
|
1428
1427
|
* ```js
|
|
1429
1428
|
* const set = new Set();
|
node/v8.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/)built into the Node.js binary. It can be accessed using:
|
|
2
|
+
* The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using:
|
|
3
3
|
*
|
|
4
4
|
* ```js
|
|
5
5
|
* const v8 = require('v8');
|
|
6
6
|
* ```
|
|
7
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
7
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/v8.js)
|
|
8
8
|
*/
|
|
9
9
|
declare module 'v8' {
|
|
10
10
|
import { Readable } from 'node:stream';
|
node/vm.d.ts
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
*
|
|
33
33
|
* console.log(x); // 1; y is not defined.
|
|
34
34
|
* ```
|
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
35
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/vm.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module 'vm' {
|
|
38
38
|
interface Context extends NodeJS.Dict<any> {}
|
|
@@ -267,7 +267,6 @@ declare module 'vm' {
|
|
|
267
267
|
* @since v10.6.0
|
|
268
268
|
*/
|
|
269
269
|
createCachedData(): Buffer;
|
|
270
|
-
|
|
271
270
|
/** @deprecated in favor of `script.createCachedData()` */
|
|
272
271
|
cachedDataProduced?: boolean | undefined;
|
|
273
272
|
cachedDataRejected?: boolean | undefined;
|
|
@@ -277,7 +276,7 @@ declare module 'vm' {
|
|
|
277
276
|
* If given a `contextObject`, the `vm.createContext()` method will `prepare
|
|
278
277
|
* that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts,
|
|
279
278
|
* the `contextObject` will be the global object, retaining all of its existing
|
|
280
|
-
* properties but also having the built-in objects and functions any standard[global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables
|
|
279
|
+
* properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables
|
|
281
280
|
* will remain unchanged.
|
|
282
281
|
*
|
|
283
282
|
* ```js
|
|
@@ -398,7 +397,7 @@ declare module 'vm' {
|
|
|
398
397
|
* ```
|
|
399
398
|
*
|
|
400
399
|
* Because `vm.runInThisContext()` does not have access to the local scope,`localVar` is unchanged. In contrast,
|
|
401
|
-
* [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval)_does_ have access to the
|
|
400
|
+
* [`eval()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) _does_ have access to the
|
|
402
401
|
* local scope, so the value `localVar` is changed. In this way`vm.runInThisContext()` is much like an [indirect `eval()` call](https://es5.github.io/#x10.4.2), e.g.`(0,eval)('code')`.
|
|
403
402
|
*
|
|
404
403
|
* ## Example: Running an HTTP server within a VM
|
node/wasi.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/)specification. WASI gives sandboxed WebAssembly applications access to the
|
|
2
|
+
* The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the
|
|
3
3
|
* underlying operating system via a collection of POSIX-like functions.
|
|
4
4
|
*
|
|
5
5
|
* ```js
|
|
6
|
-
* import
|
|
6
|
+
* import { readFile } from 'fs/promises';
|
|
7
7
|
* import { WASI } from 'wasi';
|
|
8
8
|
* import { argv, env } from 'process';
|
|
9
9
|
*
|
|
@@ -14,9 +14,14 @@
|
|
|
14
14
|
* '/sandbox': '/some/real/path/that/wasm/can/access'
|
|
15
15
|
* }
|
|
16
16
|
* });
|
|
17
|
+
*
|
|
18
|
+
* // Some WASI binaries require:
|
|
19
|
+
* // const importObject = { wasi_unstable: wasi.wasiImport };
|
|
17
20
|
* const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
|
|
18
21
|
*
|
|
19
|
-
* const wasm = await WebAssembly.compile(
|
|
22
|
+
* const wasm = await WebAssembly.compile(
|
|
23
|
+
* await readFile(new URL('./demo.wasm', import.meta.url))
|
|
24
|
+
* );
|
|
20
25
|
* const instance = await WebAssembly.instantiate(wasm, importObject);
|
|
21
26
|
*
|
|
22
27
|
* wasi.start(instance);
|
|
@@ -63,7 +68,7 @@
|
|
|
63
68
|
* The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
|
|
64
69
|
* example to run.
|
|
65
70
|
* @experimental
|
|
66
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
71
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/wasi.js)
|
|
67
72
|
*/
|
|
68
73
|
declare module 'wasi' {
|
|
69
74
|
interface WASIOptions {
|
node/worker_threads.d.ts
CHANGED
|
@@ -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/v16.
|
|
52
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/worker_threads.js)
|
|
53
53
|
*/
|
|
54
54
|
declare module 'worker_threads' {
|
|
55
55
|
import { Blob } from 'node:buffer';
|
|
@@ -94,7 +94,7 @@ declare module 'worker_threads' {
|
|
|
94
94
|
* asynchronous, two-way communications channel. It can be used to transfer
|
|
95
95
|
* structured data, memory regions and other `MessagePort`s between different `Worker` s.
|
|
96
96
|
*
|
|
97
|
-
* This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort)s.
|
|
97
|
+
* This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
|
|
98
98
|
* @since v10.5.0
|
|
99
99
|
*/
|
|
100
100
|
class MessagePort extends EventEmitter {
|
|
@@ -572,11 +572,11 @@ declare module 'worker_threads' {
|
|
|
572
572
|
* takes its place.
|
|
573
573
|
*
|
|
574
574
|
* The returned `MessagePort` is an object in the target context and
|
|
575
|
-
* inherits from its global `Object` class. Objects passed to the[`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) listener are also created in the
|
|
575
|
+
* inherits from its global `Object` class. Objects passed to the [`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) listener are also created in the
|
|
576
576
|
* target context
|
|
577
577
|
* and inherit from its global `Object` class.
|
|
578
578
|
*
|
|
579
|
-
* However, the created `MessagePort` no longer inherits from[`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget), and only
|
|
579
|
+
* However, the created `MessagePort` no longer inherits from [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget), and only
|
|
580
580
|
* [`port.onmessage()`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/onmessage) can be used to receive
|
|
581
581
|
* events using it.
|
|
582
582
|
* @since v11.13.0
|
node/zlib.d.ts
CHANGED
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
* });
|
|
89
89
|
* ```
|
|
90
90
|
* @since v0.5.8
|
|
91
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
91
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/zlib.js)
|
|
92
92
|
*/
|
|
93
93
|
declare module 'zlib' {
|
|
94
94
|
import * as stream from 'node:stream';
|