@types/node 16.18.110 → 16.18.112

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.
Files changed (46) hide show
  1. node v16.18/README.md +1 -1
  2. node v16.18/buffer.buffer.d.ts +365 -0
  3. node v16.18/buffer.d.ts +8 -362
  4. node v16.18/child_process.d.ts +34 -29
  5. node v16.18/cluster.d.ts +1 -1
  6. node v16.18/console.d.ts +2 -2
  7. node v16.18/crypto.d.ts +1 -1
  8. node v16.18/dns/promises.d.ts +6 -5
  9. node v16.18/dns.d.ts +5 -5
  10. node v16.18/domain.d.ts +2 -2
  11. node v16.18/events.d.ts +13 -13
  12. node v16.18/fs/promises.d.ts +2 -2
  13. node v16.18/fs.d.ts +1 -1
  14. node v16.18/globals.d.ts +0 -14
  15. node v16.18/globals.typedarray.d.ts +21 -0
  16. node v16.18/http.d.ts +2 -2
  17. node v16.18/http2.d.ts +24 -24
  18. node v16.18/https.d.ts +9 -9
  19. node v16.18/index.d.ts +5 -1
  20. node v16.18/inspector.d.ts +1 -1
  21. node v16.18/module.d.ts +3 -3
  22. node v16.18/net.d.ts +2 -2
  23. node v16.18/os.d.ts +1 -1
  24. node v16.18/package.json +9 -2
  25. node v16.18/path.d.ts +1 -1
  26. node v16.18/perf_hooks.d.ts +11 -11
  27. node v16.18/punycode.d.ts +1 -1
  28. node v16.18/querystring.d.ts +1 -1
  29. node v16.18/readline.d.ts +12 -12
  30. node v16.18/repl.d.ts +4 -4
  31. node v16.18/stream.d.ts +18 -18
  32. node v16.18/string_decoder.d.ts +3 -3
  33. node v16.18/timers/promises.d.ts +1 -1
  34. node v16.18/timers.d.ts +1 -1
  35. node v16.18/tls.d.ts +5 -5
  36. node v16.18/trace_events.d.ts +3 -3
  37. node v16.18/ts5.6/buffer.buffer.d.ts +365 -0
  38. node v16.18/ts5.6/globals.typedarray.d.ts +19 -0
  39. node v16.18/ts5.6/index.d.ts +90 -0
  40. node v16.18/tty.d.ts +1 -1
  41. node v16.18/url.d.ts +6 -6
  42. node v16.18/util.d.ts +40 -40
  43. node v16.18/v8.d.ts +11 -11
  44. node v16.18/vm.d.ts +11 -12
  45. node v16.18/worker_threads.d.ts +19 -19
  46. node v16.18/zlib.d.ts +8 -8
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.18.110",
3
+ "version": "16.18.112",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -203,6 +203,13 @@
203
203
  ],
204
204
  "main": "",
205
205
  "types": "index.d.ts",
206
+ "typesVersions": {
207
+ "<=5.6": {
208
+ "*": [
209
+ "ts5.6/*"
210
+ ]
211
+ }
212
+ },
206
213
  "repository": {
207
214
  "type": "git",
208
215
  "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
@@ -210,6 +217,6 @@
210
217
  },
211
218
  "scripts": {},
212
219
  "dependencies": {},
213
- "typesPublisherContentHash": "0d691889c6bd85ef024ca5b209d46b2aaa88c7dd918ac667cd6f508ac8a35f9d",
220
+ "typesPublisherContentHash": "88cebb8ab27468d7be63d81e27cc9800cd9ba095b2e1486cfc677fd2d63ed79f",
214
221
  "typeScriptVersion": "4.8"
215
222
  }
node v16.18/path.d.ts CHANGED
@@ -11,7 +11,7 @@ declare module "path/win32" {
11
11
  * It can be accessed using:
12
12
  *
13
13
  * ```js
14
- * const path = require('path');
14
+ * import path from 'node:path';
15
15
  * ```
16
16
  * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/path.js)
17
17
  */
@@ -9,7 +9,7 @@
9
9
  * * [User Timing](https://www.w3.org/TR/user-timing/)
10
10
  *
11
11
  * ```js
12
- * const { PerformanceObserver, performance } = require('perf_hooks');
12
+ * import { PerformanceObserver, performance } from 'node:perf_hooks';
13
13
  *
14
14
  * const obs = new PerformanceObserver((items) => {
15
15
  * console.log(items.getEntries()[0].duration);
@@ -307,10 +307,10 @@ declare module "perf_hooks" {
307
307
  * with respect to `performanceEntry.startTime`.
308
308
  *
309
309
  * ```js
310
- * const {
310
+ * import {
311
311
  * performance,
312
312
  * PerformanceObserver
313
- * } = require('perf_hooks');
313
+ * } from 'node:perf_hooks';
314
314
  *
315
315
  * const obs = new PerformanceObserver((perfObserverList, observer) => {
316
316
  * console.log(perfObserverList.getEntries());
@@ -346,10 +346,10 @@ declare module "perf_hooks" {
346
346
  * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
347
347
  *
348
348
  * ```js
349
- * const {
349
+ * import {
350
350
  * performance,
351
351
  * PerformanceObserver
352
- * } = require('perf_hooks');
352
+ * } from 'node:perf_hooks';
353
353
  *
354
354
  * const obs = new PerformanceObserver((perfObserverList, observer) => {
355
355
  * console.log(perfObserverList.getEntriesByName('meow'));
@@ -392,10 +392,10 @@ declare module "perf_hooks" {
392
392
  * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`.
393
393
  *
394
394
  * ```js
395
- * const {
395
+ * import {
396
396
  * performance,
397
397
  * PerformanceObserver
398
- * } = require('perf_hooks');
398
+ * } from 'node:perf_hooks';
399
399
  *
400
400
  * const obs = new PerformanceObserver((perfObserverList, observer) => {
401
401
  * console.log(perfObserverList.getEntriesByType('mark'));
@@ -438,10 +438,10 @@ declare module "perf_hooks" {
438
438
  * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`:
439
439
  *
440
440
  * ```js
441
- * const {
441
+ * import {
442
442
  * performance,
443
443
  * PerformanceObserver
444
- * } = require('perf_hooks');
444
+ * } from 'node:perf_hooks';
445
445
  *
446
446
  * const obs = new PerformanceObserver((list, observer) => {
447
447
  * // Called three times synchronously. `list` contains one item.
@@ -671,7 +671,7 @@ declare module "perf_hooks" {
671
671
  * detect.
672
672
  *
673
673
  * ```js
674
- * const { monitorEventLoopDelay } = require('perf_hooks');
674
+ * import { monitorEventLoopDelay } from 'node:perf_hooks';
675
675
  * const h = monitorEventLoopDelay({ resolution: 20 });
676
676
  * h.enable();
677
677
  * // Do something.
@@ -713,7 +713,7 @@ declare module "perf_hooks" {
713
713
  import { performance as _performance } from "perf_hooks";
714
714
  global {
715
715
  /**
716
- * `performance` is a global reference for `require('perf_hooks').performance`
716
+ * `performance` is a global reference for `import { performance } from 'node:perf_hooks'`
717
717
  * https://nodejs.org/api/globals.html#performance
718
718
  * @since v16.0.0
719
719
  */
@@ -8,7 +8,7 @@
8
8
  * can be accessed using:
9
9
  *
10
10
  * ```js
11
- * const punycode = require('punycode');
11
+ * import punycode from 'node:punycode';
12
12
  * ```
13
13
  *
14
14
  * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is
@@ -3,7 +3,7 @@
3
3
  * query strings. It can be accessed using:
4
4
  *
5
5
  * ```js
6
- * const querystring = require('querystring');
6
+ * import querystring from 'node:querystring';
7
7
  * ```
8
8
  *
9
9
  * `querystring` is more performant than `URLSearchParams` but is not a
@@ -3,13 +3,13 @@
3
3
  * using:
4
4
  *
5
5
  * ```js
6
- * const readline = require('readline');
6
+ * import readline from 'node:readline';
7
7
  * ```
8
8
  *
9
9
  * The following simple example illustrates the basic use of the `readline` module.
10
10
  *
11
11
  * ```js
12
- * const readline = require('readline');
12
+ * import readline from 'node:readline';
13
13
  *
14
14
  * const rl = readline.createInterface({
15
15
  * input: process.stdin,
@@ -176,7 +176,7 @@ declare module "readline" {
176
176
  * an `AbortController` it will reject with an `AbortError`.
177
177
  *
178
178
  * ```js
179
- * const util = require('util');
179
+ * import util from 'node:util';
180
180
  * const question = util.promisify(rl.question).bind(rl);
181
181
  *
182
182
  * async function questionExample() {
@@ -349,7 +349,7 @@ declare module "readline" {
349
349
  * The `readline.createInterface()` method creates a new `readline.Interface`instance.
350
350
  *
351
351
  * ```js
352
- * const readline = require('readline');
352
+ * import readline from 'node:readline';
353
353
  * const rl = readline.createInterface({
354
354
  * input: process.stdin,
355
355
  * output: process.stdout
@@ -446,7 +446,7 @@ declare module "readline" {
446
446
  * implement a small command-line interface:
447
447
  *
448
448
  * ```js
449
- * const readline = require('readline');
449
+ * import readline from 'node:readline';
450
450
  * const rl = readline.createInterface({
451
451
  * input: process.stdin,
452
452
  * output: process.stdout,
@@ -478,8 +478,8 @@ declare module "readline" {
478
478
  * well as a `for await...of` loop:
479
479
  *
480
480
  * ```js
481
- * const fs = require('fs');
482
- * const readline = require('readline');
481
+ * import fs from 'node:fs';
482
+ * import readline from 'node:readline';
483
483
  *
484
484
  * async function processLineByLine() {
485
485
  * const fileStream = fs.createReadStream('input.txt');
@@ -503,8 +503,8 @@ declare module "readline" {
503
503
  * Alternatively, one could use the `'line'` event:
504
504
  *
505
505
  * ```js
506
- * const fs = require('fs');
507
- * const readline = require('readline');
506
+ * import fs from 'node:fs';
507
+ * import readline from 'node:readline';
508
508
  *
509
509
  * const rl = readline.createInterface({
510
510
  * input: fs.createReadStream('sample.txt'),
@@ -519,9 +519,9 @@ declare module "readline" {
519
519
  * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
520
520
  *
521
521
  * ```js
522
- * const { once } = require('events');
523
- * const { createReadStream } = require('fs');
524
- * const { createInterface } = require('readline');
522
+ * import { once } from 'node:events';
523
+ * import { createReadStream } from 'node:fs';
524
+ * import { createInterface } from 'node:readline';
525
525
  *
526
526
  * (async function processLineByLine() {
527
527
  * try {
node v16.18/repl.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * It can be accessed using:
5
5
  *
6
6
  * ```js
7
- * const repl = require('repl');
7
+ * import repl from 'node:repl';
8
8
  * ```
9
9
  * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/repl.js)
10
10
  */
@@ -130,7 +130,7 @@ declare module "repl" {
130
130
  * or directly using the JavaScript `new` keyword.
131
131
  *
132
132
  * ```js
133
- * const repl = require('repl');
133
+ * import repl from 'node:repl';
134
134
  *
135
135
  * const options = { useColors: true };
136
136
  *
@@ -257,7 +257,7 @@ declare module "repl" {
257
257
  * The following example shows two new commands added to the REPL instance:
258
258
  *
259
259
  * ```js
260
- * const repl = require('repl');
260
+ * import repl from 'node:repl';
261
261
  *
262
262
  * const replServer = repl.start({ prompt: '> ' });
263
263
  * replServer.defineCommand('sayhello', {
@@ -407,7 +407,7 @@ declare module "repl" {
407
407
  * If `options` is a string, then it specifies the input prompt:
408
408
  *
409
409
  * ```js
410
- * const repl = require('repl');
410
+ * import repl from 'node:repl';
411
411
  *
412
412
  * // a Unix style prompt
413
413
  * repl.start('$ ');
node v16.18/stream.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * To access the `stream` module:
10
10
  *
11
11
  * ```js
12
- * const stream = require('stream');
12
+ * import stream from 'node:stream';
13
13
  * ```
14
14
  *
15
15
  * The `stream` module is useful for creating new types of stream instances. It is
@@ -293,7 +293,7 @@ declare module "stream" {
293
293
  * the method does nothing.
294
294
  *
295
295
  * ```js
296
- * const fs = require('fs');
296
+ * import fs from 'node:fs';
297
297
  * const readable = getReadableStreamSomehow();
298
298
  * const writable = fs.createWriteStream('file.txt');
299
299
  * // All the data from readable goes into 'file.txt',
@@ -331,7 +331,7 @@ declare module "stream" {
331
331
  * // Pull off a header delimited by \n\n.
332
332
  * // Use unshift() if we get too much.
333
333
  * // Call the callback with (error, header, stream).
334
- * const { StringDecoder } = require('string_decoder');
334
+ * import { StringDecoder } from 'node:string_decoder';
335
335
  * function parseHeader(stream, callback) {
336
336
  * stream.on('error', callback);
337
337
  * stream.on('readable', onReadable);
@@ -389,8 +389,8 @@ declare module "stream" {
389
389
  * libraries.
390
390
  *
391
391
  * ```js
392
- * const { OldReader } = require('./old-api-module.js');
393
- * const { Readable } = require('stream');
392
+ * import { OldReader } from './old-api-module.js';
393
+ * import { Readable } from 'node:stream';
394
394
  * const oreader = new OldReader();
395
395
  * const myReader = new Readable().wrap(oreader);
396
396
  *
@@ -669,7 +669,7 @@ declare module "stream" {
669
669
  *
670
670
  * ```js
671
671
  * // Write 'hello, ' and then end with 'world!'.
672
- * const fs = require('fs');
672
+ * import fs from 'node:fs';
673
673
  * const file = fs.createWriteStream('example.txt');
674
674
  * file.write('hello, ');
675
675
  * file.end('world!');
@@ -1062,7 +1062,7 @@ declare module "stream" {
1062
1062
  * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream.
1063
1063
  *
1064
1064
  * ```js
1065
- * const fs = require('fs');
1065
+ * import fs from 'node:fs';
1066
1066
  *
1067
1067
  * const controller = new AbortController();
1068
1068
  * const read = addAbortSignal(
@@ -1111,7 +1111,7 @@ declare module "stream" {
1111
1111
  * or has experienced an error or a premature close event.
1112
1112
  *
1113
1113
  * ```js
1114
- * const { finished } = require('stream');
1114
+ * import { finished } from 'node:stream';
1115
1115
  *
1116
1116
  * const rs = fs.createReadStream('archive.tar');
1117
1117
  *
@@ -1132,7 +1132,7 @@ declare module "stream" {
1132
1132
  * The `finished` API provides promise version:
1133
1133
  *
1134
1134
  * ```js
1135
- * const { finished } = require('stream/promises');
1135
+ * import { finished } from 'node:stream/promises';
1136
1136
  *
1137
1137
  * const rs = fs.createReadStream('archive.tar');
1138
1138
  *
@@ -1208,9 +1208,9 @@ declare module "stream" {
1208
1208
  * properly cleaning up and provide a callback when the pipeline is complete.
1209
1209
  *
1210
1210
  * ```js
1211
- * const { pipeline } = require('stream');
1212
- * const fs = require('fs');
1213
- * const zlib = require('zlib');
1211
+ * import { pipeline } from 'node:stream';
1212
+ * import fs from 'node:fs';
1213
+ * import zlib from 'node:zlib';
1214
1214
  *
1215
1215
  * // Use the pipeline API to easily pipe a series of streams
1216
1216
  * // together and get notified when the pipeline is fully done.
@@ -1236,7 +1236,7 @@ declare module "stream" {
1236
1236
  * an`AbortError`.
1237
1237
  *
1238
1238
  * ```js
1239
- * const { pipeline } = require('stream/promises');
1239
+ * import { pipeline } from 'node:stream/promises';
1240
1240
  *
1241
1241
  * async function run() {
1242
1242
  * await pipeline(
@@ -1254,7 +1254,7 @@ declare module "stream" {
1254
1254
  * as the last argument:
1255
1255
  *
1256
1256
  * ```js
1257
- * const { pipeline } = require('stream/promises');
1257
+ * import { pipeline } from 'node:stream/promises';
1258
1258
  *
1259
1259
  * async function run() {
1260
1260
  * const ac = new AbortController();
@@ -1275,8 +1275,8 @@ declare module "stream" {
1275
1275
  * The `pipeline` API also supports async generators:
1276
1276
  *
1277
1277
  * ```js
1278
- * const { pipeline } = require('stream/promises');
1279
- * const fs = require('fs');
1278
+ * import { pipeline } from 'node:stream/promises';
1279
+ * import fs from 'node:fs';
1280
1280
  *
1281
1281
  * async function run() {
1282
1282
  * await pipeline(
@@ -1300,8 +1300,8 @@ declare module "stream" {
1300
1300
  * pipeline (i.e. first argument) or the pipeline will never complete.
1301
1301
  *
1302
1302
  * ```js
1303
- * const { pipeline } = require('stream/promises');
1304
- * const fs = require('fs');
1303
+ * import { pipeline } from 'node:stream/promises';
1304
+ * import fs from 'node:fs';
1305
1305
  *
1306
1306
  * async function run() {
1307
1307
  * await pipeline(
@@ -4,13 +4,13 @@
4
4
  * characters. It can be accessed using:
5
5
  *
6
6
  * ```js
7
- * const { StringDecoder } = require('node:string_decoder');
7
+ * import { StringDecoder } from 'node:string_decoder';
8
8
  * ```
9
9
  *
10
10
  * The following example shows the basic use of the `StringDecoder` class.
11
11
  *
12
12
  * ```js
13
- * const { StringDecoder } = require('node:string_decoder');
13
+ * import { StringDecoder } from 'node:string_decoder';
14
14
  * const decoder = new StringDecoder('utf8');
15
15
  *
16
16
  * const cent = Buffer.from([0xC2, 0xA2]);
@@ -29,7 +29,7 @@
29
29
  * symbol (`€`) are written over three separate operations:
30
30
  *
31
31
  * ```js
32
- * const { StringDecoder } = require('node:string_decoder');
32
+ * import { StringDecoder } from 'node:string_decoder';
33
33
  * const decoder = new StringDecoder('utf8');
34
34
  *
35
35
  * decoder.write(Buffer.from([0xE2]));
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `timers/promises` API provides an alternative set of timer functions
3
- * that return `Promise` objects. The API is accessible via`require('timers/promises')`.
3
+ * that return `Promise` objects. The API is accessible via `import timersPromises from 'node:timers/promises'`.
4
4
  *
5
5
  * ```js
6
6
  * import {
node v16.18/timers.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `timer` module exposes a global API for scheduling functions to
3
3
  * be called at some future period of time. Because the timer functions are
4
- * globals, there is no need to call `require('timers')` to use the API.
4
+ * globals, there is no need to import `node:timers` to use the API.
5
5
  *
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
node v16.18/tls.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * The module can be accessed using:
5
5
  *
6
6
  * ```js
7
- * const tls = require('tls');
7
+ * import tls from 'node:tls';
8
8
  * ```
9
9
  * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/tls.js)
10
10
  */
@@ -905,8 +905,8 @@ declare module "tls" {
905
905
  * The following illustrates a simple echo server:
906
906
  *
907
907
  * ```js
908
- * const tls = require('tls');
909
- * const fs = require('fs');
908
+ * import tls from 'node:tls';
909
+ * import fs from 'node:fs';
910
910
  *
911
911
  * const options = {
912
912
  * key: fs.readFileSync('server-key.pem'),
@@ -951,8 +951,8 @@ declare module "tls" {
951
951
  *
952
952
  * ```js
953
953
  * // Assumes an echo server that is listening on port 8000.
954
- * const tls = require('tls');
955
- * const fs = require('fs');
954
+ * import tls from 'node:tls';
955
+ * import fs from 'node:fs';
956
956
  *
957
957
  * const options = {
958
958
  * // Necessary only if the server requires client certificate authentication.
@@ -46,7 +46,7 @@
46
46
  * Alternatively, trace events may be enabled using the `trace_events` module:
47
47
  *
48
48
  * ```js
49
- * const trace_events = require('trace_events');
49
+ * import trace_events from 'node:trace_events';
50
50
  * const tracing = trace_events.createTracing({ categories: ['node.perf'] });
51
51
  * tracing.enable(); // Enable trace event capture for the 'node.perf' category
52
52
  *
@@ -122,7 +122,7 @@ declare module "trace_events" {
122
122
  * Creates and returns a `Tracing` object for the given set of `categories`.
123
123
  *
124
124
  * ```js
125
- * const trace_events = require('trace_events');
125
+ * import trace_events from 'node:trace_events';
126
126
  * const categories = ['node.perf', 'node.async_hooks'];
127
127
  * const tracing = trace_events.createTracing({ categories });
128
128
  * tracing.enable();
@@ -142,7 +142,7 @@ declare module "trace_events" {
142
142
  * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console.
143
143
  *
144
144
  * ```js
145
- * const trace_events = require('trace_events');
145
+ * import trace_events from 'node:trace_events';
146
146
  * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
147
147
  * const t2 = trace_events.createTracing({ categories: ['node.perf'] });
148
148
  * const t3 = trace_events.createTracing({ categories: ['v8'] });