@node-red/editor-client 4.0.0-beta.1 → 4.0.0-beta.3

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 (143) hide show
  1. package/locales/de/editor.json +2 -0
  2. package/locales/en-US/editor.json +9 -1
  3. package/locales/fr/editor.json +17 -3
  4. package/locales/ja/editor.json +18 -4
  5. package/package.json +1 -1
  6. package/public/red/about +70 -0
  7. package/public/red/red.js +1602 -425
  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 +8 -8
  11. package/public/red/tours/images/nr4-background-deploy.png +0 -0
  12. package/public/red/tours/images/nr4-config-select.png +0 -0
  13. package/public/red/tours/images/nr4-diff-update.png +0 -0
  14. package/public/red/tours/images/nr4-multiplayer-location.png +0 -0
  15. package/public/red/tours/images/nr4-multiplayer.png +0 -0
  16. package/public/red/tours/images/nr4-plugins.png +0 -0
  17. package/public/red/tours/welcome.js +166 -11
  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/types/node-red/util.d.ts +1 -1
  116. package/public/vendor/ace/worker-jsonata.js +1 -1
  117. package/public/vendor/monaco/dist/{fa2cc0ab9f0bec2b3365.ttf → 0c718f5b7d2bce997c5f.ttf} +0 -0
  118. package/public/vendor/monaco/dist/css.worker.js +1 -1
  119. package/public/vendor/monaco/dist/css.worker.js.LICENSE.txt +1 -1
  120. package/public/vendor/monaco/dist/editor.js +1 -29
  121. package/public/vendor/monaco/dist/editor.js.LICENSE.txt +2 -2
  122. package/public/vendor/monaco/dist/editor.worker.js +1 -1
  123. package/public/vendor/monaco/dist/html.worker.js +1 -1
  124. package/public/vendor/monaco/dist/html.worker.js.LICENSE.txt +1 -1
  125. package/public/vendor/monaco/dist/json.worker.js +1 -1
  126. package/public/vendor/monaco/dist/json.worker.js.LICENSE.txt +1 -1
  127. package/public/vendor/monaco/dist/locale/cs.js +324 -106
  128. package/public/vendor/monaco/dist/locale/de.js +336 -118
  129. package/public/vendor/monaco/dist/locale/es.js +329 -111
  130. package/public/vendor/monaco/dist/locale/fr.js +334 -116
  131. package/public/vendor/monaco/dist/locale/it.js +327 -109
  132. package/public/vendor/monaco/dist/locale/ja.js +329 -111
  133. package/public/vendor/monaco/dist/locale/ko.js +330 -112
  134. package/public/vendor/monaco/dist/locale/pl.js +329 -111
  135. package/public/vendor/monaco/dist/locale/pt-br.js +329 -111
  136. package/public/vendor/monaco/dist/locale/qps-ploc.js +330 -112
  137. package/public/vendor/monaco/dist/locale/ru.js +331 -113
  138. package/public/vendor/monaco/dist/locale/tr.js +329 -111
  139. package/public/vendor/monaco/dist/locale/zh-hans.js +331 -113
  140. package/public/vendor/monaco/dist/locale/zh-hant.js +331 -113
  141. package/public/vendor/monaco/dist/ts.worker.js +2 -2
  142. package/public/vendor/vendor.js +1 -1
  143. package/public/vendor/monaco/dist/7064e66c3890a12c47b4.ttf +0 -0
@@ -1,5 +1,5 @@
1
1
 
2
- /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/Steve-Mcl/monaco-editor-esm-i18n */
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
3
 
4
4
  /**
5
5
  * The `fs/promises` API provides asynchronous file system methods that return
@@ -14,6 +14,7 @@
14
14
  declare module 'fs/promises' {
15
15
  import { Abortable } from 'node:events';
16
16
  import { Stream } from 'node:stream';
17
+ import { ReadableStream } from 'node:stream/web';
17
18
  import {
18
19
  BigIntStats,
19
20
  BufferEncodingOption,
@@ -33,11 +34,14 @@ declare module 'fs/promises' {
33
34
  RmOptions,
34
35
  StatOptions,
35
36
  Stats,
37
+ TimeLike,
36
38
  WatchEventType,
37
39
  WatchOptions,
38
40
  WriteStream,
39
41
  WriteVResult,
40
42
  } from 'node:fs';
43
+ import { Interface as ReadlineInterface } from 'node:readline';
44
+
41
45
  interface FileChangeInfo<T extends string | Buffer> {
42
46
  eventType: WatchEventType;
43
47
  filename: T;
@@ -46,11 +50,11 @@ declare module 'fs/promises' {
46
50
  mode?: Mode | undefined;
47
51
  flag?: OpenMode | undefined;
48
52
  }
49
- interface FileReadResult<T extends ArrayBufferView> {
53
+ interface FileReadResult<T extends NodeJS.ArrayBufferView> {
50
54
  bytesRead: number;
51
55
  buffer: T;
52
56
  }
53
- interface FileReadOptions<T extends ArrayBufferView = Buffer> {
57
+ interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
54
58
  /**
55
59
  * @default `Buffer.alloc(0xffff)`
56
60
  */
@@ -167,9 +171,9 @@ declare module 'fs/promises' {
167
171
  /**
168
172
  * `options` may also include a `start` option to allow writing data at some
169
173
  * position past the beginning of the file, allowed values are in the
170
- * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than replacing
171
- * it may require the `flags` `open` option to be set to `r+` rather than the
172
- * default `r`. The `encoding` can be any one of those accepted by `Buffer`.
174
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
175
+ * replacing it may require the `flags` `open` option to be set to `r+` rather than
176
+ * the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
173
177
  *
174
178
  * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
175
179
  * then the file descriptor won't be closed, even if there's an error.
@@ -211,8 +215,31 @@ declare module 'fs/promises' {
211
215
  * integer, the current file position will remain unchanged.
212
216
  * @return Fulfills upon success with an object with two properties:
213
217
  */
214
- read<T extends ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
215
- read<T extends ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
218
+ read<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise<FileReadResult<T>>;
219
+ read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
220
+ /**
221
+ * Returns a `ReadableStream` that may be used to read the files data.
222
+ *
223
+ * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed
224
+ * or closing.
225
+ *
226
+ * ```js
227
+ * import { open } from 'node:fs/promises';
228
+ *
229
+ * const file = await open('./some/file/to/read');
230
+ *
231
+ * for await (const chunk of file.readableWebStream())
232
+ * console.log(chunk);
233
+ *
234
+ * await file.close();
235
+ * ```
236
+ *
237
+ * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method.
238
+ *
239
+ * @since v17.0.0
240
+ * @experimental
241
+ */
242
+ readableWebStream(): ReadableStream;
216
243
  /**
217
244
  * Asynchronously reads the entire contents of a file.
218
245
  *
@@ -261,6 +288,23 @@ declare module 'fs/promises' {
261
288
  | BufferEncoding
262
289
  | null
263
290
  ): Promise<string | Buffer>;
291
+ /**
292
+ * Convenience method to create a `readline` interface and stream over the file. For example:
293
+ *
294
+ * ```js
295
+ * import { open } from 'node:fs/promises';
296
+ *
297
+ * const file = await open('./some/file/to/read');
298
+ *
299
+ * for await (const line of file.readLines()) {
300
+ * console.log(line);
301
+ * }
302
+ * ```
303
+ *
304
+ * @since v18.11.0
305
+ * @param options See `filehandle.createReadStream()` for the options.
306
+ */
307
+ readLines(options?: CreateReadStreamOptions): ReadlineInterface;
264
308
  /**
265
309
  * @since v10.0.0
266
310
  * @return Fulfills with an {fs.Stats} for the file.
@@ -309,13 +353,12 @@ declare module 'fs/promises' {
309
353
  * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success.
310
354
  * @since v10.0.0
311
355
  */
312
- utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
356
+ utimes(atime: TimeLike, mtime: TimeLike): Promise<void>;
313
357
  /**
314
358
  * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
315
359
  * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
316
- * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object, or an
317
- * object with an own `toString` function
318
- * property. The promise is resolved with no arguments upon success.
360
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
361
+ * The promise is resolved with no arguments upon success.
319
362
  *
320
363
  * If `options` is a string, then it specifies the `encoding`.
321
364
  *
@@ -333,20 +376,18 @@ declare module 'fs/promises' {
333
376
  /**
334
377
  * Write `buffer` to the file.
335
378
  *
336
- * If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
337
- *
338
379
  * The promise is resolved with an object containing two properties:
339
380
  *
340
381
  * It is unsafe to use `filehandle.write()` multiple times on the same file
341
382
  * without waiting for the promise to be resolved (or rejected). For this
342
- * scenario, use `fs.createWriteStream()`.
383
+ * scenario, use `filehandle.createWriteStream()`.
343
384
  *
344
385
  * On Linux, positional writes do not work when the file is opened in append mode.
345
386
  * The kernel ignores the position argument and always appends the data to
346
387
  * the end of the file.
347
388
  * @since v10.0.0
348
389
  * @param [offset=0] The start position from within `buffer` where the data to write begins.
349
- * @param [length=buffer.byteLength] The number of bytes from `buffer` to write.
390
+ * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write.
350
391
  * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position.
351
392
  * See the POSIX pwrite(2) documentation for more detail.
352
393
  */
@@ -411,12 +452,13 @@ declare module 'fs/promises' {
411
452
  }
412
453
 
413
454
  const constants: typeof fsConstants;
455
+
414
456
  /**
415
457
  * Tests a user's permissions for the file or directory specified by `path`.
416
458
  * The `mode` argument is an optional integer that specifies the accessibility
417
- * checks to be performed. Check `File access constants` for possible values
418
- * of `mode`. It is possible to create a mask consisting of the bitwise OR of
419
- * two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
459
+ * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
460
+ * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
461
+ * possible values of `mode`.
420
462
  *
421
463
  * If the accessibility check is successful, the promise is resolved with no
422
464
  * value. If any of the accessibility checks fail, the promise is rejected
@@ -747,7 +789,7 @@ declare module 'fs/promises' {
747
789
  * @since v14.5.0, v12.19.0
748
790
  * @return Fulfills with `undefined` upon success.
749
791
  */
750
- function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
792
+ function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
751
793
  /**
752
794
  * Changes the ownership of a file.
753
795
  * @since v10.0.0
@@ -765,7 +807,7 @@ declare module 'fs/promises' {
765
807
  * @since v10.0.0
766
808
  * @return Fulfills with `undefined` upon success.
767
809
  */
768
- function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
810
+ function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise<void>;
769
811
  /**
770
812
  * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function.
771
813
  *
@@ -836,7 +878,9 @@ declare module 'fs/promises' {
836
878
  */
837
879
  function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
838
880
  /**
839
- * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `Buffer`, or, an object with an own (not inherited)`toString` function property.
881
+ * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
882
+ * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
883
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
840
884
  *
841
885
  * The `encoding` option is ignored if `data` is a buffer.
842
886
  *
@@ -851,7 +895,7 @@ declare module 'fs/promises' {
851
895
  *
852
896
  * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience
853
897
  * method that performs multiple `write` calls internally to write the buffer
854
- * passed to it. For performance sensitive code consider using `fs.createWriteStream()`.
898
+ * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`.
855
899
  *
856
900
  * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`.
857
901
  * Cancelation is "best effort", and some amount of data is likely still
@@ -1049,7 +1093,7 @@ declare module 'fs/promises' {
1049
1093
  * disappears in the directory.
1050
1094
  *
1051
1095
  * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`.
1052
- * @since v15.9.0
1096
+ * @since v15.9.0, v14.18.0
1053
1097
  * @return of objects with the properties:
1054
1098
  */
1055
1099
  function watch(
@@ -1,5 +1,5 @@
1
1
 
2
- /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/Steve-Mcl/monaco-editor-esm-i18n */
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
3
 
4
4
  /**
5
5
  * The `fs` module enables interacting with the file system in a
@@ -19,7 +19,7 @@
19
19
  *
20
20
  * All file system operations have synchronous, callback, and promise-based
21
21
  * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).
22
- * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/fs.js)
22
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/fs.js)
23
23
  */
24
24
  declare module 'fs' {
25
25
  import * as stream from 'node:stream';
@@ -271,18 +271,22 @@ declare module 'fs' {
271
271
  */
272
272
  export interface StatWatcher extends EventEmitter {
273
273
  /**
274
+ * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have
275
+ * no effect.
276
+ *
277
+ * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally
278
+ * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been
279
+ * called previously.
274
280
  * @since v14.3.0, v12.20.0
275
- * When called, requests that the Node.js event loop not exit so long as the `fs.StatWatcher` is active.
276
- * Calling `watcher.ref()` multiple times will have no effect.
277
- * By default, all `fs.StatWatcher`` objects are "ref'ed", making it normally unnecessary to call `watcher.ref()`
278
- * unless `watcher.unref()` had been called previously.
279
281
  */
280
282
  ref(): this;
281
283
  /**
284
+ * When called, the active `fs.StatWatcher` object will not require the Node.js
285
+ * event loop to remain active. If there is no other activity keeping the
286
+ * event loop running, the process may exit before the `fs.StatWatcher` object's
287
+ * callback is invoked. Calling `watcher.unref()` multiple times will have
288
+ * no effect.
282
289
  * @since v14.3.0, v12.20.0
283
- * When called, the active `fs.StatWatcher`` object will not require the Node.js event loop to remain active.
284
- * If there is no other activity keeping the event loop running, the process may exit before the `fs.StatWatcher`` object's callback is invoked.
285
- * `Calling watcher.unref()` multiple times will have no effect.
286
290
  */
287
291
  unref(): this;
288
292
  }
@@ -1017,8 +1021,10 @@ declare module 'fs' {
1017
1021
  function __promisify__(fd: number, options?: StatOptions): Promise<Stats | BigIntStats>;
1018
1022
  }
1019
1023
  /**
1020
- * Synchronous fstat(2) - Get file status.
1021
- * @param fd A file descriptor.
1024
+ * Retrieves the `fs.Stats` for the file descriptor.
1025
+ *
1026
+ * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail.
1027
+ * @since v0.1.95
1022
1028
  */
1023
1029
  export function fstatSync(
1024
1030
  fd: number,
@@ -1033,7 +1039,6 @@ declare module 'fs' {
1033
1039
  }
1034
1040
  ): BigIntStats;
1035
1041
  export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
1036
-
1037
1042
  /**
1038
1043
  * Retrieves the `fs.Stats` for the symbolic link referred to by the path.
1039
1044
  * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic
@@ -1121,15 +1126,15 @@ declare module 'fs' {
1121
1126
  * ```js
1122
1127
  * import { symlink } from 'fs';
1123
1128
  *
1124
- * symlink('./mew', './example/mewtwo', callback);
1129
+ * symlink('./mew', './mewtwo', callback);
1125
1130
  * ```
1126
1131
  *
1127
- * The above example creates a symbolic link `mewtwo` in the `example` which points
1128
- * to `mew` in the same directory:
1132
+ * The above example creates a symbolic link `mewtwo` which points to `mew` in the
1133
+ * same directory:
1129
1134
  *
1130
1135
  * ```bash
1131
- * $ tree example/
1132
- * example/
1136
+ * $ tree .
1137
+ * .
1133
1138
  * ├── mew
1134
1139
  * └── mewtwo -> ./mew
1135
1140
  * ```
@@ -1393,7 +1398,7 @@ declare module 'fs' {
1393
1398
  * Use `fs.rm(path, { recursive: true, force: true })` instead.
1394
1399
  *
1395
1400
  * If `true`, perform a recursive directory removal. In
1396
- * recursive mode soperations are retried on failure.
1401
+ * recursive mode, operations are retried on failure.
1397
1402
  * @default false
1398
1403
  */
1399
1404
  recursive?: boolean | undefined;
@@ -1999,8 +2004,8 @@ declare module 'fs' {
1999
2004
  export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2000
2005
  /**
2001
2006
  * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
2002
- * @param [flags='r'] See `support of file system `flags``.
2003
2007
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2008
+ * @param [flags='r'] See `support of file system `flags``.
2004
2009
  */
2005
2010
  export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2006
2011
  /**
@@ -2008,6 +2013,7 @@ declare module 'fs' {
2008
2013
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2009
2014
  */
2010
2015
  export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
2016
+
2011
2017
  export namespace open {
2012
2018
  /**
2013
2019
  * Asynchronous open(2) - open and possibly create a file.
@@ -2096,8 +2102,7 @@ declare module 'fs' {
2096
2102
  */
2097
2103
  export function fsyncSync(fd: number): void;
2098
2104
  /**
2099
- * Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it
2100
- * must have an own `toString` function property.
2105
+ * Write `buffer` to the file specified by `fd`.
2101
2106
  *
2102
2107
  * `offset` determines the part of the buffer to be written, and `length` is
2103
2108
  * an integer specifying the number of bytes to write.
@@ -2220,8 +2225,6 @@ declare module 'fs' {
2220
2225
  }>;
2221
2226
  }
2222
2227
  /**
2223
- * If `buffer` is a plain object, it must have an own (not inherited) `toString`function property.
2224
- *
2225
2228
  * For detailed information, see the documentation of the asynchronous version of
2226
2229
  * this API: {@link write}.
2227
2230
  * @since v0.1.21
@@ -2237,6 +2240,23 @@ declare module 'fs' {
2237
2240
  */
2238
2241
  export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number;
2239
2242
  export type ReadPosition = number | bigint;
2243
+ export interface ReadSyncOptions {
2244
+ /**
2245
+ * @default 0
2246
+ */
2247
+ offset?: number | undefined;
2248
+ /**
2249
+ * @default `length of buffer`
2250
+ */
2251
+ length?: number | undefined;
2252
+ /**
2253
+ * @default null
2254
+ */
2255
+ position?: ReadPosition | null | undefined;
2256
+ }
2257
+ export interface ReadAsyncOptions<TBuffer extends NodeJS.ArrayBufferView> extends ReadSyncOptions {
2258
+ buffer?: TBuffer;
2259
+ }
2240
2260
  /**
2241
2261
  * Read data from the file specified by `fd`.
2242
2262
  *
@@ -2262,6 +2282,21 @@ declare module 'fs' {
2262
2282
  position: ReadPosition | null,
2263
2283
  callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void
2264
2284
  ): void;
2285
+ /**
2286
+ * Similar to the above `fs.read` function, this version takes an optional `options` object.
2287
+ * If not otherwise specified in an `options` object,
2288
+ * `buffer` defaults to `Buffer.alloc(16384)`,
2289
+ * `offset` defaults to `0`,
2290
+ * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0
2291
+ * `position` defaults to `null`
2292
+ * @since v12.17.0, 13.11.0
2293
+ */
2294
+ export function read<TBuffer extends NodeJS.ArrayBufferView>(
2295
+ fd: number,
2296
+ options: ReadAsyncOptions<TBuffer>,
2297
+ callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void
2298
+ ): void;
2299
+ export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void;
2265
2300
  export namespace read {
2266
2301
  /**
2267
2302
  * @param fd A file descriptor.
@@ -2280,20 +2315,17 @@ declare module 'fs' {
2280
2315
  bytesRead: number;
2281
2316
  buffer: TBuffer;
2282
2317
  }>;
2283
- }
2284
- export interface ReadSyncOptions {
2285
- /**
2286
- * @default 0
2287
- */
2288
- offset?: number | undefined;
2289
- /**
2290
- * @default `length of buffer`
2291
- */
2292
- length?: number | undefined;
2293
- /**
2294
- * @default null
2295
- */
2296
- position?: ReadPosition | null | undefined;
2318
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2319
+ fd: number,
2320
+ options: ReadAsyncOptions<TBuffer>
2321
+ ): Promise<{
2322
+ bytesRead: number;
2323
+ buffer: TBuffer;
2324
+ }>;
2325
+ function __promisify__(fd: number): Promise<{
2326
+ bytesRead: number;
2327
+ buffer: NodeJS.ArrayBufferView;
2328
+ }>;
2297
2329
  }
2298
2330
  /**
2299
2331
  * Returns the number of `bytesRead`.
@@ -2558,8 +2590,6 @@ declare module 'fs' {
2558
2590
  *
2559
2591
  * The `mode` option only affects the newly created file. See {@link open} for more details.
2560
2592
  *
2561
- * If `data` is a plain object, it must have an own (not inherited) `toString`function property.
2562
- *
2563
2593
  * ```js
2564
2594
  * import { writeFile } from 'fs';
2565
2595
  * import { Buffer } from 'buffer';
@@ -2636,8 +2666,6 @@ declare module 'fs' {
2636
2666
  /**
2637
2667
  * Returns `undefined`.
2638
2668
  *
2639
- * If `data` is a plain object, it must have an own (not inherited) `toString`function property.
2640
- *
2641
2669
  * The `mode` option only affects the newly created file. See {@link open} for more details.
2642
2670
  *
2643
2671
  * For detailed information, see the documentation of the asynchronous version of
@@ -2821,6 +2849,52 @@ declare module 'fs' {
2821
2849
  persistent?: boolean | undefined;
2822
2850
  interval?: number | undefined;
2823
2851
  }
2852
+ /**
2853
+ * Watch for changes on `filename`. The callback `listener` will be called each
2854
+ * time the file is accessed.
2855
+ *
2856
+ * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates
2857
+ * whether the process should continue to run as long as files are being watched.
2858
+ * The `options` object may specify an `interval` property indicating how often the
2859
+ * target should be polled in milliseconds.
2860
+ *
2861
+ * The `listener` gets two arguments the current stat object and the previous
2862
+ * stat object:
2863
+ *
2864
+ * ```js
2865
+ * import { watchFile } from 'fs';
2866
+ *
2867
+ * watchFile('message.text', (curr, prev) => {
2868
+ * console.log(`the current mtime is: ${curr.mtime}`);
2869
+ * console.log(`the previous mtime was: ${prev.mtime}`);
2870
+ * });
2871
+ * ```
2872
+ *
2873
+ * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`,
2874
+ * the numeric values in these objects are specified as `BigInt`s.
2875
+ *
2876
+ * To be notified when the file was modified, not just accessed, it is necessary
2877
+ * to compare `curr.mtimeMs` and `prev.mtimeMs`.
2878
+ *
2879
+ * When an `fs.watchFile` operation results in an `ENOENT` error, it
2880
+ * will invoke the listener once, with all the fields zeroed (or, for dates, the
2881
+ * Unix Epoch). If the file is created later on, the listener will be called
2882
+ * again, with the latest stat objects. This is a change in functionality since
2883
+ * v0.10.
2884
+ *
2885
+ * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible.
2886
+ *
2887
+ * When a file being watched by `fs.watchFile()` disappears and reappears,
2888
+ * then the contents of `previous` in the second callback event (the file's
2889
+ * reappearance) will be the same as the contents of `previous` in the first
2890
+ * callback event (its disappearance).
2891
+ *
2892
+ * This happens when:
2893
+ *
2894
+ * * the file is deleted, followed by a restore
2895
+ * * the file is renamed and then renamed a second time back to its original name
2896
+ * @since v0.1.31
2897
+ */
2824
2898
  export function watchFile(
2825
2899
  filename: PathLike,
2826
2900
  options:
@@ -3189,9 +3263,9 @@ declare module 'fs' {
3189
3263
  /**
3190
3264
  * Tests a user's permissions for the file or directory specified by `path`.
3191
3265
  * The `mode` argument is an optional integer that specifies the accessibility
3192
- * checks to be performed. Check `File access constants` for possible values
3193
- * of `mode`. It is possible to create a mask consisting of the bitwise OR of
3194
- * two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
3266
+ * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK`
3267
+ * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
3268
+ * possible values of `mode`.
3195
3269
  *
3196
3270
  * The final argument, `callback`, is a callback function that is invoked with
3197
3271
  * a possible error argument. If any of the accessibility checks fail, the error
@@ -3217,14 +3291,9 @@ declare module 'fs' {
3217
3291
  * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);
3218
3292
  * });
3219
3293
  *
3220
- * // Check if the file exists in the current directory, and if it is writable.
3221
- * access(file, constants.F_OK | constants.W_OK, (err) => {
3222
- * if (err) {
3223
- * console.error(
3224
- * `${file} ${err.code === 'ENOENT' ? 'does not exist' : 'is read-only'}`);
3225
- * } else {
3226
- * console.log(`${file} exists, and it is writable`);
3227
- * }
3294
+ * // Check if the file is readable and writable.
3295
+ * access(file, constants.R_OK | constants.W_OK, (err) => {
3296
+ * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`);
3228
3297
  * });
3229
3298
  * ```
3230
3299
  *
@@ -3368,10 +3437,9 @@ declare module 'fs' {
3368
3437
  /**
3369
3438
  * Synchronously tests a user's permissions for the file or directory specified
3370
3439
  * by `path`. The `mode` argument is an optional integer that specifies the
3371
- * accessibility checks to be performed. Check `File access constants` for
3372
- * possible values of `mode`. It is possible to create a mask consisting of
3373
- * the bitwise OR of two or more values
3374
- * (e.g. `fs.constants.W_OK | fs.constants.R_OK`).
3440
+ * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and
3441
+ * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for
3442
+ * possible values of `mode`.
3375
3443
  *
3376
3444
  * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise,
3377
3445
  * the method will return `undefined`.
@@ -3474,9 +3542,9 @@ declare module 'fs' {
3474
3542
  /**
3475
3543
  * `options` may also include a `start` option to allow writing data at some
3476
3544
  * position past the beginning of the file, allowed values are in the
3477
- * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than replacing
3478
- * it may require the `flags` option to be set to `r+` rather than the default `w`.
3479
- * The `encoding` can be any one of those accepted by `Buffer`.
3545
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
3546
+ * replacing it may require the `flags` option to be set to `r+` rather than the
3547
+ * default `w`. The `encoding` can be any one of those accepted by `Buffer`.
3480
3548
  *
3481
3549
  * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
3482
3550
  * then the file descriptor won't be closed, even if there's an error.
@@ -3756,6 +3824,11 @@ declare module 'fs' {
3756
3824
  * @default false
3757
3825
  */
3758
3826
  recursive?: boolean;
3827
+ /**
3828
+ * When true, path resolution for symlinks will be skipped
3829
+ * @default false
3830
+ */
3831
+ verbatimSymlinks?: boolean;
3759
3832
  }
3760
3833
  export interface CopyOptions extends CopyOptionsBase {
3761
3834
  /**
@@ -1,5 +1,5 @@
1
1
 
2
- /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/Steve-Mcl/monaco-editor-esm-i18n */
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
3
 
4
4
  // Declare "static" methods in Error
5
5
  interface ErrorConstructor {
@@ -56,28 +56,32 @@ interface AbortController {
56
56
  /**
57
57
  * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
58
58
  */
59
- abort(reason?: any): void;
59
+ abort(): void;
60
60
  }
61
61
 
62
62
  /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
63
- interface AbortSignal {
63
+ interface AbortSignal extends EventTarget {
64
64
  /**
65
65
  * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
66
66
  */
67
67
  readonly aborted: boolean;
68
68
  }
69
69
 
70
- declare var AbortController: {
71
- prototype: AbortController;
72
- new(): AbortController;
73
- };
74
-
75
- declare var AbortSignal: {
76
- prototype: AbortSignal;
77
- new(): AbortSignal;
78
- abort(reason?: any): AbortSignal;
79
- timeout(milliseconds: number): AbortSignal;
80
- };
70
+ declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T}
71
+ ? T
72
+ : {
73
+ prototype: AbortController;
74
+ new(): AbortController;
75
+ };
76
+
77
+ declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T}
78
+ ? T
79
+ : {
80
+ prototype: AbortSignal;
81
+ new(): AbortSignal;
82
+ abort(reason?: any): AbortSignal;
83
+ timeout(milliseconds: number): AbortSignal;
84
+ };
81
85
  //#endregion borrowed
82
86
 
83
87
  //#region ArrayLike.at()
@@ -105,6 +109,16 @@ interface BigInt64Array extends RelativeIndexable<bigint> {}
105
109
  interface BigUint64Array extends RelativeIndexable<bigint> {}
106
110
  //#endregion ArrayLike.at() end
107
111
 
112
+ /**
113
+ * @since v17.0.0
114
+ *
115
+ * Creates a deep clone of an object.
116
+ */
117
+ declare function structuredClone<T>(
118
+ value: T,
119
+ transfer?: { transfer: ReadonlyArray<import('worker_threads').TransferListItem> },
120
+ ): T;
121
+
108
122
  /*----------------------------------------------*
109
123
  * *
110
124
  * GLOBAL INTERFACES *
@@ -210,9 +224,9 @@ declare namespace NodeJS {
210
224
  writable: boolean;
211
225
  write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
212
226
  write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
213
- end(cb?: () => void): void;
214
- end(data: string | Uint8Array, cb?: () => void): void;
215
- end(str: string, encoding?: BufferEncoding, cb?: () => void): void;
227
+ end(cb?: () => void): this;
228
+ end(data: string | Uint8Array, cb?: () => void): this;
229
+ end(str: string, encoding?: BufferEncoding, cb?: () => void): this;
216
230
  }
217
231
 
218
232
  interface ReadWriteStream extends ReadableStream, WritableStream { }