@types/node 20.17.53 → 20.17.55

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 v20.17/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/v20.
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
@@ -251,11 +251,6 @@ declare global {
251
251
 
252
252
  // Global DOM types
253
253
 
254
- function structuredClone<T>(
255
- value: T,
256
- transfer?: { transfer: ReadonlyArray<import("worker_threads").TransferListItem> },
257
- ): T;
258
-
259
254
  interface DOMException extends _DOMException {}
260
255
  var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
261
256
  : NodeDOMExceptionConstructor;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.17.53",
3
+ "version": "20.17.55",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -215,6 +215,6 @@
215
215
  "undici-types": "~6.19.2"
216
216
  },
217
217
  "peerDependencies": {},
218
- "typesPublisherContentHash": "63cc46deb34f8a32b0b077f42fb1acb221f2116034a84242961091c72307fc42",
218
+ "typesPublisherContentHash": "8377a6ccbf5fad0efaa72f70c7f393873f3c595e12fc670a3e6044febf2c3660",
219
219
  "typeScriptVersion": "5.1"
220
220
  }
@@ -830,12 +830,12 @@ declare module "perf_hooks" {
830
830
  * The minimum recordable value. Must be an integer value greater than 0.
831
831
  * @default 1
832
832
  */
833
- min?: number | bigint | undefined;
833
+ lowest?: number | bigint | undefined;
834
834
  /**
835
835
  * The maximum recordable value. Must be an integer value greater than min.
836
836
  * @default Number.MAX_SAFE_INTEGER
837
837
  */
838
- max?: number | bigint | undefined;
838
+ highest?: number | bigint | undefined;
839
839
  /**
840
840
  * The number of accuracy digits. Must be a number between 1 and 5.
841
841
  * @default 3
@@ -52,14 +52,13 @@
52
52
  * @see [source](https://github.com/nodejs/node/blob/v20.13.1/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 isMainThread: boolean;
64
63
  const parentPort: null | MessagePort;
65
64
  const resourceLimits: ResourceLimits;
@@ -88,7 +87,16 @@ declare module "worker_threads" {
88
87
  interface WorkerPerformance {
89
88
  eventLoopUtilization: EventLoopUtilityFunction;
90
89
  }
91
- type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate | Blob;
90
+ type Transferable =
91
+ | ArrayBuffer
92
+ | MessagePort
93
+ | AbortSignal
94
+ | FileHandle
95
+ | ReadableStream
96
+ | WritableStream
97
+ | TransformStream;
98
+ /** @deprecated Use `import { Transferable } from "node:worker_threads"` instead. */
99
+ type TransferListItem = Transferable;
92
100
  /**
93
101
  * Instances of the `worker.MessagePort` class represent one end of an
94
102
  * asynchronous, two-way communications channel. It can be used to transfer
@@ -173,7 +181,7 @@ declare module "worker_threads" {
173
181
  * behind this API, see the `serialization API of the node:v8 module`.
174
182
  * @since v10.5.0
175
183
  */
176
- postMessage(value: any, transferList?: readonly TransferListItem[]): void;
184
+ postMessage(value: any, transferList?: readonly Transferable[]): void;
177
185
  /**
178
186
  * 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
179
187
  * behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
@@ -260,7 +268,7 @@ declare module "worker_threads" {
260
268
  /**
261
269
  * Additional data to send in the first worker message.
262
270
  */
263
- transferList?: TransferListItem[] | undefined;
271
+ transferList?: Transferable[] | undefined;
264
272
  /**
265
273
  * @default true
266
274
  */
@@ -408,7 +416,7 @@ declare module "worker_threads" {
408
416
  * See `port.postMessage()` for more details.
409
417
  * @since v10.5.0
410
418
  */
411
- postMessage(value: any, transferList?: readonly TransferListItem[]): void;
419
+ postMessage(value: any, transferList?: readonly Transferable[]): void;
412
420
  /**
413
421
  * Opposite of `unref()`, calling `ref()` on a previously `unref()`ed worker does _not_ let the program exit if it's the only active handle left (the default
414
422
  * behavior). If the worker is `ref()`ed, calling `ref()` again has
@@ -649,7 +657,7 @@ declare module "worker_threads" {
649
657
  * @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
650
658
  * for the `key` will be deleted.
651
659
  */
652
- function setEnvironmentData(key: Serializable, value: Serializable): void;
660
+ function setEnvironmentData(key: Serializable, value?: Serializable): void;
653
661
 
654
662
  import {
655
663
  BroadcastChannel as _BroadcastChannel,
@@ -657,6 +665,10 @@ declare module "worker_threads" {
657
665
  MessagePort as _MessagePort,
658
666
  } from "worker_threads";
659
667
  global {
668
+ function structuredClone<T>(
669
+ value: T,
670
+ options?: { transfer?: Transferable[] },
671
+ ): T;
660
672
  /**
661
673
  * `BroadcastChannel` class is a global reference for `import { BroadcastChannel } from 'node:worker_threads'`
662
674
  * https://nodejs.org/api/globals.html#broadcastchannel