@types/node 22.15.21 → 22.19.3
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 +39 -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 +122 -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.
|
|
@@ -295,7 +296,7 @@ declare module "tls" {
|
|
|
295
296
|
* @since v9.9.0
|
|
296
297
|
* @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
298
|
*/
|
|
298
|
-
getFinished():
|
|
299
|
+
getFinished(): NonSharedBuffer | undefined;
|
|
299
300
|
/**
|
|
300
301
|
* Returns an object representing the peer's certificate. If the peer does not
|
|
301
302
|
* provide a certificate, an empty object will be returned. If the socket has been
|
|
@@ -322,7 +323,7 @@ declare module "tls" {
|
|
|
322
323
|
* @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
324
|
* far.
|
|
324
325
|
*/
|
|
325
|
-
getPeerFinished():
|
|
326
|
+
getPeerFinished(): NonSharedBuffer | undefined;
|
|
326
327
|
/**
|
|
327
328
|
* Returns a string containing the negotiated SSL/TLS protocol version of the
|
|
328
329
|
* current connection. The value `'unknown'` will be returned for connected
|
|
@@ -352,7 +353,7 @@ declare module "tls" {
|
|
|
352
353
|
* must use the `'session'` event (it also works for TLSv1.2 and below).
|
|
353
354
|
* @since v0.11.4
|
|
354
355
|
*/
|
|
355
|
-
getSession():
|
|
356
|
+
getSession(): NonSharedBuffer | undefined;
|
|
356
357
|
/**
|
|
357
358
|
* See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
|
|
358
359
|
* @since v12.11.0
|
|
@@ -367,7 +368,7 @@ declare module "tls" {
|
|
|
367
368
|
* See `Session Resumption` for more information.
|
|
368
369
|
* @since v0.11.4
|
|
369
370
|
*/
|
|
370
|
-
getTLSTicket():
|
|
371
|
+
getTLSTicket(): NonSharedBuffer | undefined;
|
|
371
372
|
/**
|
|
372
373
|
* See `Session Resumption` for more information.
|
|
373
374
|
* @since v0.5.6
|
|
@@ -478,37 +479,37 @@ declare module "tls" {
|
|
|
478
479
|
* @param context Optionally provide a context.
|
|
479
480
|
* @return requested bytes of the keying material
|
|
480
481
|
*/
|
|
481
|
-
exportKeyingMaterial(length: number, label: string, context: Buffer):
|
|
482
|
+
exportKeyingMaterial(length: number, label: string, context: Buffer): NonSharedBuffer;
|
|
482
483
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
483
|
-
addListener(event: "OCSPResponse", listener: (response:
|
|
484
|
+
addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
484
485
|
addListener(event: "secureConnect", listener: () => void): this;
|
|
485
|
-
addListener(event: "session", listener: (session:
|
|
486
|
-
addListener(event: "keylog", listener: (line:
|
|
486
|
+
addListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
487
|
+
addListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
487
488
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
488
|
-
emit(event: "OCSPResponse", response:
|
|
489
|
+
emit(event: "OCSPResponse", response: NonSharedBuffer): boolean;
|
|
489
490
|
emit(event: "secureConnect"): boolean;
|
|
490
|
-
emit(event: "session", session:
|
|
491
|
-
emit(event: "keylog", line:
|
|
491
|
+
emit(event: "session", session: NonSharedBuffer): boolean;
|
|
492
|
+
emit(event: "keylog", line: NonSharedBuffer): boolean;
|
|
492
493
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
493
|
-
on(event: "OCSPResponse", listener: (response:
|
|
494
|
+
on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
494
495
|
on(event: "secureConnect", listener: () => void): this;
|
|
495
|
-
on(event: "session", listener: (session:
|
|
496
|
-
on(event: "keylog", listener: (line:
|
|
496
|
+
on(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
497
|
+
on(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
497
498
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
498
|
-
once(event: "OCSPResponse", listener: (response:
|
|
499
|
+
once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
499
500
|
once(event: "secureConnect", listener: () => void): this;
|
|
500
|
-
once(event: "session", listener: (session:
|
|
501
|
-
once(event: "keylog", listener: (line:
|
|
501
|
+
once(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
502
|
+
once(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
502
503
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
503
|
-
prependListener(event: "OCSPResponse", listener: (response:
|
|
504
|
+
prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
504
505
|
prependListener(event: "secureConnect", listener: () => void): this;
|
|
505
|
-
prependListener(event: "session", listener: (session:
|
|
506
|
-
prependListener(event: "keylog", listener: (line:
|
|
506
|
+
prependListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
507
|
+
prependListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
507
508
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
508
|
-
prependOnceListener(event: "OCSPResponse", listener: (response:
|
|
509
|
+
prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
|
|
509
510
|
prependOnceListener(event: "secureConnect", listener: () => void): this;
|
|
510
|
-
prependOnceListener(event: "session", listener: (session:
|
|
511
|
-
prependOnceListener(event: "keylog", listener: (line:
|
|
511
|
+
prependOnceListener(event: "session", listener: (session: NonSharedBuffer) => void): this;
|
|
512
|
+
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer) => void): this;
|
|
512
513
|
}
|
|
513
514
|
interface CommonConnectionOptions {
|
|
514
515
|
/**
|
|
@@ -531,7 +532,7 @@ declare module "tls" {
|
|
|
531
532
|
* An array of strings or a Buffer naming possible ALPN protocols.
|
|
532
533
|
* (Protocols should be ordered by their priority.)
|
|
533
534
|
*/
|
|
534
|
-
ALPNProtocols?: string[] |
|
|
535
|
+
ALPNProtocols?: readonly string[] | NodeJS.ArrayBufferView | undefined;
|
|
535
536
|
/**
|
|
536
537
|
* SNICallback(servername, cb) <Function> A function that will be
|
|
537
538
|
* called if the client supports SNI TLS extension. Two arguments
|
|
@@ -586,7 +587,7 @@ declare module "tls" {
|
|
|
586
587
|
* requires explicitly specifying a cipher suite with the `ciphers` option.
|
|
587
588
|
* More information can be found in the RFC 4279.
|
|
588
589
|
*/
|
|
589
|
-
pskCallback
|
|
590
|
+
pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
|
|
590
591
|
/**
|
|
591
592
|
* hint to send to a client to help
|
|
592
593
|
* with selecting the identity during TLS-PSK negotiation. Will be ignored
|
|
@@ -596,7 +597,7 @@ declare module "tls" {
|
|
|
596
597
|
pskIdentityHint?: string | undefined;
|
|
597
598
|
}
|
|
598
599
|
interface PSKCallbackNegotation {
|
|
599
|
-
psk:
|
|
600
|
+
psk: NodeJS.ArrayBufferView;
|
|
600
601
|
identity: string;
|
|
601
602
|
}
|
|
602
603
|
interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
|
|
@@ -627,7 +628,7 @@ declare module "tls" {
|
|
|
627
628
|
* compatible with the selected cipher's digest.
|
|
628
629
|
* `identity` must use UTF-8 encoding.
|
|
629
630
|
*/
|
|
630
|
-
pskCallback
|
|
631
|
+
pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
|
|
631
632
|
}
|
|
632
633
|
/**
|
|
633
634
|
* Accepts encrypted connections using TLS or SSL.
|
|
@@ -655,7 +656,7 @@ declare module "tls" {
|
|
|
655
656
|
* @since v3.0.0
|
|
656
657
|
* @return A 48-byte buffer containing the session ticket keys.
|
|
657
658
|
*/
|
|
658
|
-
getTicketKeys():
|
|
659
|
+
getTicketKeys(): NonSharedBuffer;
|
|
659
660
|
/**
|
|
660
661
|
* The `server.setSecureContext()` method replaces the secure context of an
|
|
661
662
|
* existing server. Existing connections to the server are not interrupted.
|
|
@@ -687,115 +688,138 @@ declare module "tls" {
|
|
|
687
688
|
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
688
689
|
addListener(
|
|
689
690
|
event: "newSession",
|
|
690
|
-
listener: (sessionId:
|
|
691
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
691
692
|
): this;
|
|
692
693
|
addListener(
|
|
693
694
|
event: "OCSPRequest",
|
|
694
695
|
listener: (
|
|
695
|
-
certificate:
|
|
696
|
-
issuer:
|
|
697
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
696
|
+
certificate: NonSharedBuffer,
|
|
697
|
+
issuer: NonSharedBuffer,
|
|
698
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
698
699
|
) => void,
|
|
699
700
|
): this;
|
|
700
701
|
addListener(
|
|
701
702
|
event: "resumeSession",
|
|
702
|
-
listener: (
|
|
703
|
+
listener: (
|
|
704
|
+
sessionId: NonSharedBuffer,
|
|
705
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
706
|
+
) => void,
|
|
703
707
|
): this;
|
|
704
708
|
addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
705
|
-
addListener(event: "keylog", listener: (line:
|
|
709
|
+
addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
706
710
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
707
711
|
emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
|
|
708
|
-
emit(
|
|
712
|
+
emit(
|
|
713
|
+
event: "newSession",
|
|
714
|
+
sessionId: NonSharedBuffer,
|
|
715
|
+
sessionData: NonSharedBuffer,
|
|
716
|
+
callback: () => void,
|
|
717
|
+
): boolean;
|
|
709
718
|
emit(
|
|
710
719
|
event: "OCSPRequest",
|
|
711
|
-
certificate:
|
|
712
|
-
issuer:
|
|
713
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
720
|
+
certificate: NonSharedBuffer,
|
|
721
|
+
issuer: NonSharedBuffer,
|
|
722
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
714
723
|
): boolean;
|
|
715
724
|
emit(
|
|
716
725
|
event: "resumeSession",
|
|
717
|
-
sessionId:
|
|
726
|
+
sessionId: NonSharedBuffer,
|
|
718
727
|
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
719
728
|
): boolean;
|
|
720
729
|
emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
|
|
721
|
-
emit(event: "keylog", line:
|
|
730
|
+
emit(event: "keylog", line: NonSharedBuffer, tlsSocket: TLSSocket): boolean;
|
|
722
731
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
723
732
|
on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
724
|
-
on(
|
|
733
|
+
on(
|
|
734
|
+
event: "newSession",
|
|
735
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
736
|
+
): this;
|
|
725
737
|
on(
|
|
726
738
|
event: "OCSPRequest",
|
|
727
739
|
listener: (
|
|
728
|
-
certificate:
|
|
729
|
-
issuer:
|
|
730
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
740
|
+
certificate: NonSharedBuffer,
|
|
741
|
+
issuer: NonSharedBuffer,
|
|
742
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
731
743
|
) => void,
|
|
732
744
|
): this;
|
|
733
745
|
on(
|
|
734
746
|
event: "resumeSession",
|
|
735
|
-
listener: (
|
|
747
|
+
listener: (
|
|
748
|
+
sessionId: NonSharedBuffer,
|
|
749
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
750
|
+
) => void,
|
|
736
751
|
): this;
|
|
737
752
|
on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
738
|
-
on(event: "keylog", listener: (line:
|
|
753
|
+
on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
739
754
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
740
755
|
once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
741
756
|
once(
|
|
742
757
|
event: "newSession",
|
|
743
|
-
listener: (sessionId:
|
|
758
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
744
759
|
): this;
|
|
745
760
|
once(
|
|
746
761
|
event: "OCSPRequest",
|
|
747
762
|
listener: (
|
|
748
|
-
certificate:
|
|
749
|
-
issuer:
|
|
750
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
763
|
+
certificate: NonSharedBuffer,
|
|
764
|
+
issuer: NonSharedBuffer,
|
|
765
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
751
766
|
) => void,
|
|
752
767
|
): this;
|
|
753
768
|
once(
|
|
754
769
|
event: "resumeSession",
|
|
755
|
-
listener: (
|
|
770
|
+
listener: (
|
|
771
|
+
sessionId: NonSharedBuffer,
|
|
772
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
773
|
+
) => void,
|
|
756
774
|
): this;
|
|
757
775
|
once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
758
|
-
once(event: "keylog", listener: (line:
|
|
776
|
+
once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
759
777
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
760
778
|
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
761
779
|
prependListener(
|
|
762
780
|
event: "newSession",
|
|
763
|
-
listener: (sessionId:
|
|
781
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
764
782
|
): this;
|
|
765
783
|
prependListener(
|
|
766
784
|
event: "OCSPRequest",
|
|
767
785
|
listener: (
|
|
768
|
-
certificate:
|
|
769
|
-
issuer:
|
|
770
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
786
|
+
certificate: NonSharedBuffer,
|
|
787
|
+
issuer: NonSharedBuffer,
|
|
788
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
771
789
|
) => void,
|
|
772
790
|
): this;
|
|
773
791
|
prependListener(
|
|
774
792
|
event: "resumeSession",
|
|
775
|
-
listener: (
|
|
793
|
+
listener: (
|
|
794
|
+
sessionId: NonSharedBuffer,
|
|
795
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
796
|
+
) => void,
|
|
776
797
|
): this;
|
|
777
798
|
prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
778
|
-
prependListener(event: "keylog", listener: (line:
|
|
799
|
+
prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
779
800
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
780
801
|
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
|
|
781
802
|
prependOnceListener(
|
|
782
803
|
event: "newSession",
|
|
783
|
-
listener: (sessionId:
|
|
804
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
784
805
|
): this;
|
|
785
806
|
prependOnceListener(
|
|
786
807
|
event: "OCSPRequest",
|
|
787
808
|
listener: (
|
|
788
|
-
certificate:
|
|
789
|
-
issuer:
|
|
790
|
-
callback: (err: Error | null, resp: Buffer) => void,
|
|
809
|
+
certificate: NonSharedBuffer,
|
|
810
|
+
issuer: NonSharedBuffer,
|
|
811
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
791
812
|
) => void,
|
|
792
813
|
): this;
|
|
793
814
|
prependOnceListener(
|
|
794
815
|
event: "resumeSession",
|
|
795
|
-
listener: (
|
|
816
|
+
listener: (
|
|
817
|
+
sessionId: NonSharedBuffer,
|
|
818
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
819
|
+
) => void,
|
|
796
820
|
): this;
|
|
797
821
|
prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
|
|
798
|
-
prependOnceListener(event: "keylog", listener: (line:
|
|
822
|
+
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: TLSSocket) => void): this;
|
|
799
823
|
}
|
|
800
824
|
/**
|
|
801
825
|
* @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
|
|
@@ -1208,6 +1232,38 @@ declare module "tls" {
|
|
|
1208
1232
|
* @since v0.10.2
|
|
1209
1233
|
*/
|
|
1210
1234
|
function getCiphers(): string[];
|
|
1235
|
+
/**
|
|
1236
|
+
* Sets the default CA certificates used by Node.js TLS clients. If the provided
|
|
1237
|
+
* certificates are parsed successfully, they will become the default CA
|
|
1238
|
+
* certificate list returned by {@link getCACertificates} and used
|
|
1239
|
+
* by subsequent TLS connections that don't specify their own CA certificates.
|
|
1240
|
+
* The certificates will be deduplicated before being set as the default.
|
|
1241
|
+
*
|
|
1242
|
+
* This function only affects the current Node.js thread. Previous
|
|
1243
|
+
* sessions cached by the HTTPS agent won't be affected by this change, so
|
|
1244
|
+
* this method should be called before any unwanted cachable TLS connections are
|
|
1245
|
+
* made.
|
|
1246
|
+
*
|
|
1247
|
+
* To use system CA certificates as the default:
|
|
1248
|
+
*
|
|
1249
|
+
* ```js
|
|
1250
|
+
* import tls from 'node:tls';
|
|
1251
|
+
* tls.setDefaultCACertificates(tls.getCACertificates('system'));
|
|
1252
|
+
* ```
|
|
1253
|
+
*
|
|
1254
|
+
* This function completely replaces the default CA certificate list. To add additional
|
|
1255
|
+
* certificates to the existing defaults, get the current certificates and append to them:
|
|
1256
|
+
*
|
|
1257
|
+
* ```js
|
|
1258
|
+
* import tls from 'node:tls';
|
|
1259
|
+
* const currentCerts = tls.getCACertificates('default');
|
|
1260
|
+
* const additionalCerts = ['-----BEGIN CERTIFICATE-----\n...'];
|
|
1261
|
+
* tls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);
|
|
1262
|
+
* ```
|
|
1263
|
+
* @since v22.19.0
|
|
1264
|
+
* @param certs An array of CA certificates in PEM format.
|
|
1265
|
+
*/
|
|
1266
|
+
function setDefaultCACertificates(certs: ReadonlyArray<string | NodeJS.ArrayBufferView>): void;
|
|
1211
1267
|
/**
|
|
1212
1268
|
* The default curve name to use for ECDH key agreement in a tls server.
|
|
1213
1269
|
* 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
|
/**
|