@types/node 22.19.15 → 22.19.17

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 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/v22.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 06 Mar 2026 00:57:44 GMT
11
+ * Last updated: Fri, 03 Apr 2026 11:14:41 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node v22.19/net.d.ts CHANGED
@@ -108,9 +108,14 @@ declare module "net" {
108
108
  * See `Writable` stream `write()` method for more
109
109
  * information.
110
110
  * @since v0.1.90
111
- * @param [encoding='utf8'] Only used when data is `string`.
112
111
  */
113
112
  write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
113
+ /**
114
+ * Sends data on the socket, with an explicit encoding for string data.
115
+ * @see {@link Socket.write} for full details.
116
+ * @since v0.1.90
117
+ * @param [encoding='utf8'] Only used when data is `string`.
118
+ */
114
119
  write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
115
120
  /**
116
121
  * Initiate a connection on a given socket.
@@ -350,12 +355,26 @@ declare module "net" {
350
355
  *
351
356
  * See `writable.end()` for further details.
352
357
  * @since v0.1.90
353
- * @param [encoding='utf8'] Only used when data is `string`.
354
358
  * @param callback Optional callback for when the socket is finished.
355
359
  * @return The socket itself.
356
360
  */
357
361
  end(callback?: () => void): this;
362
+ /**
363
+ * Half-closes the socket, with one final chunk of data.
364
+ * @see {@link Socket.end} for full details.
365
+ * @since v0.1.90
366
+ * @param callback Optional callback for when the socket is finished.
367
+ * @return The socket itself.
368
+ */
358
369
  end(buffer: Uint8Array | string, callback?: () => void): this;
370
+ /**
371
+ * Half-closes the socket, with one final chunk of data.
372
+ * @see {@link Socket.end} for full details.
373
+ * @since v0.1.90
374
+ * @param [encoding='utf8'] Only used when data is `string`.
375
+ * @param callback Optional callback for when the socket is finished.
376
+ * @return The socket itself.
377
+ */
359
378
  end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
360
379
  /**
361
380
  * events.EventEmitter
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.19.15",
3
+ "version": "22.19.17",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -140,6 +140,6 @@
140
140
  "undici-types": "~6.21.0"
141
141
  },
142
142
  "peerDependencies": {},
143
- "typesPublisherContentHash": "e4f9ffdeab50c69a72c98fc00b007f9def62394c519695bf5f543d4d49d0a1c3",
144
- "typeScriptVersion": "5.2"
143
+ "typesPublisherContentHash": "3ff369a303a30a35cbff13aa6763f9465d48e5b0ee79675ae060a4eecfb0d9e3",
144
+ "typeScriptVersion": "5.3"
145
145
  }
@@ -109,7 +109,7 @@ declare module "stream/web" {
109
109
  }
110
110
  interface ReadableStreamReadDoneResult<T> {
111
111
  done: true;
112
- value?: T;
112
+ value: T | undefined;
113
113
  }
114
114
  type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
115
115
  interface ReadableByteStreamControllerCallback {
@@ -254,7 +254,7 @@ declare module "stream/web" {
254
254
  interface ReadableStreamDefaultController<R = any> {
255
255
  readonly desiredSize: number | null;
256
256
  close(): void;
257
- enqueue(chunk?: R): void;
257
+ enqueue(chunk: R): void;
258
258
  error(e?: any): void;
259
259
  }
260
260
  const ReadableStreamDefaultController: {
@@ -283,7 +283,7 @@ declare module "stream/web" {
283
283
  };
284
284
  interface TransformStreamDefaultController<O = any> {
285
285
  readonly desiredSize: number | null;
286
- enqueue(chunk?: O): void;
286
+ enqueue(chunk: O): void;
287
287
  error(reason?: any): void;
288
288
  terminate(): void;
289
289
  }
@@ -319,7 +319,7 @@ declare module "stream/web" {
319
319
  abort(reason?: any): Promise<void>;
320
320
  close(): Promise<void>;
321
321
  releaseLock(): void;
322
- write(chunk?: W): Promise<void>;
322
+ write(chunk: W): Promise<void>;
323
323
  }
324
324
  const WritableStreamDefaultWriter: {
325
325
  prototype: WritableStreamDefaultWriter;
@@ -343,7 +343,7 @@ declare module "stream/web" {
343
343
  size?: QueuingStrategySize<T>;
344
344
  }
345
345
  interface QueuingStrategySize<T = any> {
346
- (chunk?: T): number;
346
+ (chunk: T): number;
347
347
  }
348
348
  interface QueuingStrategyInit {
349
349
  /**
node v22.19/stream.d.ts CHANGED
@@ -858,11 +858,20 @@ declare module "stream" {
858
858
  * @since v0.9.4
859
859
  * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
860
860
  * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
861
- * @param [encoding='utf8'] The encoding, if `chunk` is a string.
862
861
  * @param callback Callback for when this chunk of data is flushed.
863
862
  * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
864
863
  */
865
864
  write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
865
+ /**
866
+ * Writes data to the stream, with an explicit encoding for string data.
867
+ * @see {@link Writable.write} for full details.
868
+ * @since v0.9.4
869
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
870
+ * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
871
+ * @param encoding The encoding, if `chunk` is a string.
872
+ * @param callback Callback for when this chunk of data is flushed.
873
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
874
+ */
866
875
  write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
867
876
  /**
868
877
  * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream.
@@ -887,13 +896,27 @@ declare module "stream" {
887
896
  * // Writing more now is not allowed!
888
897
  * ```
889
898
  * @since v0.9.4
899
+ * @param cb Callback for when the stream is finished.
900
+ */
901
+ end(cb?: () => void): this;
902
+ /**
903
+ * Signals that no more data will be written, with one final chunk of data.
904
+ * @see {@link Writable.end} for full details.
905
+ * @since v0.9.4
890
906
  * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
891
907
  * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
892
- * @param encoding The encoding if `chunk` is a string
893
- * @param callback Callback for when the stream is finished.
908
+ * @param cb Callback for when the stream is finished.
894
909
  */
895
- end(cb?: () => void): this;
896
910
  end(chunk: any, cb?: () => void): this;
911
+ /**
912
+ * Signals that no more data will be written, with one final chunk of data.
913
+ * @see {@link Writable.end} for full details.
914
+ * @since v0.9.4
915
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
916
+ * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
917
+ * @param encoding The encoding if `chunk` is a string
918
+ * @param cb Callback for when the stream is finished.
919
+ */
897
920
  end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
898
921
  /**
899
922
  * The `writable.cork()` method forces all written data to be buffered in memory.