@types/node 22.15.33 → 22.19.1
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 v22.19/README.md +15 -0
- node v22.19/assert/strict.d.ts +111 -0
- {node v22.15 → node v22.19}/assert.d.ts +119 -95
- {node v22.15 → node v22.19}/buffer.buffer.d.ts +9 -0
- {node v22.15 → node v22.19}/buffer.d.ts +14 -6
- {node v22.15 → node v22.19}/child_process.d.ts +89 -162
- {node v22.15 → node v22.19}/cluster.d.ts +4 -5
- {node v22.15 → node v22.19}/crypto.d.ts +203 -167
- {node v22.15 → node v22.19}/dgram.d.ts +9 -8
- {node v22.15 → node v22.19}/dns/promises.d.ts +11 -10
- {node v22.15 → node v22.19}/dns.d.ts +24 -20
- {node v22.15 → node v22.19}/events.d.ts +80 -35
- {node v22.15 → node v22.19}/fs/promises.d.ts +78 -56
- {node v22.15 → node v22.19}/fs.d.ts +153 -129
- node v22.19/globals.d.ts +172 -0
- node v22.19/globals.typedarray.d.ts +38 -0
- {node v22.15 → node v22.19}/http.d.ts +140 -35
- {node v22.15 → node v22.19}/http2.d.ts +45 -26
- {node v22.15 → node v22.19}/https.d.ts +96 -62
- {node v22.15 → node v22.19}/index.d.ts +7 -2
- node v22.19/inspector.d.ts +253 -0
- node v22.15/inspector.d.ts → node v22.19/inspector.generated.d.ts +880 -830
- {node v22.15 → node v22.19}/module.d.ts +70 -13
- {node v22.15 → node v22.19}/net.d.ts +33 -11
- {node v22.15 → node v22.19}/os.d.ts +14 -3
- {node v22.15 → node v22.19}/package.json +3 -83
- {node v22.15 → node v22.19}/perf_hooks.d.ts +6 -8
- {node v22.15 → node v22.19}/process.d.ts +34 -27
- {node v22.15 → node v22.19}/readline/promises.d.ts +1 -2
- {node v22.15 → node v22.19}/repl.d.ts +3 -5
- {node v22.15 → node v22.19}/sqlite.d.ts +219 -6
- {node v22.15 → node v22.19}/stream/consumers.d.ts +2 -2
- {node v22.15 → node v22.19}/stream/web.d.ts +8 -0
- {node v22.15 → node v22.19}/stream.d.ts +29 -33
- {node v22.15 → node v22.19}/string_decoder.d.ts +2 -2
- node v22.19/test.d.ts +2162 -0
- {node v22.15 → node v22.19}/tls.d.ts +122 -66
- {node v22.15 → node v22.19}/ts5.6/buffer.buffer.d.ts +10 -2
- node v22.19/ts5.6/globals.typedarray.d.ts +34 -0
- {node v22.15 → node v22.19}/ts5.6/index.d.ts +7 -2
- {node v22.15 → node v22.19}/url.d.ts +21 -9
- {node v22.15 → node v22.19}/util.d.ts +32 -10
- {node v22.15 → node v22.19}/v8.d.ts +33 -35
- {node v22.15 → node v22.19}/vm.d.ts +21 -50
- {node v22.15 → node v22.19}/wasi.d.ts +1 -1
- node v22.19/web-globals/abortcontroller.d.ts +34 -0
- node v22.19/web-globals/domexception.d.ts +68 -0
- node v22.15/dom-events.d.ts → node v22.19/web-globals/events.d.ts +49 -51
- node v22.19/web-globals/fetch.d.ts +46 -0
- node v22.19/web-globals/navigator.d.ts +22 -0
- node v22.19/web-globals/storage.d.ts +24 -0
- {node v22.15 → node v22.19}/worker_threads.d.ts +93 -67
- {node v22.15 → node v22.19}/zlib.d.ts +39 -26
- node v22.15/README.md +0 -15
- node v22.15/assert/strict.d.ts +0 -8
- node v22.15/globals.d.ts +0 -364
- node v22.15/globals.typedarray.d.ts +0 -21
- node v22.15/test.d.ts +0 -2278
- node v22.15/ts5.6/globals.typedarray.d.ts +0 -19
- {node v22.15 → node v22.19}/LICENSE +0 -0
- {node v22.15 → node v22.19}/async_hooks.d.ts +1 -1
- {node v22.15 → node v22.19}/compatibility/disposable.d.ts +0 -0
- {node v22.15 → node v22.19}/compatibility/index.d.ts +0 -0
- {node v22.15 → node v22.19}/compatibility/indexable.d.ts +0 -0
- {node v22.15 → node v22.19}/compatibility/iterators.d.ts +0 -0
- {node v22.15 → node v22.19}/console.d.ts +0 -0
- {node v22.15 → node v22.19}/constants.d.ts +0 -0
- {node v22.15 → node v22.19}/diagnostics_channel.d.ts +0 -0
- {node v22.15 → node v22.19}/domain.d.ts +0 -0
- {node v22.15 → node v22.19}/path.d.ts +0 -0
- {node v22.15 → node v22.19}/punycode.d.ts +0 -0
- {node v22.15 → node v22.19}/querystring.d.ts +0 -0
- {node v22.15 → node v22.19}/readline.d.ts +0 -0
- {node v22.15 → node v22.19}/sea.d.ts +0 -0
- {node v22.15 → node v22.19}/stream/promises.d.ts +0 -0
- {node v22.15 → node v22.19}/timers/promises.d.ts +0 -0
- {node v22.15 → node v22.19}/timers.d.ts +0 -0
- {node v22.15 → node v22.19}/trace_events.d.ts +0 -0
- {node v22.15 → node v22.19}/tty.d.ts +0 -0
|
@@ -15,28 +15,31 @@
|
|
|
15
15
|
*
|
|
16
16
|
* ```js
|
|
17
17
|
* import {
|
|
18
|
-
* Worker,
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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
|
|
225
|
-
|
|
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
|
|
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
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
|
@@ -455,6 +437,13 @@ declare module "worker_threads" {
|
|
|
455
437
|
* @since v10.5.0
|
|
456
438
|
*/
|
|
457
439
|
terminate(): Promise<number>;
|
|
440
|
+
/**
|
|
441
|
+
* This method returns a `Promise` that will resolve to an object identical to `process.threadCpuUsage()`,
|
|
442
|
+
* or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
|
|
443
|
+
* This methods allows the statistics to be observed from outside the actual thread.
|
|
444
|
+
* @since v22.19.0
|
|
445
|
+
*/
|
|
446
|
+
cpuUsage(prev?: NodeJS.CpuUsage): Promise<NodeJS.CpuUsage>;
|
|
458
447
|
/**
|
|
459
448
|
* Returns a readable stream for a V8 snapshot of the current state of the Worker.
|
|
460
449
|
* See `v8.getHeapSnapshot()` for more details.
|
|
@@ -465,6 +454,25 @@ declare module "worker_threads" {
|
|
|
465
454
|
* @return A promise for a Readable Stream containing a V8 heap snapshot
|
|
466
455
|
*/
|
|
467
456
|
getHeapSnapshot(): Promise<Readable>;
|
|
457
|
+
/**
|
|
458
|
+
* This method returns a `Promise` that will resolve to an object identical to `v8.getHeapStatistics()`,
|
|
459
|
+
* or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
|
|
460
|
+
* This methods allows the statistics to be observed from outside the actual thread.
|
|
461
|
+
* @since v22.16.0
|
|
462
|
+
*/
|
|
463
|
+
getHeapStatistics(): Promise<HeapInfo>;
|
|
464
|
+
/**
|
|
465
|
+
* Calls `worker.terminate()` when the dispose scope is exited.
|
|
466
|
+
*
|
|
467
|
+
* ```js
|
|
468
|
+
* async function example() {
|
|
469
|
+
* await using worker = new Worker('for (;;) {}', { eval: true });
|
|
470
|
+
* // Worker is automatically terminate when the scope is exited.
|
|
471
|
+
* }
|
|
472
|
+
* ```
|
|
473
|
+
* @since v22.18.0
|
|
474
|
+
*/
|
|
475
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
468
476
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
469
477
|
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
|
470
478
|
addListener(event: "message", listener: (value: any) => void): this;
|
|
@@ -545,18 +553,18 @@ declare module "worker_threads" {
|
|
|
545
553
|
* ```
|
|
546
554
|
* @since v15.4.0
|
|
547
555
|
*/
|
|
548
|
-
class BroadcastChannel {
|
|
556
|
+
class BroadcastChannel extends EventTarget {
|
|
549
557
|
readonly name: string;
|
|
550
558
|
/**
|
|
551
559
|
* Invoked with a single \`MessageEvent\` argument when a message is received.
|
|
552
560
|
* @since v15.4.0
|
|
553
561
|
*/
|
|
554
|
-
onmessage: (message:
|
|
562
|
+
onmessage: (message: MessageEvent) => void;
|
|
555
563
|
/**
|
|
556
564
|
* Invoked with a received message cannot be deserialized.
|
|
557
565
|
* @since v15.4.0
|
|
558
566
|
*/
|
|
559
|
-
onmessageerror: (message:
|
|
567
|
+
onmessageerror: (message: MessageEvent) => void;
|
|
560
568
|
constructor(name: string);
|
|
561
569
|
/**
|
|
562
570
|
* Closes the `BroadcastChannel` connection.
|
|
@@ -710,6 +718,24 @@ declare module "worker_threads" {
|
|
|
710
718
|
* for the `key` will be deleted.
|
|
711
719
|
*/
|
|
712
720
|
function setEnvironmentData(key: Serializable, value?: Serializable): void;
|
|
721
|
+
/**
|
|
722
|
+
* Sends a value to another worker, identified by its thread ID.
|
|
723
|
+
* @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
|
|
724
|
+
* If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.
|
|
725
|
+
* @param value The value to send.
|
|
726
|
+
* @param transferList If one or more `MessagePort`-like objects are passed in value, a `transferList` is required for those items
|
|
727
|
+
* or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.
|
|
728
|
+
* @param timeout Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever.
|
|
729
|
+
* If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.
|
|
730
|
+
* @since v22.5.0
|
|
731
|
+
*/
|
|
732
|
+
function postMessageToThread(threadId: number, value: any, timeout?: number): Promise<void>;
|
|
733
|
+
function postMessageToThread(
|
|
734
|
+
threadId: number,
|
|
735
|
+
value: any,
|
|
736
|
+
transferList: readonly Transferable[],
|
|
737
|
+
timeout?: number,
|
|
738
|
+
): Promise<void>;
|
|
713
739
|
|
|
714
740
|
import {
|
|
715
741
|
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,16 @@ 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;
|
|
184
|
+
/**
|
|
185
|
+
* Optional dictionary used to improve compression efficiency when compressing or decompressing data that
|
|
186
|
+
* shares common patterns with the dictionary.
|
|
187
|
+
* @since v22.19.0
|
|
188
|
+
*/
|
|
189
|
+
dictionary?: NodeJS.ArrayBufferView | undefined;
|
|
175
190
|
}
|
|
176
191
|
interface Zlib {
|
|
177
192
|
/** @deprecated Use bytesWritten instead. */
|
|
@@ -215,7 +230,7 @@ declare module "zlib" {
|
|
|
215
230
|
* @returns A 32-bit unsigned integer containing the checksum.
|
|
216
231
|
* @since v22.2.0
|
|
217
232
|
*/
|
|
218
|
-
function crc32(data: string |
|
|
233
|
+
function crc32(data: string | NodeJS.ArrayBufferView, value?: number): number;
|
|
219
234
|
/**
|
|
220
235
|
* Creates and returns a new `BrotliCompress` object.
|
|
221
236
|
* @since v11.7.0, v10.16.0
|
|
@@ -279,124 +294,124 @@ declare module "zlib" {
|
|
|
279
294
|
*/
|
|
280
295
|
function createZstdDecompress(options?: ZstdOptions): ZstdDecompress;
|
|
281
296
|
type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
|
|
282
|
-
type CompressCallback = (error: Error | null, result:
|
|
297
|
+
type CompressCallback = (error: Error | null, result: NonSharedBuffer) => void;
|
|
283
298
|
/**
|
|
284
299
|
* @since v11.7.0, v10.16.0
|
|
285
300
|
*/
|
|
286
301
|
function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
|
|
287
302
|
function brotliCompress(buf: InputType, callback: CompressCallback): void;
|
|
288
303
|
namespace brotliCompress {
|
|
289
|
-
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<
|
|
304
|
+
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
|
|
290
305
|
}
|
|
291
306
|
/**
|
|
292
307
|
* Compress a chunk of data with `BrotliCompress`.
|
|
293
308
|
* @since v11.7.0, v10.16.0
|
|
294
309
|
*/
|
|
295
|
-
function brotliCompressSync(buf: InputType, options?: BrotliOptions):
|
|
310
|
+
function brotliCompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
|
|
296
311
|
/**
|
|
297
312
|
* @since v11.7.0, v10.16.0
|
|
298
313
|
*/
|
|
299
314
|
function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
|
|
300
315
|
function brotliDecompress(buf: InputType, callback: CompressCallback): void;
|
|
301
316
|
namespace brotliDecompress {
|
|
302
|
-
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<
|
|
317
|
+
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<NonSharedBuffer>;
|
|
303
318
|
}
|
|
304
319
|
/**
|
|
305
320
|
* Decompress a chunk of data with `BrotliDecompress`.
|
|
306
321
|
* @since v11.7.0, v10.16.0
|
|
307
322
|
*/
|
|
308
|
-
function brotliDecompressSync(buf: InputType, options?: BrotliOptions):
|
|
323
|
+
function brotliDecompressSync(buf: InputType, options?: BrotliOptions): NonSharedBuffer;
|
|
309
324
|
/**
|
|
310
325
|
* @since v0.6.0
|
|
311
326
|
*/
|
|
312
327
|
function deflate(buf: InputType, callback: CompressCallback): void;
|
|
313
328
|
function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
314
329
|
namespace deflate {
|
|
315
|
-
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<
|
|
330
|
+
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
|
316
331
|
}
|
|
317
332
|
/**
|
|
318
333
|
* Compress a chunk of data with `Deflate`.
|
|
319
334
|
* @since v0.11.12
|
|
320
335
|
*/
|
|
321
|
-
function deflateSync(buf: InputType, options?: ZlibOptions):
|
|
336
|
+
function deflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
|
322
337
|
/**
|
|
323
338
|
* @since v0.6.0
|
|
324
339
|
*/
|
|
325
340
|
function deflateRaw(buf: InputType, callback: CompressCallback): void;
|
|
326
341
|
function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
327
342
|
namespace deflateRaw {
|
|
328
|
-
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<
|
|
343
|
+
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
|
329
344
|
}
|
|
330
345
|
/**
|
|
331
346
|
* Compress a chunk of data with `DeflateRaw`.
|
|
332
347
|
* @since v0.11.12
|
|
333
348
|
*/
|
|
334
|
-
function deflateRawSync(buf: InputType, options?: ZlibOptions):
|
|
349
|
+
function deflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
|
335
350
|
/**
|
|
336
351
|
* @since v0.6.0
|
|
337
352
|
*/
|
|
338
353
|
function gzip(buf: InputType, callback: CompressCallback): void;
|
|
339
354
|
function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
340
355
|
namespace gzip {
|
|
341
|
-
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<
|
|
356
|
+
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
|
342
357
|
}
|
|
343
358
|
/**
|
|
344
359
|
* Compress a chunk of data with `Gzip`.
|
|
345
360
|
* @since v0.11.12
|
|
346
361
|
*/
|
|
347
|
-
function gzipSync(buf: InputType, options?: ZlibOptions):
|
|
362
|
+
function gzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
|
348
363
|
/**
|
|
349
364
|
* @since v0.6.0
|
|
350
365
|
*/
|
|
351
366
|
function gunzip(buf: InputType, callback: CompressCallback): void;
|
|
352
367
|
function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
353
368
|
namespace gunzip {
|
|
354
|
-
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<
|
|
369
|
+
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
|
355
370
|
}
|
|
356
371
|
/**
|
|
357
372
|
* Decompress a chunk of data with `Gunzip`.
|
|
358
373
|
* @since v0.11.12
|
|
359
374
|
*/
|
|
360
|
-
function gunzipSync(buf: InputType, options?: ZlibOptions):
|
|
375
|
+
function gunzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
|
361
376
|
/**
|
|
362
377
|
* @since v0.6.0
|
|
363
378
|
*/
|
|
364
379
|
function inflate(buf: InputType, callback: CompressCallback): void;
|
|
365
380
|
function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
366
381
|
namespace inflate {
|
|
367
|
-
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<
|
|
382
|
+
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
|
368
383
|
}
|
|
369
384
|
/**
|
|
370
385
|
* Decompress a chunk of data with `Inflate`.
|
|
371
386
|
* @since v0.11.12
|
|
372
387
|
*/
|
|
373
|
-
function inflateSync(buf: InputType, options?: ZlibOptions):
|
|
388
|
+
function inflateSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
|
374
389
|
/**
|
|
375
390
|
* @since v0.6.0
|
|
376
391
|
*/
|
|
377
392
|
function inflateRaw(buf: InputType, callback: CompressCallback): void;
|
|
378
393
|
function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
379
394
|
namespace inflateRaw {
|
|
380
|
-
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<
|
|
395
|
+
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
|
381
396
|
}
|
|
382
397
|
/**
|
|
383
398
|
* Decompress a chunk of data with `InflateRaw`.
|
|
384
399
|
* @since v0.11.12
|
|
385
400
|
*/
|
|
386
|
-
function inflateRawSync(buf: InputType, options?: ZlibOptions):
|
|
401
|
+
function inflateRawSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
|
387
402
|
/**
|
|
388
403
|
* @since v0.6.0
|
|
389
404
|
*/
|
|
390
405
|
function unzip(buf: InputType, callback: CompressCallback): void;
|
|
391
406
|
function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
|
392
407
|
namespace unzip {
|
|
393
|
-
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<
|
|
408
|
+
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<NonSharedBuffer>;
|
|
394
409
|
}
|
|
395
410
|
/**
|
|
396
411
|
* Decompress a chunk of data with `Unzip`.
|
|
397
412
|
* @since v0.11.12
|
|
398
413
|
*/
|
|
399
|
-
function unzipSync(buf: InputType, options?: ZlibOptions):
|
|
414
|
+
function unzipSync(buf: InputType, options?: ZlibOptions): NonSharedBuffer;
|
|
400
415
|
/**
|
|
401
416
|
* @since v22.15.0
|
|
402
417
|
* @experimental
|
|
@@ -404,14 +419,14 @@ declare module "zlib" {
|
|
|
404
419
|
function zstdCompress(buf: InputType, callback: CompressCallback): void;
|
|
405
420
|
function zstdCompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
|
|
406
421
|
namespace zstdCompress {
|
|
407
|
-
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<
|
|
422
|
+
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<NonSharedBuffer>;
|
|
408
423
|
}
|
|
409
424
|
/**
|
|
410
425
|
* Compress a chunk of data with `ZstdCompress`.
|
|
411
426
|
* @since v22.15.0
|
|
412
427
|
* @experimental
|
|
413
428
|
*/
|
|
414
|
-
function zstdCompressSync(buf: InputType, options?: ZstdOptions):
|
|
429
|
+
function zstdCompressSync(buf: InputType, options?: ZstdOptions): NonSharedBuffer;
|
|
415
430
|
/**
|
|
416
431
|
* @since v22.15.0
|
|
417
432
|
* @experimental
|
|
@@ -419,14 +434,14 @@ declare module "zlib" {
|
|
|
419
434
|
function zstdDecompress(buf: InputType, callback: CompressCallback): void;
|
|
420
435
|
function zstdDecompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
|
|
421
436
|
namespace zstdDecompress {
|
|
422
|
-
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<
|
|
437
|
+
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<NonSharedBuffer>;
|
|
423
438
|
}
|
|
424
439
|
/**
|
|
425
440
|
* Decompress a chunk of data with `ZstdDecompress`.
|
|
426
441
|
* @since v22.15.0
|
|
427
442
|
* @experimental
|
|
428
443
|
*/
|
|
429
|
-
function zstdDecompressSync(buf: InputType, options?: ZstdOptions):
|
|
444
|
+
function zstdDecompressSync(buf: InputType, options?: ZstdOptions): NonSharedBuffer;
|
|
430
445
|
namespace constants {
|
|
431
446
|
const BROTLI_DECODE: number;
|
|
432
447
|
const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
|
|
@@ -612,8 +627,6 @@ declare module "zlib" {
|
|
|
612
627
|
const Z_FINISH: number;
|
|
613
628
|
/** @deprecated Use `constants.Z_BLOCK` */
|
|
614
629
|
const Z_BLOCK: number;
|
|
615
|
-
/** @deprecated Use `constants.Z_TREES` */
|
|
616
|
-
const Z_TREES: number;
|
|
617
630
|
// Return codes for the compression/decompression functions.
|
|
618
631
|
// Negative values are errors, positive values are used for special but normal events.
|
|
619
632
|
/** @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).
|