@node-red/editor-client 2.0.4 → 2.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/locales/en-US/editor.json +37 -7
  2. package/locales/ko/editor.json +1 -1
  3. package/package.json +2 -2
  4. package/public/red/about +109 -0
  5. package/public/red/images/node-red-256.svg +1 -0
  6. package/public/red/keymap.json +13 -2
  7. package/public/red/red.js +6122 -3663
  8. package/public/red/red.min.js +1 -1
  9. package/public/red/style.min.css +2 -2
  10. package/public/red/tours/first-flow.js +80 -0
  11. package/public/red/tours/welcome.js +135 -0
  12. package/public/tours/first-flow.js +82 -0
  13. package/public/types/node/assert.d.ts +127 -0
  14. package/public/types/node/async_hooks.d.ts +229 -0
  15. package/public/types/node/buffer.d.ts +25 -1
  16. package/public/types/node/child_process.d.ts +514 -6
  17. package/public/types/node/cluster.d.ts +265 -0
  18. package/public/types/node/console.d.ts +136 -1
  19. package/public/types/node/crypto.d.ts +1189 -1
  20. package/public/types/node/dgram.d.ts +144 -1
  21. package/public/types/node/dns.d.ts +383 -10
  22. package/public/types/node/domain.d.ts +27 -1
  23. package/public/types/node/events.d.ts +81 -1
  24. package/public/types/node/fs.d.ts +2273 -1
  25. package/public/types/node/globals.d.ts +616 -1
  26. package/public/types/node/http.d.ts +489 -1
  27. package/public/types/node/http2.d.ts +961 -0
  28. package/public/types/node/https.d.ts +142 -0
  29. package/public/types/node/module.d.ts +55 -0
  30. package/public/types/node/net.d.ts +296 -1
  31. package/public/types/node/os.d.ts +242 -1
  32. package/public/types/node/path.d.ts +156 -1
  33. package/public/types/node/perf_hooks.d.ts +274 -0
  34. package/public/types/node/process.d.ts +412 -1
  35. package/public/types/node/querystring.d.ts +31 -1
  36. package/public/types/node/readline.d.ts +173 -0
  37. package/public/types/node/stream.d.ts +358 -0
  38. package/public/types/node/string_decoder.d.ts +10 -0
  39. package/public/types/node/timers.d.ts +19 -0
  40. package/public/types/node/tls.d.ts +783 -0
  41. package/public/types/node/trace_events.d.ts +64 -0
  42. package/public/types/node/tty.d.ts +69 -0
  43. package/public/types/node/url.d.ts +119 -1
  44. package/public/types/node/util.d.ts +210 -0
  45. package/public/types/node/v8.d.ts +190 -0
  46. package/public/types/node/vm.d.ts +155 -0
  47. package/public/types/node/wasi.d.ts +89 -0
  48. package/public/types/node/worker_threads.d.ts +241 -0
  49. package/public/types/node/zlib.d.ts +364 -0
  50. package/public/types/node-red/func.d.ts +1 -1
  51. package/public/types/node-red/util.d.ts +1 -1
  52. package/public/vendor/ace/worker-jsonata.js +1 -1
  53. package/public/vendor/monaco/dist/ThirdPartyNotices.txt +192 -192
  54. package/public/vendor/monaco/dist/css.worker.js +1 -1
  55. package/public/vendor/monaco/dist/editor.js +2 -2
  56. package/public/vendor/monaco/dist/editor.worker.js +1 -1
  57. package/public/vendor/monaco/dist/html.worker.js +1 -1
  58. package/public/vendor/monaco/dist/json.worker.js +1 -1
  59. package/public/vendor/monaco/dist/locale/cs.js +44 -10
  60. package/public/vendor/monaco/dist/locale/de.js +46 -12
  61. package/public/vendor/monaco/dist/locale/es.js +46 -12
  62. package/public/vendor/monaco/dist/locale/fr.js +43 -9
  63. package/public/vendor/monaco/dist/locale/it.js +45 -11
  64. package/public/vendor/monaco/dist/locale/ja.js +45 -11
  65. package/public/vendor/monaco/dist/locale/ko.js +44 -10
  66. package/public/vendor/monaco/dist/locale/pl.js +42 -8
  67. package/public/vendor/monaco/dist/locale/pt-br.js +49 -15
  68. package/public/vendor/monaco/dist/locale/qps-ploc.js +1445 -0
  69. package/public/vendor/monaco/dist/locale/ru.js +48 -14
  70. package/public/vendor/monaco/dist/locale/tr.js +49 -15
  71. package/public/vendor/monaco/dist/locale/zh-hans.js +48 -14
  72. package/public/vendor/monaco/dist/locale/zh-hant.js +45 -11
  73. package/public/vendor/monaco/dist/theme/monoindustrial.json +228 -0
  74. package/public/vendor/monaco/dist/theme/solarized-dark.json +1082 -0
  75. package/public/vendor/monaco/dist/ts.worker.js +2 -2
  76. package/public/vendor/vendor.js +4 -4
  77. package/templates/index.mst +5 -1
@@ -0,0 +1,155 @@
1
+
2
+ /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/node-red/nr-monaco-build */
3
+
4
+ declare module 'vm' {
5
+ interface Context extends NodeJS.Dict<any> { }
6
+ interface BaseOptions {
7
+ /**
8
+ * Specifies the filename used in stack traces produced by this script.
9
+ * Default: `''`.
10
+ */
11
+ filename?: string | undefined;
12
+ /**
13
+ * Specifies the line number offset that is displayed in stack traces produced by this script.
14
+ * Default: `0`.
15
+ */
16
+ lineOffset?: number | undefined;
17
+ /**
18
+ * Specifies the column number offset that is displayed in stack traces produced by this script.
19
+ * @default 0
20
+ */
21
+ columnOffset?: number | undefined;
22
+ }
23
+ interface ScriptOptions extends BaseOptions {
24
+ displayErrors?: boolean | undefined;
25
+ timeout?: number | undefined;
26
+ cachedData?: Buffer | undefined;
27
+ /** @deprecated in favor of `script.createCachedData()` */
28
+ produceCachedData?: boolean | undefined;
29
+ }
30
+ interface RunningScriptOptions extends BaseOptions {
31
+ /**
32
+ * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
33
+ * Default: `true`.
34
+ */
35
+ displayErrors?: boolean | undefined;
36
+ /**
37
+ * Specifies the number of milliseconds to execute code before terminating execution.
38
+ * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
39
+ */
40
+ timeout?: number | undefined;
41
+ /**
42
+ * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
43
+ * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
44
+ * If execution is terminated, an `Error` will be thrown.
45
+ * Default: `false`.
46
+ */
47
+ breakOnSigint?: boolean | undefined;
48
+ /**
49
+ * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
50
+ */
51
+ microtaskMode?: 'afterEvaluate' | undefined;
52
+ }
53
+ interface CompileFunctionOptions extends BaseOptions {
54
+ /**
55
+ * Provides an optional data with V8's code cache data for the supplied source.
56
+ */
57
+ cachedData?: Buffer | undefined;
58
+ /**
59
+ * Specifies whether to produce new cache data.
60
+ * Default: `false`,
61
+ */
62
+ produceCachedData?: boolean | undefined;
63
+ /**
64
+ * The sandbox/context in which the said function should be compiled in.
65
+ */
66
+ parsingContext?: Context | undefined;
67
+
68
+ /**
69
+ * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
70
+ */
71
+ contextExtensions?: Object[] | undefined;
72
+ }
73
+
74
+ interface CreateContextOptions {
75
+ /**
76
+ * Human-readable name of the newly created context.
77
+ * @default 'VM Context i' Where i is an ascending numerical index of the created context.
78
+ */
79
+ name?: string | undefined;
80
+ /**
81
+ * Corresponds to the newly created context for display purposes.
82
+ * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary),
83
+ * like the value of the `url.origin` property of a URL object.
84
+ * Most notably, this string should omit the trailing slash, as that denotes a path.
85
+ * @default ''
86
+ */
87
+ origin?: string | undefined;
88
+ codeGeneration?: {
89
+ /**
90
+ * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
91
+ * will throw an EvalError.
92
+ * @default true
93
+ */
94
+ strings?: boolean | undefined;
95
+ /**
96
+ * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
97
+ * @default true
98
+ */
99
+ wasm?: boolean | undefined;
100
+ } | undefined;
101
+ /**
102
+ * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
103
+ */
104
+ microtaskMode?: 'afterEvaluate' | undefined;
105
+ }
106
+
107
+ type MeasureMemoryMode = 'summary' | 'detailed';
108
+
109
+ interface MeasureMemoryOptions {
110
+ /**
111
+ * @default 'summary'
112
+ */
113
+ mode?: MeasureMemoryMode | undefined;
114
+ context?: Context | undefined;
115
+ }
116
+
117
+ interface MemoryMeasurement {
118
+ total: {
119
+ jsMemoryEstimate: number;
120
+ jsMemoryRange: [number, number];
121
+ };
122
+ }
123
+
124
+ class Script {
125
+ constructor(code: string, options?: ScriptOptions);
126
+ runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
127
+ runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
128
+ runInThisContext(options?: RunningScriptOptions): any;
129
+ createCachedData(): Buffer;
130
+ cachedDataRejected?: boolean | undefined;
131
+ }
132
+ function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
133
+ function isContext(sandbox: Context): boolean;
134
+ function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
135
+ function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
136
+ function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
137
+ function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function;
138
+
139
+ /**
140
+ * Measure the memory known to V8 and used by the current execution context or a specified context.
141
+ *
142
+ * The format of the object that the returned Promise may resolve with is
143
+ * specific to the V8 engine and may change from one version of V8 to the next.
144
+ *
145
+ * The returned result is different from the statistics returned by
146
+ * `v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measures
147
+ * the memory reachable by V8 from a specific context, while
148
+ * `v8.getHeapSpaceStatistics()` measures the memory used by an instance
149
+ * of V8 engine, which can switch among multiple contexts that reference
150
+ * objects in the heap of one engine.
151
+ *
152
+ * @experimental
153
+ */
154
+ function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
155
+ }
@@ -0,0 +1,89 @@
1
+
2
+ /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/node-red/nr-monaco-build */
3
+
4
+ declare module 'wasi' {
5
+ interface WASIOptions {
6
+ /**
7
+ * An array of strings that the WebAssembly application will
8
+ * see as command line arguments. The first argument is the virtual path to the
9
+ * WASI command itself.
10
+ */
11
+ args?: string[] | undefined;
12
+
13
+ /**
14
+ * An object similar to `process.env` that the WebAssembly
15
+ * application will see as its environment.
16
+ */
17
+ env?: object | undefined;
18
+
19
+ /**
20
+ * This object represents the WebAssembly application's
21
+ * sandbox directory structure. The string keys of `preopens` are treated as
22
+ * directories within the sandbox. The corresponding values in `preopens` are
23
+ * the real paths to those directories on the host machine.
24
+ */
25
+ preopens?: NodeJS.Dict<string> | undefined;
26
+
27
+ /**
28
+ * By default, WASI applications terminate the Node.js
29
+ * process via the `__wasi_proc_exit()` function. Setting this option to `true`
30
+ * causes `wasi.start()` to return the exit code rather than terminate the
31
+ * process.
32
+ * @default false
33
+ */
34
+ returnOnExit?: boolean | undefined;
35
+
36
+ /**
37
+ * The file descriptor used as standard input in the WebAssembly application.
38
+ * @default 0
39
+ */
40
+ stdin?: number | undefined;
41
+
42
+ /**
43
+ * The file descriptor used as standard output in the WebAssembly application.
44
+ * @default 1
45
+ */
46
+ stdout?: number | undefined;
47
+
48
+ /**
49
+ * The file descriptor used as standard error in the WebAssembly application.
50
+ * @default 2
51
+ */
52
+ stderr?: number | undefined;
53
+ }
54
+
55
+ class WASI {
56
+ constructor(options?: WASIOptions);
57
+ /**
58
+ *
59
+ * Attempt to begin execution of `instance` by invoking its `_start()` export.
60
+ * If `instance` does not contain a `_start()` export, then `start()` attempts to
61
+ * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
62
+ * is present on `instance`, then `start()` does nothing.
63
+ *
64
+ * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
65
+ * `memory`. If `instance` does not have a `memory` export an exception is thrown.
66
+ *
67
+ * If `start()` is called more than once, an exception is thrown.
68
+ */
69
+ start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
70
+
71
+ /**
72
+ * Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present.
73
+ * If `instance` contains a `_start()` export, then an exception is thrown.
74
+ *
75
+ * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
76
+ * `memory`. If `instance` does not have a `memory` export an exception is thrown.
77
+ *
78
+ * If `initialize()` is called more than once, an exception is thrown.
79
+ */
80
+ initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
81
+
82
+ /**
83
+ * Is an object that implements the WASI system call API. This object
84
+ * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
85
+ * [`WebAssembly.Instance`][].
86
+ */
87
+ readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
88
+ }
89
+ }
@@ -0,0 +1,241 @@
1
+
2
+ /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/node-red/nr-monaco-build */
3
+
4
+ declare module 'worker_threads' {
5
+ import { Context } from 'vm';
6
+ import EventEmitter = require('events');
7
+ import { Readable, Writable } from 'stream';
8
+ import { URL } from 'url';
9
+ import { FileHandle } from 'fs/promises';
10
+
11
+ const isMainThread: boolean;
12
+ const parentPort: null | MessagePort;
13
+ const resourceLimits: ResourceLimits;
14
+ const SHARE_ENV: unique symbol;
15
+ const threadId: number;
16
+ const workerData: any;
17
+
18
+ class MessageChannel {
19
+ readonly port1: MessagePort;
20
+ readonly port2: MessagePort;
21
+ }
22
+
23
+ type TransferListItem = ArrayBuffer | MessagePort | FileHandle;
24
+
25
+ class MessagePort extends EventEmitter {
26
+ close(): void;
27
+ postMessage(value: any, transferList?: ReadonlyArray<TransferListItem>): void;
28
+ ref(): void;
29
+ unref(): void;
30
+ start(): void;
31
+
32
+ addListener(event: "close", listener: () => void): this;
33
+ addListener(event: "message", listener: (value: any) => void): this;
34
+ addListener(event: "messageerror", listener: (error: Error) => void): this;
35
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
36
+
37
+ emit(event: "close"): boolean;
38
+ emit(event: "message", value: any): boolean;
39
+ emit(event: "messageerror", error: Error): boolean;
40
+ emit(event: string | symbol, ...args: any[]): boolean;
41
+
42
+ on(event: "close", listener: () => void): this;
43
+ on(event: "message", listener: (value: any) => void): this;
44
+ on(event: "messageerror", listener: (error: Error) => void): this;
45
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
46
+
47
+ once(event: "close", listener: () => void): this;
48
+ once(event: "message", listener: (value: any) => void): this;
49
+ once(event: "messageerror", listener: (error: Error) => void): this;
50
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
51
+
52
+ prependListener(event: "close", listener: () => void): this;
53
+ prependListener(event: "message", listener: (value: any) => void): this;
54
+ prependListener(event: "messageerror", listener: (error: Error) => void): this;
55
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
56
+
57
+ prependOnceListener(event: "close", listener: () => void): this;
58
+ prependOnceListener(event: "message", listener: (value: any) => void): this;
59
+ prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
60
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
61
+
62
+ removeListener(event: "close", listener: () => void): this;
63
+ removeListener(event: "message", listener: (value: any) => void): this;
64
+ removeListener(event: "messageerror", listener: (error: Error) => void): this;
65
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
66
+
67
+ off(event: "close", listener: () => void): this;
68
+ off(event: "message", listener: (value: any) => void): this;
69
+ off(event: "messageerror", listener: (error: Error) => void): this;
70
+ off(event: string | symbol, listener: (...args: any[]) => void): this;
71
+ }
72
+
73
+ interface WorkerOptions {
74
+ /**
75
+ * List of arguments which would be stringified and appended to
76
+ * `process.argv` in the worker. This is mostly similar to the `workerData`
77
+ * but the values will be available on the global `process.argv` as if they
78
+ * were passed as CLI options to the script.
79
+ */
80
+ argv?: any[] | undefined;
81
+ env?: NodeJS.Dict<string> | typeof SHARE_ENV | undefined;
82
+ eval?: boolean | undefined;
83
+ workerData?: any;
84
+ stdin?: boolean | undefined;
85
+ stdout?: boolean | undefined;
86
+ stderr?: boolean | undefined;
87
+ execArgv?: string[] | undefined;
88
+ resourceLimits?: ResourceLimits | undefined;
89
+ /**
90
+ * Additional data to send in the first worker message.
91
+ */
92
+ transferList?: TransferListItem[] | undefined;
93
+ trackUnmanagedFds?: boolean | undefined;
94
+ }
95
+
96
+ interface ResourceLimits {
97
+ /**
98
+ * The maximum size of a heap space for recently created objects.
99
+ */
100
+ maxYoungGenerationSizeMb?: number | undefined;
101
+ /**
102
+ * The maximum size of the main heap in MB.
103
+ */
104
+ maxOldGenerationSizeMb?: number | undefined;
105
+ /**
106
+ * The size of a pre-allocated memory range used for generated code.
107
+ */
108
+ codeRangeSizeMb?: number | undefined;
109
+ /**
110
+ * The default maximum stack size for the thread. Small values may lead to unusable Worker instances.
111
+ * @default 4
112
+ */
113
+ stackSizeMb?: number | undefined;
114
+ }
115
+
116
+ class Worker extends EventEmitter {
117
+ readonly stdin: Writable | null;
118
+ readonly stdout: Readable;
119
+ readonly stderr: Readable;
120
+ readonly threadId: number;
121
+ readonly resourceLimits?: ResourceLimits | undefined;
122
+
123
+ /**
124
+ * @param filename The path to the Worker’s main script or module.
125
+ * Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with ./ or ../,
126
+ * or a WHATWG URL object using file: protocol. If options.eval is true, this is a string containing JavaScript code rather than a path.
127
+ */
128
+ constructor(filename: string | URL, options?: WorkerOptions);
129
+
130
+ postMessage(value: any, transferList?: ReadonlyArray<TransferListItem>): void;
131
+ ref(): void;
132
+ unref(): void;
133
+ /**
134
+ * Stop all JavaScript execution in the worker thread as soon as possible.
135
+ * Returns a Promise for the exit code that is fulfilled when the `exit` event is emitted.
136
+ */
137
+ terminate(): Promise<number>;
138
+
139
+ /**
140
+ * Returns a readable stream for a V8 snapshot of the current state of the Worker.
141
+ * See [`v8.getHeapSnapshot()`][] for more details.
142
+ *
143
+ * If the Worker thread is no longer running, which may occur before the
144
+ * [`'exit'` event][] is emitted, the returned `Promise` will be rejected
145
+ * immediately with an [`ERR_WORKER_NOT_RUNNING`][] error
146
+ */
147
+ getHeapSnapshot(): Promise<Readable>;
148
+
149
+ addListener(event: "error", listener: (err: Error) => void): this;
150
+ addListener(event: "exit", listener: (exitCode: number) => void): this;
151
+ addListener(event: "message", listener: (value: any) => void): this;
152
+ addListener(event: "messageerror", listener: (error: Error) => void): this;
153
+ addListener(event: "online", listener: () => void): this;
154
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
155
+
156
+ emit(event: "error", err: Error): boolean;
157
+ emit(event: "exit", exitCode: number): boolean;
158
+ emit(event: "message", value: any): boolean;
159
+ emit(event: "messageerror", error: Error): boolean;
160
+ emit(event: "online"): boolean;
161
+ emit(event: string | symbol, ...args: any[]): boolean;
162
+
163
+ on(event: "error", listener: (err: Error) => void): this;
164
+ on(event: "exit", listener: (exitCode: number) => void): this;
165
+ on(event: "message", listener: (value: any) => void): this;
166
+ on(event: "messageerror", listener: (error: Error) => void): this;
167
+ on(event: "online", listener: () => void): this;
168
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
169
+
170
+ once(event: "error", listener: (err: Error) => void): this;
171
+ once(event: "exit", listener: (exitCode: number) => void): this;
172
+ once(event: "message", listener: (value: any) => void): this;
173
+ once(event: "messageerror", listener: (error: Error) => void): this;
174
+ once(event: "online", listener: () => void): this;
175
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
176
+
177
+ prependListener(event: "error", listener: (err: Error) => void): this;
178
+ prependListener(event: "exit", listener: (exitCode: number) => void): this;
179
+ prependListener(event: "message", listener: (value: any) => void): this;
180
+ prependListener(event: "messageerror", listener: (error: Error) => void): this;
181
+ prependListener(event: "online", listener: () => void): this;
182
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
183
+
184
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
185
+ prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
186
+ prependOnceListener(event: "message", listener: (value: any) => void): this;
187
+ prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
188
+ prependOnceListener(event: "online", listener: () => void): this;
189
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
190
+
191
+ removeListener(event: "error", listener: (err: Error) => void): this;
192
+ removeListener(event: "exit", listener: (exitCode: number) => void): this;
193
+ removeListener(event: "message", listener: (value: any) => void): this;
194
+ removeListener(event: "messageerror", listener: (error: Error) => void): this;
195
+ removeListener(event: "online", listener: () => void): this;
196
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
197
+
198
+ off(event: "error", listener: (err: Error) => void): this;
199
+ off(event: "exit", listener: (exitCode: number) => void): this;
200
+ off(event: "message", listener: (value: any) => void): this;
201
+ off(event: "messageerror", listener: (error: Error) => void): this;
202
+ off(event: "online", listener: () => void): this;
203
+ off(event: string | symbol, listener: (...args: any[]) => void): this;
204
+ }
205
+
206
+ /**
207
+ * Mark an object as not transferable.
208
+ * If `object` occurs in the transfer list of a `port.postMessage()` call, it will be ignored.
209
+ *
210
+ * In particular, this makes sense for objects that can be cloned, rather than transferred,
211
+ * and which are used by other objects on the sending side. For example, Node.js marks
212
+ * the `ArrayBuffer`s it uses for its Buffer pool with this.
213
+ *
214
+ * This operation cannot be undone.
215
+ */
216
+ function markAsUntransferable(object: object): void;
217
+
218
+ /**
219
+ * Transfer a `MessagePort` to a different `vm` Context. The original `port`
220
+ * object will be rendered unusable, and the returned `MessagePort` instance will
221
+ * take its place.
222
+ *
223
+ * The returned `MessagePort` will be an object in the target context, and will
224
+ * inherit from its global `Object` class. Objects passed to the
225
+ * `port.onmessage()` listener will also be created in the target context
226
+ * and inherit from its global `Object` class.
227
+ *
228
+ * However, the created `MessagePort` will no longer inherit from
229
+ * `EventEmitter`, and only `port.onmessage()` can be used to receive
230
+ * events using it.
231
+ */
232
+ function moveMessagePortToContext(port: MessagePort, context: Context): MessagePort;
233
+
234
+ /**
235
+ * Receive a single message from a given `MessagePort`. If no message is available,
236
+ * `undefined` is returned, otherwise an object with a single `message` property
237
+ * that contains the message payload, corresponding to the oldest message in the
238
+ * `MessagePort`’s queue.
239
+ */
240
+ function receiveMessageOnPort(port: MessagePort): { message: any } | undefined;
241
+ }