@types/node 20.19.22 → 20.19.24

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 v20.19/tls.d.ts CHANGED
@@ -9,6 +9,7 @@
9
9
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/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: Buffer;
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?: Buffer;
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(): Buffer | undefined;
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(): Buffer | undefined;
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(): Buffer | undefined;
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(): Buffer | undefined;
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): 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: Buffer) => void): this;
484
+ addListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
484
485
  addListener(event: "secureConnect", listener: () => void): this;
485
- addListener(event: "session", listener: (session: Buffer) => void): this;
486
- addListener(event: "keylog", listener: (line: Buffer) => void): this;
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: Buffer): boolean;
489
+ emit(event: "OCSPResponse", response: NonSharedBuffer): boolean;
489
490
  emit(event: "secureConnect"): boolean;
490
- emit(event: "session", session: Buffer): boolean;
491
- emit(event: "keylog", line: Buffer): boolean;
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: Buffer) => void): this;
494
+ on(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
494
495
  on(event: "secureConnect", listener: () => void): this;
495
- on(event: "session", listener: (session: Buffer) => void): this;
496
- on(event: "keylog", listener: (line: Buffer) => void): this;
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: Buffer) => void): this;
499
+ once(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
499
500
  once(event: "secureConnect", listener: () => void): this;
500
- once(event: "session", listener: (session: Buffer) => void): this;
501
- once(event: "keylog", listener: (line: Buffer) => void): this;
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: Buffer) => void): this;
504
+ prependListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
504
505
  prependListener(event: "secureConnect", listener: () => void): this;
505
- prependListener(event: "session", listener: (session: Buffer) => void): this;
506
- prependListener(event: "keylog", listener: (line: Buffer) => void): this;
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: Buffer) => void): this;
509
+ prependOnceListener(event: "OCSPResponse", listener: (response: NonSharedBuffer) => void): this;
509
510
  prependOnceListener(event: "secureConnect", listener: () => void): this;
510
- prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
511
- prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
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[] | Uint8Array[] | Uint8Array | undefined;
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
@@ -596,7 +597,7 @@ declare module "tls" {
596
597
  pskIdentityHint?: string | undefined;
597
598
  }
598
599
  interface PSKCallbackNegotation {
599
- psk: DataView | NodeJS.TypedArray;
600
+ psk: NodeJS.ArrayBufferView;
600
601
  identity: string;
601
602
  }
602
603
  interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
@@ -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(): Buffer;
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: Buffer, sessionData: Buffer, callback: () => void) => void,
691
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
691
692
  ): this;
692
693
  addListener(
693
694
  event: "OCSPRequest",
694
695
  listener: (
695
- certificate: Buffer,
696
- issuer: Buffer,
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: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
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: Buffer, tlsSocket: TLSSocket) => void): this;
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(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean;
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: Buffer,
712
- issuer: Buffer,
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: Buffer,
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: Buffer, tlsSocket: TLSSocket): boolean;
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(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this;
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: Buffer,
729
- issuer: Buffer,
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: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
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: Buffer, tlsSocket: TLSSocket) => void): this;
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: Buffer, sessionData: Buffer, callback: () => void) => void,
758
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
744
759
  ): this;
745
760
  once(
746
761
  event: "OCSPRequest",
747
762
  listener: (
748
- certificate: Buffer,
749
- issuer: Buffer,
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: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
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: Buffer, tlsSocket: TLSSocket) => void): this;
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: Buffer, sessionData: Buffer, callback: () => void) => void,
781
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
764
782
  ): this;
765
783
  prependListener(
766
784
  event: "OCSPRequest",
767
785
  listener: (
768
- certificate: Buffer,
769
- issuer: Buffer,
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: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
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: Buffer, tlsSocket: TLSSocket) => void): this;
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: Buffer, sessionData: Buffer, callback: () => void) => void,
804
+ listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
784
805
  ): this;
785
806
  prependOnceListener(
786
807
  event: "OCSPRequest",
787
808
  listener: (
788
- certificate: Buffer,
789
- issuer: Buffer,
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: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void,
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: Buffer, tlsSocket: TLSSocket) => void): this;
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.
@@ -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: ArrayBuffer | SharedArrayBuffer): Buffer;
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<ArrayBuffer | SharedArrayBuffer>,
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. */
@@ -15,5 +15,20 @@ declare global {
15
15
  | Float32Array
16
16
  | Float64Array;
17
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;
18
33
  }
19
34
  }
node v20.19/url.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/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`
node v20.19/util.d.ts CHANGED
@@ -1377,7 +1377,7 @@ declare module "util" {
1377
1377
  * encoded bytes.
1378
1378
  * @param [input='an empty string'] The text to encode.
1379
1379
  */
1380
- encode(input?: string): Uint8Array;
1380
+ encode(input?: string): NodeJS.NonSharedUint8Array;
1381
1381
  /**
1382
1382
  * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
1383
1383
  * containing the read Unicode code units and written UTF-8 bytes.
node v20.19/v8.d.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/v8.js)
8
8
  */
9
9
  declare module "v8" {
10
+ import { NonSharedBuffer } from "node:buffer";
10
11
  import { Readable } from "node:stream";
11
12
  interface HeapSpaceInfo {
12
13
  space_name: string;
@@ -339,7 +340,7 @@ declare module "v8" {
339
340
  * the buffer is released. Calling this method results in undefined behavior
340
341
  * if a previous write has failed.
341
342
  */
342
- releaseBuffer(): Buffer;
343
+ releaseBuffer(): NonSharedBuffer;
343
344
  /**
344
345
  * Marks an `ArrayBuffer` as having its contents transferred out of band.
345
346
  * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`.
@@ -367,7 +368,7 @@ declare module "v8" {
367
368
  * will require a way to compute the length of the buffer.
368
369
  * For use inside of a custom `serializer._writeHostObject()`.
369
370
  */
370
- writeRawBytes(buffer: NodeJS.TypedArray): void;
371
+ writeRawBytes(buffer: NodeJS.ArrayBufferView): void;
371
372
  }
372
373
  /**
373
374
  * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only
@@ -438,7 +439,7 @@ declare module "v8" {
438
439
  * larger than `buffer.constants.MAX_LENGTH`.
439
440
  * @since v8.0.0
440
441
  */
441
- function serialize(value: any): Buffer;
442
+ function serialize(value: any): NonSharedBuffer;
442
443
  /**
443
444
  * Uses a `DefaultDeserializer` with default options to read a JS value
444
445
  * from a buffer.
node v20.19/vm.d.ts CHANGED
@@ -37,6 +37,7 @@
37
37
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/vm.js)
38
38
  */
39
39
  declare module "vm" {
40
+ import { NonSharedBuffer } from "node:buffer";
40
41
  import { ImportAttributes } from "node:module";
41
42
  interface Context extends NodeJS.Dict<any> {}
42
43
  interface BaseOptions {
@@ -65,7 +66,7 @@ declare module "vm" {
65
66
  /**
66
67
  * Provides an optional data with V8's code cache data for the supplied source.
67
68
  */
68
- cachedData?: Buffer | NodeJS.ArrayBufferView | undefined;
69
+ cachedData?: NodeJS.ArrayBufferView | undefined;
69
70
  /** @deprecated in favor of `script.createCachedData()` */
70
71
  produceCachedData?: boolean | undefined;
71
72
  /**
@@ -361,7 +362,7 @@ declare module "vm" {
361
362
  * ```
362
363
  * @since v10.6.0
363
364
  */
364
- createCachedData(): Buffer;
365
+ createCachedData(): NonSharedBuffer;
365
366
  /** @deprecated in favor of `script.createCachedData()` */
366
367
  cachedDataProduced?: boolean;
367
368
  /**
@@ -371,7 +372,7 @@ declare module "vm" {
371
372
  * @since v5.7.0
372
373
  */
373
374
  cachedDataRejected?: boolean;
374
- cachedData?: Buffer;
375
+ cachedData?: NonSharedBuffer;
375
376
  /**
376
377
  * When the script is compiled from a source that contains a source map magic
377
378
  * comment, this property will be set to the URL of the source map.
node v20.19/zlib.d.ts CHANGED
@@ -92,6 +92,7 @@
92
92
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/zlib.js)
93
93
  */
94
94
  declare module "zlib" {
95
+ import { NonSharedBuffer } from "node:buffer";
95
96
  import * as stream from "node:stream";
96
97
  interface ZlibOptions {
97
98
  /**
@@ -180,7 +181,7 @@ declare module "zlib" {
180
181
  * @returns A 32-bit unsigned integer containing the checksum.
181
182
  * @since v20.15.0
182
183
  */
183
- function crc32(data: string | Buffer | NodeJS.ArrayBufferView, value?: number): number;
184
+ function crc32(data: string | NodeJS.ArrayBufferView, value?: number): number;
184
185
  /**
185
186
  * Creates and returns a new `BrotliCompress` object.
186
187
  * @since v11.7.0, v10.16.0
@@ -234,124 +235,124 @@ declare module "zlib" {
234
235
  */
235
236
  function createUnzip(options?: ZlibOptions): Unzip;
236
237
  type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
237
- type CompressCallback = (error: Error | null, result: Buffer) => void;
238
+ type CompressCallback = (error: Error | null, result: NonSharedBuffer) => void;
238
239
  /**
239
240
  * @since v11.7.0, v10.16.0
240
241
  */
241
242
  function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
242
243
  function brotliCompress(buf: InputType, callback: CompressCallback): void;
243
244
  namespace brotliCompress {
244
- function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
245
+ function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
245
246
  }
246
247
  /**
247
248
  * Compress a chunk of data with `BrotliCompress`.
248
249
  * @since v11.7.0, v10.16.0
249
250
  */
250
- function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
251
+ function brotliCompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
251
252
  /**
252
253
  * @since v11.7.0, v10.16.0
253
254
  */
254
255
  function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
255
256
  function brotliDecompress(buf: InputType, callback: CompressCallback): void;
256
257
  namespace brotliDecompress {
257
- function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
258
+ function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
258
259
  }
259
260
  /**
260
261
  * Decompress a chunk of data with `BrotliDecompress`.
261
262
  * @since v11.7.0, v10.16.0
262
263
  */
263
- function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
264
+ function brotliDecompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
264
265
  /**
265
266
  * @since v0.6.0
266
267
  */
267
268
  function deflate(buf: InputType, callback: CompressCallback): void;
268
269
  function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
269
270
  namespace deflate {
270
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
271
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
271
272
  }
272
273
  /**
273
274
  * Compress a chunk of data with `Deflate`.
274
275
  * @since v0.11.12
275
276
  */
276
- function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
277
+ function deflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
277
278
  /**
278
279
  * @since v0.6.0
279
280
  */
280
281
  function deflateRaw(buf: InputType, callback: CompressCallback): void;
281
282
  function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
282
283
  namespace deflateRaw {
283
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
284
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
284
285
  }
285
286
  /**
286
287
  * Compress a chunk of data with `DeflateRaw`.
287
288
  * @since v0.11.12
288
289
  */
289
- function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
290
+ function deflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
290
291
  /**
291
292
  * @since v0.6.0
292
293
  */
293
294
  function gzip(buf: InputType, callback: CompressCallback): void;
294
295
  function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
295
296
  namespace gzip {
296
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
297
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
297
298
  }
298
299
  /**
299
300
  * Compress a chunk of data with `Gzip`.
300
301
  * @since v0.11.12
301
302
  */
302
- function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
303
+ function gzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
303
304
  /**
304
305
  * @since v0.6.0
305
306
  */
306
307
  function gunzip(buf: InputType, callback: CompressCallback): void;
307
308
  function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
308
309
  namespace gunzip {
309
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
310
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
310
311
  }
311
312
  /**
312
313
  * Decompress a chunk of data with `Gunzip`.
313
314
  * @since v0.11.12
314
315
  */
315
- function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
316
+ function gunzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
316
317
  /**
317
318
  * @since v0.6.0
318
319
  */
319
320
  function inflate(buf: InputType, callback: CompressCallback): void;
320
321
  function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
321
322
  namespace inflate {
322
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
323
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
323
324
  }
324
325
  /**
325
326
  * Decompress a chunk of data with `Inflate`.
326
327
  * @since v0.11.12
327
328
  */
328
- function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
329
+ function inflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
329
330
  /**
330
331
  * @since v0.6.0
331
332
  */
332
333
  function inflateRaw(buf: InputType, callback: CompressCallback): void;
333
334
  function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
334
335
  namespace inflateRaw {
335
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
336
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
336
337
  }
337
338
  /**
338
339
  * Decompress a chunk of data with `InflateRaw`.
339
340
  * @since v0.11.12
340
341
  */
341
- function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
342
+ function inflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
342
343
  /**
343
344
  * @since v0.6.0
344
345
  */
345
346
  function unzip(buf: InputType, callback: CompressCallback): void;
346
347
  function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
347
348
  namespace unzip {
348
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
349
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
349
350
  }
350
351
  /**
351
352
  * Decompress a chunk of data with `Unzip`.
352
353
  * @since v0.11.12
353
354
  */
354
- function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
355
+ function unzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
355
356
  namespace constants {
356
357
  const BROTLI_DECODE: number;
357
358
  const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;