@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
@@ -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 `dns.promises` API provides an alternative set of asynchronous DNS methods
@@ -192,7 +192,7 @@ declare module 'dns/promises' {
192
192
  * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success,
193
193
  * the `Promise` is resolved with an array of objects containing available
194
194
  * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`).
195
- * @since v15.0.0
195
+ * @since v15.0.0, v14.17.0
196
196
  */
197
197
  function resolveCaa(hostname: string): Promise<CaaRecord[]>;
198
198
  /**
@@ -335,14 +335,16 @@ declare module 'dns/promises' {
335
335
  */
336
336
  function setServers(servers: ReadonlyArray<string>): void;
337
337
  /**
338
- * Set the default value of `verbatim` in {@link lookup}. The value could be:
339
- * - `ipv4first`: sets default `verbatim` `false`.
340
- * - `verbatim`: sets default `verbatim` `true`.
338
+ * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be:
341
339
  *
342
- * The default is `ipv4first` and {@link setDefaultResultOrder} have higher priority than `--dns-result-order`.
343
- * When using worker threads, {@link setDefaultResultOrder} from the main thread won't affect the default dns orders in workers.
344
- * @since v14.18.0
345
- * @param order must be 'ipv4first' or 'verbatim'.
340
+ * * `ipv4first`: sets default `verbatim` `false`.
341
+ * * `verbatim`: sets default `verbatim` `true`.
342
+ *
343
+ * The default is `ipv4first` and `dnsPromises.setDefaultResultOrder()` have
344
+ * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the
345
+ * default dns orders in workers.
346
+ * @since v16.4.0, v14.18.0
347
+ * @param order must be `'ipv4first'` or `'verbatim'`.
346
348
  */
347
349
  function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
348
350
  class Resolver {
@@ -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 `dns` module enables name resolution. For example, use it to look up IP
@@ -45,7 +45,7 @@
45
45
  * ```
46
46
  *
47
47
  * See the `Implementation considerations section` for more information.
48
- * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/dns.js)
48
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/dns.js)
49
49
  */
50
50
  declare module 'dns' {
51
51
  import * as dnsPromises from 'node:dns/promises';
@@ -61,6 +61,9 @@ declare module 'dns' {
61
61
  family?: number | undefined;
62
62
  hints?: number | undefined;
63
63
  all?: boolean | undefined;
64
+ /**
65
+ * @default true
66
+ */
64
67
  verbatim?: boolean | undefined;
65
68
  }
66
69
  export interface LookupOneOptions extends LookupOptions {
@@ -174,7 +177,7 @@ declare module 'dns' {
174
177
  type: 'AAAA';
175
178
  }
176
179
  export interface CaaRecord {
177
- critical: number;
180
+ critial: number;
178
181
  issue?: string | undefined;
179
182
  issuewild?: string | undefined;
180
183
  iodef?: string | undefined;
@@ -317,7 +320,7 @@ declare module 'dns' {
317
320
  * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function
318
321
  * will contain an array of certification authority authorization records
319
322
  * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`).
320
- * @since v15.0.0
323
+ * @since v15.0.0, v14.17.0
321
324
  */
322
325
  export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void;
323
326
  export namespace resolveCaa {
@@ -530,14 +533,16 @@ declare module 'dns' {
530
533
  */
531
534
  export function getServers(): string[];
532
535
  /**
533
- * Set the default value of `verbatim` in {@link lookup}. The value could be:
534
- * - `ipv4first`: sets default `verbatim` `false`.
535
- * - `verbatim`: sets default `verbatim` `true`.
536
- *
537
- * The default is `ipv4first` and {@link setDefaultResultOrder} have higher priority than `--dns-result-order`.
538
- * When using worker threads, {@link setDefaultResultOrder} from the main thread won't affect the default dns orders in workers.
539
- * @since v14.18.0
540
- * @param order must be 'ipv4first' or 'verbatim'.
536
+ * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be:
537
+ *
538
+ * * `ipv4first`: sets default `verbatim` `false`.
539
+ * * `verbatim`: sets default `verbatim` `true`.
540
+ *
541
+ * The default is `ipv4first` and {@link setDefaultResultOrder} have higher
542
+ * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default
543
+ * dns orders in workers.
544
+ * @since v16.4.0, v14.18.0
545
+ * @param order must be `'ipv4first'` or `'verbatim'`.
541
546
  */
542
547
  export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void;
543
548
  // Error codes
@@ -643,7 +648,7 @@ declare module 'dns' {
643
648
  * The resolver will use the v4 local address when making requests to IPv4 DNS
644
649
  * servers, and the v6 local address when making requests to IPv6 DNS servers.
645
650
  * The `rrtype` of resolution requests has no impact on the local address used.
646
- * @since v15.1.0
651
+ * @since v15.1.0, v14.17.0
647
652
  * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
648
653
  * @param [ipv6='::0'] A string representation of an IPv6 address.
649
654
  */
@@ -0,0 +1,129 @@
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
+ export {}; // Don't export anything!
5
+
6
+ //// DOM-like Events
7
+ // NB: The Event / EventTarget / EventListener implementations below were copied
8
+ // from lib.dom.d.ts, then edited to reflect Node's documentation at
9
+ // https://nodejs.org/api/events.html#class-eventtarget.
10
+ // Please read that link to understand important implementation differences.
11
+
12
+ // This conditional type will be the existing global Event in a browser, or
13
+ // the copy below in a Node environment.
14
+ type __Event = typeof globalThis extends { onmessage: any, Event: any }
15
+ ? {}
16
+ : {
17
+ /** This is not used in Node.js and is provided purely for completeness. */
18
+ readonly bubbles: boolean;
19
+ /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
20
+ cancelBubble: () => void;
21
+ /** True if the event was created with the cancelable option */
22
+ readonly cancelable: boolean;
23
+ /** This is not used in Node.js and is provided purely for completeness. */
24
+ readonly composed: boolean;
25
+ /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
26
+ composedPath(): [EventTarget?]
27
+ /** Alias for event.target. */
28
+ readonly currentTarget: EventTarget | null;
29
+ /** Is true if cancelable is true and event.preventDefault() has been called. */
30
+ readonly defaultPrevented: boolean;
31
+ /** This is not used in Node.js and is provided purely for completeness. */
32
+ readonly eventPhase: 0 | 2;
33
+ /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
34
+ readonly isTrusted: boolean;
35
+ /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
36
+ preventDefault(): void;
37
+ /** This is not used in Node.js and is provided purely for completeness. */
38
+ returnValue: boolean;
39
+ /** Alias for event.target. */
40
+ readonly srcElement: EventTarget | null;
41
+ /** Stops the invocation of event listeners after the current one completes. */
42
+ stopImmediatePropagation(): void;
43
+ /** This is not used in Node.js and is provided purely for completeness. */
44
+ stopPropagation(): void;
45
+ /** The `EventTarget` dispatching the event */
46
+ readonly target: EventTarget | null;
47
+ /** The millisecond timestamp when the Event object was created. */
48
+ readonly timeStamp: number;
49
+ /** Returns the type of event, e.g. "click", "hashchange", or "submit". */
50
+ readonly type: string;
51
+ };
52
+
53
+ // See comment above explaining conditional type
54
+ type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any }
55
+ ? {}
56
+ : {
57
+ /**
58
+ * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
59
+ *
60
+ * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
61
+ *
62
+ * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
63
+ * Specifically, the `capture` option is used as part of the key when registering a `listener`.
64
+ * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
65
+ */
66
+ addEventListener(
67
+ type: string,
68
+ listener: EventListener | EventListenerObject,
69
+ options?: AddEventListenerOptions | boolean,
70
+ ): void;
71
+ /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
72
+ dispatchEvent(event: Event): boolean;
73
+ /** Removes the event listener in target's event listener list with the same type, callback, and options. */
74
+ removeEventListener(
75
+ type: string,
76
+ listener: EventListener | EventListenerObject,
77
+ options?: EventListenerOptions | boolean,
78
+ ): void;
79
+ };
80
+
81
+ interface EventInit {
82
+ bubbles?: boolean;
83
+ cancelable?: boolean;
84
+ composed?: boolean;
85
+ }
86
+
87
+ interface EventListenerOptions {
88
+ /** Not directly used by Node.js. Added for API completeness. Default: `false`. */
89
+ capture?: boolean;
90
+ }
91
+
92
+ interface AddEventListenerOptions extends EventListenerOptions {
93
+ /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */
94
+ once?: boolean;
95
+ /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */
96
+ passive?: boolean;
97
+ }
98
+
99
+ interface EventListener {
100
+ (evt: Event): void;
101
+ }
102
+
103
+ interface EventListenerObject {
104
+ handleEvent(object: Event): void;
105
+ }
106
+
107
+ import {} from 'events'; // Make this an ambient declaration
108
+ declare global {
109
+ /** An event which takes place in the DOM. */
110
+ interface Event extends __Event {}
111
+ var Event: typeof globalThis extends { onmessage: any, Event: infer T }
112
+ ? T
113
+ : {
114
+ prototype: __Event;
115
+ new (type: string, eventInitDict?: EventInit): __Event;
116
+ };
117
+
118
+ /**
119
+ * EventTarget is a DOM interface implemented by objects that can
120
+ * receive events and may have listeners for them.
121
+ */
122
+ interface EventTarget extends __EventTarget {}
123
+ var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T }
124
+ ? T
125
+ : {
126
+ prototype: __EventTarget;
127
+ new (): __EventTarget;
128
+ };
129
+ }
@@ -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
  * **This module is pending deprecation.** Once a replacement API has been
@@ -15,7 +15,7 @@
15
15
  * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to
16
16
  * exit immediately with an error code.
17
17
  * @deprecated Since v1.4.2 - Deprecated
18
- * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/domain.js)
18
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/domain.js)
19
19
  */
20
20
  declare module 'domain' {
21
21
  import EventEmitter = require('node:events');
@@ -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
  * Much of the Node.js core API is built around an idiomatic asynchronous
@@ -35,19 +35,56 @@
35
35
  * });
36
36
  * myEmitter.emit('event');
37
37
  * ```
38
- * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/events.js)
38
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/events.js)
39
39
  */
40
40
  declare module 'events' {
41
+ // NOTE: This class is in the docs but is **not actually exported** by Node.
42
+ // If https://github.com/nodejs/node/issues/39903 gets resolved and Node
43
+ // actually starts exporting the class, uncomment below.
44
+
45
+ // import { EventListener, EventListenerObject } from '__dom-events';
46
+ // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */
47
+ // interface NodeEventTarget extends EventTarget {
48
+ // /**
49
+ // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API.
50
+ // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget.
51
+ // */
52
+ // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
53
+ // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */
54
+ // eventNames(): string[];
55
+ // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */
56
+ // listenerCount(type: string): number;
57
+ // /** Node.js-specific alias for `eventTarget.removeListener()`. */
58
+ // off(type: string, listener: EventListener | EventListenerObject): this;
59
+ // /** Node.js-specific alias for `eventTarget.addListener()`. */
60
+ // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this;
61
+ // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */
62
+ // once(type: string, listener: EventListener | EventListenerObject): this;
63
+ // /**
64
+ // * Node.js-specific extension to the `EventTarget` class.
65
+ // * If `type` is specified, removes all registered listeners for `type`,
66
+ // * otherwise removes all registered listeners.
67
+ // */
68
+ // removeAllListeners(type: string): this;
69
+ // /**
70
+ // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`.
71
+ // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`.
72
+ // */
73
+ // removeListener(type: string, listener: EventListener | EventListenerObject): this;
74
+ // }
75
+
41
76
  interface EventEmitterOptions {
42
77
  /**
43
78
  * Enables automatic capturing of promise rejection.
44
79
  */
45
80
  captureRejections?: boolean | undefined;
46
81
  }
47
- interface NodeEventTarget {
82
+ // Any EventTarget with a Node-style `once` function
83
+ interface _NodeEventTarget {
48
84
  once(eventName: string | symbol, listener: (...args: any[]) => void): this;
49
85
  }
50
- interface DOMEventTarget {
86
+ // Any EventTarget with a DOM-style `addEventListener`
87
+ interface _DOMEventTarget {
51
88
  addEventListener(
52
89
  eventName: string,
53
90
  listener: (...args: any[]) => void,
@@ -157,8 +194,8 @@ declare module 'events' {
157
194
  * ```
158
195
  * @since v11.13.0, v10.16.0
159
196
  */
160
- static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
161
- static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
197
+ static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
198
+ static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
162
199
  /**
163
200
  * ```js
164
201
  * const { on, EventEmitter } = require('events');
@@ -260,9 +297,9 @@ declare module 'events' {
260
297
  * getEventListeners(et, 'foo'); // [listener]
261
298
  * }
262
299
  * ```
263
- * @since v15.2.0
300
+ * @since v15.2.0, v14.17.0
264
301
  */
265
- static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
302
+ static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
266
303
  /**
267
304
  * ```js
268
305
  * const {
@@ -280,7 +317,7 @@ declare module 'events' {
280
317
  * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter}
281
318
  * objects.
282
319
  */
283
- static setMaxListeners(n?: number, ...eventTargets: Array<DOMEventTarget | NodeJS.EventEmitter>): void;
320
+ static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void;
284
321
  /**
285
322
  * This symbol shall be used to install a listener for only monitoring `'error'`
286
323
  * events. Listeners installed using this symbol are called before the regular
@@ -396,8 +433,8 @@ declare module 'events' {
396
433
  * called multiple times to remove each instance.
397
434
  *
398
435
  * Once an event is emitted, all listeners attached to it at the
399
- * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will
400
- * not remove them from`emit()` in progress. Subsequent events behave as expected.
436
+ * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution
437
+ * will not remove them from`emit()` in progress. Subsequent events behave as expected.
401
438
  *
402
439
  * ```js
403
440
  * const myEmitter = new MyEmitter();
@@ -599,7 +636,7 @@ declare module 'events' {
599
636
  */
600
637
  prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
601
638
  /**
602
- * Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this
639
+ * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this
603
640
  * listener is removed, and then invoked.
604
641
  *
605
642
  * ```js
@@ -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(