@types/node 25.5.0 → 25.5.2

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/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.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 12 Mar 2026 15:47:58 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/net.d.ts CHANGED
@@ -116,9 +116,14 @@ declare module "node:net" {
116
116
  * See `Writable` stream `write()` method for more
117
117
  * information.
118
118
  * @since v0.1.90
119
- * @param [encoding='utf8'] Only used when data is `string`.
120
119
  */
121
120
  write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
121
+ /**
122
+ * Sends data on the socket, with an explicit encoding for string data.
123
+ * @see {@link Socket.write} for full details.
124
+ * @since v0.1.90
125
+ * @param [encoding='utf8'] Only used when data is `string`.
126
+ */
122
127
  write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
123
128
  /**
124
129
  * Initiate a connection on a given socket.
@@ -358,12 +363,26 @@ declare module "node:net" {
358
363
  *
359
364
  * See `writable.end()` for further details.
360
365
  * @since v0.1.90
361
- * @param [encoding='utf8'] Only used when data is `string`.
362
366
  * @param callback Optional callback for when the socket is finished.
363
367
  * @return The socket itself.
364
368
  */
365
369
  end(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 callback Optional callback for when the socket is finished.
375
+ * @return The socket itself.
376
+ */
366
377
  end(buffer: Uint8Array | string, callback?: () => void): this;
378
+ /**
379
+ * Half-closes the socket, with one final chunk of data.
380
+ * @see {@link Socket.end} for full details.
381
+ * @since v0.1.90
382
+ * @param [encoding='utf8'] Only used when data is `string`.
383
+ * @param callback Optional callback for when the socket is finished.
384
+ * @return The socket itself.
385
+ */
367
386
  end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this;
368
387
  // #region InternalEventEmitter
369
388
  addListener<E extends keyof SocketEventMap>(eventName: E, listener: (...args: SocketEventMap[E]) => void): this;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "25.5.0",
3
+ "version": "25.5.2",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -150,6 +150,6 @@
150
150
  "undici-types": "~7.18.0"
151
151
  },
152
152
  "peerDependencies": {},
153
- "typesPublisherContentHash": "4b6968335abe1dc64bd6086fd546d6e9c50f986c37d49de8073f4ed1c900057c",
154
- "typeScriptVersion": "5.2"
153
+ "typesPublisherContentHash": "ecfeeb69f68108817337300f59f20907babb8c0a870a588637f3d9c8b96e73f5",
154
+ "typeScriptVersion": "5.3"
155
155
  }
node/stream/web.d.ts CHANGED
@@ -206,7 +206,7 @@ declare module "node:stream/web" {
206
206
  interface ReadableStreamDefaultController<R = any> {
207
207
  readonly desiredSize: number | null;
208
208
  close(): void;
209
- enqueue(chunk?: R): void;
209
+ enqueue(chunk: R): void;
210
210
  error(e?: any): void;
211
211
  }
212
212
  var ReadableStreamDefaultController: {
@@ -251,7 +251,7 @@ declare module "node:stream/web" {
251
251
  };
252
252
  interface TransformStreamDefaultController<O = any> {
253
253
  readonly desiredSize: number | null;
254
- enqueue(chunk?: O): void;
254
+ enqueue(chunk: O): void;
255
255
  error(reason?: any): void;
256
256
  terminate(): void;
257
257
  }
@@ -284,7 +284,7 @@ declare module "node:stream/web" {
284
284
  abort(reason?: any): Promise<void>;
285
285
  close(): Promise<void>;
286
286
  releaseLock(): void;
287
- write(chunk?: W): Promise<void>;
287
+ write(chunk: W): Promise<void>;
288
288
  }
289
289
  var WritableStreamDefaultWriter: {
290
290
  prototype: WritableStreamDefaultWriter;
node/stream.d.ts CHANGED
@@ -899,11 +899,20 @@ declare module "node:stream" {
899
899
  * @since v0.9.4
900
900
  * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
901
901
  * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
902
- * @param [encoding='utf8'] The encoding, if `chunk` is a string.
903
902
  * @param callback Callback for when this chunk of data is flushed.
904
903
  * @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`.
905
904
  */
906
905
  write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
906
+ /**
907
+ * Writes data to the stream, with an explicit encoding for string data.
908
+ * @see {@link Writable.write} for full details.
909
+ * @since v0.9.4
910
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
911
+ * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
912
+ * @param encoding The encoding, if `chunk` is a string.
913
+ * @param callback Callback for when this chunk of data is flushed.
914
+ * @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`.
915
+ */
907
916
  write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
908
917
  /**
909
918
  * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream.
@@ -928,13 +937,27 @@ declare module "node:stream" {
928
937
  * // Writing more now is not allowed!
929
938
  * ```
930
939
  * @since v0.9.4
940
+ * @param cb Callback for when the stream is finished.
941
+ */
942
+ end(cb?: () => void): this;
943
+ /**
944
+ * Signals that no more data will be written, with one final chunk of data.
945
+ * @see {@link Writable.end} for full details.
946
+ * @since v0.9.4
931
947
  * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
932
948
  * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
933
- * @param encoding The encoding if `chunk` is a string
934
- * @param callback Callback for when the stream is finished.
949
+ * @param cb Callback for when the stream is finished.
935
950
  */
936
- end(cb?: () => void): this;
937
951
  end(chunk: any, cb?: () => void): this;
952
+ /**
953
+ * Signals that no more data will be written, with one final chunk of data.
954
+ * @see {@link Writable.end} for full details.
955
+ * @since v0.9.4
956
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
957
+ * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
958
+ * @param encoding The encoding if `chunk` is a string
959
+ * @param cb Callback for when the stream is finished.
960
+ */
938
961
  end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
939
962
  /**
940
963
  * The `writable.cork()` method forces all written data to be buffered in memory.