@types/node 18.19.75 → 18.19.77

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 v18.19/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v18.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 04 Feb 2025 00:04:06 GMT
11
+ * Last updated: Fri, 28 Feb 2025 21:02:17 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.19.75",
3
+ "version": "18.19.77",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  "undici-types": "~5.26.4"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "2a0d6aa175147eccdbe8e73e860085cf8985c5c90517b4e9fc7d780d763620c8",
223
+ "typesPublisherContentHash": "ed4669ceee92a67988e040c8a7e8d5dba7817925d88881bb428ff13268f75869",
224
224
  "typeScriptVersion": "5.0"
225
225
  }
node v18.19/stream.d.ts CHANGED
@@ -20,12 +20,11 @@ declare module "stream" {
20
20
  import { Abortable, EventEmitter } from "node:events";
21
21
  import { Blob as NodeBlob } from "node:buffer";
22
22
  import * as streamPromises from "node:stream/promises";
23
- import * as streamConsumers from "node:stream/consumers";
24
23
  import * as streamWeb from "node:stream/web";
25
24
 
26
25
  type ComposeFnParam = (source: any) => void;
27
26
 
28
- class internal extends EventEmitter {
27
+ class Stream extends EventEmitter {
29
28
  pipe<T extends NodeJS.WritableStream>(
30
29
  destination: T,
31
30
  options?: {
@@ -37,10 +36,10 @@ declare module "stream" {
37
36
  options?: { signal: AbortSignal },
38
37
  ): T;
39
38
  }
40
- namespace internal {
41
- class Stream extends internal {
42
- constructor(opts?: ReadableOptions);
43
- }
39
+ namespace Stream {
40
+ export { Stream, streamPromises as promises };
41
+ }
42
+ namespace Stream {
44
43
  interface StreamOptions<T extends Stream> extends Abortable {
45
44
  emitClose?: boolean | undefined;
46
45
  highWaterMark?: number | undefined;
@@ -49,9 +48,9 @@ declare module "stream" {
49
48
  destroy?(this: T, error: Error | null, callback: (error?: Error | null) => void): void;
50
49
  autoDestroy?: boolean | undefined;
51
50
  }
52
- interface ReadableOptions extends StreamOptions<Readable> {
51
+ interface ReadableOptions<T extends Readable = Readable> extends StreamOptions<T> {
53
52
  encoding?: BufferEncoding | undefined;
54
- read?(this: Readable, size: number): void;
53
+ read?(this: T, size: number): void;
55
54
  }
56
55
  interface ArrayOptions {
57
56
  /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */
@@ -86,7 +85,12 @@ declare module "stream" {
86
85
  * @since v17.0.0
87
86
  * @experimental
88
87
  */
89
- static toWeb(streamReadable: Readable): streamWeb.ReadableStream;
88
+ static toWeb(
89
+ streamReadable: Readable,
90
+ options?: {
91
+ strategy?: streamWeb.QueuingStrategy | undefined;
92
+ },
93
+ ): streamWeb.ReadableStream;
90
94
  /**
91
95
  * Returns whether the stream was destroyed or errored before emitting `'end'`.
92
96
  * @since v16.8.0
@@ -681,24 +685,24 @@ declare module "stream" {
681
685
  */
682
686
  [Symbol.asyncDispose](): Promise<void>;
683
687
  }
684
- interface WritableOptions extends StreamOptions<Writable> {
688
+ interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
685
689
  decodeStrings?: boolean | undefined;
686
690
  defaultEncoding?: BufferEncoding | undefined;
687
691
  write?(
688
- this: Writable,
692
+ this: T,
689
693
  chunk: any,
690
694
  encoding: BufferEncoding,
691
695
  callback: (error?: Error | null) => void,
692
696
  ): void;
693
697
  writev?(
694
- this: Writable,
698
+ this: T,
695
699
  chunks: Array<{
696
700
  chunk: any;
697
701
  encoding: BufferEncoding;
698
702
  }>,
699
703
  callback: (error?: Error | null) => void,
700
704
  ): void;
701
- final?(this: Writable, callback: (error?: Error | null) => void): void;
705
+ final?(this: T, callback: (error?: Error | null) => void): void;
702
706
  }
703
707
  /**
704
708
  * @since v0.9.4
@@ -1006,26 +1010,13 @@ declare module "stream" {
1006
1010
  removeListener(event: "unpipe", listener: (src: Readable) => void): this;
1007
1011
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1008
1012
  }
1009
- interface DuplexOptions extends ReadableOptions, WritableOptions {
1013
+ interface DuplexOptions<T extends Duplex = Duplex> extends ReadableOptions<T>, WritableOptions<T> {
1010
1014
  allowHalfOpen?: boolean | undefined;
1011
1015
  readableObjectMode?: boolean | undefined;
1012
1016
  writableObjectMode?: boolean | undefined;
1013
1017
  readableHighWaterMark?: number | undefined;
1014
1018
  writableHighWaterMark?: number | undefined;
1015
1019
  writableCorked?: number | undefined;
1016
- construct?(this: Duplex, callback: (error?: Error | null) => void): void;
1017
- read?(this: Duplex, size: number): void;
1018
- write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
1019
- writev?(
1020
- this: Duplex,
1021
- chunks: Array<{
1022
- chunk: any;
1023
- encoding: BufferEncoding;
1024
- }>,
1025
- callback: (error?: Error | null) => void,
1026
- ): void;
1027
- final?(this: Duplex, callback: (error?: Error | null) => void): void;
1028
- destroy?(this: Duplex, error: Error | null, callback: (error?: Error | null) => void): void;
1029
1020
  }
1030
1021
  /**
1031
1022
  * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces.
@@ -1037,17 +1028,7 @@ declare module "stream" {
1037
1028
  * * `crypto streams`
1038
1029
  * @since v0.9.4
1039
1030
  */
1040
- class Duplex extends Readable implements Writable {
1041
- readonly writable: boolean;
1042
- readonly writableEnded: boolean;
1043
- readonly writableFinished: boolean;
1044
- readonly writableHighWaterMark: number;
1045
- readonly writableLength: number;
1046
- readonly writableObjectMode: boolean;
1047
- readonly writableCorked: number;
1048
- readonly writableNeedDrain: boolean;
1049
- readonly closed: boolean;
1050
- readonly errored: Error | null;
1031
+ class Duplex extends Stream implements NodeJS.ReadWriteStream {
1051
1032
  /**
1052
1033
  * If `false` then the stream will automatically end the writable side when the
1053
1034
  * readable side ends. Set initially by the `allowHalfOpen` constructor option,
@@ -1092,24 +1073,6 @@ declare module "stream" {
1092
1073
  | Promise<any>
1093
1074
  | Object,
1094
1075
  ): Duplex;
1095
- _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
1096
- _writev?(
1097
- chunks: Array<{
1098
- chunk: any;
1099
- encoding: BufferEncoding;
1100
- }>,
1101
- callback: (error?: Error | null) => void,
1102
- ): void;
1103
- _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
1104
- _final(callback: (error?: Error | null) => void): void;
1105
- write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
1106
- write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
1107
- setDefaultEncoding(encoding: BufferEncoding): this;
1108
- end(cb?: () => void): this;
1109
- end(chunk: any, cb?: () => void): this;
1110
- end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
1111
- cork(): void;
1112
- uncork(): void;
1113
1076
  /**
1114
1077
  * Event emitter
1115
1078
  * The defined events on documents including:
@@ -1210,28 +1173,11 @@ declare module "stream" {
1210
1173
  removeListener(event: "unpipe", listener: (src: Readable) => void): this;
1211
1174
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1212
1175
  }
1176
+ interface Duplex extends Readable, Writable {}
1213
1177
  type TransformCallback = (error?: Error | null, data?: any) => void;
1214
- interface TransformOptions extends DuplexOptions {
1215
- construct?(this: Transform, callback: (error?: Error | null) => void): void;
1216
- read?(this: Transform, size: number): void;
1217
- write?(
1218
- this: Transform,
1219
- chunk: any,
1220
- encoding: BufferEncoding,
1221
- callback: (error?: Error | null) => void,
1222
- ): void;
1223
- writev?(
1224
- this: Transform,
1225
- chunks: Array<{
1226
- chunk: any;
1227
- encoding: BufferEncoding;
1228
- }>,
1229
- callback: (error?: Error | null) => void,
1230
- ): void;
1231
- final?(this: Transform, callback: (error?: Error | null) => void): void;
1232
- destroy?(this: Transform, error: Error | null, callback: (error?: Error | null) => void): void;
1233
- transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
1234
- flush?(this: Transform, callback: TransformCallback): void;
1178
+ interface TransformOptions<T extends Transform = Transform> extends DuplexOptions<T> {
1179
+ transform?(this: T, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
1180
+ flush?(this: T, callback: TransformCallback): void;
1235
1181
  }
1236
1182
  /**
1237
1183
  * Transform streams are `Duplex` streams where the output is in some way
@@ -1719,11 +1665,8 @@ declare module "stream" {
1719
1665
  * @since v17.4.0
1720
1666
  */
1721
1667
  function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
1722
-
1723
- const promises: typeof streamPromises;
1724
- const consumers: typeof streamConsumers;
1725
1668
  }
1726
- export = internal;
1669
+ export = Stream;
1727
1670
  }
1728
1671
  declare module "node:stream" {
1729
1672
  import stream = require("stream");