@types/node 22.15.33 → 22.19.7
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}/path.d.ts +1 -1
- {node v22.15 → node v22.19}/perf_hooks.d.ts +6 -8
- {node v22.15 → node v22.19}/process.d.ts +53 -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 +126 -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}/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
|
@@ -338,6 +338,11 @@ declare module "util" {
|
|
|
338
338
|
* @since v9.7.0
|
|
339
339
|
*/
|
|
340
340
|
export function getSystemErrorName(err: number): string;
|
|
341
|
+
/**
|
|
342
|
+
* Enable or disable printing a stack trace on `SIGINT`. The API is only available on the main thread.
|
|
343
|
+
* @since 22.19.0
|
|
344
|
+
*/
|
|
345
|
+
export function setTraceSigInt(enable: boolean): void;
|
|
341
346
|
/**
|
|
342
347
|
* Returns a Map of all system error codes available from the Node.js API.
|
|
343
348
|
* The mapping between error codes and error names is platform-dependent.
|
|
@@ -433,7 +438,6 @@ declare module "util" {
|
|
|
433
438
|
* });
|
|
434
439
|
* ```
|
|
435
440
|
* @since v19.7.0
|
|
436
|
-
* @experimental
|
|
437
441
|
* @param resource Any non-null object tied to the abortable operation and held weakly.
|
|
438
442
|
* If `resource` is garbage collected before the `signal` aborts, the promise remains pending,
|
|
439
443
|
* allowing Node.js to stop tracking it.
|
|
@@ -445,8 +449,8 @@ declare module "util" {
|
|
|
445
449
|
* intended for debugging. The output of `util.inspect` may change at any time
|
|
446
450
|
* and should not be depended upon programmatically. Additional `options` may be
|
|
447
451
|
* passed that alter the result.
|
|
448
|
-
* `util.inspect()` will use the constructor's name and/or
|
|
449
|
-
* an identifiable tag for an inspected value.
|
|
452
|
+
* `util.inspect()` will use the constructor's name and/or `Symbol.toStringTag`
|
|
453
|
+
* property to make an identifiable tag for an inspected value.
|
|
450
454
|
*
|
|
451
455
|
* ```js
|
|
452
456
|
* class Foo {
|
|
@@ -1462,6 +1466,7 @@ declare module "util" {
|
|
|
1462
1466
|
| "hidden"
|
|
1463
1467
|
| "inverse"
|
|
1464
1468
|
| "italic"
|
|
1469
|
+
| "none"
|
|
1465
1470
|
| "overlined"
|
|
1466
1471
|
| "reset"
|
|
1467
1472
|
| "strikethrough"
|
|
@@ -1481,7 +1486,7 @@ declare module "util" {
|
|
|
1481
1486
|
/**
|
|
1482
1487
|
* This function returns a formatted text considering the `format` passed
|
|
1483
1488
|
* for printing in a terminal. It is aware of the terminal's capabilities
|
|
1484
|
-
* and acts according to the configuration set via `
|
|
1489
|
+
* and acts according to the configuration set via `NO_COLOR`,
|
|
1485
1490
|
* `NODE_DISABLE_COLORS` and `FORCE_COLOR` environment variables.
|
|
1486
1491
|
*
|
|
1487
1492
|
* ```js
|
|
@@ -1518,6 +1523,8 @@ declare module "util" {
|
|
|
1518
1523
|
* );
|
|
1519
1524
|
* ```
|
|
1520
1525
|
*
|
|
1526
|
+
* The special format value `none` applies no additional styling to the text.
|
|
1527
|
+
*
|
|
1521
1528
|
* The full list of formats can be found in [modifiers](https://nodejs.org/docs/latest-v22.x/api/util.html#modifiers).
|
|
1522
1529
|
* @param format A text format or an Array of text formats defined in `util.inspect.colors`.
|
|
1523
1530
|
* @param text The text to to be formatted.
|
|
@@ -1614,7 +1621,7 @@ declare module "util" {
|
|
|
1614
1621
|
* encoded bytes.
|
|
1615
1622
|
* @param [input='an empty string'] The text to encode.
|
|
1616
1623
|
*/
|
|
1617
|
-
encode(input?: string):
|
|
1624
|
+
encode(input?: string): NodeJS.NonSharedUint8Array;
|
|
1618
1625
|
/**
|
|
1619
1626
|
* UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object
|
|
1620
1627
|
* containing the read Unicode code units and written UTF-8 bytes.
|
|
@@ -1707,10 +1714,12 @@ declare module "util" {
|
|
|
1707
1714
|
*/
|
|
1708
1715
|
short?: string | undefined;
|
|
1709
1716
|
/**
|
|
1710
|
-
* The
|
|
1711
|
-
*
|
|
1712
|
-
*
|
|
1713
|
-
*
|
|
1717
|
+
* The value to assign to
|
|
1718
|
+
* the option if it does not appear in the arguments to be parsed. The value
|
|
1719
|
+
* must match the type specified by the `type` property. If `multiple` is
|
|
1720
|
+
* `true`, it must be an array. No default value is applied when the option
|
|
1721
|
+
* does appear in the arguments to be parsed, even if the provided value
|
|
1722
|
+
* is falsy.
|
|
1714
1723
|
* @since v18.11.0
|
|
1715
1724
|
*/
|
|
1716
1725
|
default?: string | boolean | string[] | boolean[] | undefined;
|
|
@@ -1722,7 +1731,7 @@ declare module "util" {
|
|
|
1722
1731
|
/**
|
|
1723
1732
|
* Array of argument strings.
|
|
1724
1733
|
*/
|
|
1725
|
-
args?: string[] | undefined;
|
|
1734
|
+
args?: readonly string[] | undefined;
|
|
1726
1735
|
/**
|
|
1727
1736
|
* Used to describe arguments known to the parser.
|
|
1728
1737
|
*/
|
|
@@ -2226,6 +2235,19 @@ declare module "util/types" {
|
|
|
2226
2235
|
* @since v10.0.0
|
|
2227
2236
|
*/
|
|
2228
2237
|
function isExternal(object: unknown): boolean;
|
|
2238
|
+
/**
|
|
2239
|
+
* Returns `true` if the value is a built-in `Float16Array` instance.
|
|
2240
|
+
*
|
|
2241
|
+
* ```js
|
|
2242
|
+
* util.types.isFloat16Array(new ArrayBuffer()); // Returns false
|
|
2243
|
+
* util.types.isFloat16Array(new Float16Array()); // Returns true
|
|
2244
|
+
* util.types.isFloat16Array(new Float32Array()); // Returns false
|
|
2245
|
+
* ```
|
|
2246
|
+
* @since v22.16.0
|
|
2247
|
+
*/
|
|
2248
|
+
// This does NOT return a type predicate in v22.x.
|
|
2249
|
+
// The Float16Array feature does not yet exist in this version of Node.js.
|
|
2250
|
+
function isFloat16Array(object: unknown): boolean;
|
|
2229
2251
|
/**
|
|
2230
2252
|
* 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
2253
|
*
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/v8.js)
|
|
8
8
|
*/
|
|
9
9
|
declare module "v8" {
|
|
10
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
10
11
|
import { Readable } from "node:stream";
|
|
11
12
|
interface HeapSpaceInfo {
|
|
12
13
|
space_name: string;
|
|
@@ -43,12 +44,12 @@ declare module "v8" {
|
|
|
43
44
|
* If true, expose internals in the heap snapshot.
|
|
44
45
|
* @default false
|
|
45
46
|
*/
|
|
46
|
-
exposeInternals?: boolean;
|
|
47
|
+
exposeInternals?: boolean | undefined;
|
|
47
48
|
/**
|
|
48
49
|
* If true, expose numeric values in artificial fields.
|
|
49
50
|
* @default false
|
|
50
51
|
*/
|
|
51
|
-
exposeNumericValues?: boolean;
|
|
52
|
+
exposeNumericValues?: boolean | undefined;
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
54
55
|
* Returns an integer representing a version tag derived from the V8 version,
|
|
@@ -453,7 +454,7 @@ declare module "v8" {
|
|
|
453
454
|
* the buffer is released. Calling this method results in undefined behavior
|
|
454
455
|
* if a previous write has failed.
|
|
455
456
|
*/
|
|
456
|
-
releaseBuffer():
|
|
457
|
+
releaseBuffer(): NonSharedBuffer;
|
|
457
458
|
/**
|
|
458
459
|
* Marks an `ArrayBuffer` as having its contents transferred out of band.
|
|
459
460
|
* Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`.
|
|
@@ -481,7 +482,7 @@ declare module "v8" {
|
|
|
481
482
|
* will require a way to compute the length of the buffer.
|
|
482
483
|
* For use inside of a custom `serializer._writeHostObject()`.
|
|
483
484
|
*/
|
|
484
|
-
writeRawBytes(buffer: NodeJS.
|
|
485
|
+
writeRawBytes(buffer: NodeJS.ArrayBufferView): void;
|
|
485
486
|
}
|
|
486
487
|
/**
|
|
487
488
|
* A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only
|
|
@@ -552,7 +553,7 @@ declare module "v8" {
|
|
|
552
553
|
* larger than `buffer.constants.MAX_LENGTH`.
|
|
553
554
|
* @since v8.0.0
|
|
554
555
|
*/
|
|
555
|
-
function serialize(value: any):
|
|
556
|
+
function serialize(value: any): NonSharedBuffer;
|
|
556
557
|
/**
|
|
557
558
|
* Uses a `DefaultDeserializer` with default options to read a JS value
|
|
558
559
|
* from a buffer.
|
|
@@ -581,7 +582,6 @@ declare module "v8" {
|
|
|
581
582
|
/**
|
|
582
583
|
* The API is a no-op if `--heapsnapshot-near-heap-limit` is already set from the command line or the API is called more than once.
|
|
583
584
|
* `limit` must be a positive integer. See [`--heapsnapshot-near-heap-limit`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--heapsnapshot-near-heap-limitmax_count) for more information.
|
|
584
|
-
* @experimental
|
|
585
585
|
* @since v18.10.0, v16.18.0
|
|
586
586
|
*/
|
|
587
587
|
function setHeapSnapshotNearHeapLimit(limit: number): void;
|
|
@@ -807,33 +807,6 @@ declare module "v8" {
|
|
|
807
807
|
*/
|
|
808
808
|
const promiseHooks: PromiseHooks;
|
|
809
809
|
type StartupSnapshotCallbackFn = (args: any) => any;
|
|
810
|
-
interface StartupSnapshot {
|
|
811
|
-
/**
|
|
812
|
-
* Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit.
|
|
813
|
-
* This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization.
|
|
814
|
-
* @since v18.6.0, v16.17.0
|
|
815
|
-
*/
|
|
816
|
-
addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
|
|
817
|
-
/**
|
|
818
|
-
* Add a callback that will be called when the Node.js instance is deserialized from a snapshot.
|
|
819
|
-
* The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or
|
|
820
|
-
* to re-acquire resources that the application needs when the application is restarted from the snapshot.
|
|
821
|
-
* @since v18.6.0, v16.17.0
|
|
822
|
-
*/
|
|
823
|
-
addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
|
|
824
|
-
/**
|
|
825
|
-
* This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script.
|
|
826
|
-
* If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized
|
|
827
|
-
* data (if provided), otherwise an entry point script still needs to be provided to the deserialized application.
|
|
828
|
-
* @since v18.6.0, v16.17.0
|
|
829
|
-
*/
|
|
830
|
-
setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void;
|
|
831
|
-
/**
|
|
832
|
-
* Returns true if the Node.js instance is run to build a snapshot.
|
|
833
|
-
* @since v18.6.0, v16.17.0
|
|
834
|
-
*/
|
|
835
|
-
isBuildingSnapshot(): boolean;
|
|
836
|
-
}
|
|
837
810
|
/**
|
|
838
811
|
* The `v8.startupSnapshot` interface can be used to add serialization and deserialization hooks for custom startup snapshots.
|
|
839
812
|
*
|
|
@@ -912,10 +885,35 @@ declare module "v8" {
|
|
|
912
885
|
*
|
|
913
886
|
* Currently the application deserialized from a user-land snapshot cannot be snapshotted again, so these APIs are only available to applications that are not deserialized from a user-land snapshot.
|
|
914
887
|
*
|
|
915
|
-
* @experimental
|
|
916
888
|
* @since v18.6.0, v16.17.0
|
|
917
889
|
*/
|
|
918
|
-
|
|
890
|
+
namespace startupSnapshot {
|
|
891
|
+
/**
|
|
892
|
+
* Add a callback that will be called when the Node.js instance is about to get serialized into a snapshot and exit.
|
|
893
|
+
* This can be used to release resources that should not or cannot be serialized or to convert user data into a form more suitable for serialization.
|
|
894
|
+
* @since v18.6.0, v16.17.0
|
|
895
|
+
*/
|
|
896
|
+
function addSerializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
|
|
897
|
+
/**
|
|
898
|
+
* Add a callback that will be called when the Node.js instance is deserialized from a snapshot.
|
|
899
|
+
* The `callback` and the `data` (if provided) will be serialized into the snapshot, they can be used to re-initialize the state of the application or
|
|
900
|
+
* to re-acquire resources that the application needs when the application is restarted from the snapshot.
|
|
901
|
+
* @since v18.6.0, v16.17.0
|
|
902
|
+
*/
|
|
903
|
+
function addDeserializeCallback(callback: StartupSnapshotCallbackFn, data?: any): void;
|
|
904
|
+
/**
|
|
905
|
+
* This sets the entry point of the Node.js application when it is deserialized from a snapshot. This can be called only once in the snapshot building script.
|
|
906
|
+
* If called, the deserialized application no longer needs an additional entry point script to start up and will simply invoke the callback along with the deserialized
|
|
907
|
+
* data (if provided), otherwise an entry point script still needs to be provided to the deserialized application.
|
|
908
|
+
* @since v18.6.0, v16.17.0
|
|
909
|
+
*/
|
|
910
|
+
function setDeserializeMainFunction(callback: StartupSnapshotCallbackFn, data?: any): void;
|
|
911
|
+
/**
|
|
912
|
+
* Returns true if the Node.js instance is run to build a snapshot.
|
|
913
|
+
* @since v18.6.0, v16.17.0
|
|
914
|
+
*/
|
|
915
|
+
function isBuildingSnapshot(): boolean;
|
|
916
|
+
}
|
|
919
917
|
}
|
|
920
918
|
declare module "node:v8" {
|
|
921
919
|
export * from "v8";
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/vm.js)
|
|
38
38
|
*/
|
|
39
39
|
declare module "vm" {
|
|
40
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
40
41
|
import { ImportAttributes } from "node:module";
|
|
41
42
|
interface Context extends NodeJS.Dict<any> {}
|
|
42
43
|
interface BaseOptions {
|
|
@@ -65,7 +66,7 @@ declare module "vm" {
|
|
|
65
66
|
/**
|
|
66
67
|
* Provides an optional data with V8's code cache data for the supplied source.
|
|
67
68
|
*/
|
|
68
|
-
cachedData?:
|
|
69
|
+
cachedData?: NodeJS.ArrayBufferView | undefined;
|
|
69
70
|
/** @deprecated in favor of `script.createCachedData()` */
|
|
70
71
|
produceCachedData?: boolean | undefined;
|
|
71
72
|
/**
|
|
@@ -97,28 +98,22 @@ declare module "vm" {
|
|
|
97
98
|
*/
|
|
98
99
|
breakOnSigint?: boolean | undefined;
|
|
99
100
|
}
|
|
100
|
-
interface RunningScriptInNewContextOptions
|
|
101
|
+
interface RunningScriptInNewContextOptions
|
|
102
|
+
extends RunningScriptOptions, Pick<CreateContextOptions, "microtaskMode">
|
|
103
|
+
{
|
|
101
104
|
/**
|
|
102
105
|
* Human-readable name of the newly created context.
|
|
103
106
|
*/
|
|
104
|
-
contextName?: CreateContextOptions["name"];
|
|
107
|
+
contextName?: CreateContextOptions["name"] | undefined;
|
|
105
108
|
/**
|
|
106
109
|
* Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
|
|
107
110
|
* but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
|
|
108
111
|
* Most notably, this string should omit the trailing slash, as that denotes a path.
|
|
109
112
|
*/
|
|
110
|
-
contextOrigin?: CreateContextOptions["origin"];
|
|
111
|
-
contextCodeGeneration?: CreateContextOptions["codeGeneration"];
|
|
112
|
-
/**
|
|
113
|
-
* If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
|
|
114
|
-
*/
|
|
115
|
-
microtaskMode?: CreateContextOptions["microtaskMode"];
|
|
113
|
+
contextOrigin?: CreateContextOptions["origin"] | undefined;
|
|
114
|
+
contextCodeGeneration?: CreateContextOptions["codeGeneration"] | undefined;
|
|
116
115
|
}
|
|
117
|
-
interface RunningCodeOptions extends RunningScriptOptions {
|
|
118
|
-
/**
|
|
119
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
120
|
-
*/
|
|
121
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
116
|
+
interface RunningCodeOptions extends RunningScriptOptions, Pick<ScriptOptions, "cachedData"> {
|
|
122
117
|
/**
|
|
123
118
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
124
119
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
@@ -129,11 +124,9 @@ declare module "vm" {
|
|
|
129
124
|
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
|
130
125
|
| undefined;
|
|
131
126
|
}
|
|
132
|
-
interface RunningCodeInNewContextOptions
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
*/
|
|
136
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
127
|
+
interface RunningCodeInNewContextOptions
|
|
128
|
+
extends RunningScriptInNewContextOptions, Pick<ScriptOptions, "cachedData">
|
|
129
|
+
{
|
|
137
130
|
/**
|
|
138
131
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
139
132
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
@@ -144,16 +137,7 @@ declare module "vm" {
|
|
|
144
137
|
| typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
|
|
145
138
|
| undefined;
|
|
146
139
|
}
|
|
147
|
-
interface CompileFunctionOptions extends BaseOptions {
|
|
148
|
-
/**
|
|
149
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
150
|
-
*/
|
|
151
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
152
|
-
/**
|
|
153
|
-
* Specifies whether to produce new cache data.
|
|
154
|
-
* @default false
|
|
155
|
-
*/
|
|
156
|
-
produceCachedData?: boolean | undefined;
|
|
140
|
+
interface CompileFunctionOptions extends BaseOptions, Pick<ScriptOptions, "cachedData" | "produceCachedData"> {
|
|
157
141
|
/**
|
|
158
142
|
* The sandbox/context in which the said function should be compiled in.
|
|
159
143
|
*/
|
|
@@ -378,17 +362,17 @@ declare module "vm" {
|
|
|
378
362
|
* ```
|
|
379
363
|
* @since v10.6.0
|
|
380
364
|
*/
|
|
381
|
-
createCachedData():
|
|
365
|
+
createCachedData(): NonSharedBuffer;
|
|
382
366
|
/** @deprecated in favor of `script.createCachedData()` */
|
|
383
|
-
cachedDataProduced?: boolean
|
|
367
|
+
cachedDataProduced?: boolean;
|
|
384
368
|
/**
|
|
385
369
|
* When `cachedData` is supplied to create the `vm.Script`, this value will be set
|
|
386
370
|
* to either `true` or `false` depending on acceptance of the data by V8.
|
|
387
371
|
* Otherwise the value is `undefined`.
|
|
388
372
|
* @since v5.7.0
|
|
389
373
|
*/
|
|
390
|
-
cachedDataRejected?: boolean
|
|
391
|
-
cachedData?:
|
|
374
|
+
cachedDataRejected?: boolean;
|
|
375
|
+
cachedData?: NonSharedBuffer;
|
|
392
376
|
/**
|
|
393
377
|
* When the script is compiled from a source that contains a source map magic
|
|
394
378
|
* comment, this property will be set to the URL of the source map.
|
|
@@ -406,7 +390,7 @@ declare module "vm" {
|
|
|
406
390
|
* ```
|
|
407
391
|
* @since v19.1.0, v18.13.0
|
|
408
392
|
*/
|
|
409
|
-
sourceMapURL
|
|
393
|
+
sourceMapURL: string | undefined;
|
|
410
394
|
}
|
|
411
395
|
/**
|
|
412
396
|
* If the given `contextObject` is an object, the `vm.createContext()` method will
|
|
@@ -616,11 +600,7 @@ declare module "vm" {
|
|
|
616
600
|
code: string,
|
|
617
601
|
params?: readonly string[],
|
|
618
602
|
options?: CompileFunctionOptions,
|
|
619
|
-
): Function &
|
|
620
|
-
cachedData?: Script["cachedData"] | undefined;
|
|
621
|
-
cachedDataProduced?: Script["cachedDataProduced"] | undefined;
|
|
622
|
-
cachedDataRejected?: Script["cachedDataRejected"] | undefined;
|
|
623
|
-
};
|
|
603
|
+
): Function & Pick<Script, "cachedData" | "cachedDataProduced" | "cachedDataRejected">;
|
|
624
604
|
/**
|
|
625
605
|
* Measure the memory known to V8 and used by all contexts known to the
|
|
626
606
|
* current V8 isolate, or the main context.
|
|
@@ -677,10 +657,7 @@ declare module "vm" {
|
|
|
677
657
|
* @experimental
|
|
678
658
|
*/
|
|
679
659
|
function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
|
|
680
|
-
interface ModuleEvaluateOptions {
|
|
681
|
-
timeout?: RunningScriptOptions["timeout"] | undefined;
|
|
682
|
-
breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
|
|
683
|
-
}
|
|
660
|
+
interface ModuleEvaluateOptions extends Pick<RunningScriptOptions, "breakOnSigint" | "timeout"> {}
|
|
684
661
|
type ModuleLinker = (
|
|
685
662
|
specifier: string,
|
|
686
663
|
referencingModule: Module,
|
|
@@ -887,19 +864,13 @@ declare module "vm" {
|
|
|
887
864
|
*/
|
|
888
865
|
link(linker: ModuleLinker): Promise<void>;
|
|
889
866
|
}
|
|
890
|
-
interface SourceTextModuleOptions {
|
|
867
|
+
interface SourceTextModuleOptions extends Pick<ScriptOptions, "cachedData" | "columnOffset" | "lineOffset"> {
|
|
891
868
|
/**
|
|
892
869
|
* String used in stack traces.
|
|
893
870
|
* @default 'vm:module(i)' where i is a context-specific ascending index.
|
|
894
871
|
*/
|
|
895
872
|
identifier?: string | undefined;
|
|
896
|
-
/**
|
|
897
|
-
* Provides an optional data with V8's code cache data for the supplied source.
|
|
898
|
-
*/
|
|
899
|
-
cachedData?: ScriptOptions["cachedData"] | undefined;
|
|
900
873
|
context?: Context | undefined;
|
|
901
|
-
lineOffset?: BaseOptions["lineOffset"] | undefined;
|
|
902
|
-
columnOffset?: BaseOptions["columnOffset"] | undefined;
|
|
903
874
|
/**
|
|
904
875
|
* Called during evaluation of this module to initialize the `import.meta`.
|
|
905
876
|
*/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
type _AbortController = typeof globalThis extends { onmessage: any } ? {} : AbortController;
|
|
4
|
+
interface AbortController {
|
|
5
|
+
readonly signal: AbortSignal;
|
|
6
|
+
abort(reason?: any): void;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type _AbortSignal = typeof globalThis extends { onmessage: any } ? {} : AbortSignal;
|
|
10
|
+
interface AbortSignal extends EventTarget {
|
|
11
|
+
readonly aborted: boolean;
|
|
12
|
+
onabort: ((this: AbortSignal, ev: Event) => any) | null;
|
|
13
|
+
readonly reason: any;
|
|
14
|
+
throwIfAborted(): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare global {
|
|
18
|
+
interface AbortController extends _AbortController {}
|
|
19
|
+
var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
|
|
20
|
+
: {
|
|
21
|
+
prototype: AbortController;
|
|
22
|
+
new(): AbortController;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface AbortSignal extends _AbortSignal {}
|
|
26
|
+
var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
|
|
27
|
+
: {
|
|
28
|
+
prototype: AbortSignal;
|
|
29
|
+
new(): AbortSignal;
|
|
30
|
+
abort(reason?: any): AbortSignal;
|
|
31
|
+
any(signals: AbortSignal[]): AbortSignal;
|
|
32
|
+
timeout(milliseconds: number): AbortSignal;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
type _DOMException = typeof globalThis extends { onmessage: any } ? {} : DOMException;
|
|
4
|
+
interface DOMException extends Error {
|
|
5
|
+
readonly code: number;
|
|
6
|
+
readonly message: string;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly INDEX_SIZE_ERR: 1;
|
|
9
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
|
10
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
|
11
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
|
12
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
|
13
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
|
14
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
|
15
|
+
readonly NOT_FOUND_ERR: 8;
|
|
16
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
|
17
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
|
18
|
+
readonly INVALID_STATE_ERR: 11;
|
|
19
|
+
readonly SYNTAX_ERR: 12;
|
|
20
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
|
21
|
+
readonly NAMESPACE_ERR: 14;
|
|
22
|
+
readonly INVALID_ACCESS_ERR: 15;
|
|
23
|
+
readonly VALIDATION_ERR: 16;
|
|
24
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
|
25
|
+
readonly SECURITY_ERR: 18;
|
|
26
|
+
readonly NETWORK_ERR: 19;
|
|
27
|
+
readonly ABORT_ERR: 20;
|
|
28
|
+
readonly URL_MISMATCH_ERR: 21;
|
|
29
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
|
30
|
+
readonly TIMEOUT_ERR: 23;
|
|
31
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
32
|
+
readonly DATA_CLONE_ERR: 25;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare global {
|
|
36
|
+
interface DOMException extends _DOMException {}
|
|
37
|
+
var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
|
|
38
|
+
: {
|
|
39
|
+
prototype: DOMException;
|
|
40
|
+
new(message?: string, name?: string): DOMException;
|
|
41
|
+
new(message?: string, options?: { name?: string; cause?: unknown }): DOMException;
|
|
42
|
+
readonly INDEX_SIZE_ERR: 1;
|
|
43
|
+
readonly DOMSTRING_SIZE_ERR: 2;
|
|
44
|
+
readonly HIERARCHY_REQUEST_ERR: 3;
|
|
45
|
+
readonly WRONG_DOCUMENT_ERR: 4;
|
|
46
|
+
readonly INVALID_CHARACTER_ERR: 5;
|
|
47
|
+
readonly NO_DATA_ALLOWED_ERR: 6;
|
|
48
|
+
readonly NO_MODIFICATION_ALLOWED_ERR: 7;
|
|
49
|
+
readonly NOT_FOUND_ERR: 8;
|
|
50
|
+
readonly NOT_SUPPORTED_ERR: 9;
|
|
51
|
+
readonly INUSE_ATTRIBUTE_ERR: 10;
|
|
52
|
+
readonly INVALID_STATE_ERR: 11;
|
|
53
|
+
readonly SYNTAX_ERR: 12;
|
|
54
|
+
readonly INVALID_MODIFICATION_ERR: 13;
|
|
55
|
+
readonly NAMESPACE_ERR: 14;
|
|
56
|
+
readonly INVALID_ACCESS_ERR: 15;
|
|
57
|
+
readonly VALIDATION_ERR: 16;
|
|
58
|
+
readonly TYPE_MISMATCH_ERR: 17;
|
|
59
|
+
readonly SECURITY_ERR: 18;
|
|
60
|
+
readonly NETWORK_ERR: 19;
|
|
61
|
+
readonly ABORT_ERR: 20;
|
|
62
|
+
readonly URL_MISMATCH_ERR: 21;
|
|
63
|
+
readonly QUOTA_EXCEEDED_ERR: 22;
|
|
64
|
+
readonly TIMEOUT_ERR: 23;
|
|
65
|
+
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
66
|
+
readonly DATA_CLONE_ERR: 25;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -1,37 +1,62 @@
|
|
|
1
|
-
// Make this a module
|
|
2
1
|
export {};
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
interface AddEventListenerOptions extends EventListenerOptions {
|
|
4
|
+
once?: boolean;
|
|
5
|
+
passive?: boolean;
|
|
6
|
+
signal?: AbortSignal;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type _CustomEvent<T = any> = typeof globalThis extends { onmessage: any } ? {} : CustomEvent<T>;
|
|
10
|
+
interface CustomEvent<T = any> extends Event {
|
|
11
|
+
readonly detail: T;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface CustomEventInit<T = any> extends EventInit {
|
|
15
|
+
detail?: T;
|
|
16
|
+
}
|
|
6
17
|
|
|
7
|
-
type
|
|
18
|
+
type _Event = typeof globalThis extends { onmessage: any } ? {} : Event;
|
|
8
19
|
interface Event {
|
|
9
20
|
readonly bubbles: boolean;
|
|
10
21
|
cancelBubble: boolean;
|
|
11
22
|
readonly cancelable: boolean;
|
|
12
23
|
readonly composed: boolean;
|
|
13
|
-
composedPath(): [EventTarget?];
|
|
14
24
|
readonly currentTarget: EventTarget | null;
|
|
15
25
|
readonly defaultPrevented: boolean;
|
|
16
26
|
readonly eventPhase: 0 | 2;
|
|
17
|
-
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
|
|
18
27
|
readonly isTrusted: boolean;
|
|
19
|
-
|
|
20
|
-
readonly returnValue: boolean;
|
|
28
|
+
returnValue: boolean;
|
|
21
29
|
readonly srcElement: EventTarget | null;
|
|
22
|
-
stopImmediatePropagation(): void;
|
|
23
|
-
stopPropagation(): void;
|
|
24
30
|
readonly target: EventTarget | null;
|
|
25
31
|
readonly timeStamp: number;
|
|
26
32
|
readonly type: string;
|
|
33
|
+
composedPath(): [EventTarget?];
|
|
34
|
+
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
|
|
35
|
+
preventDefault(): void;
|
|
36
|
+
stopImmediatePropagation(): void;
|
|
37
|
+
stopPropagation(): void;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
interface EventInit {
|
|
41
|
+
bubbles?: boolean;
|
|
42
|
+
cancelable?: boolean;
|
|
43
|
+
composed?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface EventListener {
|
|
47
|
+
(evt: Event): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface EventListenerObject {
|
|
51
|
+
handleEvent(object: Event): void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type _EventListenerOptions = typeof globalThis extends { onmessage: any } ? {} : EventListenerOptions;
|
|
55
|
+
interface EventListenerOptions {
|
|
56
|
+
capture?: boolean;
|
|
32
57
|
}
|
|
33
58
|
|
|
34
|
-
type
|
|
59
|
+
type _EventTarget = typeof globalThis extends { onmessage: any } ? {} : EventTarget;
|
|
35
60
|
interface EventTarget {
|
|
36
61
|
addEventListener(
|
|
37
62
|
type: string,
|
|
@@ -46,51 +71,24 @@ interface EventTarget {
|
|
|
46
71
|
): void;
|
|
47
72
|
}
|
|
48
73
|
|
|
49
|
-
interface EventInit {
|
|
50
|
-
bubbles?: boolean;
|
|
51
|
-
cancelable?: boolean;
|
|
52
|
-
composed?: boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
interface CustomEventInit<T = any> extends EventInit {
|
|
56
|
-
detail?: T;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
interface EventListenerOptions {
|
|
60
|
-
capture?: boolean;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface AddEventListenerOptions extends EventListenerOptions {
|
|
64
|
-
once?: boolean;
|
|
65
|
-
passive?: boolean;
|
|
66
|
-
signal?: AbortSignal;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
interface EventListener {
|
|
70
|
-
(evt: Event): void;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface EventListenerObject {
|
|
74
|
-
handleEvent(object: Event): void;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Merge conditional interfaces into global scope, and conditionally declare global constructors.
|
|
78
74
|
declare global {
|
|
79
|
-
interface
|
|
75
|
+
interface CustomEvent<T = any> extends _CustomEvent<T> {}
|
|
76
|
+
var CustomEvent: typeof globalThis extends { onmessage: any; CustomEvent: infer T } ? T
|
|
77
|
+
: {
|
|
78
|
+
prototype: CustomEvent;
|
|
79
|
+
new<T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
interface Event extends _Event {}
|
|
80
83
|
var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
|
|
81
84
|
: {
|
|
82
85
|
prototype: Event;
|
|
83
86
|
new(type: string, eventInitDict?: EventInit): Event;
|
|
84
87
|
};
|
|
85
88
|
|
|
86
|
-
interface
|
|
87
|
-
var CustomEvent: typeof globalThis extends { onmessage: any; CustomEvent: infer T } ? T
|
|
88
|
-
: {
|
|
89
|
-
prototype: CustomEvent;
|
|
90
|
-
new<T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
|
|
91
|
-
};
|
|
89
|
+
interface EventListenerOptions extends _EventListenerOptions {}
|
|
92
90
|
|
|
93
|
-
interface EventTarget extends
|
|
91
|
+
interface EventTarget extends _EventTarget {}
|
|
94
92
|
var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
|
|
95
93
|
: {
|
|
96
94
|
prototype: EventTarget;
|