@node-red/editor-client 3.1.8 → 4.0.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 (149) hide show
  1. package/locales/de/editor.json +2 -0
  2. package/locales/en-US/editor.json +10 -1
  3. package/locales/fr/editor.json +8 -1
  4. package/locales/ja/editor.json +10 -3
  5. package/package.json +1 -1
  6. package/public/red/about +52 -0
  7. package/public/red/red.js +1433 -263
  8. package/public/red/red.min.js +3 -3
  9. package/public/red/style.min.css +2 -2
  10. package/public/red/tours/3.1/welcome.js +231 -0
  11. package/public/red/tours/images/nr4-auto-complete.png +0 -0
  12. package/public/red/tours/images/nr4-config-select.png +0 -0
  13. package/public/red/tours/images/nr4-multiplayer.png +0 -0
  14. package/public/red/tours/images/nr4-plugins.png +0 -0
  15. package/public/red/tours/images/nr4-sf-config.png +0 -0
  16. package/public/red/tours/images/nr4-timestamp-formatting.png +0 -0
  17. package/public/red/tours/welcome.js +105 -161
  18. package/public/types/node/assert/strict.d.ts +1 -1
  19. package/public/types/node/assert.d.ts +8 -9
  20. package/public/types/node/async_hooks.d.ts +9 -5
  21. package/public/types/node/buffer.d.ts +43 -18
  22. package/public/types/node/child_process.d.ts +8 -5
  23. package/public/types/node/cluster.d.ts +15 -19
  24. package/public/types/node/console.d.ts +2 -2
  25. package/public/types/node/crypto.d.ts +165 -70
  26. package/public/types/node/dgram.d.ts +4 -4
  27. package/public/types/node/diagnostics_channel.d.ts +8 -7
  28. package/public/types/node/dns/promises.d.ts +11 -9
  29. package/public/types/node/dns.d.ts +18 -13
  30. package/public/types/node/dom-events.d.ts +129 -0
  31. package/public/types/node/domain.d.ts +2 -2
  32. package/public/types/node/events.d.ts +49 -12
  33. package/public/types/node/fs/promises.d.ts +68 -24
  34. package/public/types/node/fs.d.ts +132 -59
  35. package/public/types/node/globals.d.ts +31 -17
  36. package/public/types/node/http.d.ts +138 -27
  37. package/public/types/node/http2.d.ts +38 -5
  38. package/public/types/node/https.d.ts +12 -3
  39. package/public/types/node/module.d.ts +1 -2
  40. package/public/types/node/net.d.ts +69 -28
  41. package/public/types/node/os.d.ts +16 -5
  42. package/public/types/node/path.d.ts +5 -5
  43. package/public/types/node/perf_hooks.d.ts +48 -9
  44. package/public/types/node/process.d.ts +18 -17
  45. package/public/types/node/querystring.d.ts +2 -2
  46. package/public/types/node/readline/promises.d.ts +146 -0
  47. package/public/types/node/readline.d.ts +141 -31
  48. package/public/types/node/stream/consumers.d.ts +2 -2
  49. package/public/types/node/stream/promises.d.ts +1 -1
  50. package/public/types/node/stream/web.d.ts +4 -66
  51. package/public/types/node/stream.d.ts +96 -118
  52. package/public/types/node/string_decoder.d.ts +2 -2
  53. package/public/types/node/test.d.ts +200 -16
  54. package/public/types/node/timers/promises.d.ts +1 -26
  55. package/public/types/node/timers.d.ts +2 -2
  56. package/public/types/node/tls.d.ts +21 -12
  57. package/public/types/node/trace_events.d.ts +12 -2
  58. package/public/types/node/ts4.8/assert/strict.d.ts +11 -0
  59. package/public/types/node/ts4.8/assert.d.ts +964 -0
  60. package/public/types/node/ts4.8/async_hooks.d.ts +504 -0
  61. package/public/types/node/ts4.8/buffer.d.ts +2262 -0
  62. package/public/types/node/ts4.8/child_process.d.ts +1372 -0
  63. package/public/types/node/ts4.8/cluster.d.ts +413 -0
  64. package/public/types/node/ts4.8/console.d.ts +415 -0
  65. package/public/types/node/ts4.8/crypto.d.ts +3967 -0
  66. package/public/types/node/ts4.8/dgram.d.ts +548 -0
  67. package/public/types/node/ts4.8/diagnostics_channel.d.ts +156 -0
  68. package/public/types/node/ts4.8/dns/promises.d.ts +373 -0
  69. package/public/types/node/ts4.8/dns.d.ts +662 -0
  70. package/public/types/node/ts4.8/dom-events.d.ts +129 -0
  71. package/public/types/node/ts4.8/domain.d.ts +173 -0
  72. package/public/types/node/ts4.8/events.d.ts +681 -0
  73. package/public/types/node/ts4.8/fs/promises.d.ts +1141 -0
  74. package/public/types/node/ts4.8/fs.d.ts +3875 -0
  75. package/public/types/node/ts4.8/globals.d.ts +297 -0
  76. package/public/types/node/ts4.8/http.d.ts +1617 -0
  77. package/public/types/node/ts4.8/http2.d.ts +2137 -0
  78. package/public/types/node/ts4.8/https.d.ts +544 -0
  79. package/public/types/node/ts4.8/module.d.ts +117 -0
  80. package/public/types/node/ts4.8/net.d.ts +872 -0
  81. package/public/types/node/ts4.8/os.d.ts +469 -0
  82. package/public/types/node/ts4.8/path.d.ts +194 -0
  83. package/public/types/node/ts4.8/perf_hooks.d.ts +628 -0
  84. package/public/types/node/ts4.8/process.d.ts +1485 -0
  85. package/public/types/node/ts4.8/querystring.d.ts +134 -0
  86. package/public/types/node/ts4.8/readline/promises.d.ts +146 -0
  87. package/public/types/node/ts4.8/readline.d.ts +656 -0
  88. package/public/types/node/ts4.8/stream/consumers.d.ts +15 -0
  89. package/public/types/node/ts4.8/stream/promises.d.ts +45 -0
  90. package/public/types/node/ts4.8/stream/web.d.ts +333 -0
  91. package/public/types/node/ts4.8/stream.d.ts +1343 -0
  92. package/public/types/node/ts4.8/string_decoder.d.ts +70 -0
  93. package/public/types/node/ts4.8/test.d.ts +377 -0
  94. package/public/types/node/ts4.8/timers/promises.d.ts +71 -0
  95. package/public/types/node/ts4.8/timers.d.ts +97 -0
  96. package/public/types/node/ts4.8/tls.d.ts +1031 -0
  97. package/public/types/node/ts4.8/trace_events.d.ts +174 -0
  98. package/public/types/node/ts4.8/tty.d.ts +209 -0
  99. package/public/types/node/ts4.8/url.d.ts +900 -0
  100. package/public/types/node/ts4.8/util.d.ts +1853 -0
  101. package/public/types/node/ts4.8/v8.d.ts +399 -0
  102. package/public/types/node/ts4.8/vm.d.ts +512 -0
  103. package/public/types/node/ts4.8/wasi.d.ts +161 -0
  104. package/public/types/node/ts4.8/worker_threads.d.ts +692 -0
  105. package/public/types/node/ts4.8/zlib.d.ts +520 -0
  106. package/public/types/node/tty.d.ts +5 -3
  107. package/public/types/node/url.d.ts +81 -39
  108. package/public/types/node/util.d.ts +269 -13
  109. package/public/types/node/v8.d.ts +22 -4
  110. package/public/types/node/vm.d.ts +7 -5
  111. package/public/types/node/wasi.d.ts +2 -2
  112. package/public/types/node/worker_threads.d.ts +51 -11
  113. package/public/types/node/zlib.d.ts +2 -2
  114. package/public/types/node-red/func.d.ts +26 -17
  115. package/public/vendor/ace/worker-jsonata.js +1 -1
  116. package/public/vendor/monaco/dist/{fa2cc0ab9f0bec2b3365.ttf → 0c718f5b7d2bce997c5f.ttf} +0 -0
  117. package/public/vendor/monaco/dist/css.worker.js +1 -1
  118. package/public/vendor/monaco/dist/css.worker.js.LICENSE.txt +1 -1
  119. package/public/vendor/monaco/dist/editor.js +1 -29
  120. package/public/vendor/monaco/dist/editor.js.LICENSE.txt +2 -2
  121. package/public/vendor/monaco/dist/editor.worker.js +1 -1
  122. package/public/vendor/monaco/dist/html.worker.js +1 -1
  123. package/public/vendor/monaco/dist/html.worker.js.LICENSE.txt +1 -1
  124. package/public/vendor/monaco/dist/json.worker.js +1 -1
  125. package/public/vendor/monaco/dist/json.worker.js.LICENSE.txt +1 -1
  126. package/public/vendor/monaco/dist/locale/cs.js +324 -106
  127. package/public/vendor/monaco/dist/locale/de.js +336 -118
  128. package/public/vendor/monaco/dist/locale/es.js +329 -111
  129. package/public/vendor/monaco/dist/locale/fr.js +334 -116
  130. package/public/vendor/monaco/dist/locale/it.js +327 -109
  131. package/public/vendor/monaco/dist/locale/ja.js +329 -111
  132. package/public/vendor/monaco/dist/locale/ko.js +330 -112
  133. package/public/vendor/monaco/dist/locale/pl.js +329 -111
  134. package/public/vendor/monaco/dist/locale/pt-br.js +329 -111
  135. package/public/vendor/monaco/dist/locale/qps-ploc.js +330 -112
  136. package/public/vendor/monaco/dist/locale/ru.js +331 -113
  137. package/public/vendor/monaco/dist/locale/tr.js +329 -111
  138. package/public/vendor/monaco/dist/locale/zh-hans.js +331 -113
  139. package/public/vendor/monaco/dist/locale/zh-hant.js +331 -113
  140. package/public/vendor/monaco/dist/ts.worker.js +2 -2
  141. package/public/vendor/vendor.js +1 -1
  142. package/public/vendor/monaco/dist/7064e66c3890a12c47b4.ttf +0 -0
  143. /package/public/red/tours/{images → 3.1/images}/context-menu.png +0 -0
  144. /package/public/red/tours/{images → 3.1/images}/global-env-vars.png +0 -0
  145. /package/public/red/tours/{images → 3.1/images}/hiding-flows.png +0 -0
  146. /package/public/red/tours/{images → 3.1/images}/locking-flows.png +0 -0
  147. /package/public/red/tours/{images → 3.1/images}/mermaid.png +0 -0
  148. /package/public/red/tours/{images → 3.1/images}/node-help.png +0 -0
  149. /package/public/red/tours/{images → 3.1/images}/tab-changes.png +0 -0
@@ -0,0 +1,70 @@
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
+ /**
5
+ * The `string_decoder` module provides an API for decoding `Buffer` objects into
6
+ * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16
7
+ * characters. It can be accessed using:
8
+ *
9
+ * ```js
10
+ * const { StringDecoder } = require('string_decoder');
11
+ * ```
12
+ *
13
+ * The following example shows the basic use of the `StringDecoder` class.
14
+ *
15
+ * ```js
16
+ * const { StringDecoder } = require('string_decoder');
17
+ * const decoder = new StringDecoder('utf8');
18
+ *
19
+ * const cent = Buffer.from([0xC2, 0xA2]);
20
+ * console.log(decoder.write(cent));
21
+ *
22
+ * const euro = Buffer.from([0xE2, 0x82, 0xAC]);
23
+ * console.log(decoder.write(euro));
24
+ * ```
25
+ *
26
+ * When a `Buffer` instance is written to the `StringDecoder` instance, an
27
+ * internal buffer is used to ensure that the decoded string does not contain
28
+ * any incomplete multibyte characters. These are held in the buffer until the
29
+ * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called.
30
+ *
31
+ * In the following example, the three UTF-8 encoded bytes of the European Euro
32
+ * symbol (`€`) are written over three separate operations:
33
+ *
34
+ * ```js
35
+ * const { StringDecoder } = require('string_decoder');
36
+ * const decoder = new StringDecoder('utf8');
37
+ *
38
+ * decoder.write(Buffer.from([0xE2]));
39
+ * decoder.write(Buffer.from([0x82]));
40
+ * console.log(decoder.end(Buffer.from([0xAC])));
41
+ * ```
42
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/string_decoder.js)
43
+ */
44
+ declare module 'string_decoder' {
45
+ class StringDecoder {
46
+ constructor(encoding?: BufferEncoding);
47
+ /**
48
+ * Returns a decoded string, ensuring that any incomplete multibyte characters at
49
+ * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the
50
+ * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`.
51
+ * @since v0.1.99
52
+ * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
53
+ */
54
+ write(buffer: Buffer): string;
55
+ /**
56
+ * Returns any remaining input stored in the internal buffer as a string. Bytes
57
+ * representing incomplete UTF-8 and UTF-16 characters will be replaced with
58
+ * substitution characters appropriate for the character encoding.
59
+ *
60
+ * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input.
61
+ * After `end()` is called, the `stringDecoder` object can be reused for new input.
62
+ * @since v0.9.3
63
+ * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode.
64
+ */
65
+ end(buffer?: Buffer): string;
66
+ }
67
+ }
68
+ declare module 'node:string_decoder' {
69
+ export * from 'string_decoder';
70
+ }
@@ -0,0 +1,377 @@
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
+ /**
5
+ * The `node:test` module provides a standalone testing module.
6
+ * @see [source](https://github.com/nodejs/node/blob/v18.8.0/lib/test.js)
7
+ */
8
+ declare module 'node:test' {
9
+ /**
10
+ * Programmatically start the test runner.
11
+ * @since v18.9.0
12
+ * @param options Configuration options for running tests.
13
+ * @returns A {@link TapStream} that emits events about the test execution.
14
+ */
15
+ function run(options?: RunOptions): TapStream;
16
+
17
+ /**
18
+ * The `test()` function is the value imported from the test module. Each invocation of this
19
+ * function results in the creation of a test point in the TAP output.
20
+ *
21
+ * The {@link TestContext} object passed to the fn argument can be used to perform actions
22
+ * related to the current test. Examples include skipping the test, adding additional TAP
23
+ * diagnostic information, or creating subtests.
24
+ *
25
+ * `test()` returns a {@link Promise} that resolves once the test completes. The return value
26
+ * can usually be discarded for top level tests. However, the return value from subtests should
27
+ * be used to prevent the parent test from finishing first and cancelling the subtest as shown
28
+ * in the following example.
29
+ *
30
+ * ```js
31
+ * test('top level test', async (t) => {
32
+ * // The setTimeout() in the following subtest would cause it to outlive its
33
+ * // parent test if 'await' is removed on the next line. Once the parent test
34
+ * // completes, it will cancel any outstanding subtests.
35
+ * await t.test('longer running subtest', async (t) => {
36
+ * return new Promise((resolve, reject) => {
37
+ * setTimeout(resolve, 1000);
38
+ * });
39
+ * });
40
+ * });
41
+ * ```
42
+ * @since v18.0.0
43
+ * @param name The name of the test, which is displayed when reporting test results.
44
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
45
+ * @param options Configuration options for the test
46
+ * @param fn The function under test. The first argument to this function is a
47
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
48
+ * passed as the second argument. Default: A no-op function.
49
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
50
+ */
51
+ function test(name?: string, fn?: TestFn): Promise<void>;
52
+ function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
53
+ function test(options?: TestOptions, fn?: TestFn): Promise<void>;
54
+ function test(fn?: TestFn): Promise<void>;
55
+
56
+ /**
57
+ * @since v18.6.0
58
+ * @param name The name of the suite, which is displayed when reporting suite results.
59
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
60
+ * @param options Configuration options for the suite
61
+ * @param fn The function under suite. Default: A no-op function.
62
+ */
63
+ function describe(name?: string, options?: TestOptions, fn?: SuiteFn): void;
64
+ function describe(name?: string, fn?: SuiteFn): void;
65
+ function describe(options?: TestOptions, fn?: SuiteFn): void;
66
+ function describe(fn?: SuiteFn): void;
67
+
68
+ /**
69
+ * @since v18.6.0
70
+ * @param name The name of the test, which is displayed when reporting test results.
71
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
72
+ * @param options Configuration options for the test
73
+ * @param fn The function under test. If the test uses callbacks, the callback function is
74
+ * passed as the second argument. Default: A no-op function.
75
+ */
76
+ function it(name?: string, options?: TestOptions, fn?: ItFn): void;
77
+ function it(name?: string, fn?: ItFn): void;
78
+ function it(options?: TestOptions, fn?: ItFn): void;
79
+ function it(fn?: ItFn): void;
80
+
81
+ /**
82
+ * The type of a function under test. The first argument to this function is a
83
+ * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
84
+ * the second argument.
85
+ */
86
+ type TestFn = (t: TestContext, done: (result?: any) => void) => any;
87
+
88
+ /**
89
+ * The type of a function under Suite.
90
+ * If the test uses callbacks, the callback function is passed as an argument
91
+ */
92
+ type SuiteFn = (done: (result?: any) => void) => void;
93
+
94
+ /**
95
+ * The type of a function under test.
96
+ * If the test uses callbacks, the callback function is passed as an argument
97
+ */
98
+ type ItFn = (done: (result?: any) => void) => any;
99
+
100
+ interface RunOptions {
101
+ /**
102
+ * @default false
103
+ */
104
+ concurrency?: number | boolean;
105
+
106
+ /**
107
+ * An array containing the list of files to run. If unspecified, the test runner execution model will be used.
108
+ */
109
+ files?: readonly string[];
110
+
111
+ /**
112
+ * Allows aborting an in-progress test.
113
+ * @default undefined
114
+ */
115
+ signal?: AbortSignal;
116
+
117
+ /**
118
+ * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
119
+ * value from their parent.
120
+ * @default Infinity
121
+ */
122
+ timeout?: number;
123
+ }
124
+
125
+ /**
126
+ * A successful call of the run() method will return a new TapStream object, streaming a TAP output.
127
+ * TapStream will emit events in the order of the tests' definitions.
128
+ * @since v18.9.0
129
+ */
130
+ interface TapStream extends NodeJS.ReadableStream {
131
+ addListener(event: 'test:diagnostic', listener: (message: string) => void): this;
132
+ addListener(event: 'test:fail', listener: (data: TestFail) => void): this;
133
+ addListener(event: 'test:pass', listener: (data: TestPass) => void): this;
134
+ addListener(event: string, listener: (...args: any[]) => void): this;
135
+ emit(event: 'test:diagnostic', message: string): boolean;
136
+ emit(event: 'test:fail', data: TestFail): boolean;
137
+ emit(event: 'test:pass', data: TestPass): boolean;
138
+ emit(event: string | symbol, ...args: any[]): boolean;
139
+ on(event: 'test:diagnostic', listener: (message: string) => void): this;
140
+ on(event: 'test:fail', listener: (data: TestFail) => void): this;
141
+ on(event: 'test:pass', listener: (data: TestPass) => void): this;
142
+ on(event: string, listener: (...args: any[]) => void): this;
143
+ once(event: 'test:diagnostic', listener: (message: string) => void): this;
144
+ once(event: 'test:fail', listener: (data: TestFail) => void): this;
145
+ once(event: 'test:pass', listener: (data: TestPass) => void): this;
146
+ once(event: string, listener: (...args: any[]) => void): this;
147
+ prependListener(event: 'test:diagnostic', listener: (message: string) => void): this;
148
+ prependListener(event: 'test:fail', listener: (data: TestFail) => void): this;
149
+ prependListener(event: 'test:pass', listener: (data: TestPass) => void): this;
150
+ prependListener(event: string, listener: (...args: any[]) => void): this;
151
+ prependOnceListener(event: 'test:diagnostic', listener: (message: string) => void): this;
152
+ prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this;
153
+ prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this;
154
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
155
+ }
156
+
157
+ interface TestFail {
158
+ /**
159
+ * The test duration.
160
+ */
161
+ duration: number;
162
+
163
+ /**
164
+ * The failure casing test to fail.
165
+ */
166
+ error: Error;
167
+
168
+ /**
169
+ * The test name.
170
+ */
171
+ name: string;
172
+
173
+ /**
174
+ * The ordinal number of the test.
175
+ */
176
+ testNumber: number;
177
+
178
+ /**
179
+ * Present if `context.todo` is called.
180
+ */
181
+ todo?: string;
182
+
183
+ /**
184
+ * Present if `context.skip` is called.
185
+ */
186
+ skip?: string;
187
+ }
188
+
189
+ interface TestPass {
190
+ /**
191
+ * The test duration.
192
+ */
193
+ duration: number;
194
+
195
+ /**
196
+ * The test name.
197
+ */
198
+ name: string;
199
+
200
+ /**
201
+ * The ordinal number of the test.
202
+ */
203
+ testNumber: number;
204
+
205
+ /**
206
+ * Present if `context.todo` is called.
207
+ */
208
+ todo?: string;
209
+
210
+ /**
211
+ * Present if `context.skip` is called.
212
+ */
213
+ skip?: string;
214
+ }
215
+
216
+ /**
217
+ * An instance of `TestContext` is passed to each test function in order to interact with the
218
+ * test runner. However, the `TestContext` constructor is not exposed as part of the API.
219
+ * @since v18.0.0
220
+ */
221
+ interface TestContext {
222
+ /**
223
+ * This function is used to write TAP diagnostics to the output. Any diagnostic information is
224
+ * included at the end of the test's results. This function does not return a value.
225
+ * @param message Message to be displayed as a TAP diagnostic.
226
+ * @since v18.0.0
227
+ */
228
+ diagnostic(message: string): void;
229
+
230
+ /**
231
+ * If `shouldRunOnlyTests` is truthy, the test context will only run tests that have the `only`
232
+ * option set. Otherwise, all tests are run. If Node.js was not started with the `--test-only`
233
+ * command-line option, this function is a no-op.
234
+ * @param shouldRunOnlyTests Whether or not to run `only` tests.
235
+ * @since v18.0.0
236
+ */
237
+ runOnly(shouldRunOnlyTests: boolean): void;
238
+
239
+ /**
240
+ * This function causes the test's output to indicate the test as skipped. If `message` is
241
+ * provided, it is included in the TAP output. Calling `skip()` does not terminate execution of
242
+ * the test function. This function does not return a value.
243
+ * @param message Optional skip message to be displayed in TAP output.
244
+ * @since v18.0.0
245
+ */
246
+ skip(message?: string): void;
247
+
248
+ /**
249
+ * This function adds a `TODO` directive to the test's output. If `message` is provided, it is
250
+ * included in the TAP output. Calling `todo()` does not terminate execution of the test
251
+ * function. This function does not return a value.
252
+ * @param message Optional `TODO` message to be displayed in TAP output.
253
+ * @since v18.0.0
254
+ */
255
+ todo(message?: string): void;
256
+
257
+ /**
258
+ * This function is used to create subtests under the current test. This function behaves in
259
+ * the same fashion as the top level {@link test} function.
260
+ * @since v18.0.0
261
+ * @param name The name of the test, which is displayed when reporting test results.
262
+ * Default: The `name` property of fn, or `'<anonymous>'` if `fn` does not have a name.
263
+ * @param options Configuration options for the test
264
+ * @param fn The function under test. This first argument to this function is a
265
+ * {@link TestContext} object. If the test uses callbacks, the callback function is
266
+ * passed as the second argument. Default: A no-op function.
267
+ * @returns A {@link Promise} resolved with `undefined` once the test completes.
268
+ */
269
+ test: typeof test;
270
+ }
271
+
272
+ interface TestOptions {
273
+ /**
274
+ * The number of tests that can be run at the same time. If unspecified, subtests inherit this
275
+ * value from their parent.
276
+ * @default 1
277
+ */
278
+ concurrency?: number;
279
+
280
+ /**
281
+ * If truthy, and the test context is configured to run `only` tests, then this test will be
282
+ * run. Otherwise, the test is skipped.
283
+ * @default false
284
+ */
285
+ only?: boolean;
286
+
287
+ /**
288
+ * Allows aborting an in-progress test.
289
+ * @since v18.8.0
290
+ */
291
+ signal?: AbortSignal;
292
+
293
+ /**
294
+ * If truthy, the test is skipped. If a string is provided, that string is displayed in the
295
+ * test results as the reason for skipping the test.
296
+ * @default false
297
+ */
298
+ skip?: boolean | string;
299
+
300
+ /**
301
+ * A number of milliseconds the test will fail after. If unspecified, subtests inherit this
302
+ * value from their parent.
303
+ * @default Infinity
304
+ * @since v18.7.0
305
+ */
306
+ timeout?: number;
307
+
308
+ /**
309
+ * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in
310
+ * the test results as the reason why the test is `TODO`.
311
+ * @default false
312
+ */
313
+ todo?: boolean | string;
314
+ }
315
+
316
+ /**
317
+ * This function is used to create a hook running before running a suite.
318
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
319
+ * the second argument. Default: A no-op function.
320
+ * @param options Configuration options for the hook.
321
+ * @since v18.8.0
322
+ */
323
+ function before(fn?: HookFn, options?: HookOptions): void;
324
+
325
+ /**
326
+ * This function is used to create a hook running after running a suite.
327
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
328
+ * the second argument. Default: A no-op function.
329
+ * @param options Configuration options for the hook.
330
+ * @since v18.8.0
331
+ */
332
+ function after(fn?: HookFn, options?: HookOptions): void;
333
+
334
+ /**
335
+ * This function is used to create a hook running before each subtest of the current suite.
336
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
337
+ * the second argument. Default: A no-op function.
338
+ * @param options Configuration options for the hook.
339
+ * @since v18.8.0
340
+ */
341
+ function beforeEach(fn?: HookFn, options?: HookOptions): void;
342
+
343
+ /**
344
+ * This function is used to create a hook running after each subtest of the current test.
345
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
346
+ * the second argument. Default: A no-op function.
347
+ * @param options Configuration options for the hook.
348
+ * @since v18.8.0
349
+ */
350
+ function afterEach(fn?: HookFn, options?: HookOptions): void;
351
+
352
+ /**
353
+ * The hook function. If the hook uses callbacks, the callback function is passed as the
354
+ * second argument.
355
+ */
356
+ type HookFn = (done: (result?: any) => void) => any;
357
+
358
+ /**
359
+ * Configuration options for hooks.
360
+ * @since v18.8.0
361
+ */
362
+ interface HookOptions {
363
+ /**
364
+ * Allows aborting an in-progress hook.
365
+ */
366
+ signal?: AbortSignal;
367
+
368
+ /**
369
+ * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
370
+ * value from their parent.
371
+ * @default Infinity
372
+ */
373
+ timeout?: number;
374
+ }
375
+
376
+ export { test as default, run, test, describe, it, before, after, beforeEach, afterEach };
377
+ }
@@ -0,0 +1,71 @@
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
+ /**
5
+ * The `timers/promises` API provides an alternative set of timer functions
6
+ * that return `Promise` objects. The API is accessible via`require('timers/promises')`.
7
+ *
8
+ * ```js
9
+ * import {
10
+ * setTimeout,
11
+ * setImmediate,
12
+ * setInterval,
13
+ * } from 'timers/promises';
14
+ * ```
15
+ * @since v15.0.0
16
+ */
17
+ declare module 'timers/promises' {
18
+ import { TimerOptions } from 'node:timers';
19
+ /**
20
+ * ```js
21
+ * import {
22
+ * setTimeout,
23
+ * } from 'timers/promises';
24
+ *
25
+ * const res = await setTimeout(100, 'result');
26
+ *
27
+ * console.log(res); // Prints 'result'
28
+ * ```
29
+ * @since v15.0.0
30
+ * @param [delay=1] The number of milliseconds to wait before fulfilling the promise.
31
+ * @param value A value with which the promise is fulfilled.
32
+ */
33
+ function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
34
+ /**
35
+ * ```js
36
+ * import {
37
+ * setImmediate,
38
+ * } from 'timers/promises';
39
+ *
40
+ * const res = await setImmediate('result');
41
+ *
42
+ * console.log(res); // Prints 'result'
43
+ * ```
44
+ * @since v15.0.0
45
+ * @param value A value with which the promise is fulfilled.
46
+ */
47
+ function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
48
+ /**
49
+ * Returns an async iterator that generates values in an interval of `delay` ms.
50
+ *
51
+ * ```js
52
+ * import {
53
+ * setInterval,
54
+ * } from 'timers/promises';
55
+ *
56
+ * const interval = 100;
57
+ * for await (const startTime of setInterval(interval, Date.now())) {
58
+ * const now = Date.now();
59
+ * console.log(now);
60
+ * if ((now - startTime) > 1000)
61
+ * break;
62
+ * }
63
+ * console.log(Date.now());
64
+ * ```
65
+ * @since v15.9.0
66
+ */
67
+ function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): AsyncIterable<T>;
68
+ }
69
+ declare module 'node:timers/promises' {
70
+ export * from 'timers/promises';
71
+ }
@@ -0,0 +1,97 @@
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
+ /**
5
+ * The `timer` module exposes a global API for scheduling functions to
6
+ * be called at some future period of time. Because the timer functions are
7
+ * globals, there is no need to call `require('timers')` to use the API.
8
+ *
9
+ * The timer functions within Node.js implement a similar API as the timers API
10
+ * provided by Web Browsers but use a different internal implementation that is
11
+ * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
12
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/timers.js)
13
+ */
14
+ declare module 'timers' {
15
+ import { Abortable } from 'node:events';
16
+ import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises';
17
+ interface TimerOptions extends Abortable {
18
+ /**
19
+ * Set to `false` to indicate that the scheduled `Timeout`
20
+ * should not require the Node.js event loop to remain active.
21
+ * @default true
22
+ */
23
+ ref?: boolean | undefined;
24
+ }
25
+ let setTimeout: typeof global.setTimeout;
26
+ let clearTimeout: typeof global.clearTimeout;
27
+ let setInterval: typeof global.setInterval;
28
+ let clearInterval: typeof global.clearInterval;
29
+ let setImmediate: typeof global.setImmediate;
30
+ let clearImmediate: typeof global.clearImmediate;
31
+ global {
32
+ namespace NodeJS {
33
+ // compatibility with older typings
34
+ interface Timer extends RefCounted {
35
+ hasRef(): boolean;
36
+ refresh(): this;
37
+ [Symbol.toPrimitive](): number;
38
+ }
39
+ interface Immediate extends RefCounted {
40
+ /**
41
+ * If true, the `Immediate` object will keep the Node.js event loop active.
42
+ * @since v11.0.0
43
+ */
44
+ hasRef(): boolean;
45
+ _onImmediate: Function; // to distinguish it from the Timeout class
46
+ }
47
+ interface Timeout extends Timer {
48
+ /**
49
+ * If true, the `Timeout` object will keep the Node.js event loop active.
50
+ * @since v11.0.0
51
+ */
52
+ hasRef(): boolean;
53
+ /**
54
+ * Sets the timer's start time to the current time, and reschedules the timer to
55
+ * call its callback at the previously specified duration adjusted to the current
56
+ * time. This is useful for refreshing a timer without allocating a new
57
+ * JavaScript object.
58
+ *
59
+ * Using this on a timer that has already called its callback will reactivate the
60
+ * timer.
61
+ * @since v10.2.0
62
+ * @return a reference to `timeout`
63
+ */
64
+ refresh(): this;
65
+ [Symbol.toPrimitive](): number;
66
+ }
67
+ }
68
+ function setTimeout<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout;
69
+ // util.promisify no rest args compability
70
+ // tslint:disable-next-line void-return
71
+ function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout;
72
+ namespace setTimeout {
73
+ const __promisify__: typeof setTimeoutPromise;
74
+ }
75
+ function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void;
76
+ function setInterval<TArgs extends any[]>(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer;
77
+ // util.promisify no rest args compability
78
+ // tslint:disable-next-line void-return
79
+ function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer;
80
+ namespace setInterval {
81
+ const __promisify__: typeof setIntervalPromise;
82
+ }
83
+ function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void;
84
+ function setImmediate<TArgs extends any[]>(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate;
85
+ // util.promisify no rest args compability
86
+ // tslint:disable-next-line void-return
87
+ function setImmediate(callback: (args: void) => void): NodeJS.Immediate;
88
+ namespace setImmediate {
89
+ const __promisify__: typeof setImmediatePromise;
90
+ }
91
+ function clearImmediate(immediateId: NodeJS.Immediate | undefined): void;
92
+ function queueMicrotask(callback: () => void): void;
93
+ }
94
+ }
95
+ declare module 'node:timers' {
96
+ export * from 'timers';
97
+ }