@types/node 16.4.11 → 16.6.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/querystring.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * The `querystring` API is considered Legacy. While it is still maintained,
10
10
  * new code should use the `<URLSearchParams>` API instead.
11
11
  * @deprecated Legacy
12
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/querystring.js)
12
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/querystring.js)
13
13
  */
14
14
  declare module 'querystring' {
15
15
  interface StringifyOptions {
node/readline.d.ts CHANGED
@@ -26,7 +26,7 @@
26
26
  *
27
27
  * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be
28
28
  * received on the `input` stream.
29
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/readline.js)
29
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/readline.js)
30
30
  */
31
31
  declare module 'readline' {
32
32
  import { Abortable, EventEmitter } from 'node:events';
node/repl.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * ```js
7
7
  * const repl = require('repl');
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/repl.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/repl.js)
10
10
  */
11
11
  declare module 'repl' {
12
12
  import { Interface, Completer, AsyncCompleter } from 'node:readline';
node/stream/web.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ declare module 'stream/web' {
2
+ // stub module, pending copy&paste from .d.ts or manual impl
3
+ }
4
+
5
+ declare module 'node:stream/web' {
6
+ export * from 'stream/web';
7
+ }
node/stream.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * The `stream` module is useful for creating new types of stream instances. It is
16
16
  * usually not necessary to use the `stream` module to consume streams.
17
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/stream.js)
17
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/stream.js)
18
18
  */
19
19
  declare module 'stream' {
20
20
  import { EventEmitter, Abortable } from 'node:events';
node/string_decoder.d.ts CHANGED
@@ -36,7 +36,7 @@
36
36
  * decoder.write(Buffer.from([0x82]));
37
37
  * console.log(decoder.end(Buffer.from([0xAC])));
38
38
  * ```
39
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/string_decoder.js)
39
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/string_decoder.js)
40
40
  */
41
41
  declare module 'string_decoder' {
42
42
  class StringDecoder {
node/timers/promises.d.ts CHANGED
@@ -9,14 +9,6 @@
9
9
  * setInterval,
10
10
  * } from 'timers/promises';
11
11
  * ```
12
- *
13
- * ```js
14
- * const {
15
- * setTimeout,
16
- * setImmediate,
17
- * setInterval,
18
- * } = require('timers/promises');
19
- * ```
20
12
  * @since v15.0.0
21
13
  */
22
14
  declare module 'timers/promises' {
@@ -31,16 +23,6 @@ declare module 'timers/promises' {
31
23
  *
32
24
  * console.log(res); // Prints 'result'
33
25
  * ```
34
- *
35
- * ```js
36
- * const {
37
- * setTimeout,
38
- * } = require('timers/promises');
39
- *
40
- * setTimeout(100, 'result').then((res) => {
41
- * console.log(res); // Prints 'result'
42
- * });
43
- * ```
44
26
  * @since v15.0.0
45
27
  * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
46
28
  * @param value A value with which the promise is fulfilled.
@@ -56,16 +38,6 @@ declare module 'timers/promises' {
56
38
  *
57
39
  * console.log(res); // Prints 'result'
58
40
  * ```
59
- *
60
- * ```js
61
- * const {
62
- * setImmediate,
63
- * } = require('timers/promises');
64
- *
65
- * setImmediate('result').then((res) => {
66
- * console.log(res); // Prints 'result'
67
- * });
68
- * ```
69
41
  * @since v15.0.0
70
42
  * @param value A value with which the promise is fulfilled.
71
43
  */
@@ -87,23 +59,6 @@ declare module 'timers/promises' {
87
59
  * }
88
60
  * console.log(Date.now());
89
61
  * ```
90
- *
91
- * ```js
92
- * const {
93
- * setInterval,
94
- * } = require('timers/promises');
95
- * const interval = 100;
96
- *
97
- * (async function() {
98
- * for await (const startTime of setInterval(interval, Date.now())) {
99
- * const now = Date.now();
100
- * console.log(now);
101
- * if ((now - startTime) > 1000)
102
- * break;
103
- * }
104
- * console.log(Date.now());
105
- * })();
106
- * ```
107
62
  * @since v15.9.0
108
63
  */
109
64
  function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
node/timers.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * The timer functions within Node.js implement a similar API as the timers API
7
7
  * provided by Web Browsers but use a different internal implementation that is
8
8
  * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
9
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/timers.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/timers.js)
10
10
  */
11
11
  declare module 'timers' {
12
12
  import { Abortable } from 'node:events';
node/tls.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * ```js
7
7
  * const tls = require('tls');
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/tls.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/tls.js)
10
10
  */
11
11
  declare module 'tls' {
12
12
  import { X509Certificate } from 'node:crypto';
node/trace_events.d.ts CHANGED
@@ -73,7 +73,7 @@
73
73
  *
74
74
  * The features from this module are not available in `Worker` threads.
75
75
  * @experimental
76
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/trace_events.js)
76
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/trace_events.js)
77
77
  */
78
78
  declare module 'trace_events' {
79
79
  /**
node/ts3.6/base.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  // - ~/ts3.6/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in
8
8
 
9
9
  // Reference required types from the default lib:
10
- /// <reference lib="es2018" />
10
+ /// <reference lib="es2020" />
11
11
  /// <reference lib="esnext.asynciterable" />
12
12
  /// <reference lib="esnext.intl" />
13
13
  /// <reference lib="esnext.bigint" />
@@ -47,6 +47,7 @@
47
47
  /// <reference path="../repl.d.ts" />
48
48
  /// <reference path="../stream.d.ts" />
49
49
  /// <reference path="../stream/promises.d.ts" />
50
+ /// <reference path="../stream/web.d.ts" />
50
51
  /// <reference path="../string_decoder.d.ts" />
51
52
  /// <reference path="../timers.d.ts" />
52
53
  /// <reference path="../timers/promises.d.ts" />
node/tty.d.ts CHANGED
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * In most cases, there should be little to no reason for an application to
24
24
  * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes.
25
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/tty.js)
25
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/tty.js)
26
26
  */
27
27
  declare module 'tty' {
28
28
  import * as net from 'node:net';
@@ -176,9 +176,9 @@ declare module 'tty' {
176
176
  hasColors(env?: object): boolean;
177
177
  hasColors(count: number, env?: object): boolean;
178
178
  /**
179
- * `writeStream.getWindowSize()` returns the size of the `TTY` corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent
180
- * the number
181
- * of columns and rows in the corresponding `TTY`.
179
+ * `writeStream.getWindowSize()` returns the size of the TTY
180
+ * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number
181
+ * of columns and rows in the corresponding TTY.
182
182
  * @since v0.7.7
183
183
  */
184
184
  getWindowSize(): [number, number];
node/url.d.ts CHANGED
@@ -5,11 +5,7 @@
5
5
  * ```js
6
6
  * import url from 'url';
7
7
  * ```
8
- *
9
- * ```js
10
- * const url = require('url');
11
- * ```
12
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/url.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/url.js)
13
9
  */
14
10
  declare module 'url' {
15
11
  import { ClientRequestArgs } from 'node:http';
@@ -191,17 +187,6 @@ declare module 'url' {
191
187
  * console.log(url.domainToASCII('xn--iñvalid.com'));
192
188
  * // Prints an empty string
193
189
  * ```
194
- *
195
- * ```js
196
- * const url = require('url');
197
- *
198
- * console.log(url.domainToASCII('español.com'));
199
- * // Prints xn--espaol-zwa.com
200
- * console.log(url.domainToASCII('中文.com'));
201
- * // Prints xn--fiq228c.com
202
- * console.log(url.domainToASCII('xn--iñvalid.com'));
203
- * // Prints an empty string
204
- * ```
205
190
  * @since v7.4.0, v6.13.0
206
191
  */
207
192
  function domainToASCII(domain: string): string;
@@ -223,17 +208,6 @@ declare module 'url' {
223
208
  * console.log(url.domainToUnicode('xn--iñvalid.com'));
224
209
  * // Prints an empty string
225
210
  * ```
226
- *
227
- * ```js
228
- * const url = require('url');
229
- *
230
- * console.log(url.domainToUnicode('xn--espaol-zwa.com'));
231
- * // Prints español.com
232
- * console.log(url.domainToUnicode('xn--fiq228c.com'));
233
- * // Prints 中文.com
234
- * console.log(url.domainToUnicode('xn--iñvalid.com'));
235
- * // Prints an empty string
236
- * ```
237
211
  * @since v7.4.0, v6.13.0
238
212
  */
239
213
  function domainToUnicode(domain: string): string;
@@ -258,21 +232,6 @@ declare module 'url' {
258
232
  * new URL('file:///hello world').pathname; // Incorrect: /hello%20world
259
233
  * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX)
260
234
  * ```
261
- *
262
- * ```js
263
- * const { fileURLToPath } = require('url');
264
- * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/
265
- * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows)
266
- *
267
- * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt
268
- * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows)
269
- *
270
- * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt
271
- * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX)
272
- *
273
- * new URL('file:///hello world').pathname; // Incorrect: /hello%20world
274
- * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX)
275
- * ```
276
235
  * @since v10.12.0
277
236
  * @param url The file URL string or URL object to convert to a path.
278
237
  * @return The fully-resolved platform-specific Node.js file path.
@@ -291,20 +250,6 @@ declare module 'url' {
291
250
  * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c
292
251
  * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX)
293
252
  * ```
294
- *
295
- * ```js
296
- * const { pathToFileURL } = require('url');
297
- * new URL(__filename); // Incorrect: throws (POSIX)
298
- * new URL(__filename); // Incorrect: C:\... (Windows)
299
- * pathToFileURL(__filename); // Correct: file:///... (POSIX)
300
- * pathToFileURL(__filename); // Correct: file:///C:/... (Windows)
301
- *
302
- * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1
303
- * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX)
304
- *
305
- * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c
306
- * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX)
307
- * ```
308
253
  * @since v10.12.0
309
254
  * @param path The path to convert to a File URL.
310
255
  * @return The file URL object.
@@ -332,25 +277,6 @@ declare module 'url' {
332
277
  * }
333
278
  *
334
279
  * ```
335
- *
336
- * ```js
337
- * const { urlToHttpOptions } = require('url');
338
- * const myURL = new URL('https://a:b@測試?abc#foo');
339
- *
340
- * console.log(urlToHttpOptions(myUrl));
341
- *
342
- * {
343
- * protocol: 'https:',
344
- * hostname: 'xn--g6w251d',
345
- * hash: '#foo',
346
- * search: '?abc',
347
- * pathname: '/',
348
- * path: '/?abc',
349
- * href: 'https://a:b@xn--g6w251d/?abc#foo',
350
- * auth: 'a:b'
351
- * }
352
- *
353
- * ```
354
280
  * @since v15.7.0
355
281
  * @param url The `WHATWG URL` object to convert to an options object.
356
282
  * @return Options object
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.4.2/lib/util.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/util.js)
10
10
  */
11
11
  declare module 'util' {
12
12
  import * as types from 'node:util/types';
node/v8.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * ```js
5
5
  * const v8 = require('v8');
6
6
  * ```
7
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/v8.js)
7
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/v8.js)
8
8
  */
9
9
  declare module 'v8' {
10
10
  import { Readable } from 'node:stream';
node/vm.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `vm` module enables compiling and running code within V8 Virtual
3
3
  * Machine contexts. **The `vm` module is not a security mechanism. Do**
4
- * **not use it to run untrusted code**.
4
+ * **not use it to run untrusted code.**
5
5
  *
6
6
  * JavaScript code can be compiled and run immediately or
7
7
  * compiled, saved, and run later.
@@ -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.4.2/lib/vm.js)
35
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/vm.js)
36
36
  */
37
37
  declare module 'vm' {
38
38
  interface Context extends NodeJS.Dict<any> {}
node/wasi.d.ts CHANGED
@@ -5,10 +5,11 @@
5
5
  * ```js
6
6
  * import fs from 'fs';
7
7
  * import { WASI } from 'wasi';
8
+ * import { argv, env } from 'process';
8
9
  *
9
10
  * const wasi = new WASI({
10
- * args: process.argv,
11
- * env: process.env,
11
+ * args: argv,
12
+ * env,
12
13
  * preopens: {
13
14
  * '/sandbox': '/some/real/path/that/wasm/can/access'
14
15
  * }
@@ -21,27 +22,6 @@
21
22
  * wasi.start(instance);
22
23
  * ```
23
24
  *
24
- * ```js
25
- * 'use strict';
26
- * const fs = require('fs');
27
- * const { WASI } = require('wasi');
28
- * const wasi = new WASI({
29
- * args: process.argv,
30
- * env: process.env,
31
- * preopens: {
32
- * '/sandbox': '/some/real/path/that/wasm/can/access'
33
- * }
34
- * });
35
- * const importObject = { wasi_snapshot_preview1: wasi.wasiImport };
36
- *
37
- * (async () => {
38
- * const wasm = await WebAssembly.compile(fs.readFileSync('./demo.wasm'));
39
- * const instance = await WebAssembly.instantiate(wasm, importObject);
40
- *
41
- * wasi.start(instance);
42
- * })();
43
- * ```
44
- *
45
25
  * To run the above example, create a new WebAssembly text format file named`demo.wat`:
46
26
  *
47
27
  * ```text
@@ -83,7 +63,7 @@
83
63
  * The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
84
64
  * example to run.
85
65
  * @experimental
86
- * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/wasi.js)
66
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/wasi.js)
87
67
  */
88
68
  declare module 'wasi' {
89
69
  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.4.2/lib/worker_threads.js)
52
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/worker_threads.js)
53
53
  */
54
54
  declare module 'worker_threads' {
55
55
  import { Blob } from 'node:buffer';
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.4.2/lib/zlib.js)
91
+ * @see [source](https://github.com/nodejs/node/blob/v16.6.0/lib/zlib.js)
92
92
  */
93
93
  declare module 'zlib' {
94
94
  import * as stream from 'node:stream';