@types/node 25.3.5 → 25.5.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: Fri, 06 Mar 2026 00:57:44 GMT
11
+ * Last updated: Thu, 12 Mar 2026 15:47:58 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/assert.d.ts CHANGED
@@ -253,10 +253,10 @@ declare module "node:assert" {
253
253
  * import assert from 'node:assert/strict';
254
254
  *
255
255
  * // Using `assert()` works the same:
256
- * assert(0);
256
+ * assert(2 + 2 > 5);;
257
257
  * // AssertionError: The expression evaluated to a falsy value:
258
258
  * //
259
- * // assert(0)
259
+ * // assert(2 + 2 > 5)
260
260
  * ```
261
261
  * @since v0.1.21
262
262
  */
node/child_process.d.ts CHANGED
@@ -228,6 +228,11 @@ declare module "node:child_process" {
228
228
  /**
229
229
  * The `subprocess.exitCode` property indicates the exit code of the child process.
230
230
  * If the child process is still running, the field will be `null`.
231
+ *
232
+ * When the child process is terminated by a signal, `subprocess.exitCode` will be
233
+ * `null` and `subprocess.signalCode` will be set. To get the corresponding
234
+ * POSIX exit code, use
235
+ * `util.convertProcessSignalToExitCode(subprocess.signalCode)`.
231
236
  */
232
237
  readonly exitCode: number | null;
233
238
  /**
node/events.d.ts CHANGED
@@ -638,24 +638,17 @@ declare module "node:events" {
638
638
  */
639
639
  function getMaxListeners(emitter: EventEmitter | EventTarget): number;
640
640
  /**
641
- * A class method that returns the number of listeners for the given `eventName`
642
- * registered on the given `emitter`.
641
+ * Returns the number of registered listeners for the event named `eventName`.
643
642
  *
644
- * ```js
645
- * import { EventEmitter, listenerCount } from 'node:events';
643
+ * For `EventEmitter`s this behaves exactly the same as calling `.listenerCount`
644
+ * on the emitter.
646
645
  *
647
- * const myEmitter = new EventEmitter();
648
- * myEmitter.on('event', () => {});
649
- * myEmitter.on('event', () => {});
650
- * console.log(listenerCount(myEmitter, 'event'));
651
- * // Prints: 2
652
- * ```
646
+ * For `EventTarget`s this is the only way to obtain the listener count. This can
647
+ * be useful for debugging and diagnostic purposes.
653
648
  * @since v0.9.12
654
- * @deprecated Use `emitter.listenerCount()` instead.
655
- * @param emitter The emitter to query
656
- * @param eventName The event name
657
649
  */
658
650
  function listenerCount(emitter: EventEmitter, eventName: string | symbol): number;
651
+ function listenerCount(emitter: EventTarget, eventName: string): number;
659
652
  interface OnOptions extends Abortable {
660
653
  /**
661
654
  * Names of events that will end the iteration.
node/fs.d.ts CHANGED
@@ -3553,10 +3553,12 @@ declare module "node:fs" {
3553
3553
  */
3554
3554
  function unwatchFile(filename: PathLike, listener?: StatsListener): void;
3555
3555
  function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
3556
+ type WatchIgnorePredicate = string | RegExp | ((filename: string) => boolean);
3556
3557
  interface WatchOptions extends Abortable {
3557
3558
  encoding?: BufferEncoding | "buffer" | undefined;
3558
3559
  persistent?: boolean | undefined;
3559
3560
  recursive?: boolean | undefined;
3561
+ ignore?: WatchIgnorePredicate | readonly WatchIgnorePredicate[] | undefined;
3560
3562
  }
3561
3563
  interface WatchOptionsWithBufferEncoding extends WatchOptions {
3562
3564
  encoding: "buffer";
node/http.d.ts CHANGED
@@ -2136,6 +2136,27 @@ declare module "node:http" {
2136
2136
  * @param [max=1000]
2137
2137
  */
2138
2138
  function setMaxIdleHTTPParsers(max: number): void;
2139
+ /**
2140
+ * Dynamically resets the global configurations to enable built-in proxy support for
2141
+ * `fetch()` and `http.request()`/`https.request()` at runtime, as an alternative
2142
+ * to using the `--use-env-proxy` flag or `NODE_USE_ENV_PROXY` environment variable.
2143
+ * It can also be used to override settings configured from the environment variables.
2144
+ *
2145
+ * As this function resets the global configurations, any previously configured
2146
+ * `http.globalAgent`, `https.globalAgent` or undici global dispatcher would be
2147
+ * overridden after this function is invoked. It's recommended to invoke it before any
2148
+ * requests are made and avoid invoking it in the middle of any requests.
2149
+ *
2150
+ * See [Built-in Proxy Support](https://nodejs.org/docs/latest-v25.x/api/http.html#built-in-proxy-support) for details on proxy URL formats and `NO_PROXY`
2151
+ * syntax.
2152
+ * @since v25.4.0
2153
+ * @param proxyEnv An object containing proxy configuration. This accepts the
2154
+ * same options as the `proxyEnv` option accepted by {@link Agent}. **Default:**
2155
+ * `process.env`.
2156
+ * @returns A function that restores the original agent and dispatcher
2157
+ * settings to the state before this `http.setGlobalProxyFromEnv()` is invoked.
2158
+ */
2159
+ function setGlobalProxyFromEnv(proxyEnv?: ProxyEnv): () => void;
2139
2160
  /**
2140
2161
  * Global instance of `Agent` which is used as the default for all HTTP client
2141
2162
  * requests. Diverges from a default `Agent` configuration by having `keepAlive`
node/inspector.d.ts CHANGED
@@ -218,6 +218,51 @@ declare module "node:inspector" {
218
218
  */
219
219
  function put(url: string, data: string): void;
220
220
  }
221
+ namespace DOMStorage {
222
+ /**
223
+ * This feature is only available with the
224
+ * `--experimental-storage-inspection` flag enabled.
225
+ *
226
+ * Broadcasts the `DOMStorage.domStorageItemAdded` event to connected frontends.
227
+ * This event indicates that a new item has been added to the storage.
228
+ * @since v25.5.0
229
+ */
230
+ function domStorageItemAdded(params: DomStorageItemAddedEventDataType): void;
231
+ /**
232
+ * This feature is only available with the
233
+ * `--experimental-storage-inspection` flag enabled.
234
+ *
235
+ * Broadcasts the `DOMStorage.domStorageItemRemoved` event to connected frontends.
236
+ * This event indicates that an item has been removed from the storage.
237
+ * @since v25.5.0
238
+ */
239
+ function domStorageItemRemoved(params: DomStorageItemRemovedEventDataType): void;
240
+ /**
241
+ * This feature is only available with the
242
+ * `--experimental-storage-inspection` flag enabled.
243
+
244
+ * Broadcasts the `DOMStorage.domStorageItemUpdated` event to connected frontends.
245
+ * This event indicates that a storage item has been updated.
246
+ * @since v25.5.0
247
+ */
248
+ function domStorageItemUpdated(params: DomStorageItemUpdatedEventDataType): void;
249
+ /**
250
+ * This feature is only available with the
251
+ * `--experimental-storage-inspection` flag enabled.
252
+ *
253
+ * Broadcasts the `DOMStorage.domStorageItemsCleared` event to connected
254
+ * frontends. This event indicates that all items have been cleared from the
255
+ * storage.
256
+ * @since v25.5.0
257
+ */
258
+ function domStorageItemsCleared(params: DomStorageItemsClearedEventDataType): void;
259
+ /**
260
+ * This feature is only available with the
261
+ * `--experimental-storage-inspection` flag enabled.
262
+ * @since v25.5.0
263
+ */
264
+ function registerStorage(params: unknown): void;
265
+ }
221
266
  }
222
267
  declare module "inspector" {
223
268
  export * from "node:inspector";