@types/node 22.15.33 → 22.18.13

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.
Files changed (77) hide show
  1. node v22.18/README.md +15 -0
  2. {node v22.15 → node v22.18}/assert.d.ts +19 -0
  3. {node v22.15 → node v22.18}/buffer.buffer.d.ts +9 -0
  4. {node v22.15 → node v22.18}/buffer.d.ts +14 -6
  5. {node v22.15 → node v22.18}/child_process.d.ts +89 -162
  6. {node v22.15 → node v22.18}/cluster.d.ts +4 -5
  7. {node v22.15 → node v22.18}/crypto.d.ts +203 -167
  8. {node v22.15 → node v22.18}/dgram.d.ts +9 -8
  9. {node v22.15 → node v22.18}/dns/promises.d.ts +11 -10
  10. {node v22.15 → node v22.18}/dns.d.ts +19 -20
  11. {node v22.15 → node v22.18}/events.d.ts +80 -35
  12. {node v22.15 → node v22.18}/fs/promises.d.ts +78 -56
  13. {node v22.15 → node v22.18}/fs.d.ts +153 -129
  14. node v22.18/globals.d.ts +172 -0
  15. node v22.18/globals.typedarray.d.ts +38 -0
  16. {node v22.15 → node v22.18}/http.d.ts +112 -32
  17. {node v22.15 → node v22.18}/http2.d.ts +45 -26
  18. {node v22.15 → node v22.18}/https.d.ts +96 -62
  19. {node v22.15 → node v22.18}/index.d.ts +7 -3
  20. node v22.15/inspector.d.ts → node v22.18/inspector.generated.d.ts +219 -10
  21. {node v22.15 → node v22.18}/module.d.ts +70 -13
  22. {node v22.15 → node v22.18}/net.d.ts +12 -11
  23. {node v22.15 → node v22.18}/os.d.ts +14 -3
  24. {node v22.15 → node v22.18}/package.json +3 -83
  25. {node v22.15 → node v22.18}/perf_hooks.d.ts +6 -8
  26. {node v22.15 → node v22.18}/process.d.ts +15 -27
  27. {node v22.15 → node v22.18}/readline/promises.d.ts +1 -2
  28. {node v22.15 → node v22.18}/repl.d.ts +3 -5
  29. {node v22.15 → node v22.18}/sqlite.d.ts +212 -6
  30. {node v22.15 → node v22.18}/stream/consumers.d.ts +2 -2
  31. {node v22.15 → node v22.18}/stream/web.d.ts +8 -0
  32. {node v22.15 → node v22.18}/stream.d.ts +29 -33
  33. {node v22.15 → node v22.18}/string_decoder.d.ts +2 -2
  34. node v22.18/test.d.ts +2162 -0
  35. {node v22.15 → node v22.18}/tls.d.ts +90 -66
  36. {node v22.15 → node v22.18}/ts5.6/buffer.buffer.d.ts +10 -2
  37. node v22.18/ts5.6/globals.typedarray.d.ts +34 -0
  38. {node v22.15 → node v22.18}/ts5.6/index.d.ts +7 -3
  39. {node v22.15 → node v22.18}/url.d.ts +13 -4
  40. {node v22.15 → node v22.18}/util.d.ts +21 -6
  41. {node v22.15 → node v22.18}/v8.d.ts +33 -35
  42. {node v22.15 → node v22.18}/vm.d.ts +21 -50
  43. {node v22.15 → node v22.18}/wasi.d.ts +1 -1
  44. node v22.18/web-globals/abortcontroller.d.ts +34 -0
  45. node v22.18/web-globals/domexception.d.ts +68 -0
  46. node v22.15/dom-events.d.ts → node v22.18/web-globals/events.d.ts +49 -51
  47. node v22.18/web-globals/fetch.d.ts +46 -0
  48. node v22.18/web-globals/navigator.d.ts +22 -0
  49. node v22.18/web-globals/storage.d.ts +24 -0
  50. {node v22.15 → node v22.18}/worker_threads.d.ts +86 -67
  51. {node v22.15 → node v22.18}/zlib.d.ts +33 -26
  52. node v22.15/README.md +0 -15
  53. node v22.15/globals.d.ts +0 -364
  54. node v22.15/globals.typedarray.d.ts +0 -21
  55. node v22.15/test.d.ts +0 -2278
  56. node v22.15/ts5.6/globals.typedarray.d.ts +0 -19
  57. {node v22.15 → node v22.18}/LICENSE +0 -0
  58. {node v22.15 → node v22.18}/assert/strict.d.ts +0 -0
  59. {node v22.15 → node v22.18}/async_hooks.d.ts +1 -1
  60. {node v22.15 → node v22.18}/compatibility/disposable.d.ts +0 -0
  61. {node v22.15 → node v22.18}/compatibility/index.d.ts +0 -0
  62. {node v22.15 → node v22.18}/compatibility/indexable.d.ts +0 -0
  63. {node v22.15 → node v22.18}/compatibility/iterators.d.ts +0 -0
  64. {node v22.15 → node v22.18}/console.d.ts +0 -0
  65. {node v22.15 → node v22.18}/constants.d.ts +0 -0
  66. {node v22.15 → node v22.18}/diagnostics_channel.d.ts +0 -0
  67. {node v22.15 → node v22.18}/domain.d.ts +0 -0
  68. {node v22.15 → node v22.18}/path.d.ts +0 -0
  69. {node v22.15 → node v22.18}/punycode.d.ts +0 -0
  70. {node v22.15 → node v22.18}/querystring.d.ts +0 -0
  71. {node v22.15 → node v22.18}/readline.d.ts +0 -0
  72. {node v22.15 → node v22.18}/sea.d.ts +0 -0
  73. {node v22.15 → node v22.18}/stream/promises.d.ts +0 -0
  74. {node v22.15 → node v22.18}/timers/promises.d.ts +0 -0
  75. {node v22.15 → node v22.18}/timers.d.ts +0 -0
  76. {node v22.15 → node v22.18}/trace_events.d.ts +0 -0
  77. {node v22.15 → node v22.18}/tty.d.ts +0 -0
@@ -15,28 +15,31 @@
15
15
  *
16
16
  * ```js
17
17
  * import {
18
- * Worker, isMainThread, parentPort, workerData,
18
+ * Worker,
19
+ * isMainThread,
20
+ * parentPort,
21
+ * workerData,
19
22
  * } from 'node:worker_threads';
20
- * import { parse } from 'some-js-parsing-library';
21
23
  *
22
- * if (isMainThread) {
23
- * module.exports = function parseJSAsync(script) {
24
- * return new Promise((resolve, reject) => {
25
- * const worker = new Worker(__filename, {
26
- * workerData: script,
27
- * });
28
- * worker.on('message', resolve);
29
- * worker.on('error', reject);
30
- * worker.on('exit', (code) => {
31
- * if (code !== 0)
32
- * reject(new Error(`Worker stopped with exit code ${code}`));
33
- * });
34
- * });
35
- * };
36
- * } else {
24
+ * if (!isMainThread) {
25
+ * const { parse } = await import('some-js-parsing-library');
37
26
  * const script = workerData;
38
27
  * parentPort.postMessage(parse(script));
39
28
  * }
29
+ *
30
+ * export default function parseJSAsync(script) {
31
+ * return new Promise((resolve, reject) => {
32
+ * const worker = new Worker(new URL(import.meta.url), {
33
+ * workerData: script,
34
+ * });
35
+ * worker.on('message', resolve);
36
+ * worker.on('error', reject);
37
+ * worker.on('exit', (code) => {
38
+ * if (code !== 0)
39
+ * reject(new Error(`Worker stopped with exit code ${code}`));
40
+ * });
41
+ * });
42
+ * };
40
43
  * ```
41
44
  *
42
45
  * The above example spawns a Worker thread for each `parseJSAsync()` call. In
@@ -53,12 +56,14 @@
53
56
  */
54
57
  declare module "worker_threads" {
55
58
  import { Context } from "node:vm";
56
- import { EventEmitter } from "node:events";
59
+ import { EventEmitter, NodeEventTarget } from "node:events";
57
60
  import { EventLoopUtilityFunction } from "node:perf_hooks";
58
61
  import { FileHandle } from "node:fs/promises";
59
62
  import { Readable, Writable } from "node:stream";
60
63
  import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
61
64
  import { URL } from "node:url";
65
+ import { HeapInfo } from "node:v8";
66
+ import { MessageEvent } from "undici-types";
62
67
  const isInternalThread: boolean;
63
68
  const isMainThread: boolean;
64
69
  const parentPort: null | MessagePort;
@@ -106,7 +111,7 @@ declare module "worker_threads" {
106
111
  * This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
107
112
  * @since v10.5.0
108
113
  */
109
- class MessagePort extends EventEmitter {
114
+ class MessagePort implements EventTarget {
110
115
  /**
111
116
  * Disables further sending of messages on either side of the connection.
112
117
  * This method can be called when no further communication will happen over this `MessagePort`.
@@ -183,6 +188,11 @@ declare module "worker_threads" {
183
188
  * @since v10.5.0
184
189
  */
185
190
  postMessage(value: any, transferList?: readonly Transferable[]): void;
191
+ /**
192
+ * If true, the `MessagePort` object will keep the Node.js event loop active.
193
+ * @since v18.1.0, v16.17.0
194
+ */
195
+ hasRef(): boolean;
186
196
  /**
187
197
  * 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
188
198
  * behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
@@ -214,42 +224,32 @@ declare module "worker_threads" {
214
224
  * @since v10.5.0
215
225
  */
216
226
  start(): void;
217
- addListener(event: "close", listener: () => void): this;
227
+ addListener(event: "close", listener: (ev: Event) => void): this;
218
228
  addListener(event: "message", listener: (value: any) => void): this;
219
229
  addListener(event: "messageerror", listener: (error: Error) => void): this;
220
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
221
- emit(event: "close"): boolean;
230
+ addListener(event: string, listener: (arg: any) => void): this;
231
+ emit(event: "close", ev: Event): boolean;
222
232
  emit(event: "message", value: any): boolean;
223
233
  emit(event: "messageerror", error: Error): boolean;
224
- emit(event: string | symbol, ...args: any[]): boolean;
225
- on(event: "close", listener: () => void): this;
234
+ emit(event: string, arg: any): boolean;
235
+ off(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this;
236
+ off(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this;
237
+ off(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this;
238
+ off(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
239
+ on(event: "close", listener: (ev: Event) => void): this;
226
240
  on(event: "message", listener: (value: any) => void): this;
227
241
  on(event: "messageerror", listener: (error: Error) => void): this;
228
- on(event: string | symbol, listener: (...args: any[]) => void): this;
229
- once(event: "close", listener: () => void): this;
242
+ on(event: string, listener: (arg: any) => void): this;
243
+ once(event: "close", listener: (ev: Event) => void): this;
230
244
  once(event: "message", listener: (value: any) => void): this;
231
245
  once(event: "messageerror", listener: (error: Error) => void): this;
232
- once(event: string | symbol, listener: (...args: any[]) => void): this;
233
- prependListener(event: "close", listener: () => void): this;
234
- prependListener(event: "message", listener: (value: any) => void): this;
235
- prependListener(event: "messageerror", listener: (error: Error) => void): this;
236
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
237
- prependOnceListener(event: "close", listener: () => void): this;
238
- prependOnceListener(event: "message", listener: (value: any) => void): this;
239
- prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
240
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
241
- removeListener(event: "close", listener: () => void): this;
242
- removeListener(event: "message", listener: (value: any) => void): this;
243
- removeListener(event: "messageerror", listener: (error: Error) => void): this;
244
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
245
- off(event: "close", listener: () => void): this;
246
- off(event: "message", listener: (value: any) => void): this;
247
- off(event: "messageerror", listener: (error: Error) => void): this;
248
- off(event: string | symbol, listener: (...args: any[]) => void): this;
249
- addEventListener: EventTarget["addEventListener"];
250
- dispatchEvent: EventTarget["dispatchEvent"];
251
- removeEventListener: EventTarget["removeEventListener"];
246
+ once(event: string, listener: (arg: any) => void): this;
247
+ removeListener(event: "close", listener: (ev: Event) => void, options?: EventListenerOptions): this;
248
+ removeListener(event: "message", listener: (value: any) => void, options?: EventListenerOptions): this;
249
+ removeListener(event: "messageerror", listener: (error: Error) => void, options?: EventListenerOptions): this;
250
+ removeListener(event: string, listener: (arg: any) => void, options?: EventListenerOptions): this;
252
251
  }
252
+ interface MessagePort extends NodeEventTarget {}
253
253
  interface WorkerOptions {
254
254
  /**
255
255
  * List of arguments which would be stringified and appended to
@@ -418,24 +418,6 @@ declare module "worker_threads" {
418
418
  * @since v10.5.0
419
419
  */
420
420
  postMessage(value: any, transferList?: readonly Transferable[]): void;
421
- /**
422
- * Sends a value to another worker, identified by its thread ID.
423
- * @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
424
- * If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.
425
- * @param value The value to send.
426
- * @param transferList If one or more `MessagePort`-like objects are passed in value, a `transferList` is required for those items
427
- * or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.
428
- * @param timeout Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever.
429
- * If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.
430
- * @since v22.5.0
431
- */
432
- postMessageToThread(threadId: number, value: any, timeout?: number): Promise<void>;
433
- postMessageToThread(
434
- threadId: number,
435
- value: any,
436
- transferList: readonly Transferable[],
437
- timeout?: number,
438
- ): Promise<void>;
439
421
  /**
440
422
  * 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
441
423
  * behavior). If the worker is `ref()`ed, calling `ref()` again has
@@ -465,6 +447,25 @@ declare module "worker_threads" {
465
447
  * @return A promise for a Readable Stream containing a V8 heap snapshot
466
448
  */
467
449
  getHeapSnapshot(): Promise<Readable>;
450
+ /**
451
+ * This method returns a `Promise` that will resolve to an object identical to `v8.getHeapStatistics()`,
452
+ * or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
453
+ * This methods allows the statistics to be observed from outside the actual thread.
454
+ * @since v22.16.0
455
+ */
456
+ getHeapStatistics(): Promise<HeapInfo>;
457
+ /**
458
+ * Calls `worker.terminate()` when the dispose scope is exited.
459
+ *
460
+ * ```js
461
+ * async function example() {
462
+ * await using worker = new Worker('for (;;) {}', { eval: true });
463
+ * // Worker is automatically terminate when the scope is exited.
464
+ * }
465
+ * ```
466
+ * @since v22.18.0
467
+ */
468
+ [Symbol.asyncDispose](): Promise<void>;
468
469
  addListener(event: "error", listener: (err: Error) => void): this;
469
470
  addListener(event: "exit", listener: (exitCode: number) => void): this;
470
471
  addListener(event: "message", listener: (value: any) => void): this;
@@ -545,18 +546,18 @@ declare module "worker_threads" {
545
546
  * ```
546
547
  * @since v15.4.0
547
548
  */
548
- class BroadcastChannel {
549
+ class BroadcastChannel extends EventTarget {
549
550
  readonly name: string;
550
551
  /**
551
552
  * Invoked with a single \`MessageEvent\` argument when a message is received.
552
553
  * @since v15.4.0
553
554
  */
554
- onmessage: (message: unknown) => void;
555
+ onmessage: (message: MessageEvent) => void;
555
556
  /**
556
557
  * Invoked with a received message cannot be deserialized.
557
558
  * @since v15.4.0
558
559
  */
559
- onmessageerror: (message: unknown) => void;
560
+ onmessageerror: (message: MessageEvent) => void;
560
561
  constructor(name: string);
561
562
  /**
562
563
  * Closes the `BroadcastChannel` connection.
@@ -710,6 +711,24 @@ declare module "worker_threads" {
710
711
  * for the `key` will be deleted.
711
712
  */
712
713
  function setEnvironmentData(key: Serializable, value?: Serializable): void;
714
+ /**
715
+ * Sends a value to another worker, identified by its thread ID.
716
+ * @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
717
+ * If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.
718
+ * @param value The value to send.
719
+ * @param transferList If one or more `MessagePort`-like objects are passed in value, a `transferList` is required for those items
720
+ * or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.
721
+ * @param timeout Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever.
722
+ * If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.
723
+ * @since v22.5.0
724
+ */
725
+ function postMessageToThread(threadId: number, value: any, timeout?: number): Promise<void>;
726
+ function postMessageToThread(
727
+ threadId: number,
728
+ value: any,
729
+ transferList: readonly Transferable[],
730
+ timeout?: number,
731
+ ): Promise<void>;
713
732
 
714
733
  import {
715
734
  BroadcastChannel as _BroadcastChannel,
@@ -92,6 +92,7 @@
92
92
  * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/zlib.js)
93
93
  */
94
94
  declare module "zlib" {
95
+ import { NonSharedBuffer } from "node:buffer";
95
96
  import * as stream from "node:stream";
96
97
  interface ZlibOptions {
97
98
  /**
@@ -147,6 +148,10 @@ declare module "zlib" {
147
148
  * @default buffer.kMaxLength
148
149
  */
149
150
  maxOutputLength?: number | undefined;
151
+ /**
152
+ * If `true`, returns an object with `buffer` and `engine`.
153
+ */
154
+ info?: boolean | undefined;
150
155
  }
151
156
  interface ZstdOptions {
152
157
  /**
@@ -172,6 +177,10 @@ declare module "zlib" {
172
177
  * @default buffer.kMaxLength
173
178
  */
174
179
  maxOutputLength?: number | undefined;
180
+ /**
181
+ * If `true`, returns an object with `buffer` and `engine`.
182
+ */
183
+ info?: boolean | undefined;
175
184
  }
176
185
  interface Zlib {
177
186
  /** @deprecated Use bytesWritten instead. */
@@ -215,7 +224,7 @@ declare module "zlib" {
215
224
  * @returns A 32-bit unsigned integer containing the checksum.
216
225
  * @since v22.2.0
217
226
  */
218
- function crc32(data: string | Buffer | NodeJS.ArrayBufferView, value?: number): number;
227
+ function crc32(data: string | NodeJS.ArrayBufferView, value?: number): number;
219
228
  /**
220
229
  * Creates and returns a new `BrotliCompress` object.
221
230
  * @since v11.7.0, v10.16.0
@@ -279,124 +288,124 @@ declare module "zlib" {
279
288
  */
280
289
  function createZstdDecompress(options?: ZstdOptions): ZstdDecompress;
281
290
  type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
282
- type CompressCallback = (error: Error | null, result: Buffer) => void;
291
+ type CompressCallback = (error: Error | null, result: NonSharedBuffer) => void;
283
292
  /**
284
293
  * @since v11.7.0, v10.16.0
285
294
  */
286
295
  function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
287
296
  function brotliCompress(buf: InputType, callback: CompressCallback): void;
288
297
  namespace brotliCompress {
289
- function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
298
+ function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
290
299
  }
291
300
  /**
292
301
  * Compress a chunk of data with `BrotliCompress`.
293
302
  * @since v11.7.0, v10.16.0
294
303
  */
295
- function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
304
+ function brotliCompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
296
305
  /**
297
306
  * @since v11.7.0, v10.16.0
298
307
  */
299
308
  function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
300
309
  function brotliDecompress(buf: InputType, callback: CompressCallback): void;
301
310
  namespace brotliDecompress {
302
- function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
311
+ function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
303
312
  }
304
313
  /**
305
314
  * Decompress a chunk of data with `BrotliDecompress`.
306
315
  * @since v11.7.0, v10.16.0
307
316
  */
308
- function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
317
+ function brotliDecompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
309
318
  /**
310
319
  * @since v0.6.0
311
320
  */
312
321
  function deflate(buf: InputType, callback: CompressCallback): void;
313
322
  function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
314
323
  namespace deflate {
315
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
324
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
316
325
  }
317
326
  /**
318
327
  * Compress a chunk of data with `Deflate`.
319
328
  * @since v0.11.12
320
329
  */
321
- function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
330
+ function deflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
322
331
  /**
323
332
  * @since v0.6.0
324
333
  */
325
334
  function deflateRaw(buf: InputType, callback: CompressCallback): void;
326
335
  function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
327
336
  namespace deflateRaw {
328
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
337
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
329
338
  }
330
339
  /**
331
340
  * Compress a chunk of data with `DeflateRaw`.
332
341
  * @since v0.11.12
333
342
  */
334
- function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
343
+ function deflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
335
344
  /**
336
345
  * @since v0.6.0
337
346
  */
338
347
  function gzip(buf: InputType, callback: CompressCallback): void;
339
348
  function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
340
349
  namespace gzip {
341
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
350
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
342
351
  }
343
352
  /**
344
353
  * Compress a chunk of data with `Gzip`.
345
354
  * @since v0.11.12
346
355
  */
347
- function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
356
+ function gzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
348
357
  /**
349
358
  * @since v0.6.0
350
359
  */
351
360
  function gunzip(buf: InputType, callback: CompressCallback): void;
352
361
  function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
353
362
  namespace gunzip {
354
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
363
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
355
364
  }
356
365
  /**
357
366
  * Decompress a chunk of data with `Gunzip`.
358
367
  * @since v0.11.12
359
368
  */
360
- function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
369
+ function gunzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
361
370
  /**
362
371
  * @since v0.6.0
363
372
  */
364
373
  function inflate(buf: InputType, callback: CompressCallback): void;
365
374
  function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
366
375
  namespace inflate {
367
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
376
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
368
377
  }
369
378
  /**
370
379
  * Decompress a chunk of data with `Inflate`.
371
380
  * @since v0.11.12
372
381
  */
373
- function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
382
+ function inflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
374
383
  /**
375
384
  * @since v0.6.0
376
385
  */
377
386
  function inflateRaw(buf: InputType, callback: CompressCallback): void;
378
387
  function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
379
388
  namespace inflateRaw {
380
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
389
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
381
390
  }
382
391
  /**
383
392
  * Decompress a chunk of data with `InflateRaw`.
384
393
  * @since v0.11.12
385
394
  */
386
- function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
395
+ function inflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
387
396
  /**
388
397
  * @since v0.6.0
389
398
  */
390
399
  function unzip(buf: InputType, callback: CompressCallback): void;
391
400
  function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
392
401
  namespace unzip {
393
- function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
402
+ function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
394
403
  }
395
404
  /**
396
405
  * Decompress a chunk of data with `Unzip`.
397
406
  * @since v0.11.12
398
407
  */
399
- function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
408
+ function unzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
400
409
  /**
401
410
  * @since v22.15.0
402
411
  * @experimental
@@ -404,14 +413,14 @@ declare module "zlib" {
404
413
  function zstdCompress(buf: InputType, callback: CompressCallback): void;
405
414
  function zstdCompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
406
415
  namespace zstdCompress {
407
- function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<Buffer>;
416
+ function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<NonSharedBuffer>;
408
417
  }
409
418
  /**
410
419
  * Compress a chunk of data with `ZstdCompress`.
411
420
  * @since v22.15.0
412
421
  * @experimental
413
422
  */
414
- function zstdCompressSync(buf: InputType, options?: ZstdOptions): Buffer;
423
+ function zstdCompressSync(buf: InputType, options?: ZstdOptions): NonSharedBuffer;
415
424
  /**
416
425
  * @since v22.15.0
417
426
  * @experimental
@@ -419,14 +428,14 @@ declare module "zlib" {
419
428
  function zstdDecompress(buf: InputType, callback: CompressCallback): void;
420
429
  function zstdDecompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
421
430
  namespace zstdDecompress {
422
- function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<Buffer>;
431
+ function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<NonSharedBuffer>;
423
432
  }
424
433
  /**
425
434
  * Decompress a chunk of data with `ZstdDecompress`.
426
435
  * @since v22.15.0
427
436
  * @experimental
428
437
  */
429
- function zstdDecompressSync(buf: InputType, options?: ZstdOptions): Buffer;
438
+ function zstdDecompressSync(buf: InputType, options?: ZstdOptions): NonSharedBuffer;
430
439
  namespace constants {
431
440
  const BROTLI_DECODE: number;
432
441
  const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
@@ -612,8 +621,6 @@ declare module "zlib" {
612
621
  const Z_FINISH: number;
613
622
  /** @deprecated Use `constants.Z_BLOCK` */
614
623
  const Z_BLOCK: number;
615
- /** @deprecated Use `constants.Z_TREES` */
616
- const Z_TREES: number;
617
624
  // Return codes for the compression/decompression functions.
618
625
  // Negative values are errors, positive values are used for special but normal events.
619
626
  /** @deprecated Use `constants.Z_OK` */
node v22.15/README.md DELETED
@@ -1,15 +0,0 @@
1
- # Installation
2
- > `npm install --save @types/node`
3
-
4
- # Summary
5
- This package contains type definitions for node (https://nodejs.org/).
6
-
7
- # Details
8
- Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v22.
9
-
10
- ### Additional Details
11
- * Last updated: Tue, 24 Jun 2025 16:39:29 GMT
12
- * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
-
14
- # Credits
15
- These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), and [René](https://github.com/Renegade334).