@types/node 16.4.14 → 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/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';