@types/node 22.15.21 → 22.19.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 v22.19/README.md +15 -0
- node v22.19/assert/strict.d.ts +111 -0
- node/assert.d.ts → node v22.19/assert.d.ts +119 -95
- node/buffer.buffer.d.ts → node v22.19/buffer.buffer.d.ts +9 -0
- node/buffer.d.ts → node v22.19/buffer.d.ts +14 -6
- node/child_process.d.ts → node v22.19/child_process.d.ts +89 -162
- node/cluster.d.ts → node v22.19/cluster.d.ts +4 -5
- node/compatibility/disposable.d.ts → node v22.19/compatibility/disposable.d.ts +0 -2
- node/compatibility/indexable.d.ts → node v22.19/compatibility/indexable.d.ts +0 -3
- node/compatibility/iterators.d.ts → node v22.19/compatibility/iterators.d.ts +0 -1
- node/crypto.d.ts → node v22.19/crypto.d.ts +203 -167
- node/dgram.d.ts → node v22.19/dgram.d.ts +9 -8
- node/diagnostics_channel.d.ts → node v22.19/diagnostics_channel.d.ts +17 -12
- node/dns/promises.d.ts → node v22.19/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v22.19/dns.d.ts +79 -21
- node/events.d.ts → node v22.19/events.d.ts +80 -35
- node/fs/promises.d.ts → node v22.19/fs/promises.d.ts +81 -58
- node/fs.d.ts → node v22.19/fs.d.ts +154 -130
- node v22.19/globals.d.ts +172 -0
- node v22.19/globals.typedarray.d.ts +38 -0
- node/http.d.ts → node v22.19/http.d.ts +140 -35
- node/http2.d.ts → node v22.19/http2.d.ts +114 -27
- node/https.d.ts → node v22.19/https.d.ts +96 -62
- node/index.d.ts → node v22.19/index.d.ts +7 -2
- node v22.19/inspector.d.ts +253 -0
- node/inspector.d.ts → node v22.19/inspector.generated.d.ts +880 -830
- node/module.d.ts → node v22.19/module.d.ts +136 -17
- node/net.d.ts → node v22.19/net.d.ts +33 -11
- node/os.d.ts → node v22.19/os.d.ts +14 -3
- node/package.json → node v22.19/package.json +3 -83
- node/path.d.ts → node v22.19/path.d.ts +1 -1
- node/perf_hooks.d.ts → node v22.19/perf_hooks.d.ts +8 -10
- node/process.d.ts → node v22.19/process.d.ts +53 -27
- node/readline/promises.d.ts → node v22.19/readline/promises.d.ts +1 -2
- node/repl.d.ts → node v22.19/repl.d.ts +3 -5
- node/sqlite.d.ts → node v22.19/sqlite.d.ts +219 -6
- node/stream/consumers.d.ts → node v22.19/stream/consumers.d.ts +2 -2
- node/stream/web.d.ts → node v22.19/stream/web.d.ts +8 -0
- node/stream.d.ts → node v22.19/stream.d.ts +34 -32
- node/string_decoder.d.ts → node v22.19/string_decoder.d.ts +2 -2
- node v22.19/test.d.ts +2162 -0
- node/tls.d.ts → node v22.19/tls.d.ts +126 -66
- node/ts5.6/buffer.buffer.d.ts → node v22.19/ts5.6/buffer.buffer.d.ts +10 -2
- node v22.19/ts5.6/globals.typedarray.d.ts +34 -0
- node/ts5.6/index.d.ts → node v22.19/ts5.6/index.d.ts +7 -2
- node/url.d.ts → node v22.19/url.d.ts +21 -9
- node/util.d.ts → node v22.19/util.d.ts +33 -11
- node/v8.d.ts → node v22.19/v8.d.ts +66 -35
- node/vm.d.ts → node v22.19/vm.d.ts +65 -56
- node/wasi.d.ts → node v22.19/wasi.d.ts +1 -1
- node v22.19/web-globals/abortcontroller.d.ts +34 -0
- node v22.19/web-globals/domexception.d.ts +68 -0
- node v22.19/web-globals/events.d.ts +97 -0
- node v22.19/web-globals/fetch.d.ts +46 -0
- node v22.19/web-globals/navigator.d.ts +22 -0
- node v22.19/web-globals/storage.d.ts +24 -0
- node/worker_threads.d.ts → node v22.19/worker_threads.d.ts +112 -74
- node/zlib.d.ts → node v22.19/zlib.d.ts +39 -26
- node/README.md +0 -15
- node/assert/strict.d.ts +0 -8
- node/dom-events.d.ts +0 -124
- node/globals.d.ts +0 -371
- node/globals.typedarray.d.ts +0 -21
- node/test.d.ts +0 -2280
- node/ts5.6/globals.typedarray.d.ts +0 -19
- {node → node v22.19}/LICENSE +0 -0
- node/async_hooks.d.ts → node v22.19/async_hooks.d.ts +1 -1
- {node → node v22.19}/compatibility/index.d.ts +0 -0
- {node → node v22.19}/console.d.ts +0 -0
- {node → node v22.19}/constants.d.ts +0 -0
- {node → node v22.19}/domain.d.ts +0 -0
- {node → node v22.19}/punycode.d.ts +0 -0
- {node → node v22.19}/querystring.d.ts +0 -0
- {node → node v22.19}/readline.d.ts +0 -0
- {node → node v22.19}/sea.d.ts +0 -0
- {node → node v22.19}/stream/promises.d.ts +0 -0
- {node → node v22.19}/timers/promises.d.ts +0 -0
- {node → node v22.19}/timers.d.ts +0 -0
- {node → node v22.19}/trace_events.d.ts +0 -0
- {node → node v22.19}/tty.d.ts +0 -0
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tls.js)
|
|
10
10
|
*/
|
|
11
11
|
declare module "tls" {
|
|
12
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
12
13
|
import { X509Certificate } from "node:crypto";
|
|
13
14
|
import * as net from "node:net";
|
|
14
15
|
import * as stream from "stream";
|
|
@@ -49,7 +50,7 @@ declare module "tls" {
|
|
|
49
50
|
/**
|
|
50
51
|
* The DER encoded X.509 certificate data.
|
|
51
52
|
*/
|
|
52
|
-
raw:
|
|
53
|
+
raw: NonSharedBuffer;
|
|
53
54
|
/**
|
|
54
55
|
* The certificate subject.
|
|
55
56
|
*/
|
|
@@ -115,7 +116,7 @@ declare module "tls" {
|
|
|
115
116
|
/**
|
|
116
117
|
* The public key.
|
|
117
118
|
*/
|
|
118
|
-
pubkey?:
|
|
119
|
+
pubkey?: NonSharedBuffer;
|
|
119
120
|
/**
|
|
120
121
|
* The ASN.1 name of the OID of the elliptic curve.
|
|
121
122
|
* Well-known curves are identified by an OID.
|
|
@@ -244,6 +245,10 @@ declare module "tls" {
|
|
|
244
245
|
* When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false.
|
|
245
246
|
*/
|
|
246
247
|
alpnProtocol: string | false | null;
|
|
248
|
+
/**
|
|
249
|
+
* String containing the server name requested via SNI (Server Name Indication) TLS extension.
|
|
250
|
+
*/
|
|
251
|
+
servername: string | false | null;
|
|
247
252
|
/**
|
|
248
253
|
* Returns an object representing the local certificate. The returned object has
|
|
249
254
|
* some properties corresponding to the fields of the certificate.
|
|
@@ -295,7 +300,7 @@ declare module "tls" {
|
|
|
295
300
|
* @since v9.9.0
|
|
296
301
|
* @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet.
|
|
297
302
|
*/
|
|
298
|
-
getFinished():
|
|
303
|
+
getFinished(): NonSharedBuffer | undefined;
|
|
299
304
|
/**
|
|
300
305
|
* Returns an object representing the peer's certificate. If the peer does not
|
|
301
306
|
* provide a certificate, an empty object will be returned. If the socket has been
|
|
@@ -322,7 +327,7 @@ declare module "tls" {
|
|
|
322
327
|
* @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so
|
|
323
328
|
* far.
|
|
324
329
|
*/
|
|
325
|
-
getPeerFinished():
|
|
330
|
+
getPeerFinished(): NonSharedBuffer | undefined;
|
|
326
331
|
/**
|
|
327
332
|
* Returns a string containing the negotiated SSL/TLS protocol version of the
|
|
328
333
|
* current connection. The value `'unknown'` will be returned for connected
|
|
@@ -352,7 +357,7 @@ declare module "tls" {
|
|
|
352
357
|
* must use the `'session'` event (it also works for TLSv1.2 and below).
|
|
353
358
|
* @since v0.11.4
|
|
354
359
|
*/
|
|
355
|
-
getSession():
|
|
360
|
+
getSession(): NonSharedBuffer | undefined;
|
|
356
361
|
/**
|
|
357
362
|
* See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
|
|
358
363
|
* @since v12.11.0
|
|
@@ -367,7 +372,7 @@ declare module "tls" {
|
|
|
367
372
|
* See `Session Resumption` for more information.
|
|
368
373
|
* @since v0.11.4
|
|
369
374
|
*/
|
|
370
|
-
getTLSTicket():
|
|
375
|
+
getTLSTicket(): NonSharedBuffer | undefined;
|
|
371
376
|
/**
|
|
372
377
|
* See `Session Resumption` for more information.
|
|
373
378
|
* @since v0.5.6
|
|
@@ -478,37 +483,37 @@ declare module "tls" {
|
|
|
478
483
|
* @param context Optionally provide a context.
|
|
479
484
|
* @return requested bytes of the keying material
|
|
480
485
|
*/
|
|
481
|
-
exportKeyingMaterial(length: number, label: string, context: Buffer):
|
|
486
|
+
exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
|
|
482
487
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
483
|
-
addListener(event: "OCSPResponse", listener: (response:
|
|
488
|
+
addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
484
489
|
addListener(event: "secureConnect", listener: () => void): this;
|
|
485
|
-
addListener(event: "session", listener: (session:
|
|
486
|
-
addListener(event: "keylog", listener: (line:
|
|
490
|
+
addListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
491
|
+
addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
487
492
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
488
|
-
emit(event: "OCSPResponse", response:
|
|
493
|
+
emit(event: "OCSPResponse", response: NonSharedBuffer): boolean;
|
|
489
494
|
emit(event: "secureConnect"): boolean;
|
|
490
|
-
emit(event: "session", session:
|
|
491
|
-
emit(event: "keylog", line:
|
|
495
|
+
emit(event: "session", session: NonSharedBuffer): boolean;
|
|
496
|
+
emit(event: "keylog", line: NonSharedBuffer): boolean;
|
|
492
497
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
493
|
-
on(event: "OCSPResponse", listener: (response:
|
|
498
|
+
on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
494
499
|
on(event: "secureConnect", listener: () => void): this;
|
|
495
|
-
on(event: "session", listener: (session:
|
|
496
|
-
on(event: "keylog", listener: (line:
|
|
500
|
+
on(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
501
|
+
on(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
497
502
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
498
|
-
once(event: "OCSPResponse", listener: (response:
|
|
503
|
+
once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
499
504
|
once(event: "secureConnect", listener: () => void): this;
|
|
500
|
-
once(event: "session", listener: (session:
|
|
501
|
-
once(event: "keylog", listener: (line:
|
|
505
|
+
once(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
506
|
+
once(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
502
507
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
503
|
-
prependListener(event: "OCSPResponse", listener: (response:
|
|
508
|
+
prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
504
509
|
prependListener(event: "secureConnect", listener: () => void): this;
|
|
505
|
-
prependListener(event: "session", listener: (session:
|
|
506
|
-
prependListener(event: "keylog", listener: (line:
|
|
510
|
+
prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
511
|
+
prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
507
512
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
508
|
-
prependOnceListener(event: "OCSPResponse", listener: (response:
|
|
513
|
+
prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
509
514
|
prependOnceListener(event: "secureConnect", listener: () => void): this;
|
|
510
|
-
prependOnceListener(event: "session", listener: (session:
|
|
511
|
-
prependOnceListener(event: "keylog", listener: (line:
|
|
515
|
+
prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
516
|
+
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
512
517
|
}
|
|
513
518
|
interface CommonConnectionOptions {
|
|
514
519
|
/**
|
|
@@ -531,7 +536,7 @@ declare module "tls" {
|
|
|
531
536
|
* An array of strings or a Buffer naming possible ALPN protocols.
|
|
532
537
|
* (Protocols should be ordered by their priority.)
|
|
533
538
|
*/
|
|
534
|
-
ALPNProtocols?: string[] |
|
|
539
|
+
ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
|
|
535
540
|
/**
|
|
536
541
|
* SNICallback(servername, cb) <Function> A function that will be
|
|
537
542
|
* called if the client supports SNI TLS extension. Two arguments
|
|
@@ -586,7 +591,7 @@ declare module "tls" {
|
|
|
586
591
|
* requires explicitly specifying a cipher suite with the `ciphers` option.
|
|
587
592
|
* More information can be found in the RFC 4279.
|
|
588
593
|
*/
|
|
589
|
-
pskCallback
|
|
594
|
+
pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
|
|
590
595
|
/**
|
|
591
596
|
* hint to send to a client to help
|
|
592
597
|
* with selecting the identity during TLS-PSK negotiation. Will be ignored
|
|
@@ -596,7 +601,7 @@ declare module "tls" {
|
|
|
596
601
|
pskIdentityHint?: string | undefined;
|
|
597
602
|
}
|
|
598
603
|
interface PSKCallbackNegotation {
|
|
599
|
-
psk:
|
|
604
|
+
psk: NodeJS.ArrayBufferView;
|
|
600
605
|
identity: string;
|
|
601
606
|
}
|
|
602
607
|
interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
@@ -627,7 +632,7 @@ declare module "tls" {
|
|
|
627
632
|
* compatible with the selected cipher's digest.
|
|
628
633
|
* `identity` must use UTF-8 encoding.
|
|
629
634
|
*/
|
|
630
|
-
pskCallback
|
|
635
|
+
pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
|
|
631
636
|
}
|
|
632
637
|
/**
|
|
633
638
|
* Accepts encrypted connections using TLS or SSL.
|
|
@@ -655,7 +660,7 @@ declare module "tls" {
|
|
|
655
660
|
* @since v3.0.0
|
|
656
661
|
* @return A 48-byte buffer containing the session ticket keys.
|
|
657
662
|
*/
|
|
658
|
-
getTicketKeys():
|
|
663
|
+
getTicketKeys(): NonSharedBuffer;
|
|
659
664
|
/**
|
|
660
665
|
* The `server.setSecureContext()` method replaces the secure context of an
|
|
661
666
|
* existing server. Existing connections to the server are not interrupted.
|
|
@@ -687,115 +692,138 @@ declare module "tls" {
|
|
|
687
692
|
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
688
693
|
addListener(
|
|
689
694
|
event: "newSession",
|
|
690
|
-
listener: (sessionId:
|
|
695
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
691
696
|
): this;
|
|
692
697
|
addListener(
|
|
693
698
|
event: "OCSPRequest",
|
|
694
699
|
listener: (
|
|
695
|
-
certificate:
|
|
696
|
-
issuer:
|
|
697
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
700
|
+
certificate: NonSharedBuffer,
|
|
701
|
+
issuer: NonSharedBuffer,
|
|
702
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
698
703
|
) => void,
|
|
699
704
|
): this;
|
|
700
705
|
addListener(
|
|
701
706
|
event: "resumeSession",
|
|
702
|
-
listener: (
|
|
707
|
+
listener: (
|
|
708
|
+
sessionId: NonSharedBuffer,
|
|
709
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
710
|
+
) => void,
|
|
703
711
|
): this;
|
|
704
712
|
addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
705
|
-
addListener(event: "keylog", listener: (line:
|
|
713
|
+
addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
706
714
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
707
715
|
emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
|
|
708
|
-
emit(
|
|
716
|
+
emit(
|
|
717
|
+
event: "newSession",
|
|
718
|
+
sessionId: NonSharedBuffer,
|
|
719
|
+
sessionData: NonSharedBuffer,
|
|
720
|
+
callback: () => void,
|
|
721
|
+
): boolean;
|
|
709
722
|
emit(
|
|
710
723
|
event: "OCSPRequest",
|
|
711
|
-
certificate:
|
|
712
|
-
issuer:
|
|
713
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
724
|
+
certificate: NonSharedBuffer,
|
|
725
|
+
issuer: NonSharedBuffer,
|
|
726
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
714
727
|
): boolean;
|
|
715
728
|
emit(
|
|
716
729
|
event: "resumeSession",
|
|
717
|
-
sessionId:
|
|
730
|
+
sessionId: NonSharedBuffer,
|
|
718
731
|
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
719
732
|
): boolean;
|
|
720
733
|
emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
|
|
721
|
-
emit(event: "keylog", line:
|
|
734
|
+
emit(event: "keylog", line: NonSharedBuffer, tlsSocket: TLSSocket): boolean;
|
|
722
735
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
723
736
|
on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
724
|
-
on(
|
|
737
|
+
on(
|
|
738
|
+
event: "newSession",
|
|
739
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
740
|
+
): this;
|
|
725
741
|
on(
|
|
726
742
|
event: "OCSPRequest",
|
|
727
743
|
listener: (
|
|
728
|
-
certificate:
|
|
729
|
-
issuer:
|
|
730
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
744
|
+
certificate: NonSharedBuffer,
|
|
745
|
+
issuer: NonSharedBuffer,
|
|
746
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
731
747
|
) => void,
|
|
732
748
|
): this;
|
|
733
749
|
on(
|
|
734
750
|
event: "resumeSession",
|
|
735
|
-
listener: (
|
|
751
|
+
listener: (
|
|
752
|
+
sessionId: NonSharedBuffer,
|
|
753
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
754
|
+
) => void,
|
|
736
755
|
): this;
|
|
737
756
|
on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
738
|
-
on(event: "keylog", listener: (line:
|
|
757
|
+
on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
739
758
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
740
759
|
once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
741
760
|
once(
|
|
742
761
|
event: "newSession",
|
|
743
|
-
listener: (sessionId:
|
|
762
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
744
763
|
): this;
|
|
745
764
|
once(
|
|
746
765
|
event: "OCSPRequest",
|
|
747
766
|
listener: (
|
|
748
|
-
certificate:
|
|
749
|
-
issuer:
|
|
750
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
767
|
+
certificate: NonSharedBuffer,
|
|
768
|
+
issuer: NonSharedBuffer,
|
|
769
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
751
770
|
) => void,
|
|
752
771
|
): this;
|
|
753
772
|
once(
|
|
754
773
|
event: "resumeSession",
|
|
755
|
-
listener: (
|
|
774
|
+
listener: (
|
|
775
|
+
sessionId: NonSharedBuffer,
|
|
776
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
777
|
+
) => void,
|
|
756
778
|
): this;
|
|
757
779
|
once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
758
|
-
once(event: "keylog", listener: (line:
|
|
780
|
+
once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
759
781
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
760
782
|
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
761
783
|
prependListener(
|
|
762
784
|
event: "newSession",
|
|
763
|
-
listener: (sessionId:
|
|
785
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
764
786
|
): this;
|
|
765
787
|
prependListener(
|
|
766
788
|
event: "OCSPRequest",
|
|
767
789
|
listener: (
|
|
768
|
-
certificate:
|
|
769
|
-
issuer:
|
|
770
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
790
|
+
certificate: NonSharedBuffer,
|
|
791
|
+
issuer: NonSharedBuffer,
|
|
792
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
771
793
|
) => void,
|
|
772
794
|
): this;
|
|
773
795
|
prependListener(
|
|
774
796
|
event: "resumeSession",
|
|
775
|
-
listener: (
|
|
797
|
+
listener: (
|
|
798
|
+
sessionId: NonSharedBuffer,
|
|
799
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
800
|
+
) => void,
|
|
776
801
|
): this;
|
|
777
802
|
prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
778
|
-
prependListener(event: "keylog", listener: (line:
|
|
803
|
+
prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
779
804
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
780
805
|
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
781
806
|
prependOnceListener(
|
|
782
807
|
event: "newSession",
|
|
783
|
-
listener: (sessionId:
|
|
808
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
784
809
|
): this;
|
|
785
810
|
prependOnceListener(
|
|
786
811
|
event: "OCSPRequest",
|
|
787
812
|
listener: (
|
|
788
|
-
certificate:
|
|
789
|
-
issuer:
|
|
790
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
813
|
+
certificate: NonSharedBuffer,
|
|
814
|
+
issuer: NonSharedBuffer,
|
|
815
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
791
816
|
) => void,
|
|
792
817
|
): this;
|
|
793
818
|
prependOnceListener(
|
|
794
819
|
event: "resumeSession",
|
|
795
|
-
listener: (
|
|
820
|
+
listener: (
|
|
821
|
+
sessionId: NonSharedBuffer,
|
|
822
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
823
|
+
) => void,
|
|
796
824
|
): this;
|
|
797
825
|
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
798
|
-
prependOnceListener(event: "keylog", listener: (line:
|
|
826
|
+
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
799
827
|
}
|
|
800
828
|
/**
|
|
801
829
|
* @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
|
|
@@ -1208,6 +1236,38 @@ declare module "tls" {
|
|
|
1208
1236
|
* @since v0.10.2
|
|
1209
1237
|
*/
|
|
1210
1238
|
function getCiphers(): string[];
|
|
1239
|
+
/**
|
|
1240
|
+
* Sets the default CA certificates used by Node.js TLS clients. If the provided
|
|
1241
|
+
* certificates are parsed successfully, they will become the default CA
|
|
1242
|
+
* certificate list returned by {@link getCACertificates} and used
|
|
1243
|
+
* by subsequent TLS connections that don't specify their own CA certificates.
|
|
1244
|
+
* The certificates will be deduplicated before being set as the default.
|
|
1245
|
+
*
|
|
1246
|
+
* This function only affects the current Node.js thread. Previous
|
|
1247
|
+
* sessions cached by the HTTPS agent won't be affected by this change, so
|
|
1248
|
+
* this method should be called before any unwanted cachable TLS connections are
|
|
1249
|
+
* made.
|
|
1250
|
+
*
|
|
1251
|
+
* To use system CA certificates as the default:
|
|
1252
|
+
*
|
|
1253
|
+
* ```js
|
|
1254
|
+
* import tls from 'node:tls';
|
|
1255
|
+
* tls.setDefaultCACertificates(tls.getCACertificates('system'));
|
|
1256
|
+
* ```
|
|
1257
|
+
*
|
|
1258
|
+
* This function completely replaces the default CA certificate list. To add additional
|
|
1259
|
+
* certificates to the existing defaults, get the current certificates and append to them:
|
|
1260
|
+
*
|
|
1261
|
+
* ```js
|
|
1262
|
+
* import tls from 'node:tls';
|
|
1263
|
+
* const currentCerts = tls.getCACertificates('default');
|
|
1264
|
+
* const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
|
|
1265
|
+
* tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
|
|
1266
|
+
* ```
|
|
1267
|
+
* @since v22.19.0
|
|
1268
|
+
* @param certs An array of CA certificates in PEM format.
|
|
1269
|
+
*/
|
|
1270
|
+
function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
|
|
1211
1271
|
/**
|
|
1212
1272
|
* The default curve name to use for ECDH key agreement in a tls server.
|
|
1213
1273
|
* The default value is `'auto'`. See `{@link createSecureContext()}` for further
|
|
@@ -32,7 +32,7 @@ declare module "buffer" {
|
|
|
32
32
|
* @param arrayBuffer The ArrayBuffer with which to share memory.
|
|
33
33
|
* @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
|
|
34
34
|
*/
|
|
35
|
-
new(arrayBuffer:
|
|
35
|
+
new(arrayBuffer: ArrayBufferLike): Buffer;
|
|
36
36
|
/**
|
|
37
37
|
* Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
|
|
38
38
|
* Array entries outside that range will be truncated to fit into it.
|
|
@@ -126,7 +126,7 @@ declare module "buffer" {
|
|
|
126
126
|
* `arrayBuffer.byteLength - byteOffset`.
|
|
127
127
|
*/
|
|
128
128
|
from(
|
|
129
|
-
arrayBuffer: WithImplicitCoercion<
|
|
129
|
+
arrayBuffer: WithImplicitCoercion<ArrayBufferLike>,
|
|
130
130
|
byteOffset?: number,
|
|
131
131
|
length?: number,
|
|
132
132
|
): Buffer;
|
|
@@ -448,7 +448,15 @@ declare module "buffer" {
|
|
|
448
448
|
*/
|
|
449
449
|
subarray(start?: number, end?: number): Buffer;
|
|
450
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
453
|
+
* TypeScript versions earlier than 5.7.
|
|
454
|
+
*/
|
|
451
455
|
type NonSharedBuffer = Buffer;
|
|
456
|
+
/**
|
|
457
|
+
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
|
|
458
|
+
* TypeScript versions earlier than 5.7.
|
|
459
|
+
*/
|
|
452
460
|
type AllowSharedBuffer = Buffer;
|
|
453
461
|
}
|
|
454
462
|
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export {}; // Make this a module
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
namespace NodeJS {
|
|
5
|
+
type TypedArray =
|
|
6
|
+
| Uint8Array
|
|
7
|
+
| Uint8ClampedArray
|
|
8
|
+
| Uint16Array
|
|
9
|
+
| Uint32Array
|
|
10
|
+
| Int8Array
|
|
11
|
+
| Int16Array
|
|
12
|
+
| Int32Array
|
|
13
|
+
| BigUint64Array
|
|
14
|
+
| BigInt64Array
|
|
15
|
+
| Float32Array
|
|
16
|
+
| Float64Array;
|
|
17
|
+
type ArrayBufferView = TypedArray | DataView;
|
|
18
|
+
|
|
19
|
+
type NonSharedUint8Array = Uint8Array;
|
|
20
|
+
type NonSharedUint8ClampedArray = Uint8ClampedArray;
|
|
21
|
+
type NonSharedUint16Array = Uint16Array;
|
|
22
|
+
type NonSharedUint32Array = Uint32Array;
|
|
23
|
+
type NonSharedInt8Array = Int8Array;
|
|
24
|
+
type NonSharedInt16Array = Int16Array;
|
|
25
|
+
type NonSharedInt32Array = Int32Array;
|
|
26
|
+
type NonSharedBigUint64Array = BigUint64Array;
|
|
27
|
+
type NonSharedBigInt64Array = BigInt64Array;
|
|
28
|
+
type NonSharedFloat32Array = Float32Array;
|
|
29
|
+
type NonSharedFloat64Array = Float64Array;
|
|
30
|
+
type NonSharedDataView = DataView;
|
|
31
|
+
type NonSharedTypedArray = TypedArray;
|
|
32
|
+
type NonSharedArrayBufferView = ArrayBufferView;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
|
|
37
37
|
// Definitions for Node.js modules that are not specific to any version of TypeScript:
|
|
38
38
|
/// <reference path="../globals.d.ts" />
|
|
39
|
+
/// <reference path="../web-globals/abortcontroller.d.ts" />
|
|
40
|
+
/// <reference path="../web-globals/domexception.d.ts" />
|
|
41
|
+
/// <reference path="../web-globals/events.d.ts" />
|
|
42
|
+
/// <reference path="../web-globals/fetch.d.ts" />
|
|
43
|
+
/// <reference path="../web-globals/navigator.d.ts" />
|
|
44
|
+
/// <reference path="../web-globals/storage.d.ts" />
|
|
39
45
|
/// <reference path="../assert.d.ts" />
|
|
40
46
|
/// <reference path="../assert/strict.d.ts" />
|
|
41
47
|
/// <reference path="../async_hooks.d.ts" />
|
|
@@ -49,9 +55,7 @@
|
|
|
49
55
|
/// <reference path="../diagnostics_channel.d.ts" />
|
|
50
56
|
/// <reference path="../dns.d.ts" />
|
|
51
57
|
/// <reference path="../dns/promises.d.ts" />
|
|
52
|
-
/// <reference path="../dns/promises.d.ts" />
|
|
53
58
|
/// <reference path="../domain.d.ts" />
|
|
54
|
-
/// <reference path="../dom-events.d.ts" />
|
|
55
59
|
/// <reference path="../events.d.ts" />
|
|
56
60
|
/// <reference path="../fs.d.ts" />
|
|
57
61
|
/// <reference path="../fs/promises.d.ts" />
|
|
@@ -59,6 +63,7 @@
|
|
|
59
63
|
/// <reference path="../http2.d.ts" />
|
|
60
64
|
/// <reference path="../https.d.ts" />
|
|
61
65
|
/// <reference path="../inspector.d.ts" />
|
|
66
|
+
/// <reference path="../inspector.generated.d.ts" />
|
|
62
67
|
/// <reference path="../module.d.ts" />
|
|
63
68
|
/// <reference path="../net.d.ts" />
|
|
64
69
|
/// <reference path="../os.d.ts" />
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/url.js)
|
|
9
9
|
*/
|
|
10
10
|
declare module "url" {
|
|
11
|
-
import { Blob as NodeBlob } from "node:buffer";
|
|
11
|
+
import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
|
|
12
12
|
import { ClientRequestArgs } from "node:http";
|
|
13
13
|
import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
|
|
14
14
|
// Input to `url.format`
|
|
@@ -315,6 +315,17 @@ declare module "url" {
|
|
|
315
315
|
* @return The fully-resolved platform-specific Node.js file path.
|
|
316
316
|
*/
|
|
317
317
|
function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string;
|
|
318
|
+
/**
|
|
319
|
+
* Like `url.fileURLToPath(...)` except that instead of returning a string
|
|
320
|
+
* representation of the path, a `Buffer` is returned. This conversion is
|
|
321
|
+
* helpful when the input URL contains percent-encoded segments that are
|
|
322
|
+
* not valid UTF-8 / Unicode sequences.
|
|
323
|
+
* @since v22.18.0
|
|
324
|
+
* @param url The file URL string or URL object to convert to a path.
|
|
325
|
+
* @returns The fully-resolved platform-specific Node.js file path
|
|
326
|
+
* as a `Buffer`.
|
|
327
|
+
*/
|
|
328
|
+
function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): NonSharedBuffer;
|
|
318
329
|
/**
|
|
319
330
|
* This function ensures that `path` is resolved absolutely, and that the URL
|
|
320
331
|
* control characters are correctly encoded when converting into a File URL.
|
|
@@ -420,14 +431,12 @@ declare module "url" {
|
|
|
420
431
|
* Threads, `Blob` objects registered within one Worker will not be available
|
|
421
432
|
* to other workers or the main thread.
|
|
422
433
|
* @since v16.7.0
|
|
423
|
-
* @experimental
|
|
424
434
|
*/
|
|
425
435
|
static createObjectURL(blob: NodeBlob): string;
|
|
426
436
|
/**
|
|
427
437
|
* Removes the stored `Blob` identified by the given ID. Attempting to revoke a
|
|
428
438
|
* ID that isn't registered will silently fail.
|
|
429
439
|
* @since v16.7.0
|
|
430
|
-
* @experimental
|
|
431
440
|
* @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
|
|
432
441
|
*/
|
|
433
442
|
static revokeObjectURL(id: string): void;
|
|
@@ -446,12 +455,15 @@ declare module "url" {
|
|
|
446
455
|
*/
|
|
447
456
|
static canParse(input: string, base?: string): boolean;
|
|
448
457
|
/**
|
|
449
|
-
* Parses a string as a URL. If `base` is provided, it will be used as the base
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
* `converted to a string` first.
|
|
453
|
-
* @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
|
|
458
|
+
* Parses a string as a URL. If `base` is provided, it will be used as the base
|
|
459
|
+
* URL for the purpose of resolving non-absolute `input` URLs. Returns `null`
|
|
460
|
+
* if the parameters can't be resolved to a valid URL.
|
|
454
461
|
* @since v22.1.0
|
|
462
|
+
* @param input The absolute or relative input URL to parse. If `input`
|
|
463
|
+
* is relative, then `base` is required. If `input` is absolute, the `base`
|
|
464
|
+
* is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
|
|
465
|
+
* @param base The base URL to resolve against if the `input` is not
|
|
466
|
+
* absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
|
|
455
467
|
*/
|
|
456
468
|
static parse(input: string, base?: string): URL | null;
|
|
457
469
|
constructor(input: string | { toString: () => string }, base?: string | URL);
|
|
@@ -828,7 +840,7 @@ declare module "url" {
|
|
|
828
840
|
* Returns an ES6 `Iterator` over each of the name-value pairs in the query.
|
|
829
841
|
* Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`.
|
|
830
842
|
*
|
|
831
|
-
* Alias for `urlSearchParams[
|
|
843
|
+
* Alias for `urlSearchParams[Symbol.iterator]()`.
|
|
832
844
|
*/
|
|
833
845
|
entries(): URLSearchParamsIterator<[string, string]>;
|
|
834
846
|
/**
|