create-leo-app 0.9.13 → 0.9.14
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.
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/template-build-and-execute-authorization-ts/package.json +1 -1
- package/template-extension/package.json +1 -1
- package/template-nextjs-ts/next-env.d.ts +1 -1
- package/template-nextjs-ts/node_modules/@types/node/README.md +2 -2
- package/template-nextjs-ts/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/template-nextjs-ts/node_modules/@types/node/assert.d.ts +119 -95
- package/template-nextjs-ts/node_modules/@types/node/buffer.buffer.d.ts +9 -0
- package/template-nextjs-ts/node_modules/@types/node/buffer.d.ts +12 -6
- package/template-nextjs-ts/node_modules/@types/node/child_process.d.ts +89 -162
- package/template-nextjs-ts/node_modules/@types/node/cluster.d.ts +4 -5
- package/template-nextjs-ts/node_modules/@types/node/crypto.d.ts +203 -167
- package/template-nextjs-ts/node_modules/@types/node/dgram.d.ts +9 -8
- package/template-nextjs-ts/node_modules/@types/node/dns/promises.d.ts +11 -10
- package/template-nextjs-ts/node_modules/@types/node/dns.d.ts +24 -20
- package/template-nextjs-ts/node_modules/@types/node/events.d.ts +80 -34
- package/template-nextjs-ts/node_modules/@types/node/fs/promises.d.ts +78 -56
- package/template-nextjs-ts/node_modules/@types/node/fs.d.ts +153 -129
- package/template-nextjs-ts/node_modules/@types/node/globals.d.ts +151 -343
- package/template-nextjs-ts/node_modules/@types/node/globals.typedarray.d.ts +17 -0
- package/template-nextjs-ts/node_modules/@types/node/http.d.ts +82 -54
- package/template-nextjs-ts/node_modules/@types/node/http2.d.ts +45 -26
- package/template-nextjs-ts/node_modules/@types/node/https.d.ts +96 -62
- package/template-nextjs-ts/node_modules/@types/node/index.d.ts +7 -2
- package/template-nextjs-ts/node_modules/@types/node/inspector.d.ts +187 -3936
- package/template-nextjs-ts/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/template-nextjs-ts/node_modules/@types/node/module.d.ts +24 -0
- package/template-nextjs-ts/node_modules/@types/node/net.d.ts +33 -11
- package/template-nextjs-ts/node_modules/@types/node/os.d.ts +14 -3
- package/template-nextjs-ts/node_modules/@types/node/package.json +3 -83
- package/template-nextjs-ts/node_modules/@types/node/path.d.ts +1 -1
- package/template-nextjs-ts/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/template-nextjs-ts/node_modules/@types/node/process.d.ts +34 -25
- package/template-nextjs-ts/node_modules/@types/node/readline/promises.d.ts +1 -2
- package/template-nextjs-ts/node_modules/@types/node/sqlite.d.ts +48 -7
- package/template-nextjs-ts/node_modules/@types/node/stream/consumers.d.ts +2 -2
- package/template-nextjs-ts/node_modules/@types/node/stream/web.d.ts +4 -0
- package/template-nextjs-ts/node_modules/@types/node/stream.d.ts +29 -33
- package/template-nextjs-ts/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/template-nextjs-ts/node_modules/@types/node/test.d.ts +10 -23
- package/template-nextjs-ts/node_modules/@types/node/tls.d.ts +122 -66
- package/template-nextjs-ts/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
- package/template-nextjs-ts/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +15 -0
- package/template-nextjs-ts/node_modules/@types/node/ts5.6/index.d.ts +7 -2
- package/template-nextjs-ts/node_modules/@types/node/url.d.ts +21 -9
- package/template-nextjs-ts/node_modules/@types/node/util.d.ts +18 -8
- package/template-nextjs-ts/node_modules/@types/node/v8.d.ts +33 -35
- package/template-nextjs-ts/node_modules/@types/node/vm.d.ts +21 -50
- package/template-nextjs-ts/node_modules/@types/node/wasi.d.ts +1 -1
- package/template-nextjs-ts/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/template-nextjs-ts/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/template-nextjs-ts/node_modules/@types/node/{dom-events.d.ts → web-globals/events.d.ts} +49 -51
- package/template-nextjs-ts/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
- package/template-nextjs-ts/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/template-nextjs-ts/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/template-nextjs-ts/node_modules/@types/node/worker_threads.d.ts +65 -50
- package/template-nextjs-ts/node_modules/@types/node/zlib.d.ts +39 -26
- package/template-nextjs-ts/package.json +2 -2
- package/template-nextjs-ts/src/app/page.tsx +1 -1
- package/template-node/package.json +2 -2
- package/template-node-ts/package.json +2 -2
- package/template-offline-public-transaction-ts/package.json +1 -1
- package/template-private-transaction-ts/package.json +1 -1
- package/template-react-leo/package.json +1 -1
- package/template-react-managed-worker/package.json +1 -1
- package/template-react-ts/node_modules/@types/node/README.md +2 -2
- package/template-react-ts/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/template-react-ts/node_modules/@types/node/assert.d.ts +119 -95
- package/template-react-ts/node_modules/@types/node/buffer.buffer.d.ts +9 -0
- package/template-react-ts/node_modules/@types/node/buffer.d.ts +12 -6
- package/template-react-ts/node_modules/@types/node/child_process.d.ts +89 -162
- package/template-react-ts/node_modules/@types/node/cluster.d.ts +4 -5
- package/template-react-ts/node_modules/@types/node/crypto.d.ts +203 -167
- package/template-react-ts/node_modules/@types/node/dgram.d.ts +9 -8
- package/template-react-ts/node_modules/@types/node/dns/promises.d.ts +11 -10
- package/template-react-ts/node_modules/@types/node/dns.d.ts +24 -20
- package/template-react-ts/node_modules/@types/node/events.d.ts +80 -34
- package/template-react-ts/node_modules/@types/node/fs/promises.d.ts +78 -56
- package/template-react-ts/node_modules/@types/node/fs.d.ts +153 -129
- package/template-react-ts/node_modules/@types/node/globals.d.ts +151 -343
- package/template-react-ts/node_modules/@types/node/globals.typedarray.d.ts +17 -0
- package/template-react-ts/node_modules/@types/node/http.d.ts +82 -54
- package/template-react-ts/node_modules/@types/node/http2.d.ts +45 -26
- package/template-react-ts/node_modules/@types/node/https.d.ts +96 -62
- package/template-react-ts/node_modules/@types/node/index.d.ts +7 -2
- package/template-react-ts/node_modules/@types/node/inspector.d.ts +187 -3936
- package/template-react-ts/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/template-react-ts/node_modules/@types/node/module.d.ts +24 -0
- package/template-react-ts/node_modules/@types/node/net.d.ts +33 -11
- package/template-react-ts/node_modules/@types/node/os.d.ts +14 -3
- package/template-react-ts/node_modules/@types/node/package.json +3 -83
- package/template-react-ts/node_modules/@types/node/path.d.ts +1 -1
- package/template-react-ts/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/template-react-ts/node_modules/@types/node/process.d.ts +34 -25
- package/template-react-ts/node_modules/@types/node/readline/promises.d.ts +1 -2
- package/template-react-ts/node_modules/@types/node/sqlite.d.ts +48 -7
- package/template-react-ts/node_modules/@types/node/stream/consumers.d.ts +2 -2
- package/template-react-ts/node_modules/@types/node/stream/web.d.ts +4 -0
- package/template-react-ts/node_modules/@types/node/stream.d.ts +29 -33
- package/template-react-ts/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/template-react-ts/node_modules/@types/node/test.d.ts +10 -23
- package/template-react-ts/node_modules/@types/node/tls.d.ts +122 -66
- package/template-react-ts/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
- package/template-react-ts/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +15 -0
- package/template-react-ts/node_modules/@types/node/ts5.6/index.d.ts +7 -2
- package/template-react-ts/node_modules/@types/node/url.d.ts +21 -9
- package/template-react-ts/node_modules/@types/node/util.d.ts +18 -8
- package/template-react-ts/node_modules/@types/node/v8.d.ts +33 -35
- package/template-react-ts/node_modules/@types/node/vm.d.ts +21 -50
- package/template-react-ts/node_modules/@types/node/wasi.d.ts +1 -1
- package/template-react-ts/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/template-react-ts/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/template-react-ts/node_modules/@types/node/{dom-events.d.ts → web-globals/events.d.ts} +49 -51
- package/template-react-ts/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
- package/template-react-ts/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/template-react-ts/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/template-react-ts/node_modules/@types/node/worker_threads.d.ts +65 -50
- package/template-react-ts/node_modules/@types/node/zlib.d.ts +39 -26
- package/template-react-ts/package.json +1 -1
- package/template-vanilla/package.json +1 -1
|
@@ -56,13 +56,14 @@
|
|
|
56
56
|
*/
|
|
57
57
|
declare module "worker_threads" {
|
|
58
58
|
import { Context } from "node:vm";
|
|
59
|
-
import { EventEmitter } from "node:events";
|
|
59
|
+
import { EventEmitter, NodeEventTarget } from "node:events";
|
|
60
60
|
import { EventLoopUtilityFunction } from "node:perf_hooks";
|
|
61
61
|
import { FileHandle } from "node:fs/promises";
|
|
62
62
|
import { Readable, Writable } from "node:stream";
|
|
63
63
|
import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
|
|
64
64
|
import { URL } from "node:url";
|
|
65
65
|
import { HeapInfo } from "node:v8";
|
|
66
|
+
import { MessageEvent } from "undici-types";
|
|
66
67
|
const isInternalThread: boolean;
|
|
67
68
|
const isMainThread: boolean;
|
|
68
69
|
const parentPort: null | MessagePort;
|
|
@@ -110,7 +111,7 @@ declare module "worker_threads" {
|
|
|
110
111
|
* This implementation matches [browser `MessagePort`](https://developer.mozilla.org/en-US/docs/Web/API/MessagePort) s.
|
|
111
112
|
* @since v10.5.0
|
|
112
113
|
*/
|
|
113
|
-
class MessagePort
|
|
114
|
+
class MessagePort implements EventTarget {
|
|
114
115
|
/**
|
|
115
116
|
* Disables further sending of messages on either side of the connection.
|
|
116
117
|
* This method can be called when no further communication will happen over this `MessagePort`.
|
|
@@ -187,6 +188,11 @@ declare module "worker_threads" {
|
|
|
187
188
|
* @since v10.5.0
|
|
188
189
|
*/
|
|
189
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;
|
|
190
196
|
/**
|
|
191
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
|
|
192
198
|
* behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
|
|
@@ -218,42 +224,32 @@ declare module "worker_threads" {
|
|
|
218
224
|
* @since v10.5.0
|
|
219
225
|
*/
|
|
220
226
|
start(): void;
|
|
221
|
-
addListener(event: "close", listener: () => void): this;
|
|
227
|
+
addListener(event: "close", listener: (ev: Event) => void): this;
|
|
222
228
|
addListener(event: "message", listener: (value: any) => void): this;
|
|
223
229
|
addListener(event: "messageerror", listener: (error: Error) => void): this;
|
|
224
|
-
addListener(event: string
|
|
225
|
-
emit(event: "close"): boolean;
|
|
230
|
+
addListener(event: string, listener: (arg: any) => void): this;
|
|
231
|
+
emit(event: "close", ev: Event): boolean;
|
|
226
232
|
emit(event: "message", value: any): boolean;
|
|
227
233
|
emit(event: "messageerror", error: Error): boolean;
|
|
228
|
-
emit(event: string
|
|
229
|
-
|
|
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;
|
|
230
240
|
on(event: "message", listener: (value: any) => void): this;
|
|
231
241
|
on(event: "messageerror", listener: (error: Error) => void): this;
|
|
232
|
-
on(event: string
|
|
233
|
-
once(event: "close", listener: () => void): this;
|
|
242
|
+
on(event: string, listener: (arg: any) => void): this;
|
|
243
|
+
once(event: "close", listener: (ev: Event) => void): this;
|
|
234
244
|
once(event: "message", listener: (value: any) => void): this;
|
|
235
245
|
once(event: "messageerror", listener: (error: Error) => void): this;
|
|
236
|
-
once(event: string
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
prependOnceListener(event: "close", listener: () => void): this;
|
|
242
|
-
prependOnceListener(event: "message", listener: (value: any) => void): this;
|
|
243
|
-
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
|
|
244
|
-
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
245
|
-
removeListener(event: "close", listener: () => void): this;
|
|
246
|
-
removeListener(event: "message", listener: (value: any) => void): this;
|
|
247
|
-
removeListener(event: "messageerror", listener: (error: Error) => void): this;
|
|
248
|
-
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
249
|
-
off(event: "close", listener: () => void): this;
|
|
250
|
-
off(event: "message", listener: (value: any) => void): this;
|
|
251
|
-
off(event: "messageerror", listener: (error: Error) => void): this;
|
|
252
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
253
|
-
addEventListener: EventTarget["addEventListener"];
|
|
254
|
-
dispatchEvent: EventTarget["dispatchEvent"];
|
|
255
|
-
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;
|
|
256
251
|
}
|
|
252
|
+
interface MessagePort extends NodeEventTarget {}
|
|
257
253
|
interface WorkerOptions {
|
|
258
254
|
/**
|
|
259
255
|
* List of arguments which would be stringified and appended to
|
|
@@ -422,24 +418,6 @@ declare module "worker_threads" {
|
|
|
422
418
|
* @since v10.5.0
|
|
423
419
|
*/
|
|
424
420
|
postMessage(value: any, transferList?: readonly Transferable[]): void;
|
|
425
|
-
/**
|
|
426
|
-
* Sends a value to another worker, identified by its thread ID.
|
|
427
|
-
* @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
|
|
428
|
-
* If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.
|
|
429
|
-
* @param value The value to send.
|
|
430
|
-
* @param transferList If one or more `MessagePort`-like objects are passed in value, a `transferList` is required for those items
|
|
431
|
-
* or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.
|
|
432
|
-
* @param timeout Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever.
|
|
433
|
-
* If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.
|
|
434
|
-
* @since v22.5.0
|
|
435
|
-
*/
|
|
436
|
-
postMessageToThread(threadId: number, value: any, timeout?: number): Promise<void>;
|
|
437
|
-
postMessageToThread(
|
|
438
|
-
threadId: number,
|
|
439
|
-
value: any,
|
|
440
|
-
transferList: readonly Transferable[],
|
|
441
|
-
timeout?: number,
|
|
442
|
-
): Promise<void>;
|
|
443
421
|
/**
|
|
444
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
|
|
445
423
|
* behavior). If the worker is `ref()`ed, calling `ref()` again has
|
|
@@ -459,6 +437,13 @@ declare module "worker_threads" {
|
|
|
459
437
|
* @since v10.5.0
|
|
460
438
|
*/
|
|
461
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>;
|
|
462
447
|
/**
|
|
463
448
|
* Returns a readable stream for a V8 snapshot of the current state of the Worker.
|
|
464
449
|
* See `v8.getHeapSnapshot()` for more details.
|
|
@@ -476,6 +461,18 @@ declare module "worker_threads" {
|
|
|
476
461
|
* @since v22.16.0
|
|
477
462
|
*/
|
|
478
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>;
|
|
479
476
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
480
477
|
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
|
481
478
|
addListener(event: "message", listener: (value: any) => void): this;
|
|
@@ -556,18 +553,18 @@ declare module "worker_threads" {
|
|
|
556
553
|
* ```
|
|
557
554
|
* @since v15.4.0
|
|
558
555
|
*/
|
|
559
|
-
class BroadcastChannel {
|
|
556
|
+
class BroadcastChannel extends EventTarget {
|
|
560
557
|
readonly name: string;
|
|
561
558
|
/**
|
|
562
559
|
* Invoked with a single \`MessageEvent\` argument when a message is received.
|
|
563
560
|
* @since v15.4.0
|
|
564
561
|
*/
|
|
565
|
-
onmessage: (message:
|
|
562
|
+
onmessage: (message: MessageEvent) => void;
|
|
566
563
|
/**
|
|
567
564
|
* Invoked with a received message cannot be deserialized.
|
|
568
565
|
* @since v15.4.0
|
|
569
566
|
*/
|
|
570
|
-
onmessageerror: (message:
|
|
567
|
+
onmessageerror: (message: MessageEvent) => void;
|
|
571
568
|
constructor(name: string);
|
|
572
569
|
/**
|
|
573
570
|
* Closes the `BroadcastChannel` connection.
|
|
@@ -721,6 +718,24 @@ declare module "worker_threads" {
|
|
|
721
718
|
* for the `key` will be deleted.
|
|
722
719
|
*/
|
|
723
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>;
|
|
724
739
|
|
|
725
740
|
import {
|
|
726
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` */
|