@types/node 24.7.1 → 24.8.0

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, 09 Oct 2025 17:35:09 GMT
11
+ * Last updated: Thu, 16 Oct 2025 12:02:25 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/assert.d.ts CHANGED
@@ -88,7 +88,7 @@ declare module "assert" {
88
88
  * @since v24.6.0
89
89
  */
90
90
  new(
91
- options?: AssertOptions & { strict?: true },
91
+ options?: AssertOptions & { strict?: true | undefined },
92
92
  ): AssertStrict;
93
93
  new(
94
94
  options: AssertOptions,
node/child_process.d.ts CHANGED
@@ -69,7 +69,7 @@ declare module "child_process" {
69
69
  import { Abortable, EventEmitter } from "node:events";
70
70
  import * as dgram from "node:dgram";
71
71
  import * as net from "node:net";
72
- import { Pipe, Readable, Stream, Writable } from "node:stream";
72
+ import { Readable, Stream, Writable } from "node:stream";
73
73
  import { URL } from "node:url";
74
74
  type Serializable = string | object | number | boolean | bigint;
75
75
  type SendHandle = net.Socket | net.Server | dgram.Socket | undefined;
@@ -139,7 +139,7 @@ declare module "child_process" {
139
139
  * no IPC channel exists, this property is `undefined`.
140
140
  * @since v7.1.0
141
141
  */
142
- readonly channel?: Pipe | null | undefined;
142
+ readonly channel?: Control | null;
143
143
  /**
144
144
  * A sparse array of pipes to the child process, corresponding with positions in
145
145
  * the `stdio` option passed to {@link spawn} that have been set
@@ -612,6 +612,10 @@ declare module "child_process" {
612
612
  Readable | Writable | null | undefined, // extra, no modification
613
613
  ];
614
614
  }
615
+ interface Control extends EventEmitter {
616
+ ref(): void;
617
+ unref(): void;
618
+ }
615
619
  interface MessageOptions {
616
620
  keepOpen?: boolean | undefined;
617
621
  }
@@ -894,11 +898,12 @@ declare module "child_process" {
894
898
  interface ExecOptionsWithBufferEncoding extends ExecOptions {
895
899
  encoding: "buffer" | null; // specify `null`.
896
900
  }
901
+ // TODO: Just Plain Wrong™ (see also nodejs/node#57392)
897
902
  interface ExecException extends Error {
898
- cmd?: string | undefined;
899
- killed?: boolean | undefined;
900
- code?: number | undefined;
901
- signal?: NodeJS.Signals | undefined;
903
+ cmd?: string;
904
+ killed?: boolean;
905
+ code?: number;
906
+ signal?: NodeJS.Signals;
902
907
  stdout?: string;
903
908
  stderr?: string;
904
909
  }
@@ -1056,10 +1061,11 @@ declare module "child_process" {
1056
1061
  }
1057
1062
  /** @deprecated Use `ExecFileOptions` instead. */
1058
1063
  interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
1064
+ // TODO: execFile exceptions can take many forms... this accurately describes none of them
1059
1065
  type ExecFileException =
1060
1066
  & Omit<ExecException, "code">
1061
1067
  & Omit<NodeJS.ErrnoException, "code">
1062
- & { code?: string | number | undefined | null };
1068
+ & { code?: string | number | null };
1063
1069
  /**
1064
1070
  * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
1065
1071
  * executable `file` is spawned directly as a new process making it slightly more
@@ -1320,7 +1326,7 @@ declare module "child_process" {
1320
1326
  stderr: T;
1321
1327
  status: number | null;
1322
1328
  signal: NodeJS.Signals | null;
1323
- error?: Error | undefined;
1329
+ error?: Error;
1324
1330
  }
1325
1331
  /**
1326
1332
  * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
@@ -1409,7 +1415,7 @@ declare module "child_process" {
1409
1415
  encoding: BufferEncoding;
1410
1416
  }
1411
1417
  interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
1412
- encoding?: "buffer" | null; // specify `null`.
1418
+ encoding?: "buffer" | null | undefined; // specify `null`.
1413
1419
  }
1414
1420
  /**
1415
1421
  * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
node/cluster.d.ts CHANGED
@@ -481,7 +481,7 @@ declare module "cluster" {
481
481
  * ```
482
482
  * @since v0.7.0
483
483
  */
484
- readonly worker?: Worker | undefined;
484
+ readonly worker?: Worker;
485
485
  /**
486
486
  * A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
487
487
  *
@@ -497,7 +497,7 @@ declare module "cluster" {
497
497
  * ```
498
498
  * @since v0.7.0
499
499
  */
500
- readonly workers?: NodeJS.Dict<Worker> | undefined;
500
+ readonly workers?: NodeJS.Dict<Worker>;
501
501
  readonly SCHED_NONE: number;
502
502
  readonly SCHED_RR: number;
503
503
  /**
@@ -550,10 +550,9 @@ declare module "cluster" {
550
550
  prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
551
551
  prependListener(event: "fork", listener: (worker: Worker) => void): this;
552
552
  prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
553
- // the handle is a net.Socket or net.Server object, or undefined.
554
553
  prependListener(
555
554
  event: "message",
556
- listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
555
+ listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
557
556
  ): this;
558
557
  prependListener(event: "online", listener: (worker: Worker) => void): this;
559
558
  prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;