@node-red/editor-client 3.0.2 → 3.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/locales/de/editor.json +2 -0
  2. package/locales/de/infotips.json +0 -0
  3. package/locales/de/jsonata.json +0 -0
  4. package/locales/en-US/editor.json +37 -6
  5. package/locales/en-US/infotips.json +0 -0
  6. package/locales/en-US/jsonata.json +0 -0
  7. package/locales/fr/editor.json +1238 -0
  8. package/locales/fr/infotips.json +23 -0
  9. package/locales/fr/jsonata.json +274 -0
  10. package/locales/ja/editor.json +48 -9
  11. package/locales/ko/editor.json +233 -31
  12. package/locales/ko/infotips.json +0 -0
  13. package/locales/ko/jsonata.json +0 -0
  14. package/locales/pt-BR/editor.json +1208 -0
  15. package/locales/pt-BR/infotips.json +23 -0
  16. package/locales/pt-BR/jsonata.json +274 -0
  17. package/locales/ru/editor.json +2 -0
  18. package/locales/ru/infotips.json +0 -0
  19. package/locales/ru/jsonata.json +0 -0
  20. package/locales/zh-CN/editor.json +1175 -1049
  21. package/locales/zh-TW/editor.json +3 -0
  22. package/package.json +1 -1
  23. package/public/red/about +140 -0
  24. package/public/red/red.js +2699 -1397
  25. package/public/red/red.min.js +4 -3
  26. package/public/red/style.min.css +1 -1
  27. package/public/red/tours/3.0/images/context-menu.png +0 -0
  28. package/public/red/tours/3.0/welcome.js +155 -0
  29. package/public/red/tours/images/context-menu.png +0 -0
  30. package/public/red/tours/images/global-env-vars.png +0 -0
  31. package/public/red/tours/images/hiding-flows.png +0 -0
  32. package/public/red/tours/images/locking-flows.png +0 -0
  33. package/public/red/tours/images/mermaid.png +0 -0
  34. package/public/red/tours/images/node-help.png +0 -0
  35. package/public/red/tours/images/tab-changes.png +0 -0
  36. package/public/red/tours/welcome.js +111 -94
  37. package/public/types/node/assert/strict.d.ts +11 -0
  38. package/public/types/node/assert.d.ts +898 -64
  39. package/public/types/node/async_hooks.d.ts +362 -94
  40. package/public/types/node/buffer.d.ts +2158 -14
  41. package/public/types/node/child_process.d.ts +1109 -257
  42. package/public/types/node/cluster.d.ts +349 -200
  43. package/public/types/node/console.d.ts +313 -43
  44. package/public/types/node/crypto.d.ts +3329 -656
  45. package/public/types/node/dgram.d.ts +459 -58
  46. package/public/types/node/diagnostics_channel.d.ts +155 -0
  47. package/public/types/node/dns/promises.d.ts +371 -0
  48. package/public/types/node/dns.d.ts +532 -265
  49. package/public/types/node/domain.d.ts +159 -16
  50. package/public/types/node/events.d.ts +589 -30
  51. package/public/types/node/fs/promises.d.ts +1097 -0
  52. package/public/types/node/fs.d.ts +2484 -958
  53. package/public/types/node/globals.d.ts +43 -503
  54. package/public/types/node/http.d.ts +1156 -145
  55. package/public/types/node/http2.d.ts +1610 -470
  56. package/public/types/node/https.d.ts +462 -72
  57. package/public/types/node/module.d.ts +72 -13
  58. package/public/types/node/net.d.ts +663 -131
  59. package/public/types/node/os.d.ts +238 -25
  60. package/public/types/node/path.d.ts +57 -23
  61. package/public/types/node/perf_hooks.d.ts +424 -112
  62. package/public/types/node/process.d.ts +1261 -193
  63. package/public/types/node/querystring.d.ts +107 -7
  64. package/public/types/node/readline.d.ts +443 -74
  65. package/public/types/node/stream/consumers.d.ts +15 -0
  66. package/public/types/node/stream/promises.d.ts +45 -0
  67. package/public/types/node/stream/web.d.ts +395 -0
  68. package/public/types/node/stream.d.ts +1081 -177
  69. package/public/types/node/string_decoder.d.ts +57 -0
  70. package/public/types/node/test.d.ts +193 -0
  71. package/public/types/node/timers/promises.d.ts +96 -0
  72. package/public/types/node/timers.d.ts +87 -12
  73. package/public/types/node/tls.d.ts +457 -222
  74. package/public/types/node/trace_events.d.ts +107 -10
  75. package/public/types/node/tty.d.ts +158 -23
  76. package/public/types/node/url.d.ts +734 -28
  77. package/public/types/node/util.d.ts +1542 -164
  78. package/public/types/node/v8.d.ts +261 -73
  79. package/public/types/node/vm.d.ts +384 -32
  80. package/public/types/node/wasi.d.ts +92 -23
  81. package/public/types/node/worker_threads.d.ts +531 -123
  82. package/public/types/node/zlib.d.ts +216 -63
  83. package/public/types/node-red/func.d.ts +3 -0
  84. package/public/vendor/jquery/css/base/images/ui-icons_444444_256x240.png +0 -0
  85. package/public/vendor/jquery/css/base/images/ui-icons_555555_256x240.png +0 -0
  86. package/public/vendor/jquery/css/base/images/ui-icons_777620_256x240.png +0 -0
  87. package/public/vendor/jquery/css/base/images/ui-icons_777777_256x240.png +0 -0
  88. package/public/vendor/jquery/css/base/images/ui-icons_cc0000_256x240.png +0 -0
  89. package/public/vendor/jquery/css/base/images/ui-icons_ffffff_256x240.png +0 -0
  90. package/public/vendor/jquery/css/base/jquery-ui.min.css +4 -4
  91. package/public/vendor/mermaid/mermaid.min.js +1284 -0
  92. package/public/vendor/monaco/dist/{ade705761eb7e702770d.ttf → 7064e66c3890a12c47b4.ttf} +0 -0
  93. package/public/vendor/monaco/dist/css.worker.js +1 -1
  94. package/public/vendor/monaco/dist/css.worker.js.LICENSE.txt +1 -1
  95. package/public/vendor/monaco/dist/editor.js +1 -1
  96. package/public/vendor/monaco/dist/editor.js.LICENSE.txt +5 -1
  97. package/public/vendor/monaco/dist/editor.worker.js +1 -1
  98. package/public/vendor/monaco/dist/html.worker.js +1 -1
  99. package/public/vendor/monaco/dist/html.worker.js.LICENSE.txt +1 -1
  100. package/public/vendor/monaco/dist/json.worker.js +1 -1
  101. package/public/vendor/monaco/dist/json.worker.js.LICENSE.txt +1 -1
  102. package/public/vendor/monaco/dist/locale/cs.js +319 -71
  103. package/public/vendor/monaco/dist/locale/de.js +323 -75
  104. package/public/vendor/monaco/dist/locale/es.js +318 -70
  105. package/public/vendor/monaco/dist/locale/fr.js +327 -79
  106. package/public/vendor/monaco/dist/locale/it.js +325 -77
  107. package/public/vendor/monaco/dist/locale/ja.js +337 -89
  108. package/public/vendor/monaco/dist/locale/ko.js +324 -76
  109. package/public/vendor/monaco/dist/locale/pl.js +322 -74
  110. package/public/vendor/monaco/dist/locale/pt-br.js +321 -73
  111. package/public/vendor/monaco/dist/locale/qps-ploc.js +1580 -1332
  112. package/public/vendor/monaco/dist/locale/ru.js +324 -76
  113. package/public/vendor/monaco/dist/locale/tr.js +326 -78
  114. package/public/vendor/monaco/dist/locale/zh-hans.js +328 -80
  115. package/public/vendor/monaco/dist/locale/zh-hant.js +321 -73
  116. package/public/vendor/monaco/dist/theme/forge.json +236 -0
  117. package/public/vendor/monaco/dist/theme/github-dark.json +348 -0
  118. package/public/vendor/monaco/dist/theme/github-light.json +348 -0
  119. package/public/vendor/monaco/dist/theme/nord.json +93 -0
  120. package/public/vendor/monaco/dist/ts.worker.js +1 -1
  121. package/public/vendor/monaco/dist/ts.worker.js.LICENSE.txt +14 -6
  122. package/public/vendor/vendor.js +9 -15
  123. /package/public/red/tours/{images → 3.0/images}/continuous-search.png +0 -0
  124. /package/public/red/tours/{images → 3.0/images}/debug-path-tooltip.png +0 -0
  125. /package/public/red/tours/{images → 3.0/images}/junction-quick-add.png +0 -0
  126. /package/public/red/tours/{images → 3.0/images}/junction-slice.gif +0 -0
  127. /package/public/red/tours/{images → 3.0/images}/split-wire-with-links.gif +0 -0
@@ -1,9 +1,38 @@
1
1
 
2
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 */
3
3
 
4
+ /**
5
+ * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. It can be accessed
6
+ * using:
7
+ *
8
+ * ```js
9
+ * const readline = require('readline');
10
+ * ```
11
+ *
12
+ * The following simple example illustrates the basic use of the `readline` module.
13
+ *
14
+ * ```js
15
+ * const readline = require('readline');
16
+ *
17
+ * const rl = readline.createInterface({
18
+ * input: process.stdin,
19
+ * output: process.stdout
20
+ * });
21
+ *
22
+ * rl.question('What do you think of Node.js? ', (answer) => {
23
+ * // TODO: Log the answer in a database
24
+ * console.log(`Thank you for your valuable feedback: ${answer}`);
25
+ *
26
+ * rl.close();
27
+ * });
28
+ * ```
29
+ *
30
+ * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be
31
+ * received on the `input` stream.
32
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/readline.js)
33
+ */
4
34
  declare module 'readline' {
5
- import EventEmitter = require('events');
6
-
35
+ import { Abortable, EventEmitter } from 'node:events';
7
36
  interface Key {
8
37
  sequence?: string | undefined;
9
38
  name?: string | undefined;
@@ -11,17 +40,56 @@ declare module 'readline' {
11
40
  meta?: boolean | undefined;
12
41
  shift?: boolean | undefined;
13
42
  }
14
-
43
+ /**
44
+ * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a
45
+ * single `input` `Readable` stream and a single `output` `Writable` stream.
46
+ * The `output` stream is used to print prompts for user input that arrives on,
47
+ * and is read from, the `input` stream.
48
+ * @since v0.1.104
49
+ */
15
50
  class Interface extends EventEmitter {
16
51
  readonly terminal: boolean;
17
-
18
- // Need direct access to line/cursor data, for use in external processes
19
- // see: https://github.com/nodejs/node/issues/30347
20
- /** The current input data */
52
+ /**
53
+ * The current input data being processed by node.
54
+ *
55
+ * This can be used when collecting input from a TTY stream to retrieve the
56
+ * current value that has been processed thus far, prior to the `line` event
57
+ * being emitted. Once the `line` event has been emitted, this property will
58
+ * be an empty string.
59
+ *
60
+ * Be aware that modifying the value during the instance runtime may have
61
+ * unintended consequences if `rl.cursor` is not also controlled.
62
+ *
63
+ * **If not using a TTY stream for input, use the `'line'` event.**
64
+ *
65
+ * One possible use case would be as follows:
66
+ *
67
+ * ```js
68
+ * const values = ['lorem ipsum', 'dolor sit amet'];
69
+ * const rl = readline.createInterface(process.stdin);
70
+ * const showResults = debounce(() => {
71
+ * console.log(
72
+ * '\n',
73
+ * values.filter((val) => val.startsWith(rl.line)).join(' ')
74
+ * );
75
+ * }, 300);
76
+ * process.stdin.on('keypress', (c, k) => {
77
+ * showResults();
78
+ * });
79
+ * ```
80
+ * @since v0.1.98
81
+ */
21
82
  readonly line: string;
22
- /** The current cursor position in the input line */
83
+ /**
84
+ * The cursor position relative to `rl.line`.
85
+ *
86
+ * This will track where the current cursor lands in the input string, when
87
+ * reading input from a TTY stream. The position of cursor determines the
88
+ * portion of the input string that will be modified as input is processed,
89
+ * as well as the column where the terminal caret will be rendered.
90
+ * @since v0.1.98
91
+ */
23
92
  readonly cursor: number;
24
-
25
93
  /**
26
94
  * NOTE: According to the documentation:
27
95
  *
@@ -40,23 +108,145 @@ declare module 'readline' {
40
108
  * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
41
109
  */
42
110
  protected constructor(options: ReadLineOptions);
43
-
111
+ /**
112
+ * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
113
+ * @since v15.3.0
114
+ * @return the current prompt string
115
+ */
116
+ getPrompt(): string;
117
+ /**
118
+ * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called.
119
+ * @since v0.1.98
120
+ */
44
121
  setPrompt(prompt: string): void;
122
+ /**
123
+ * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new
124
+ * location at which to provide input.
125
+ *
126
+ * When called, `rl.prompt()` will resume the `input` stream if it has been
127
+ * paused.
128
+ *
129
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written.
130
+ * @since v0.1.98
131
+ * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`.
132
+ */
45
133
  prompt(preserveCursor?: boolean): void;
134
+ /**
135
+ * The `rl.question()` method displays the `query` by writing it to the `output`,
136
+ * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument.
137
+ *
138
+ * When called, `rl.question()` will resume the `input` stream if it has been
139
+ * paused.
140
+ *
141
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written.
142
+ *
143
+ * The `callback` function passed to `rl.question()` does not follow the typical
144
+ * pattern of accepting an `Error` object or `null` as the first argument.
145
+ * The `callback` is called with the provided answer as the only argument.
146
+ *
147
+ * Example usage:
148
+ *
149
+ * ```js
150
+ * rl.question('What is your favorite food? ', (answer) => {
151
+ * console.log(`Oh, so your favorite food is ${answer}`);
152
+ * });
153
+ * ```
154
+ *
155
+ * Using an `AbortController` to cancel a question.
156
+ *
157
+ * ```js
158
+ * const ac = new AbortController();
159
+ * const signal = ac.signal;
160
+ *
161
+ * rl.question('What is your favorite food? ', { signal }, (answer) => {
162
+ * console.log(`Oh, so your favorite food is ${answer}`);
163
+ * });
164
+ *
165
+ * signal.addEventListener('abort', () => {
166
+ * console.log('The food question timed out');
167
+ * }, { once: true });
168
+ *
169
+ * setTimeout(() => ac.abort(), 10000);
170
+ * ```
171
+ *
172
+ * If this method is invoked as it's util.promisify()ed version, it returns a
173
+ * Promise that fulfills with the answer. If the question is canceled using
174
+ * an `AbortController` it will reject with an `AbortError`.
175
+ *
176
+ * ```js
177
+ * const util = require('util');
178
+ * const question = util.promisify(rl.question).bind(rl);
179
+ *
180
+ * async function questionExample() {
181
+ * try {
182
+ * const answer = await question('What is you favorite food? ');
183
+ * console.log(`Oh, so your favorite food is ${answer}`);
184
+ * } catch (err) {
185
+ * console.error('Question rejected', err);
186
+ * }
187
+ * }
188
+ * questionExample();
189
+ * ```
190
+ * @since v0.3.3
191
+ * @param query A statement or query to write to `output`, prepended to the prompt.
192
+ * @param callback A callback function that is invoked with the user's input in response to the `query`.
193
+ */
46
194
  question(query: string, callback: (answer: string) => void): void;
195
+ question(query: string, options: Abortable, callback: (answer: string) => void): void;
196
+ /**
197
+ * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed
198
+ * later if necessary.
199
+ *
200
+ * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance.
201
+ * @since v0.3.4
202
+ */
47
203
  pause(): this;
204
+ /**
205
+ * The `rl.resume()` method resumes the `input` stream if it has been paused.
206
+ * @since v0.3.4
207
+ */
48
208
  resume(): this;
209
+ /**
210
+ * The `rl.close()` method closes the `readline.Interface` instance and
211
+ * relinquishes control over the `input` and `output` streams. When called,
212
+ * the `'close'` event will be emitted.
213
+ *
214
+ * Calling `rl.close()` does not immediately stop other events (including `'line'`)
215
+ * from being emitted by the `readline.Interface` instance.
216
+ * @since v0.1.98
217
+ */
49
218
  close(): void;
219
+ /**
220
+ * The `rl.write()` method will write either `data` or a key sequence identified
221
+ * by `key` to the `output`. The `key` argument is supported only if `output` is
222
+ * a `TTY` text terminal. See `TTY keybindings` for a list of key
223
+ * combinations.
224
+ *
225
+ * If `key` is specified, `data` is ignored.
226
+ *
227
+ * When called, `rl.write()` will resume the `input` stream if it has been
228
+ * paused.
229
+ *
230
+ * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written.
231
+ *
232
+ * ```js
233
+ * rl.write('Delete this!');
234
+ * // Simulate Ctrl+U to delete the line written previously
235
+ * rl.write(null, { ctrl: true, name: 'u' });
236
+ * ```
237
+ *
238
+ * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_.
239
+ * @since v0.1.98
240
+ */
50
241
  write(data: string | Buffer, key?: Key): void;
51
242
  write(data: undefined | null | string | Buffer, key: Key): void;
52
-
53
243
  /**
54
244
  * Returns the real position of the cursor in relation to the input
55
- * prompt + string. Long input (wrapping) strings, as well as multiple
245
+ * prompt + string. Long input (wrapping) strings, as well as multiple
56
246
  * line prompts are included in the calculations.
247
+ * @since v13.5.0, v12.16.0
57
248
  */
58
249
  getCursorPos(): CursorPos;
59
-
60
250
  /**
61
251
  * events.EventEmitter
62
252
  * 1. close
@@ -66,109 +256,288 @@ declare module 'readline' {
66
256
  * 5. SIGCONT
67
257
  * 6. SIGINT
68
258
  * 7. SIGTSTP
259
+ * 8. history
69
260
  */
70
-
71
261
  addListener(event: string, listener: (...args: any[]) => void): this;
72
- addListener(event: "close", listener: () => void): this;
73
- addListener(event: "line", listener: (input: string) => void): this;
74
- addListener(event: "pause", listener: () => void): this;
75
- addListener(event: "resume", listener: () => void): this;
76
- addListener(event: "SIGCONT", listener: () => void): this;
77
- addListener(event: "SIGINT", listener: () => void): this;
78
- addListener(event: "SIGTSTP", listener: () => void): this;
79
-
262
+ addListener(event: 'close', listener: () => void): this;
263
+ addListener(event: 'line', listener: (input: string) => void): this;
264
+ addListener(event: 'pause', listener: () => void): this;
265
+ addListener(event: 'resume', listener: () => void): this;
266
+ addListener(event: 'SIGCONT', listener: () => void): this;
267
+ addListener(event: 'SIGINT', listener: () => void): this;
268
+ addListener(event: 'SIGTSTP', listener: () => void): this;
269
+ addListener(event: 'history', listener: (history: string[]) => void): this;
80
270
  emit(event: string | symbol, ...args: any[]): boolean;
81
- emit(event: "close"): boolean;
82
- emit(event: "line", input: string): boolean;
83
- emit(event: "pause"): boolean;
84
- emit(event: "resume"): boolean;
85
- emit(event: "SIGCONT"): boolean;
86
- emit(event: "SIGINT"): boolean;
87
- emit(event: "SIGTSTP"): boolean;
88
-
271
+ emit(event: 'close'): boolean;
272
+ emit(event: 'line', input: string): boolean;
273
+ emit(event: 'pause'): boolean;
274
+ emit(event: 'resume'): boolean;
275
+ emit(event: 'SIGCONT'): boolean;
276
+ emit(event: 'SIGINT'): boolean;
277
+ emit(event: 'SIGTSTP'): boolean;
278
+ emit(event: 'history', history: string[]): boolean;
89
279
  on(event: string, listener: (...args: any[]) => void): this;
90
- on(event: "close", listener: () => void): this;
91
- on(event: "line", listener: (input: string) => void): this;
92
- on(event: "pause", listener: () => void): this;
93
- on(event: "resume", listener: () => void): this;
94
- on(event: "SIGCONT", listener: () => void): this;
95
- on(event: "SIGINT", listener: () => void): this;
96
- on(event: "SIGTSTP", listener: () => void): this;
97
-
280
+ on(event: 'close', listener: () => void): this;
281
+ on(event: 'line', listener: (input: string) => void): this;
282
+ on(event: 'pause', listener: () => void): this;
283
+ on(event: 'resume', listener: () => void): this;
284
+ on(event: 'SIGCONT', listener: () => void): this;
285
+ on(event: 'SIGINT', listener: () => void): this;
286
+ on(event: 'SIGTSTP', listener: () => void): this;
287
+ on(event: 'history', listener: (history: string[]) => void): this;
98
288
  once(event: string, listener: (...args: any[]) => void): this;
99
- once(event: "close", listener: () => void): this;
100
- once(event: "line", listener: (input: string) => void): this;
101
- once(event: "pause", listener: () => void): this;
102
- once(event: "resume", listener: () => void): this;
103
- once(event: "SIGCONT", listener: () => void): this;
104
- once(event: "SIGINT", listener: () => void): this;
105
- once(event: "SIGTSTP", listener: () => void): this;
106
-
289
+ once(event: 'close', listener: () => void): this;
290
+ once(event: 'line', listener: (input: string) => void): this;
291
+ once(event: 'pause', listener: () => void): this;
292
+ once(event: 'resume', listener: () => void): this;
293
+ once(event: 'SIGCONT', listener: () => void): this;
294
+ once(event: 'SIGINT', listener: () => void): this;
295
+ once(event: 'SIGTSTP', listener: () => void): this;
296
+ once(event: 'history', listener: (history: string[]) => void): this;
107
297
  prependListener(event: string, listener: (...args: any[]) => void): this;
108
- prependListener(event: "close", listener: () => void): this;
109
- prependListener(event: "line", listener: (input: string) => void): this;
110
- prependListener(event: "pause", listener: () => void): this;
111
- prependListener(event: "resume", listener: () => void): this;
112
- prependListener(event: "SIGCONT", listener: () => void): this;
113
- prependListener(event: "SIGINT", listener: () => void): this;
114
- prependListener(event: "SIGTSTP", listener: () => void): this;
115
-
298
+ prependListener(event: 'close', listener: () => void): this;
299
+ prependListener(event: 'line', listener: (input: string) => void): this;
300
+ prependListener(event: 'pause', listener: () => void): this;
301
+ prependListener(event: 'resume', listener: () => void): this;
302
+ prependListener(event: 'SIGCONT', listener: () => void): this;
303
+ prependListener(event: 'SIGINT', listener: () => void): this;
304
+ prependListener(event: 'SIGTSTP', listener: () => void): this;
305
+ prependListener(event: 'history', listener: (history: string[]) => void): this;
116
306
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
117
- prependOnceListener(event: "close", listener: () => void): this;
118
- prependOnceListener(event: "line", listener: (input: string) => void): this;
119
- prependOnceListener(event: "pause", listener: () => void): this;
120
- prependOnceListener(event: "resume", listener: () => void): this;
121
- prependOnceListener(event: "SIGCONT", listener: () => void): this;
122
- prependOnceListener(event: "SIGINT", listener: () => void): this;
123
- prependOnceListener(event: "SIGTSTP", listener: () => void): this;
307
+ prependOnceListener(event: 'close', listener: () => void): this;
308
+ prependOnceListener(event: 'line', listener: (input: string) => void): this;
309
+ prependOnceListener(event: 'pause', listener: () => void): this;
310
+ prependOnceListener(event: 'resume', listener: () => void): this;
311
+ prependOnceListener(event: 'SIGCONT', listener: () => void): this;
312
+ prependOnceListener(event: 'SIGINT', listener: () => void): this;
313
+ prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
314
+ prependOnceListener(event: 'history', listener: (history: string[]) => void): this;
124
315
  [Symbol.asyncIterator](): AsyncIterableIterator<string>;
125
316
  }
126
-
127
317
  type ReadLine = Interface; // type forwarded for backwards compatibility
128
-
129
318
  type Completer = (line: string) => CompleterResult;
130
- type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
131
-
319
+ type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void;
132
320
  type CompleterResult = [string[], string];
133
-
134
321
  interface ReadLineOptions {
135
322
  input: NodeJS.ReadableStream;
136
323
  output?: NodeJS.WritableStream | undefined;
137
324
  completer?: Completer | AsyncCompleter | undefined;
138
325
  terminal?: boolean | undefined;
326
+ /**
327
+ * Initial list of history lines. This option makes sense
328
+ * only if `terminal` is set to `true` by the user or by an internal `output`
329
+ * check, otherwise the history caching mechanism is not initialized at all.
330
+ * @default []
331
+ */
332
+ history?: string[] | undefined;
139
333
  historySize?: number | undefined;
140
334
  prompt?: string | undefined;
141
335
  crlfDelay?: number | undefined;
336
+ /**
337
+ * If `true`, when a new input line added
338
+ * to the history list duplicates an older one, this removes the older line
339
+ * from the list.
340
+ * @default false
341
+ */
142
342
  removeHistoryDuplicates?: boolean | undefined;
143
343
  escapeCodeTimeout?: number | undefined;
144
344
  tabSize?: number | undefined;
145
345
  }
146
-
346
+ /**
347
+ * The `readline.createInterface()` method creates a new `readline.Interface`instance.
348
+ *
349
+ * ```js
350
+ * const readline = require('readline');
351
+ * const rl = readline.createInterface({
352
+ * input: process.stdin,
353
+ * output: process.stdout
354
+ * });
355
+ * ```
356
+ *
357
+ * Once the `readline.Interface` instance is created, the most common case is to
358
+ * listen for the `'line'` event:
359
+ *
360
+ * ```js
361
+ * rl.on('line', (line) => {
362
+ * console.log(`Received: ${line}`);
363
+ * });
364
+ * ```
365
+ *
366
+ * If `terminal` is `true` for this instance then the `output` stream will get
367
+ * the best compatibility if it defines an `output.columns` property and emits
368
+ * a `'resize'` event on the `output` if or when the columns ever change
369
+ * (`process.stdout` does this automatically when it is a TTY).
370
+ *
371
+ * When creating a `readline.Interface` using `stdin` as input, the program
372
+ * will not terminate until it receives `EOF` (Ctrl+D on
373
+ * Linux/macOS, Ctrl+Z followed by Return on
374
+ * Windows).
375
+ * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream:
376
+ *
377
+ * ```js
378
+ * process.stdin.unref();
379
+ * ```
380
+ * @since v0.1.98
381
+ */
147
382
  function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
148
383
  function createInterface(options: ReadLineOptions): Interface;
384
+ /**
385
+ * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
386
+ *
387
+ * Optionally, `interface` specifies a `readline.Interface` instance for which
388
+ * autocompletion is disabled when copy-pasted input is detected.
389
+ *
390
+ * If the `stream` is a `TTY`, then it must be in raw mode.
391
+ *
392
+ * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop
393
+ * the `input` from emitting `'keypress'` events.
394
+ *
395
+ * ```js
396
+ * readline.emitKeypressEvents(process.stdin);
397
+ * if (process.stdin.isTTY)
398
+ * process.stdin.setRawMode(true);
399
+ * ```
400
+ * @since v0.7.7
401
+ */
149
402
  function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
150
-
151
403
  type Direction = -1 | 0 | 1;
152
-
153
404
  interface CursorPos {
154
405
  rows: number;
155
406
  cols: number;
156
407
  }
157
-
158
408
  /**
159
- * Clears the current line of this WriteStream in a direction identified by `dir`.
409
+ * The `readline.clearLine()` method clears current line of given `TTY` stream
410
+ * in a specified direction identified by `dir`.
411
+ * @since v0.7.7
412
+ * @param callback Invoked once the operation completes.
413
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
160
414
  */
161
415
  function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
162
416
  /**
163
- * Clears this `WriteStream` from the current cursor down.
417
+ * The `readline.clearScreenDown()` method clears the given `TTY` stream from
418
+ * the current position of the cursor down.
419
+ * @since v0.7.7
420
+ * @param callback Invoked once the operation completes.
421
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
164
422
  */
165
423
  function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
166
424
  /**
167
- * Moves this WriteStream's cursor to the specified position.
425
+ * The `readline.cursorTo()` method moves cursor to the specified position in a
426
+ * given `TTY` `stream`.
427
+ * @since v0.7.7
428
+ * @param callback Invoked once the operation completes.
429
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
168
430
  */
169
431
  function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
170
432
  /**
171
- * Moves this WriteStream's cursor relative to its current position.
433
+ * The `readline.moveCursor()` method moves the cursor _relative_ to its current
434
+ * position in a given `TTY` `stream`.
435
+ *
436
+ * ## Example: Tiny CLI
437
+ *
438
+ * The following example illustrates the use of `readline.Interface` class to
439
+ * implement a small command-line interface:
440
+ *
441
+ * ```js
442
+ * const readline = require('readline');
443
+ * const rl = readline.createInterface({
444
+ * input: process.stdin,
445
+ * output: process.stdout,
446
+ * prompt: 'OHAI> '
447
+ * });
448
+ *
449
+ * rl.prompt();
450
+ *
451
+ * rl.on('line', (line) => {
452
+ * switch (line.trim()) {
453
+ * case 'hello':
454
+ * console.log('world!');
455
+ * break;
456
+ * default:
457
+ * console.log(`Say what? I might have heard '${line.trim()}'`);
458
+ * break;
459
+ * }
460
+ * rl.prompt();
461
+ * }).on('close', () => {
462
+ * console.log('Have a great day!');
463
+ * process.exit(0);
464
+ * });
465
+ * ```
466
+ *
467
+ * ## Example: Read file stream line-by-Line
468
+ *
469
+ * A common use case for `readline` is to consume an input file one line at a
470
+ * time. The easiest way to do so is leveraging the `fs.ReadStream` API as
471
+ * well as a `for await...of` loop:
472
+ *
473
+ * ```js
474
+ * const fs = require('fs');
475
+ * const readline = require('readline');
476
+ *
477
+ * async function processLineByLine() {
478
+ * const fileStream = fs.createReadStream('input.txt');
479
+ *
480
+ * const rl = readline.createInterface({
481
+ * input: fileStream,
482
+ * crlfDelay: Infinity
483
+ * });
484
+ * // Note: we use the crlfDelay option to recognize all instances of CR LF
485
+ * // ('\r\n') in input.txt as a single line break.
486
+ *
487
+ * for await (const line of rl) {
488
+ * // Each line in input.txt will be successively available here as `line`.
489
+ * console.log(`Line from file: ${line}`);
490
+ * }
491
+ * }
492
+ *
493
+ * processLineByLine();
494
+ * ```
495
+ *
496
+ * Alternatively, one could use the `'line'` event:
497
+ *
498
+ * ```js
499
+ * const fs = require('fs');
500
+ * const readline = require('readline');
501
+ *
502
+ * const rl = readline.createInterface({
503
+ * input: fs.createReadStream('sample.txt'),
504
+ * crlfDelay: Infinity
505
+ * });
506
+ *
507
+ * rl.on('line', (line) => {
508
+ * console.log(`Line from file: ${line}`);
509
+ * });
510
+ * ```
511
+ *
512
+ * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied:
513
+ *
514
+ * ```js
515
+ * const { once } = require('events');
516
+ * const { createReadStream } = require('fs');
517
+ * const { createInterface } = require('readline');
518
+ *
519
+ * (async function processLineByLine() {
520
+ * try {
521
+ * const rl = createInterface({
522
+ * input: createReadStream('big-file.txt'),
523
+ * crlfDelay: Infinity
524
+ * });
525
+ *
526
+ * rl.on('line', (line) => {
527
+ * // Process the line.
528
+ * });
529
+ *
530
+ * await once(rl, 'close');
531
+ *
532
+ * console.log('File processed.');
533
+ * } catch (err) {
534
+ * console.error(err);
535
+ * }
536
+ * })();
537
+ * ```
538
+ * @since v0.7.7
539
+ * @param callback Invoked once the operation completes.
540
+ * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
172
541
  */
173
542
  function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
174
543
  }
@@ -0,0 +1,15 @@
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 */
3
+
4
+ declare module 'stream/consumers' {
5
+ import { Readable } from 'node:stream';
6
+ import { Blob as NodeBlob } from "node:buffer";
7
+ function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<Buffer>;
8
+ function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<string>;
9
+ function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<ArrayBuffer>;
10
+ function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<NodeBlob>;
11
+ function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator<any>): Promise<unknown>;
12
+ }
13
+ declare module 'node:stream/consumers' {
14
+ export * from 'stream/consumers';
15
+ }
@@ -0,0 +1,45 @@
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 */
3
+
4
+ declare module 'stream/promises' {
5
+ import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream';
6
+ function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
7
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(source: A, destination: B, options?: PipelineOptions): PipelinePromise<B>;
8
+ function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, B extends PipelineDestination<T1, any>>(
9
+ source: A,
10
+ transform1: T1,
11
+ destination: B,
12
+ options?: PipelineOptions
13
+ ): PipelinePromise<B>;
14
+ function pipeline<A extends PipelineSource<any>, T1 extends PipelineTransform<A, any>, T2 extends PipelineTransform<T1, any>, B extends PipelineDestination<T2, any>>(
15
+ source: A,
16
+ transform1: T1,
17
+ transform2: T2,
18
+ destination: B,
19
+ options?: PipelineOptions
20
+ ): PipelinePromise<B>;
21
+ function pipeline<
22
+ A extends PipelineSource<any>,
23
+ T1 extends PipelineTransform<A, any>,
24
+ T2 extends PipelineTransform<T1, any>,
25
+ T3 extends PipelineTransform<T2, any>,
26
+ B extends PipelineDestination<T3, any>
27
+ >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise<B>;
28
+ function pipeline<
29
+ A extends PipelineSource<any>,
30
+ T1 extends PipelineTransform<A, any>,
31
+ T2 extends PipelineTransform<T1, any>,
32
+ T3 extends PipelineTransform<T2, any>,
33
+ T4 extends PipelineTransform<T3, any>,
34
+ B extends PipelineDestination<T4, any>
35
+ >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise<B>;
36
+ function pipeline(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, options?: PipelineOptions): Promise<void>;
37
+ function pipeline(
38
+ stream1: NodeJS.ReadableStream,
39
+ stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
40
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
41
+ ): Promise<void>;
42
+ }
43
+ declare module 'node:stream/promises' {
44
+ export * from 'stream/promises';
45
+ }