@types/node 16.4.3 → 16.4.7

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/fs.d.ts CHANGED
@@ -305,8 +305,6 @@ declare module 'fs' {
305
305
  prependOnceListener(event: 'close', listener: () => void): this;
306
306
  }
307
307
  /**
308
- * * Extends: `<stream.Readable>`
309
- *
310
308
  * Instances of `<fs.ReadStream>` are created and returned using the {@link createReadStream} function.
311
309
  * @since v0.1.93
312
310
  */
@@ -2555,7 +2553,7 @@ declare module 'fs' {
2555
2553
  * @since v0.1.29
2556
2554
  * @param file filename or file descriptor
2557
2555
  */
2558
- export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void;
2556
+ export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void;
2559
2557
  /**
2560
2558
  * Asynchronously writes data to a file, replacing the file if it already exists.
2561
2559
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -2586,7 +2584,7 @@ declare module 'fs' {
2586
2584
  * @since v0.1.29
2587
2585
  * @param file filename or file descriptor
2588
2586
  */
2589
- export function writeFileSync(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void;
2587
+ export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void;
2590
2588
  /**
2591
2589
  * Asynchronously append data to a file, creating the file if it does not yet
2592
2590
  * exist. `data` can be a string or a `<Buffer>`.
@@ -2638,7 +2636,7 @@ declare module 'fs' {
2638
2636
  * @since v0.6.7
2639
2637
  * @param path filename or file descriptor
2640
2638
  */
2641
- export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void;
2639
+ export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void;
2642
2640
  /**
2643
2641
  * Asynchronously append data to a file, creating the file if it does not exist.
2644
2642
  * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -2706,7 +2704,7 @@ declare module 'fs' {
2706
2704
  * @since v0.6.7
2707
2705
  * @param path filename or file descriptor
2708
2706
  */
2709
- export function appendFileSync(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void;
2707
+ export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void;
2710
2708
  /**
2711
2709
  * Watch for changes on `filename`. The callback `listener` will be called each
2712
2710
  * time the file is accessed.
@@ -3479,31 +3477,9 @@ declare module 'fs' {
3479
3477
  * @param mode modifiers for copy operation.
3480
3478
  */
3481
3479
  export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
3482
- /**
3483
- * Asynchronously copies src to dest. By default, dest is overwritten if it already exists.
3484
- * No arguments other than a possible exception are given to the callback function.
3485
- * Node.js makes no guarantees about the atomicity of the copy operation.
3486
- * If an error occurs after the destination file has been opened for writing, Node.js will attempt
3487
- * to remove the destination.
3488
- * @param src A path to the source file.
3489
- * @param dest A path to the destination file.
3490
- * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists.
3491
- */
3492
- export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: NoParamCallback): void;
3480
+ export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void;
3493
3481
  export namespace copyFile {
3494
- /**
3495
- * Asynchronously copies src to dest. By default, dest is overwritten if it already exists.
3496
- * No arguments other than a possible exception are given to the callback function.
3497
- * Node.js makes no guarantees about the atomicity of the copy operation.
3498
- * If an error occurs after the destination file has been opened for writing, Node.js will attempt
3499
- * to remove the destination.
3500
- * @param src A path to the source file.
3501
- * @param dest A path to the destination file.
3502
- * @param flags An optional integer that specifies the behavior of the copy operation.
3503
- * The only supported flag is fs.constants.COPYFILE_EXCL,
3504
- * which causes the copy operation to fail if dest already exists.
3505
- */
3506
- function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise<void>;
3482
+ function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise<void>;
3507
3483
  }
3508
3484
  /**
3509
3485
  * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it
@@ -3539,7 +3515,7 @@ declare module 'fs' {
3539
3515
  * @param dest destination filename of the copy operation
3540
3516
  * @param mode modifiers for copy operation.
3541
3517
  */
3542
- export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void;
3518
+ export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void;
3543
3519
  /**
3544
3520
  * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.
3545
3521
  *
node/http.d.ts CHANGED
@@ -182,7 +182,6 @@ declare module 'http' {
182
182
  }
183
183
  interface Server extends HttpBase {}
184
184
  /**
185
- * * Extends: `<net.Server>`
186
185
  * @since v0.1.17
187
186
  */
188
187
  class Server extends NetServer {
@@ -620,8 +619,6 @@ declare module 'http' {
620
619
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
621
620
  }
622
621
  /**
623
- * * Extends: `<stream.Readable>`
624
- *
625
622
  * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to
626
623
  * access response
627
624
  * status, headers and data.
@@ -677,7 +674,7 @@ declare module 'http' {
677
674
  /**
678
675
  * Alias for `message.socket`.
679
676
  * @since v0.1.90
680
- * @deprecated Since v16.0.0 - Deprecated. Use `socket`.
677
+ * @deprecated Since v16.0.0 - Use `socket`.
681
678
  */
682
679
  connection: Socket;
683
680
  /**
node/http2.d.ts CHANGED
@@ -1002,7 +1002,7 @@ declare module 'http2' {
1002
1002
  * @param origins One or more URL Strings passed as separate arguments.
1003
1003
  */
1004
1004
  origin(
1005
- ...args: Array<
1005
+ ...origins: Array<
1006
1006
  | string
1007
1007
  | url.URL
1008
1008
  | {
@@ -1170,8 +1170,6 @@ declare module 'http2' {
1170
1170
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
1171
1171
  }
1172
1172
  /**
1173
- * * Extends: `<stream.Readable>`
1174
- *
1175
1173
  * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status,
1176
1174
  * headers, and
1177
1175
  * data.
@@ -1194,7 +1192,7 @@ declare module 'http2' {
1194
1192
  /**
1195
1193
  * See `request.socket`.
1196
1194
  * @since v8.4.0
1197
- * @deprecated Since v13.0.0 - Deprecated. Use `socket`.
1195
+ * @deprecated Since v13.0.0 - Use `socket`.
1198
1196
  */
1199
1197
  readonly connection: net.Socket | tls.TLSSocket;
1200
1198
  /**
@@ -1417,14 +1415,14 @@ declare module 'http2' {
1417
1415
  /**
1418
1416
  * See `response.socket`.
1419
1417
  * @since v8.4.0
1420
- * @deprecated Since v13.0.0 - Deprecated. Use `socket`.
1418
+ * @deprecated Since v13.0.0 - Use `socket`.
1421
1419
  */
1422
1420
  readonly connection: net.Socket | tls.TLSSocket;
1423
1421
  /**
1424
1422
  * Boolean value that indicates whether the response has completed. Starts
1425
1423
  * as `false`. After `response.end()` executes, the value will be `true`.
1426
1424
  * @since v8.4.0
1427
- * @deprecated Since v13.4.0,v12.16.0 - Deprecated. Use `writableEnded`.
1425
+ * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`.
1428
1426
  */
1429
1427
  readonly finished: boolean;
1430
1428
  /**
@@ -1432,10 +1430,71 @@ declare module 'http2' {
1432
1430
  * @since v8.4.0
1433
1431
  */
1434
1432
  readonly headersSent: boolean;
1433
+ /**
1434
+ * A reference to the original HTTP2 request object.
1435
+ * @since v15.7.0
1436
+ */
1437
+ readonly req: Http2ServerRequest;
1438
+ /**
1439
+ * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but
1440
+ * applies getters, setters, and methods based on HTTP/2 logic.
1441
+ *
1442
+ * `destroyed`, `readable`, and `writable` properties will be retrieved from and
1443
+ * set on `response.stream`.
1444
+ *
1445
+ * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`.
1446
+ *
1447
+ * `setTimeout` method will be called on `response.stream.session`.
1448
+ *
1449
+ * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for
1450
+ * more information.
1451
+ *
1452
+ * All other interactions will be routed directly to the socket.
1453
+ *
1454
+ * ```js
1455
+ * const http2 = require('http2');
1456
+ * const server = http2.createServer((req, res) => {
1457
+ * const ip = req.socket.remoteAddress;
1458
+ * const port = req.socket.remotePort;
1459
+ * res.end(`Your IP address is ${ip} and your source port is ${port}.`);
1460
+ * }).listen(3000);
1461
+ * ```
1462
+ * @since v8.4.0
1463
+ */
1435
1464
  readonly socket: net.Socket | tls.TLSSocket;
1465
+ /**
1466
+ * The `Http2Stream` object backing the response.
1467
+ * @since v8.4.0
1468
+ */
1436
1469
  readonly stream: ServerHttp2Stream;
1470
+ /**
1471
+ * When true, the Date header will be automatically generated and sent in
1472
+ * the response if it is not already present in the headers. Defaults to true.
1473
+ *
1474
+ * This should only be disabled for testing; HTTP requires the Date header
1475
+ * in responses.
1476
+ * @since v8.4.0
1477
+ */
1437
1478
  sendDate: boolean;
1479
+ /**
1480
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
1481
+ * this property controls the status code that will be sent to the client when
1482
+ * the headers get flushed.
1483
+ *
1484
+ * ```js
1485
+ * response.statusCode = 404;
1486
+ * ```
1487
+ *
1488
+ * After response header was sent to the client, this property indicates the
1489
+ * status code which was sent out.
1490
+ * @since v8.4.0
1491
+ */
1438
1492
  statusCode: number;
1493
+ /**
1494
+ * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns
1495
+ * an empty string.
1496
+ * @since v8.4.0
1497
+ */
1439
1498
  statusMessage: '';
1440
1499
  /**
1441
1500
  * This method adds HTTP trailing headers (a header but at the end of the
node/https.d.ts CHANGED
@@ -27,8 +27,6 @@ declare module 'https' {
27
27
  }
28
28
  interface Server extends http.HttpBase {}
29
29
  /**
30
- * * Extends: `<tls.Server>`
31
- *
32
30
  * See `http.Server` for more information.
33
31
  * @since v0.3.4
34
32
  */
node/module.d.ts CHANGED
@@ -66,6 +66,9 @@ declare module 'module' {
66
66
  * @since v13.7.0, v12.17.0
67
67
  */
68
68
  class SourceMap {
69
+ /**
70
+ * Getter for the payload used to construct the `SourceMap` instance.
71
+ */
69
72
  readonly payload: SourceMapPayload;
70
73
  constructor(payload: SourceMapPayload);
71
74
  /**
node/net.d.ts CHANGED
@@ -59,8 +59,6 @@ declare module 'net' {
59
59
  }
60
60
  type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
61
61
  /**
62
- * * Extends: `<stream.Duplex>`
63
- *
64
62
  * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint
65
63
  * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also
66
64
  * an `EventEmitter`.
@@ -286,9 +284,9 @@ declare module 'net' {
286
284
  * @param callback Optional callback for when the socket is finished.
287
285
  * @return The socket itself.
288
286
  */
289
- end(cb?: () => void): void;
290
- end(buffer: Uint8Array | string, cb?: () => void): void;
291
- end(str: Uint8Array | string, encoding?: BufferEncoding, cb?: () => void): void;
287
+ end(callback?: () => void): void;
288
+ end(buffer: Uint8Array | string, callback?: () => void): void;
289
+ end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): void;
292
290
  /**
293
291
  * events.EventEmitter
294
292
  * 1. close
@@ -301,7 +299,7 @@ declare module 'net' {
301
299
  * 8. timeout
302
300
  */
303
301
  addListener(event: string, listener: (...args: any[]) => void): this;
304
- addListener(event: 'close', listener: (had_error: boolean) => void): this;
302
+ addListener(event: 'close', listener: (hadError: boolean) => void): this;
305
303
  addListener(event: 'connect', listener: () => void): this;
306
304
  addListener(event: 'data', listener: (data: Buffer) => void): this;
307
305
  addListener(event: 'drain', listener: () => void): this;
@@ -310,7 +308,7 @@ declare module 'net' {
310
308
  addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
311
309
  addListener(event: 'timeout', listener: () => void): this;
312
310
  emit(event: string | symbol, ...args: any[]): boolean;
313
- emit(event: 'close', had_error: boolean): boolean;
311
+ emit(event: 'close', hadError: boolean): boolean;
314
312
  emit(event: 'connect'): boolean;
315
313
  emit(event: 'data', data: Buffer): boolean;
316
314
  emit(event: 'drain'): boolean;
@@ -319,7 +317,7 @@ declare module 'net' {
319
317
  emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean;
320
318
  emit(event: 'timeout'): boolean;
321
319
  on(event: string, listener: (...args: any[]) => void): this;
322
- on(event: 'close', listener: (had_error: boolean) => void): this;
320
+ on(event: 'close', listener: (hadError: boolean) => void): this;
323
321
  on(event: 'connect', listener: () => void): this;
324
322
  on(event: 'data', listener: (data: Buffer) => void): this;
325
323
  on(event: 'drain', listener: () => void): this;
@@ -328,7 +326,7 @@ declare module 'net' {
328
326
  on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
329
327
  on(event: 'timeout', listener: () => void): this;
330
328
  once(event: string, listener: (...args: any[]) => void): this;
331
- once(event: 'close', listener: (had_error: boolean) => void): this;
329
+ once(event: 'close', listener: (hadError: boolean) => void): this;
332
330
  once(event: 'connect', listener: () => void): this;
333
331
  once(event: 'data', listener: (data: Buffer) => void): this;
334
332
  once(event: 'drain', listener: () => void): this;
@@ -337,7 +335,7 @@ declare module 'net' {
337
335
  once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
338
336
  once(event: 'timeout', listener: () => void): this;
339
337
  prependListener(event: string, listener: (...args: any[]) => void): this;
340
- prependListener(event: 'close', listener: (had_error: boolean) => void): this;
338
+ prependListener(event: 'close', listener: (hadError: boolean) => void): this;
341
339
  prependListener(event: 'connect', listener: () => void): this;
342
340
  prependListener(event: 'data', listener: (data: Buffer) => void): this;
343
341
  prependListener(event: 'drain', listener: () => void): this;
@@ -346,7 +344,7 @@ declare module 'net' {
346
344
  prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this;
347
345
  prependListener(event: 'timeout', listener: () => void): this;
348
346
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
349
- prependOnceListener(event: 'close', listener: (had_error: boolean) => void): this;
347
+ prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this;
350
348
  prependOnceListener(event: 'connect', listener: () => void): this;
351
349
  prependOnceListener(event: 'data', listener: (data: Buffer) => void): this;
352
350
  prependOnceListener(event: 'drain', listener: () => void): this;
node/os.d.ts CHANGED
@@ -448,10 +448,6 @@ declare module 'os' {
448
448
  * @param priority The scheduling priority to assign to the process.
449
449
  */
450
450
  function setPriority(priority: number): void;
451
- /**
452
- * Sets the priority of the process specified process.
453
- * @param priority Must be in range of -20 to 19
454
- */
455
451
  function setPriority(pid: number, priority: number): void;
456
452
  }
457
453
  declare module 'node:os' {
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.4.3",
3
+ "version": "16.4.7",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -232,6 +232,6 @@
232
232
  },
233
233
  "scripts": {},
234
234
  "dependencies": {},
235
- "typesPublisherContentHash": "7773c70431ea6e9c0933bf765366c8cdb469355d431747d11fab3a760e130912",
235
+ "typesPublisherContentHash": "15db94446f7f1e160948be1b1ecb14684eef4f4a29dc0fd41a570f2f071209d1",
236
236
  "typeScriptVersion": "3.6"
237
237
  }
node/process.d.ts CHANGED
@@ -1126,7 +1126,7 @@ declare module 'process' {
1126
1126
  * }
1127
1127
  * ```
1128
1128
  * @since v0.1.26
1129
- * @param ...args Additional arguments to pass when invoking the `callback`
1129
+ * @param args Additional arguments to pass when invoking the `callback`
1130
1130
  */
1131
1131
  nextTick(callback: Function, ...args: any[]): void;
1132
1132
  /**
@@ -1165,8 +1165,8 @@ declare module 'process' {
1165
1165
  * `process.umask()` returns the Node.js process's file mode creation mask. Child
1166
1166
  * processes inherit the mask from the parent process.
1167
1167
  * @since v0.1.19
1168
- * @deprecated Deprecated. Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a *
1169
- * potential security vulnerability. There is no safe, cross-platform alternative API.
1168
+ * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential *
1169
+ * security vulnerability. There is no safe, cross-platform alternative API.
1170
1170
  */
1171
1171
  umask(): number;
1172
1172
  /**
node/repl.d.ts CHANGED
@@ -312,7 +312,7 @@ declare module 'repl' {
312
312
  * @param historyPath the path to the history file
313
313
  * @param callback called when history writes are ready or upon error
314
314
  */
315
- setupHistory(path: string, cb: (err: Error | null, repl: this) => void): void;
315
+ setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void;
316
316
  /**
317
317
  * events.EventEmitter
318
318
  * 1. close - inherited from `readline.Interface`
node/stream.d.ts CHANGED
@@ -376,7 +376,7 @@ declare module 'stream' {
376
376
  * @since v0.9.4
377
377
  * @param stream An "old style" readable stream
378
378
  */
379
- wrap(oldStream: NodeJS.ReadableStream): this;
379
+ wrap(stream: NodeJS.ReadableStream): this;
380
380
  push(chunk: any, encoding?: BufferEncoding): boolean;
381
381
  _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
382
382
  /**
@@ -591,8 +591,8 @@ declare module 'stream' {
591
591
  * @param callback Callback for when this chunk of data is flushed.
592
592
  * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
593
593
  */
594
- write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
595
- write(chunk: any, encoding: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
594
+ write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
595
+ write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
596
596
  /**
597
597
  * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream.
598
598
  * @since v0.11.15
node/tls.d.ts CHANGED
@@ -127,8 +127,6 @@ declare module 'tls' {
127
127
  requestOCSP?: boolean | undefined;
128
128
  }
129
129
  /**
130
- * * Extends: `<net.Socket>`
131
- *
132
130
  * Performs transparent encryption of written data and all required TLS
133
131
  * negotiation.
134
132
  *
@@ -144,7 +142,9 @@ declare module 'tls' {
144
142
  */
145
143
  constructor(socket: net.Socket, options?: TLSSocketOptions);
146
144
  /**
147
- * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.
145
+ * Returns `true` if the peer certificate was signed by one of the CAs specified
146
+ * when creating the `tls.TLSSocket` instance, otherwise `false`.
147
+ * @since v0.11.4
148
148
  */
149
149
  authorized: boolean;
150
150
  /**
@@ -542,8 +542,6 @@ declare module 'tls' {
542
542
  pskCallback?(hint: string | null): PSKCallbackNegotation | null;
543
543
  }
544
544
  /**
545
- * * Extends: `<net.Server>`
546
- *
547
545
  * Accepts encrypted connections using TLS or SSL.
548
546
  * @since v0.3.2
549
547
  */
@@ -560,7 +558,7 @@ declare module 'tls' {
560
558
  * @param hostname A SNI host name or wildcard (e.g. `'*'`)
561
559
  * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc).
562
560
  */
563
- addContext(hostName: string, credentials: SecureContextOptions): void;
561
+ addContext(hostname: string, context: SecureContextOptions): void;
564
562
  /**
565
563
  * Returns the session ticket keys.
566
564
  *
@@ -575,7 +573,7 @@ declare module 'tls' {
575
573
  * @since v11.0.0
576
574
  * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc).
577
575
  */
578
- setSecureContext(details: SecureContextOptions): void;
576
+ setSecureContext(options: SecureContextOptions): void;
579
577
  /**
580
578
  * Sets the session ticket keys.
581
579
  *
@@ -825,7 +823,7 @@ declare module 'tls' {
825
823
  * @param hostname The host name or IP address to verify the certificate against.
826
824
  * @param cert A `certificate object` representing the peer's certificate.
827
825
  */
828
- function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined;
826
+ function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined;
829
827
  /**
830
828
  * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is
831
829
  * automatically set as a listener for the `'secureConnection'` event.
@@ -949,7 +947,7 @@ declare module 'tls' {
949
947
  * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`.
950
948
  * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`.
951
949
  */
952
- function createSecurePair(credentials?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
950
+ function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
953
951
  /**
954
952
  * {@link createServer} sets the default value of the `honorCipherOrder` option
955
953
  * to `true`, other APIs that create secure contexts leave it unset.
node/tty.d.ts CHANGED
@@ -35,8 +35,6 @@ declare module 'tty' {
35
35
  */
36
36
  function isatty(fd: number): boolean;
37
37
  /**
38
- * * Extends: `<net.Socket>`
39
- *
40
38
  * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js
41
39
  * process and there should be no reason to create additional instances.
42
40
  * @since v0.5.8
@@ -74,8 +72,6 @@ declare module 'tty' {
74
72
  */
75
73
  type Direction = -1 | 0 | 1;
76
74
  /**
77
- * * Extends: `<net.Socket>`
78
- *
79
75
  * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there
80
76
  * should be no reason to create additional instances.
81
77
  * @since v0.5.8
@@ -155,7 +151,7 @@ declare module 'tty' {
155
151
  * @since v9.9.0
156
152
  * @param env An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
157
153
  */
158
- getColorDepth(env?: {}): number;
154
+ getColorDepth(env?: object): number;
159
155
  /**
160
156
  * Returns `true` if the `writeStream` supports at least as many colors as provided
161
157
  * in `count`. Minimum support is 2 (black and white).
@@ -176,9 +172,9 @@ declare module 'tty' {
176
172
  * @param count The number of colors that are requested (minimum 2).
177
173
  * @param env An object containing the environment variables to check. This enables simulating the usage of a specific terminal.
178
174
  */
179
- hasColors(depth?: number): boolean;
180
- hasColors(env?: {}): boolean;
181
- hasColors(depth: number, env?: {}): boolean;
175
+ hasColors(count?: number): boolean;
176
+ hasColors(env?: object): boolean;
177
+ hasColors(count: number, env?: object): boolean;
182
178
  /**
183
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
184
180
  * the number
node/url.d.ts CHANGED
@@ -70,13 +70,10 @@ declare module 'url' {
70
70
  * @param slashesDenoteHost If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the result
71
71
  * would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
72
72
  */
73
- function parse(urlStr: string): UrlWithStringQuery;
74
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
75
- function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
76
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
77
- function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
78
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
79
- function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
73
+ function parse(urlString: string): UrlWithStringQuery;
74
+ function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
75
+ function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
76
+ function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
80
77
  /**
81
78
  * The `url.format()` method returns a formatted URL string derived from`urlObject`.
82
79
  *
@@ -140,8 +137,7 @@ declare module 'url' {
140
137
  * @deprecated Legacy: Use the WHATWG URL API instead.
141
138
  * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`.
142
139
  */
143
- function format(URL: URL, options?: URLFormatOptions): string;
144
- /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
140
+ function format(urlObject: URL, options?: URLFormatOptions): string;
145
141
  function format(urlObject: UrlObject | string): string;
146
142
  /**
147
143
  * The `url.resolve()` method resolves a target URL relative to a base URL in a
@@ -313,7 +309,7 @@ declare module 'url' {
313
309
  * @param path The path to convert to a File URL.
314
310
  * @return The file URL object.
315
311
  */
316
- function pathToFileURL(url: string): URL;
312
+ function pathToFileURL(path: string): URL;
317
313
  /**
318
314
  * This utility function converts a URL object into an ordinary options object as
319
315
  * expected by the `http.request()` and `https.request()` APIs.
@@ -758,7 +754,7 @@ declare module 'url' {
758
754
  * @param fn Invoked for each name-value pair in the query
759
755
  * @param thisArg To be used as `this` value for when `fn` is called
760
756
  */
761
- forEach(callback: (value: string, name: string, searchParams: this) => void): void;
757
+ forEach<TThis = this>(callback: (this: TThis, value: string, name: string, searchParams: this) => void, thisArg?: TThis): void;
762
758
  /**
763
759
  * Returns the value of the first name-value pair whose name is `name`. If there
764
760
  * are no such pairs, `null` is returned.
node/util.d.ts CHANGED
@@ -451,6 +451,10 @@ declare module 'util' {
451
451
  * @deprecated Legacy: Use ES2015 class syntax and `extends` keyword instead.
452
452
  */
453
453
  export function inherits(constructor: unknown, superConstructor: unknown): void;
454
+ export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
455
+ export interface DebugLogger extends DebugLoggerFunction {
456
+ enabled: boolean;
457
+ }
454
458
  /**
455
459
  * The `util.debuglog()` method is used to create a function that conditionally
456
460
  * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that
@@ -508,7 +512,7 @@ declare module 'util' {
508
512
  * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function.
509
513
  * @return The logging function
510
514
  */
511
- export function debuglog(key: string): (msg: string, ...param: unknown[]) => void;
515
+ export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
512
516
  /**
513
517
  * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
514
518
  *
@@ -768,7 +772,7 @@ declare module 'util' {
768
772
  * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes.
769
773
  * @return The deprecated function wrapped to emit a warning.
770
774
  */
771
- export function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
775
+ export function deprecate<T extends Function>(fn: T, msg: string, code?: string): T;
772
776
  /**
773
777
  * Returns `true` if there is deep strict equality between `val1` and `val2`.
774
778
  * Otherwise, returns `false`.
@@ -1050,7 +1054,7 @@ declare module 'util' {
1050
1054
  * @param src The text to encode.
1051
1055
  * @param dest The array to hold the encode result.
1052
1056
  */
1053
- encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
1057
+ encodeInto(src: string, dest: Uint8Array): EncodeIntoResult;
1054
1058
  }
1055
1059
  }
1056
1060
  declare module 'util/types' {
node/v8.d.ts CHANGED
@@ -217,7 +217,7 @@ declare module 'v8' {
217
217
  * worker thread.
218
218
  * @return The filename where the snapshot was saved.
219
219
  */
220
- function writeHeapSnapshot(fileName?: string): string;
220
+ function writeHeapSnapshot(filename?: string): string;
221
221
  /**
222
222
  * Returns an object with the following properties:
223
223
  *
@@ -353,7 +353,7 @@ declare module 'v8' {
353
353
  * @since v8.0.0
354
354
  * @param buffer A buffer returned by {@link serialize}.
355
355
  */
356
- function deserialize(data: NodeJS.TypedArray): any;
356
+ function deserialize(buffer: NodeJS.TypedArray): any;
357
357
  /**
358
358
  * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple
359
359
  * times during the lifetime of the process. Each time the execution counter will
node/vm.d.ts CHANGED
@@ -191,7 +191,7 @@ declare module 'vm' {
191
191
  * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method.
192
192
  * @return the result of the very last statement executed in the script.
193
193
  */
194
- runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
194
+ runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any;
195
195
  /**
196
196
  * First contextifies the given `contextObject`, runs the compiled code contained
197
197
  * by the `vm.Script` object within the created context, and returns the result.
@@ -218,7 +218,7 @@ declare module 'vm' {
218
218
  * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
219
219
  * @return the result of the very last statement executed in the script.
220
220
  */
221
- runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
221
+ runInNewContext(contextObject?: Context, options?: RunningScriptOptions): any;
222
222
  /**
223
223
  * Runs the compiled code contained by the `vm.Script` within the context of the
224
224
  * current `global` object. Running code does not have access to local scope, but_does_ have access to the current `global` object.
@@ -340,7 +340,7 @@ declare module 'vm' {
340
340
  * @param contextifiedObject The `contextified` object that will be used as the `global` when the `code` is compiled and run.
341
341
  * @return the result of the very last statement executed in the script.
342
342
  */
343
- function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
343
+ function runInContext(code: string, contextifiedObject: Context, options?: RunningScriptOptions | string): any;
344
344
  /**
345
345
  * The `vm.runInNewContext()` first contextifies the given `contextObject` (or
346
346
  * creates a new `contextObject` if passed as `undefined`), compiles the `code`,
@@ -369,7 +369,7 @@ declare module 'vm' {
369
369
  * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
370
370
  * @return the result of the very last statement executed in the script.
371
371
  */
372
- function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
372
+ function runInNewContext(code: string, contextObject?: Context, options?: RunningScriptOptions | string): any;
373
373
  /**
374
374
  * `vm.runInThisContext()` compiles `code`, runs it within the context of the
375
375
  * current `global` and returns the result. Running code does not have access to