@types/node 16.11.39 → 18.11.2

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 (111) hide show
  1. {node v16.11 → node}/LICENSE +0 -0
  2. node v16.11/README.md → node/README.md +4 -4
  3. {node v16.11 → node}/assert/strict.d.ts +0 -0
  4. node v16.11/assert.d.ts → node/assert.d.ts +7 -8
  5. node v16.11/async_hooks.d.ts → node/async_hooks.d.ts +8 -4
  6. node/buffer.d.ts +2258 -0
  7. node v16.11/child_process.d.ts → node/child_process.d.ts +6 -3
  8. node v16.11/cluster.d.ts → node/cluster.d.ts +14 -18
  9. node v16.11/console.d.ts → node/console.d.ts +1 -1
  10. {node v16.11 → node}/constants.d.ts +0 -0
  11. node v16.11/crypto.d.ts → node/crypto.d.ts +679 -53
  12. node v16.11/dgram.d.ts → node/dgram.d.ts +3 -3
  13. node v16.11/diagnostics_channel.d.ts → node/diagnostics_channel.d.ts +2 -1
  14. node v16.11/dns/promises.d.ts → node/dns/promises.d.ts +10 -8
  15. node v16.11/dns.d.ts → node/dns.d.ts +16 -11
  16. node/dom-events.d.ts +126 -0
  17. node v16.11/domain.d.ts → node/domain.d.ts +3 -2
  18. node v16.11/events.d.ts → node/events.d.ts +65 -10
  19. node v16.11/fs/promises.d.ts → node/fs/promises.d.ts +86 -39
  20. node v16.11/fs.d.ts → node/fs.d.ts +149 -67
  21. node/globals.d.ts +300 -0
  22. {node v16.11 → node}/globals.global.d.ts +0 -0
  23. node v16.11/http.d.ts → node/http.d.ts +305 -77
  24. node v16.11/http2.d.ts → node/http2.d.ts +38 -5
  25. node v16.11/https.d.ts → node/https.d.ts +209 -59
  26. node v16.11/index.d.ts → node/index.d.ts +6 -3
  27. node v16.11/inspector.d.ts → node/inspector.d.ts +11 -15
  28. {node v16.11 → node}/module.d.ts +0 -0
  29. node v16.11/net.d.ts → node/net.d.ts +94 -21
  30. node v16.11/os.d.ts → node/os.d.ts +15 -4
  31. node v16.11/package.json → node/package.json +15 -8
  32. node v16.11/path.d.ts → node/path.d.ts +34 -23
  33. node v16.11/perf_hooks.d.ts → node/perf_hooks.d.ts +76 -8
  34. node v16.11/process.d.ts → node/process.d.ts +17 -16
  35. node v16.11/punycode.d.ts → node/punycode.d.ts +1 -1
  36. node v16.11/querystring.d.ts → node/querystring.d.ts +4 -4
  37. node/readline/promises.d.ts +143 -0
  38. node v16.11/readline.d.ts → node/readline.d.ts +140 -30
  39. node v16.11/repl.d.ts → node/repl.d.ts +2 -2
  40. node v16.11/stream/consumers.d.ts → node/stream/consumers.d.ts +2 -14
  41. {node v16.11 → node}/stream/promises.d.ts +0 -0
  42. node v16.11/stream/web.d.ts → node/stream/web.d.ts +3 -65
  43. node v16.11/stream.d.ts → node/stream.d.ts +97 -19
  44. node v16.11/string_decoder.d.ts → node/string_decoder.d.ts +1 -1
  45. node/test.d.ts +314 -0
  46. {node v16.11 → node}/timers/promises.d.ts +0 -0
  47. node v16.11/timers.d.ts → node/timers.d.ts +1 -1
  48. node v16.11/tls.d.ts → node/tls.d.ts +32 -23
  49. node v16.11/trace_events.d.ts → node/trace_events.d.ts +11 -1
  50. node/ts4.8/assert/strict.d.ts +8 -0
  51. node/ts4.8/assert.d.ts +911 -0
  52. node/ts4.8/async_hooks.d.ts +501 -0
  53. node v16.11/buffer.d.ts → node/ts4.8/buffer.d.ts +46 -19
  54. node/ts4.8/child_process.d.ts +1369 -0
  55. node/ts4.8/cluster.d.ts +410 -0
  56. node/ts4.8/console.d.ts +412 -0
  57. node/ts4.8/constants.d.ts +18 -0
  58. node/ts4.8/crypto.d.ts +3964 -0
  59. node/ts4.8/dgram.d.ts +545 -0
  60. node/ts4.8/diagnostics_channel.d.ts +153 -0
  61. node/ts4.8/dns/promises.d.ts +370 -0
  62. node/ts4.8/dns.d.ts +659 -0
  63. node/ts4.8/dom-events.d.ts +126 -0
  64. node/ts4.8/domain.d.ts +170 -0
  65. node/ts4.8/events.d.ts +678 -0
  66. node/ts4.8/fs/promises.d.ts +1138 -0
  67. node/ts4.8/fs.d.ts +3872 -0
  68. node v16.11/globals.d.ts → node/ts4.8/globals.d.ts +14 -4
  69. node/ts4.8/globals.global.d.ts +1 -0
  70. node/ts4.8/http.d.ts +1607 -0
  71. node/ts4.8/http2.d.ts +2134 -0
  72. node/ts4.8/https.d.ts +541 -0
  73. node/ts4.8/index.d.ts +88 -0
  74. node/ts4.8/inspector.d.ts +2741 -0
  75. node/ts4.8/module.d.ts +114 -0
  76. node/ts4.8/net.d.ts +869 -0
  77. node/ts4.8/os.d.ts +466 -0
  78. node/ts4.8/path.d.ts +191 -0
  79. node/ts4.8/perf_hooks.d.ts +625 -0
  80. node/ts4.8/process.d.ts +1482 -0
  81. node/ts4.8/punycode.d.ts +117 -0
  82. node/ts4.8/querystring.d.ts +131 -0
  83. node/ts4.8/readline/promises.d.ts +143 -0
  84. node/ts4.8/readline.d.ts +653 -0
  85. node/ts4.8/repl.d.ts +424 -0
  86. node/ts4.8/stream/consumers.d.ts +12 -0
  87. node/ts4.8/stream/promises.d.ts +42 -0
  88. node/ts4.8/stream/web.d.ts +330 -0
  89. node/ts4.8/stream.d.ts +1340 -0
  90. node/ts4.8/string_decoder.d.ts +67 -0
  91. node/ts4.8/test.d.ts +314 -0
  92. node/ts4.8/timers/promises.d.ts +68 -0
  93. node/ts4.8/timers.d.ts +94 -0
  94. node/ts4.8/tls.d.ts +1028 -0
  95. node/ts4.8/trace_events.d.ts +171 -0
  96. node v16.11/tty.d.ts → node/ts4.8/tty.d.ts +4 -2
  97. node v16.11/url.d.ts → node/ts4.8/url.d.ts +85 -39
  98. node v16.11/util.d.ts → node/ts4.8/util.d.ts +268 -12
  99. node v16.11/v8.d.ts → node/ts4.8/v8.d.ts +21 -3
  100. node v16.11/vm.d.ts → node/ts4.8/vm.d.ts +6 -4
  101. node v16.11/wasi.d.ts → node/ts4.8/wasi.d.ts +1 -1
  102. node v16.11/worker_threads.d.ts → node/ts4.8/worker_threads.d.ts +50 -10
  103. node v16.11/zlib.d.ts → node/ts4.8/zlib.d.ts +1 -1
  104. node/tty.d.ts +206 -0
  105. node/url.d.ts +897 -0
  106. node/util.d.ts +1850 -0
  107. node/v8.d.ts +396 -0
  108. node/vm.d.ts +509 -0
  109. node/wasi.d.ts +158 -0
  110. node/worker_threads.d.ts +689 -0
  111. node/zlib.d.ts +517 -0
@@ -6,11 +6,12 @@
6
6
  * ```js
7
7
  * const tls = require('tls');
8
8
  * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/tls.js)
9
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/tls.js)
10
10
  */
11
11
  declare module 'tls' {
12
12
  import { X509Certificate } from 'node:crypto';
13
13
  import * as net from 'node:net';
14
+ import * as stream from 'stream';
14
15
  const CLIENT_RENEG_LIMIT: number;
15
16
  const CLIENT_RENEG_WINDOW: number;
16
17
  interface Certificate {
@@ -142,8 +143,8 @@ declare module 'tls' {
142
143
  */
143
144
  constructor(socket: net.Socket, options?: TLSSocketOptions);
144
145
  /**
145
- * Returns `true` if the peer certificate was signed by one of the CAs specified
146
- * when creating the `tls.TLSSocket` instance, otherwise `false`.
146
+ * This property is `true` if the peer certificate was signed by one of the CAs
147
+ * specified when creating the `tls.TLSSocket` instance, otherwise `false`.
147
148
  * @since v0.11.4
148
149
  */
149
150
  authorized: boolean;
@@ -342,9 +343,9 @@ declare module 'tls' {
342
343
  * When enabled, TLS packet trace information is written to `stderr`. This can be
343
344
  * used to debug TLS connection problems.
344
345
  *
345
- * Note: The format of the output is identical to the output of `openssl s_client -trace` or `openssl s_server -trace`. While it is produced by OpenSSL's`SSL_trace()` function, the format is
346
- * undocumented, can change without notice,
347
- * and should not be relied on.
346
+ * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by
347
+ * OpenSSL's `SSL_trace()` function, the format is undocumented, can change
348
+ * without notice, and should not be relied on.
348
349
  * @since v12.2.0
349
350
  */
350
351
  enableTrace(): void;
@@ -373,7 +374,7 @@ declare module 'tls' {
373
374
  * 128,
374
375
  * 'client finished');
375
376
  *
376
- *
377
+ * /*
377
378
  * Example return value of keyingMaterial:
378
379
  * <Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9
379
380
  * 12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91
@@ -516,7 +517,7 @@ declare module 'tls' {
516
517
  host?: string | undefined;
517
518
  port?: number | undefined;
518
519
  path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
519
- socket?: net.Socket | undefined; // Establish secure connection on a given socket rather than creating a new socket
520
+ socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket
520
521
  checkServerIdentity?: typeof checkServerIdentity | undefined;
521
522
  servername?: string | undefined; // SNI TLS Extension
522
523
  session?: Buffer | undefined;
@@ -597,44 +598,44 @@ declare module 'tls' {
597
598
  */
598
599
  addListener(event: string, listener: (...args: any[]) => void): this;
599
600
  addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
600
- addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
601
+ addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
601
602
  addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
602
- addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
603
+ addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
603
604
  addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
604
605
  addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
605
606
  emit(event: string | symbol, ...args: any[]): boolean;
606
607
  emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean;
607
- emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean;
608
+ emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
608
609
  emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
609
- emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
610
+ emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean;
610
611
  emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean;
611
612
  emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean;
612
613
  on(event: string, listener: (...args: any[]) => void): this;
613
614
  on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
614
- on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
615
+ on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
615
616
  on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
616
- on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
617
+ on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
617
618
  on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
618
619
  on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
619
620
  once(event: string, listener: (...args: any[]) => void): this;
620
621
  once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
621
- once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
622
+ once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
622
623
  once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
623
- once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
624
+ once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
624
625
  once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
625
626
  once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
626
627
  prependListener(event: string, listener: (...args: any[]) => void): this;
627
628
  prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
628
- prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
629
+ prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
629
630
  prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
630
- prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
631
+ prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
631
632
  prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
632
633
  prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
633
634
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
634
635
  prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this;
635
- prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
636
+ prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
636
637
  prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
637
- prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
638
+ prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this;
638
639
  prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this;
639
640
  prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
640
641
  }
@@ -722,7 +723,7 @@ declare module 'tls' {
722
723
  * object.passphrase is optional. Encrypted keys will be decrypted with
723
724
  * object.passphrase if provided, or options.passphrase if it is not.
724
725
  */
725
- key?: string | Buffer | Array<Buffer | KeyObject> | undefined;
726
+ key?: string | Buffer | Array<string | Buffer | KeyObject> | undefined;
726
727
  /**
727
728
  * Name of an OpenSSL engine to get private key from. Should be used
728
729
  * together with privateKeyIdentifier.
@@ -813,13 +814,19 @@ declare module 'tls' {
813
814
  * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on
814
815
  * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type).
815
816
  *
816
- * This function can be overwritten by providing alternative function as part of
817
- * the `options.checkServerIdentity` option passed to `tls.connect()`. The
817
+ * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as
818
+ * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead.
819
+ *
820
+ * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The
818
821
  * overwriting function can call `tls.checkServerIdentity()` of course, to augment
819
822
  * the checks done with additional verification.
820
823
  *
821
824
  * This function is only called if the certificate passed all other checks, such as
822
825
  * being issued by trusted CA (`options.ca`).
826
+ *
827
+ * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name
828
+ * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use
829
+ * a custom`options.checkServerIdentity` function that implements the desired behavior.
823
830
  * @since v0.8.4
824
831
  * @param hostname The host name or IP address to verify the certificate against.
825
832
  * @param cert A `certificate object` representing the peer's certificate.
@@ -972,6 +979,8 @@ declare module 'tls' {
972
979
  * lower-case for historical reasons, but must be uppercased to be used in
973
980
  * the `ciphers` option of {@link createSecureContext}.
974
981
  *
982
+ * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`.
983
+ *
975
984
  * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for
976
985
  * TLSv1.2 and below.
977
986
  *
@@ -66,6 +66,16 @@
66
66
  * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
67
67
  * ```
68
68
  *
69
+ * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
70
+ * in your code, such as:
71
+ *
72
+ * ```js
73
+ * process.on('SIGINT', function onSigint() {
74
+ * console.info('Received SIGINT.');
75
+ * process.exit(130); // Or applicable exit code depending on OS and signal
76
+ * });
77
+ * ```
78
+ *
69
79
  * The tracing system uses the same time source
70
80
  * as the one used by `process.hrtime()`.
71
81
  * However the trace-event timestamps are expressed in microseconds,
@@ -73,7 +83,7 @@
73
83
  *
74
84
  * The features from this module are not available in `Worker` threads.
75
85
  * @experimental
76
- * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/trace_events.js)
86
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/trace_events.js)
77
87
  */
78
88
  declare module 'trace_events' {
79
89
  /**
@@ -0,0 +1,8 @@
1
+ declare module 'assert/strict' {
2
+ import { strict } from 'node:assert';
3
+ export = strict;
4
+ }
5
+ declare module 'node:assert/strict' {
6
+ import { strict } from 'node:assert';
7
+ export = strict;
8
+ }