@types/node 22.15.34 → 22.16.0
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.15 → node v22.16}/README.md +1 -1
- {node v22.15 → node v22.16}/buffer.d.ts +2 -0
- {node v22.15 → node v22.16}/events.d.ts +0 -1
- {node v22.15 → node v22.16}/module.d.ts +47 -14
- {node v22.15 → node v22.16}/package.json +2 -2
- {node v22.15 → node v22.16}/process.d.ts +0 -2
- {node v22.15 → node v22.16}/repl.d.ts +3 -5
- {node v22.15 → node v22.16}/sqlite.d.ts +172 -0
- {node v22.15 → node v22.16}/stream/web.d.ts +4 -0
- node v22.16/test.d.ts +2175 -0
- {node v22.15 → node v22.16}/util.d.ts +14 -2
- {node v22.15 → node v22.16}/worker_threads.d.ts +28 -17
- node v22.15/test.d.ts +0 -2278
- {node v22.15 → node v22.16}/LICENSE +0 -0
- {node v22.15 → node v22.16}/assert/strict.d.ts +0 -0
- {node v22.15 → node v22.16}/assert.d.ts +0 -0
- {node v22.15 → node v22.16}/async_hooks.d.ts +1 -1
- {node v22.15 → node v22.16}/buffer.buffer.d.ts +0 -0
- {node v22.15 → node v22.16}/child_process.d.ts +0 -0
- {node v22.15 → node v22.16}/cluster.d.ts +0 -0
- {node v22.15 → node v22.16}/compatibility/disposable.d.ts +0 -0
- {node v22.15 → node v22.16}/compatibility/index.d.ts +0 -0
- {node v22.15 → node v22.16}/compatibility/indexable.d.ts +0 -0
- {node v22.15 → node v22.16}/compatibility/iterators.d.ts +0 -0
- {node v22.15 → node v22.16}/console.d.ts +0 -0
- {node v22.15 → node v22.16}/constants.d.ts +0 -0
- {node v22.15 → node v22.16}/crypto.d.ts +0 -0
- {node v22.15 → node v22.16}/dgram.d.ts +0 -0
- {node v22.15 → node v22.16}/diagnostics_channel.d.ts +0 -0
- {node v22.15 → node v22.16}/dns/promises.d.ts +0 -0
- {node v22.15 → node v22.16}/dns.d.ts +0 -0
- {node v22.15 → node v22.16}/dom-events.d.ts +0 -0
- {node v22.15 → node v22.16}/domain.d.ts +0 -0
- {node v22.15 → node v22.16}/fs/promises.d.ts +0 -0
- {node v22.15 → node v22.16}/fs.d.ts +0 -0
- {node v22.15 → node v22.16}/globals.d.ts +0 -0
- {node v22.15 → node v22.16}/globals.typedarray.d.ts +0 -0
- {node v22.15 → node v22.16}/http.d.ts +0 -0
- {node v22.15 → node v22.16}/http2.d.ts +0 -0
- {node v22.15 → node v22.16}/https.d.ts +0 -0
- {node v22.15 → node v22.16}/index.d.ts +0 -0
- {node v22.15 → node v22.16}/inspector.d.ts +0 -0
- {node v22.15 → node v22.16}/net.d.ts +0 -0
- {node v22.15 → node v22.16}/os.d.ts +0 -0
- {node v22.15 → node v22.16}/path.d.ts +0 -0
- {node v22.15 → node v22.16}/perf_hooks.d.ts +0 -0
- {node v22.15 → node v22.16}/punycode.d.ts +0 -0
- {node v22.15 → node v22.16}/querystring.d.ts +0 -0
- {node v22.15 → node v22.16}/readline/promises.d.ts +0 -0
- {node v22.15 → node v22.16}/readline.d.ts +0 -0
- {node v22.15 → node v22.16}/sea.d.ts +0 -0
- {node v22.15 → node v22.16}/stream/consumers.d.ts +0 -0
- {node v22.15 → node v22.16}/stream/promises.d.ts +0 -0
- {node v22.15 → node v22.16}/stream.d.ts +0 -0
- {node v22.15 → node v22.16}/string_decoder.d.ts +0 -0
- {node v22.15 → node v22.16}/timers/promises.d.ts +0 -0
- {node v22.15 → node v22.16}/timers.d.ts +0 -0
- {node v22.15 → node v22.16}/tls.d.ts +0 -0
- {node v22.15 → node v22.16}/trace_events.d.ts +0 -0
- {node v22.15 → node v22.16}/ts5.6/buffer.buffer.d.ts +0 -0
- {node v22.15 → node v22.16}/ts5.6/globals.typedarray.d.ts +0 -0
- {node v22.15 → node v22.16}/ts5.6/index.d.ts +0 -0
- {node v22.15 → node v22.16}/tty.d.ts +0 -0
- {node v22.15 → node v22.16}/url.d.ts +0 -0
- {node v22.15 → node v22.16}/v8.d.ts +0 -0
- {node v22.15 → node v22.16}/vm.d.ts +0 -0
- {node v22.15 → node v22.16}/wasi.d.ts +0 -0
- {node v22.15 → node v22.16}/zlib.d.ts +0 -0
@@ -433,7 +433,6 @@ declare module "util" {
|
|
433
433
|
* });
|
434
434
|
* ```
|
435
435
|
* @since v19.7.0
|
436
|
-
* @experimental
|
437
436
|
* @param resource Any non-null object tied to the abortable operation and held weakly.
|
438
437
|
* If `resource` is garbage collected before the `signal` aborts, the promise remains pending,
|
439
438
|
* allowing Node.js to stop tracking it.
|
@@ -1481,7 +1480,7 @@ declare module "util" {
|
|
1481
1480
|
/**
|
1482
1481
|
* This function returns a formatted text considering the `format` passed
|
1483
1482
|
* for printing in a terminal. It is aware of the terminal's capabilities
|
1484
|
-
* and acts according to the configuration set via `
|
1483
|
+
* and acts according to the configuration set via `NO_COLOR`,
|
1485
1484
|
* `NODE_DISABLE_COLORS` and `FORCE_COLOR` environment variables.
|
1486
1485
|
*
|
1487
1486
|
* ```js
|
@@ -2226,6 +2225,19 @@ declare module "util/types" {
|
|
2226
2225
|
* @since v10.0.0
|
2227
2226
|
*/
|
2228
2227
|
function isExternal(object: unknown): boolean;
|
2228
|
+
/**
|
2229
|
+
* Returns `true` if the value is a built-in `Float16Array` instance.
|
2230
|
+
*
|
2231
|
+
* ```js
|
2232
|
+
* util.types.isFloat16Array(new ArrayBuffer()); // Returns false
|
2233
|
+
* util.types.isFloat16Array(new Float16Array()); // Returns true
|
2234
|
+
* util.types.isFloat16Array(new Float32Array()); // Returns false
|
2235
|
+
* ```
|
2236
|
+
* @since v22.16.0
|
2237
|
+
*/
|
2238
|
+
// This does NOT return a type predicate in v22.x.
|
2239
|
+
// The Float16Array feature does not yet exist in this version of Node.js.
|
2240
|
+
function isFloat16Array(object: unknown): boolean;
|
2229
2241
|
/**
|
2230
2242
|
* Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance.
|
2231
2243
|
*
|
@@ -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
|
@@ -59,6 +62,7 @@ declare module "worker_threads" {
|
|
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";
|
62
66
|
const isInternalThread: boolean;
|
63
67
|
const isMainThread: boolean;
|
64
68
|
const parentPort: null | MessagePort;
|
@@ -465,6 +469,13 @@ declare module "worker_threads" {
|
|
465
469
|
* @return A promise for a Readable Stream containing a V8 heap snapshot
|
466
470
|
*/
|
467
471
|
getHeapSnapshot(): Promise<Readable>;
|
472
|
+
/**
|
473
|
+
* This method returns a `Promise` that will resolve to an object identical to `v8.getHeapStatistics()`,
|
474
|
+
* or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
|
475
|
+
* This methods allows the statistics to be observed from outside the actual thread.
|
476
|
+
* @since v22.16.0
|
477
|
+
*/
|
478
|
+
getHeapStatistics(): Promise<HeapInfo>;
|
468
479
|
addListener(event: "error", listener: (err: Error) => void): this;
|
469
480
|
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
470
481
|
addListener(event: "message", listener: (value: any) => void): this;
|