@types/node 16.6.2 → 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 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +256 -37
- node/child_process.d.ts +1 -1
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +9 -9
- node/dgram.d.ts +1 -1
- node/diagnostics_channel.d.ts +1 -1
- node/dns.d.ts +5 -1
- node/domain.d.ts +1 -1
- node/events.d.ts +183 -4
- node/fs/promises.d.ts +33 -19
- node/fs.d.ts +118 -48
- node/http.d.ts +5 -5
- node/http2.d.ts +1 -1
- node/https.d.ts +1 -1
- node/index.d.ts +1 -1
- node/inspector.d.ts +1 -1
- 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/punycode.d.ts +1 -1
- node/querystring.d.ts +2 -2
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream/web.d.ts +0 -1
- node/stream.d.ts +2 -2
- node/string_decoder.d.ts +1 -1
- node/timers.d.ts +1 -1
- node/tls.d.ts +3 -3
- node/trace_events.d.ts +1 -1
- node/tty.d.ts +1 -1
- node/url.d.ts +37 -2
- node/util.d.ts +3 -3
- node/v8.d.ts +1 -1
- node/vm.d.ts +1 -1
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
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.
|
|
39
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/string_decoder.js)
|
|
40
40
|
*/
|
|
41
41
|
declare module 'string_decoder' {
|
|
42
42
|
class StringDecoder {
|
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.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.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.
|
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/tls.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'tls' {
|
|
12
12
|
import { X509Certificate } from 'node:crypto';
|
|
@@ -348,14 +348,14 @@ declare module 'tls' {
|
|
|
348
348
|
*/
|
|
349
349
|
enableTrace(): void;
|
|
350
350
|
/**
|
|
351
|
-
* Returns the peer certificate as an
|
|
351
|
+
* Returns the peer certificate as an `X509Certificate` object.
|
|
352
352
|
*
|
|
353
353
|
* If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned.
|
|
354
354
|
* @since v15.9.0
|
|
355
355
|
*/
|
|
356
356
|
getPeerX509Certificate(): X509Certificate | undefined;
|
|
357
357
|
/**
|
|
358
|
-
* Returns the local certificate as an
|
|
358
|
+
* Returns the local certificate as an `X509Certificate` object.
|
|
359
359
|
*
|
|
360
360
|
* If there is no local certificate, or the socket has been destroyed,`undefined` will be returned.
|
|
361
361
|
* @since v15.9.0
|
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.
|
|
76
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/trace_events.js)
|
|
77
77
|
*/
|
|
78
78
|
declare module 'trace_events' {
|
|
79
79
|
/**
|
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.
|
|
25
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/tty.js)
|
|
26
26
|
*/
|
|
27
27
|
declare module 'tty' {
|
|
28
28
|
import * as net from 'node:net';
|
node/url.d.ts
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
* ```js
|
|
6
6
|
* import url from 'url';
|
|
7
7
|
* ```
|
|
8
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/url.js)
|
|
9
9
|
*/
|
|
10
10
|
declare module 'url' {
|
|
11
|
+
import { Blob } from 'node:buffer';
|
|
11
12
|
import { ClientRequestArgs } from 'node:http';
|
|
12
13
|
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring';
|
|
13
14
|
// Input to `url.format`
|
|
@@ -263,7 +264,7 @@ declare module 'url' {
|
|
|
263
264
|
* import { urlToHttpOptions } from 'url';
|
|
264
265
|
* const myURL = new URL('https://a:b@測試?abc#foo');
|
|
265
266
|
*
|
|
266
|
-
* console.log(urlToHttpOptions(
|
|
267
|
+
* console.log(urlToHttpOptions(myURL));
|
|
267
268
|
*
|
|
268
269
|
* {
|
|
269
270
|
* protocol: 'https:',
|
|
@@ -301,6 +302,40 @@ declare module 'url' {
|
|
|
301
302
|
* @since v7.0.0, v6.13.0
|
|
302
303
|
*/
|
|
303
304
|
class URL {
|
|
305
|
+
/**
|
|
306
|
+
* Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later.
|
|
307
|
+
*
|
|
308
|
+
* ```js
|
|
309
|
+
* const {
|
|
310
|
+
* Blob,
|
|
311
|
+
* resolveObjectURL,
|
|
312
|
+
* } = require('buffer');
|
|
313
|
+
*
|
|
314
|
+
* const blob = new Blob(['hello']);
|
|
315
|
+
* const id = URL.createObjectURL(blob);
|
|
316
|
+
*
|
|
317
|
+
* // later...
|
|
318
|
+
*
|
|
319
|
+
* const otherBlob = resolveObjectURL(id);
|
|
320
|
+
* console.log(otherBlob.size);
|
|
321
|
+
* ```
|
|
322
|
+
*
|
|
323
|
+
* The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it.
|
|
324
|
+
*
|
|
325
|
+
* `Blob` objects are registered within the current thread. If using Worker
|
|
326
|
+
* Threads, `Blob` objects registered within one Worker will not be available
|
|
327
|
+
* to other workers or the main thread.
|
|
328
|
+
* @since v16.7.0
|
|
329
|
+
* @experimental
|
|
330
|
+
*/
|
|
331
|
+
static createObjectURL(blob: Blob): string;
|
|
332
|
+
/**
|
|
333
|
+
* Removes the stored `Blob` identified by the given ID.
|
|
334
|
+
* @since v16.7.0
|
|
335
|
+
* @experimental
|
|
336
|
+
* @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
|
|
337
|
+
*/
|
|
338
|
+
static revokeObjectURL(objectUrl: string): void;
|
|
304
339
|
constructor(input: string, base?: string | URL);
|
|
305
340
|
/**
|
|
306
341
|
* Gets and sets the fragment portion of the URL.
|
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.7.0/lib/util.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module 'util' {
|
|
12
12
|
import * as types from 'node:util/types';
|
|
@@ -1538,12 +1538,12 @@ declare module 'util/types' {
|
|
|
1538
1538
|
*/
|
|
1539
1539
|
function isWeakSet(object: unknown): object is WeakSet<object>;
|
|
1540
1540
|
/**
|
|
1541
|
-
* Returns `true` if `value` is a
|
|
1541
|
+
* Returns `true` if `value` is a `KeyObject`, `false` otherwise.
|
|
1542
1542
|
* @since v16.2.0
|
|
1543
1543
|
*/
|
|
1544
1544
|
function isKeyObject(object: unknown): object is KeyObject;
|
|
1545
1545
|
/**
|
|
1546
|
-
* Returns `true` if `value` is a
|
|
1546
|
+
* Returns `true` if `value` is a `CryptoKey`, `false` otherwise.
|
|
1547
1547
|
* @since v16.2.0
|
|
1548
1548
|
*/
|
|
1549
1549
|
function isCryptoKey(object: unknown): object is webcrypto.CryptoKey;
|
node/v8.d.ts
CHANGED
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.7.0/lib/vm.js)
|
|
36
36
|
*/
|
|
37
37
|
declare module 'vm' {
|
|
38
38
|
interface Context extends NodeJS.Dict<any> {}
|
node/wasi.d.ts
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
* The `--experimental-wasi-unstable-preview1` CLI argument is needed for this
|
|
64
64
|
* example to run.
|
|
65
65
|
* @experimental
|
|
66
|
-
* @see [source](https://github.com/nodejs/node/blob/v16.
|
|
66
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/wasi.js)
|
|
67
67
|
*/
|
|
68
68
|
declare module 'wasi' {
|
|
69
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.
|
|
52
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.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.
|
|
91
|
+
* @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/zlib.js)
|
|
92
92
|
*/
|
|
93
93
|
declare module 'zlib' {
|
|
94
94
|
import * as stream from 'node:stream';
|