@types/node 22.15.25 → 22.15.27

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, 29 May 2025 22:36:39 GMT
11
+ * Last updated: Fri, 30 May 2025 05:02:50 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/globals.d.ts CHANGED
@@ -266,11 +266,6 @@ declare global {
266
266
 
267
267
  // Global DOM types
268
268
 
269
- function structuredClone<T>(
270
- value: T,
271
- transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
272
- ): T;
273
-
274
269
  interface DOMException extends _DOMException {}
275
270
  var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
276
271
  : NodeDOMExceptionConstructor;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.15.25",
3
+ "version": "22.15.27",
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": "~6.21.0"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "8b19db6d49dabe49bfd2ef4d9f9b77671032ec641027d29c04fe89eca592159a",
223
+ "typesPublisherContentHash": "b9177cabc8a459c3570f9577c085dbfdc96e40f78ed41af33c674c3696a4e277",
224
224
  "typeScriptVersion": "5.1"
225
225
  }
node/perf_hooks.d.ts CHANGED
@@ -866,12 +866,12 @@ declare module "perf_hooks" {
866
866
  * The minimum recordable value. Must be an integer value greater than 0.
867
867
  * @default 1
868
868
  */
869
- min?: number | bigint | undefined;
869
+ lowest?: number | bigint | undefined;
870
870
  /**
871
871
  * The maximum recordable value. Must be an integer value greater than min.
872
872
  * @default Number.MAX_SAFE_INTEGER
873
873
  */
874
- max?: number | bigint | undefined;
874
+ highest?: number | bigint | undefined;
875
875
  /**
876
876
  * The number of accuracy digits. Must be a number between 1 and 5.
877
877
  * @default 3
node/worker_threads.d.ts CHANGED
@@ -52,14 +52,13 @@
52
52
  * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/worker_threads.js)
53
53
  */
54
54
  declare module "worker_threads" {
55
- import { Blob } from "node:buffer";
56
55
  import { Context } from "node:vm";
57
56
  import { EventEmitter } from "node:events";
58
57
  import { EventLoopUtilityFunction } from "node:perf_hooks";
59
58
  import { FileHandle } from "node:fs/promises";
60
59
  import { Readable, Writable } from "node:stream";
60
+ import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
61
61
  import { URL } from "node:url";
62
- import { X509Certificate } from "node:crypto";
63
62
  const isInternalThread: boolean;
64
63
  const isMainThread: boolean;
65
64
  const parentPort: null | MessagePort;
@@ -89,7 +88,17 @@ declare module "worker_threads" {
89
88
  interface WorkerPerformance {
90
89
  eventLoopUtilization: EventLoopUtilityFunction;
91
90
  }
92
- type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate | Blob;
91
+ type Transferable =
92
+ | ArrayBuffer
93
+ | MessagePort
94
+ | AbortSignal
95
+ | FileHandle
96
+ | ReadableStream
97
+ | WritableStream
98
+ | TransformStream;
99
+ /** @deprecated Use `import { Transferable } from "node:worker_threads"` instead. */
100
+ // TODO: remove in a future major @types/node version.
101
+ type TransferListItem = Transferable;
93
102
  /**
94
103
  * Instances of the `worker.MessagePort` class represent one end of an
95
104
  * asynchronous, two-way communications channel. It can be used to transfer
@@ -174,7 +183,7 @@ declare module "worker_threads" {
174
183
  * behind this API, see the `serialization API of the node:v8 module`.
175
184
  * @since v10.5.0
176
185
  */
177
- postMessage(value: any, transferList?: readonly TransferListItem[]): void;
186
+ postMessage(value: any, transferList?: readonly Transferable[]): void;
178
187
  /**
179
188
  * Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed port does _not_ let the program exit if it's the only active handle left (the default
180
189
  * behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
@@ -261,7 +270,7 @@ declare module "worker_threads" {
261
270
  /**
262
271
  * Additional data to send in the first worker message.
263
272
  */
264
- transferList?: TransferListItem[] | undefined;
273
+ transferList?: Transferable[] | undefined;
265
274
  /**
266
275
  * @default true
267
276
  */
@@ -409,7 +418,7 @@ declare module "worker_threads" {
409
418
  * See `port.postMessage()` for more details.
410
419
  * @since v10.5.0
411
420
  */
412
- postMessage(value: any, transferList?: readonly TransferListItem[]): void;
421
+ postMessage(value: any, transferList?: readonly Transferable[]): void;
413
422
  /**
414
423
  * Sends a value to another worker, identified by its thread ID.
415
424
  * @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
@@ -425,7 +434,7 @@ declare module "worker_threads" {
425
434
  postMessageToThread(
426
435
  threadId: number,
427
436
  value: any,
428
- transferList: readonly TransferListItem[],
437
+ transferList: readonly Transferable[],
429
438
  timeout?: number,
430
439
  ): Promise<void>;
431
440
  /**
@@ -701,7 +710,7 @@ declare module "worker_threads" {
701
710
  * @param value Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value
702
711
  * for the `key` will be deleted.
703
712
  */
704
- function setEnvironmentData(key: Serializable, value: Serializable): void;
713
+ function setEnvironmentData(key: Serializable, value?: Serializable): void;
705
714
 
706
715
  import {
707
716
  BroadcastChannel as _BroadcastChannel,
@@ -709,6 +718,10 @@ declare module "worker_threads" {
709
718
  MessagePort as _MessagePort,
710
719
  } from "worker_threads";
711
720
  global {
721
+ function structuredClone<T>(
722
+ value: T,
723
+ options?: { transfer?: Transferable[] },
724
+ ): T;
712
725
  /**
713
726
  * `BroadcastChannel` class is a global reference for `import { BroadcastChannel } from 'worker_threads'`
714
727
  * https://nodejs.org/api/globals.html#broadcastchannel