@types/node 18.19.76 → 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: Thu, 13 Feb 2025 22:34:15 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.76",
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": "8b84ac7ae7decd715ecc009f000a5d2ef12d25a5771e69a2c02890b57118880d",
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**. */
@@ -686,24 +685,24 @@ declare module "stream" {
686
685
  */
687
686
  [Symbol.asyncDispose](): Promise<void>;
688
687
  }
689
- interface WritableOptions extends StreamOptions<Writable> {
688
+ interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
690
689
  decodeStrings?: boolean | undefined;
691
690
  defaultEncoding?: BufferEncoding | undefined;
692
691
  write?(
693
- this: Writable,
692
+ this: T,
694
693
  chunk: any,
695
694
  encoding: BufferEncoding,
696
695
  callback: (error?: Error | null) => void,
697
696
  ): void;
698
697
  writev?(
699
- this: Writable,
698
+ this: T,
700
699
  chunks: Array<{
701
700
  chunk: any;
702
701
  encoding: BufferEncoding;
703
702
  }>,
704
703
  callback: (error?: Error | null) => void,
705
704
  ): void;
706
- final?(this: Writable, callback: (error?: Error | null) => void): void;
705
+ final?(this: T, callback: (error?: Error | null) => void): void;
707
706
  }
708
707
  /**
709
708
  * @since v0.9.4
@@ -1011,26 +1010,13 @@ declare module "stream" {
1011
1010
  removeListener(event: "unpipe", listener: (src: Readable) => void): this;
1012
1011
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1013
1012
  }
1014
- interface DuplexOptions extends ReadableOptions, WritableOptions {
1013
+ interface DuplexOptions<T extends Duplex = Duplex> extends ReadableOptions<T>, WritableOptions<T> {
1015
1014
  allowHalfOpen?: boolean | undefined;
1016
1015
  readableObjectMode?: boolean | undefined;
1017
1016
  writableObjectMode?: boolean | undefined;
1018
1017
  readableHighWaterMark?: number | undefined;
1019
1018
  writableHighWaterMark?: number | undefined;
1020
1019
  writableCorked?: number | undefined;
1021
- construct?(this: Duplex, callback: (error?: Error | null) => void): void;
1022
- read?(this: Duplex, size: number): void;
1023
- write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
1024
- writev?(
1025
- this: Duplex,
1026
- chunks: Array<{
1027
- chunk: any;
1028
- encoding: BufferEncoding;
1029
- }>,
1030
- callback: (error?: Error | null) => void,
1031
- ): void;
1032
- final?(this: Duplex, callback: (error?: Error | null) => void): void;
1033
- destroy?(this: Duplex, error: Error | null, callback: (error?: Error | null) => void): void;
1034
1020
  }
1035
1021
  /**
1036
1022
  * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces.
@@ -1042,17 +1028,7 @@ declare module "stream" {
1042
1028
  * * `crypto streams`
1043
1029
  * @since v0.9.4
1044
1030
  */
1045
- class Duplex extends Readable implements Writable {
1046
- readonly writable: boolean;
1047
- readonly writableEnded: boolean;
1048
- readonly writableFinished: boolean;
1049
- readonly writableHighWaterMark: number;
1050
- readonly writableLength: number;
1051
- readonly writableObjectMode: boolean;
1052
- readonly writableCorked: number;
1053
- readonly writableNeedDrain: boolean;
1054
- readonly closed: boolean;
1055
- readonly errored: Error | null;
1031
+ class Duplex extends Stream implements NodeJS.ReadWriteStream {
1056
1032
  /**
1057
1033
  * If `false` then the stream will automatically end the writable side when the
1058
1034
  * readable side ends. Set initially by the `allowHalfOpen` constructor option,
@@ -1097,24 +1073,6 @@ declare module "stream" {
1097
1073
  | Promise<any>
1098
1074
  | Object,
1099
1075
  ): Duplex;
1100
- _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
1101
- _writev?(
1102
- chunks: Array<{
1103
- chunk: any;
1104
- encoding: BufferEncoding;
1105
- }>,
1106
- callback: (error?: Error | null) => void,
1107
- ): void;
1108
- _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
1109
- _final(callback: (error?: Error | null) => void): void;
1110
- write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
1111
- write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
1112
- setDefaultEncoding(encoding: BufferEncoding): this;
1113
- end(cb?: () => void): this;
1114
- end(chunk: any, cb?: () => void): this;
1115
- end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
1116
- cork(): void;
1117
- uncork(): void;
1118
1076
  /**
1119
1077
  * Event emitter
1120
1078
  * The defined events on documents including:
@@ -1215,28 +1173,11 @@ declare module "stream" {
1215
1173
  removeListener(event: "unpipe", listener: (src: Readable) => void): this;
1216
1174
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1217
1175
  }
1176
+ interface Duplex extends Readable, Writable {}
1218
1177
  type TransformCallback = (error?: Error | null, data?: any) => void;
1219
- interface TransformOptions extends DuplexOptions {
1220
- construct?(this: Transform, callback: (error?: Error | null) => void): void;
1221
- read?(this: Transform, size: number): void;
1222
- write?(
1223
- this: Transform,
1224
- chunk: any,
1225
- encoding: BufferEncoding,
1226
- callback: (error?: Error | null) => void,
1227
- ): void;
1228
- writev?(
1229
- this: Transform,
1230
- chunks: Array<{
1231
- chunk: any;
1232
- encoding: BufferEncoding;
1233
- }>,
1234
- callback: (error?: Error | null) => void,
1235
- ): void;
1236
- final?(this: Transform, callback: (error?: Error | null) => void): void;
1237
- destroy?(this: Transform, error: Error | null, callback: (error?: Error | null) => void): void;
1238
- transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
1239
- 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;
1240
1181
  }
1241
1182
  /**
1242
1183
  * Transform streams are `Duplex` streams where the output is in some way
@@ -1724,11 +1665,8 @@ declare module "stream" {
1724
1665
  * @since v17.4.0
1725
1666
  */
1726
1667
  function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
1727
-
1728
- const promises: typeof streamPromises;
1729
- const consumers: typeof streamConsumers;
1730
1668
  }
1731
- export = internal;
1669
+ export = Stream;
1732
1670
  }
1733
1671
  declare module "node:stream" {
1734
1672
  import stream = require("stream");