@node-red/editor-client 3.1.8 → 4.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/locales/de/editor.json +2 -0
  2. package/locales/en-US/editor.json +10 -1
  3. package/locales/fr/editor.json +8 -1
  4. package/locales/ja/editor.json +10 -3
  5. package/package.json +1 -1
  6. package/public/red/about +52 -0
  7. package/public/red/red.js +1433 -263
  8. package/public/red/red.min.js +3 -3
  9. package/public/red/style.min.css +2 -2
  10. package/public/red/tours/3.1/welcome.js +231 -0
  11. package/public/red/tours/images/nr4-auto-complete.png +0 -0
  12. package/public/red/tours/images/nr4-config-select.png +0 -0
  13. package/public/red/tours/images/nr4-multiplayer.png +0 -0
  14. package/public/red/tours/images/nr4-plugins.png +0 -0
  15. package/public/red/tours/images/nr4-sf-config.png +0 -0
  16. package/public/red/tours/images/nr4-timestamp-formatting.png +0 -0
  17. package/public/red/tours/welcome.js +105 -161
  18. package/public/types/node/assert/strict.d.ts +1 -1
  19. package/public/types/node/assert.d.ts +8 -9
  20. package/public/types/node/async_hooks.d.ts +9 -5
  21. package/public/types/node/buffer.d.ts +43 -18
  22. package/public/types/node/child_process.d.ts +8 -5
  23. package/public/types/node/cluster.d.ts +15 -19
  24. package/public/types/node/console.d.ts +2 -2
  25. package/public/types/node/crypto.d.ts +165 -70
  26. package/public/types/node/dgram.d.ts +4 -4
  27. package/public/types/node/diagnostics_channel.d.ts +8 -7
  28. package/public/types/node/dns/promises.d.ts +11 -9
  29. package/public/types/node/dns.d.ts +18 -13
  30. package/public/types/node/dom-events.d.ts +129 -0
  31. package/public/types/node/domain.d.ts +2 -2
  32. package/public/types/node/events.d.ts +49 -12
  33. package/public/types/node/fs/promises.d.ts +68 -24
  34. package/public/types/node/fs.d.ts +132 -59
  35. package/public/types/node/globals.d.ts +31 -17
  36. package/public/types/node/http.d.ts +138 -27
  37. package/public/types/node/http2.d.ts +38 -5
  38. package/public/types/node/https.d.ts +12 -3
  39. package/public/types/node/module.d.ts +1 -2
  40. package/public/types/node/net.d.ts +69 -28
  41. package/public/types/node/os.d.ts +16 -5
  42. package/public/types/node/path.d.ts +5 -5
  43. package/public/types/node/perf_hooks.d.ts +48 -9
  44. package/public/types/node/process.d.ts +18 -17
  45. package/public/types/node/querystring.d.ts +2 -2
  46. package/public/types/node/readline/promises.d.ts +146 -0
  47. package/public/types/node/readline.d.ts +141 -31
  48. package/public/types/node/stream/consumers.d.ts +2 -2
  49. package/public/types/node/stream/promises.d.ts +1 -1
  50. package/public/types/node/stream/web.d.ts +4 -66
  51. package/public/types/node/stream.d.ts +96 -118
  52. package/public/types/node/string_decoder.d.ts +2 -2
  53. package/public/types/node/test.d.ts +200 -16
  54. package/public/types/node/timers/promises.d.ts +1 -26
  55. package/public/types/node/timers.d.ts +2 -2
  56. package/public/types/node/tls.d.ts +21 -12
  57. package/public/types/node/trace_events.d.ts +12 -2
  58. package/public/types/node/ts4.8/assert/strict.d.ts +11 -0
  59. package/public/types/node/ts4.8/assert.d.ts +964 -0
  60. package/public/types/node/ts4.8/async_hooks.d.ts +504 -0
  61. package/public/types/node/ts4.8/buffer.d.ts +2262 -0
  62. package/public/types/node/ts4.8/child_process.d.ts +1372 -0
  63. package/public/types/node/ts4.8/cluster.d.ts +413 -0
  64. package/public/types/node/ts4.8/console.d.ts +415 -0
  65. package/public/types/node/ts4.8/crypto.d.ts +3967 -0
  66. package/public/types/node/ts4.8/dgram.d.ts +548 -0
  67. package/public/types/node/ts4.8/diagnostics_channel.d.ts +156 -0
  68. package/public/types/node/ts4.8/dns/promises.d.ts +373 -0
  69. package/public/types/node/ts4.8/dns.d.ts +662 -0
  70. package/public/types/node/ts4.8/dom-events.d.ts +129 -0
  71. package/public/types/node/ts4.8/domain.d.ts +173 -0
  72. package/public/types/node/ts4.8/events.d.ts +681 -0
  73. package/public/types/node/ts4.8/fs/promises.d.ts +1141 -0
  74. package/public/types/node/ts4.8/fs.d.ts +3875 -0
  75. package/public/types/node/ts4.8/globals.d.ts +297 -0
  76. package/public/types/node/ts4.8/http.d.ts +1617 -0
  77. package/public/types/node/ts4.8/http2.d.ts +2137 -0
  78. package/public/types/node/ts4.8/https.d.ts +544 -0
  79. package/public/types/node/ts4.8/module.d.ts +117 -0
  80. package/public/types/node/ts4.8/net.d.ts +872 -0
  81. package/public/types/node/ts4.8/os.d.ts +469 -0
  82. package/public/types/node/ts4.8/path.d.ts +194 -0
  83. package/public/types/node/ts4.8/perf_hooks.d.ts +628 -0
  84. package/public/types/node/ts4.8/process.d.ts +1485 -0
  85. package/public/types/node/ts4.8/querystring.d.ts +134 -0
  86. package/public/types/node/ts4.8/readline/promises.d.ts +146 -0
  87. package/public/types/node/ts4.8/readline.d.ts +656 -0
  88. package/public/types/node/ts4.8/stream/consumers.d.ts +15 -0
  89. package/public/types/node/ts4.8/stream/promises.d.ts +45 -0
  90. package/public/types/node/ts4.8/stream/web.d.ts +333 -0
  91. package/public/types/node/ts4.8/stream.d.ts +1343 -0
  92. package/public/types/node/ts4.8/string_decoder.d.ts +70 -0
  93. package/public/types/node/ts4.8/test.d.ts +377 -0
  94. package/public/types/node/ts4.8/timers/promises.d.ts +71 -0
  95. package/public/types/node/ts4.8/timers.d.ts +97 -0
  96. package/public/types/node/ts4.8/tls.d.ts +1031 -0
  97. package/public/types/node/ts4.8/trace_events.d.ts +174 -0
  98. package/public/types/node/ts4.8/tty.d.ts +209 -0
  99. package/public/types/node/ts4.8/url.d.ts +900 -0
  100. package/public/types/node/ts4.8/util.d.ts +1853 -0
  101. package/public/types/node/ts4.8/v8.d.ts +399 -0
  102. package/public/types/node/ts4.8/vm.d.ts +512 -0
  103. package/public/types/node/ts4.8/wasi.d.ts +161 -0
  104. package/public/types/node/ts4.8/worker_threads.d.ts +692 -0
  105. package/public/types/node/ts4.8/zlib.d.ts +520 -0
  106. package/public/types/node/tty.d.ts +5 -3
  107. package/public/types/node/url.d.ts +81 -39
  108. package/public/types/node/util.d.ts +269 -13
  109. package/public/types/node/v8.d.ts +22 -4
  110. package/public/types/node/vm.d.ts +7 -5
  111. package/public/types/node/wasi.d.ts +2 -2
  112. package/public/types/node/worker_threads.d.ts +51 -11
  113. package/public/types/node/zlib.d.ts +2 -2
  114. package/public/types/node-red/func.d.ts +26 -17
  115. package/public/vendor/ace/worker-jsonata.js +1 -1
  116. package/public/vendor/monaco/dist/{fa2cc0ab9f0bec2b3365.ttf → 0c718f5b7d2bce997c5f.ttf} +0 -0
  117. package/public/vendor/monaco/dist/css.worker.js +1 -1
  118. package/public/vendor/monaco/dist/css.worker.js.LICENSE.txt +1 -1
  119. package/public/vendor/monaco/dist/editor.js +1 -29
  120. package/public/vendor/monaco/dist/editor.js.LICENSE.txt +2 -2
  121. package/public/vendor/monaco/dist/editor.worker.js +1 -1
  122. package/public/vendor/monaco/dist/html.worker.js +1 -1
  123. package/public/vendor/monaco/dist/html.worker.js.LICENSE.txt +1 -1
  124. package/public/vendor/monaco/dist/json.worker.js +1 -1
  125. package/public/vendor/monaco/dist/json.worker.js.LICENSE.txt +1 -1
  126. package/public/vendor/monaco/dist/locale/cs.js +324 -106
  127. package/public/vendor/monaco/dist/locale/de.js +336 -118
  128. package/public/vendor/monaco/dist/locale/es.js +329 -111
  129. package/public/vendor/monaco/dist/locale/fr.js +334 -116
  130. package/public/vendor/monaco/dist/locale/it.js +327 -109
  131. package/public/vendor/monaco/dist/locale/ja.js +329 -111
  132. package/public/vendor/monaco/dist/locale/ko.js +330 -112
  133. package/public/vendor/monaco/dist/locale/pl.js +329 -111
  134. package/public/vendor/monaco/dist/locale/pt-br.js +329 -111
  135. package/public/vendor/monaco/dist/locale/qps-ploc.js +330 -112
  136. package/public/vendor/monaco/dist/locale/ru.js +331 -113
  137. package/public/vendor/monaco/dist/locale/tr.js +329 -111
  138. package/public/vendor/monaco/dist/locale/zh-hans.js +331 -113
  139. package/public/vendor/monaco/dist/locale/zh-hant.js +331 -113
  140. package/public/vendor/monaco/dist/ts.worker.js +2 -2
  141. package/public/vendor/vendor.js +1 -1
  142. package/public/vendor/monaco/dist/7064e66c3890a12c47b4.ttf +0 -0
  143. /package/public/red/tours/{images → 3.1/images}/context-menu.png +0 -0
  144. /package/public/red/tours/{images → 3.1/images}/global-env-vars.png +0 -0
  145. /package/public/red/tours/{images → 3.1/images}/hiding-flows.png +0 -0
  146. /package/public/red/tours/{images → 3.1/images}/locking-flows.png +0 -0
  147. /package/public/red/tours/{images → 3.1/images}/mermaid.png +0 -0
  148. /package/public/red/tours/{images → 3.1/images}/node-help.png +0 -0
  149. /package/public/red/tours/{images → 3.1/images}/tab-changes.png +0 -0
@@ -0,0 +1,415 @@
1
+
2
+ /* NOTE: Do not edit directly! This file is generated using `npm run update-types` in https://github.com/node-red/nr-monaco-build */
3
+
4
+ /**
5
+ * The `console` module provides a simple debugging console that is similar to the
6
+ * JavaScript console mechanism provided by web browsers.
7
+ *
8
+ * The module exports two specific components:
9
+ *
10
+ * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream.
11
+ * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`.
12
+ *
13
+ * _**Warning**_: The global console object's methods are neither consistently
14
+ * synchronous like the browser APIs they resemble, nor are they consistently
15
+ * asynchronous like all other Node.js streams. See the `note on process I/O` for
16
+ * more information.
17
+ *
18
+ * Example using the global `console`:
19
+ *
20
+ * ```js
21
+ * console.log('hello world');
22
+ * // Prints: hello world, to stdout
23
+ * console.log('hello %s', 'world');
24
+ * // Prints: hello world, to stdout
25
+ * console.error(new Error('Whoops, something bad happened'));
26
+ * // Prints error message and stack trace to stderr:
27
+ * // Error: Whoops, something bad happened
28
+ * // at [eval]:5:15
29
+ * // at Script.runInThisContext (node:vm:132:18)
30
+ * // at Object.runInThisContext (node:vm:309:38)
31
+ * // at node:internal/process/execution:77:19
32
+ * // at [eval]-wrapper:6:22
33
+ * // at evalScript (node:internal/process/execution:76:60)
34
+ * // at node:internal/main/eval_string:23:3
35
+ *
36
+ * const name = 'Will Robinson';
37
+ * console.warn(`Danger ${name}! Danger!`);
38
+ * // Prints: Danger Will Robinson! Danger!, to stderr
39
+ * ```
40
+ *
41
+ * Example using the `Console` class:
42
+ *
43
+ * ```js
44
+ * const out = getStreamSomehow();
45
+ * const err = getStreamSomehow();
46
+ * const myConsole = new console.Console(out, err);
47
+ *
48
+ * myConsole.log('hello world');
49
+ * // Prints: hello world, to out
50
+ * myConsole.log('hello %s', 'world');
51
+ * // Prints: hello world, to out
52
+ * myConsole.error(new Error('Whoops, something bad happened'));
53
+ * // Prints: [Error: Whoops, something bad happened], to err
54
+ *
55
+ * const name = 'Will Robinson';
56
+ * myConsole.warn(`Danger ${name}! Danger!`);
57
+ * // Prints: Danger Will Robinson! Danger!, to err
58
+ * ```
59
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/console.js)
60
+ */
61
+ declare module 'console' {
62
+ import console = require('node:console');
63
+ export = console;
64
+ }
65
+ declare module 'node:console' {
66
+ import { InspectOptions } from 'node:util';
67
+ global {
68
+ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
69
+ interface Console {
70
+ Console: console.ConsoleConstructor;
71
+ /**
72
+ * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only
73
+ * writes a message and does not otherwise affect execution. The output always
74
+ * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`.
75
+ *
76
+ * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens.
77
+ *
78
+ * ```js
79
+ * console.assert(true, 'does nothing');
80
+ *
81
+ * console.assert(false, 'Whoops %s work', 'didn\'t');
82
+ * // Assertion failed: Whoops didn't work
83
+ *
84
+ * console.assert();
85
+ * // Assertion failed
86
+ * ```
87
+ * @since v0.1.101
88
+ * @param value The value tested for being truthy.
89
+ * @param message All arguments besides `value` are used as error message.
90
+ */
91
+ assert(value: any, message?: string, ...optionalParams: any[]): void;
92
+ /**
93
+ * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the
94
+ * TTY. When `stdout` is not a TTY, this method does nothing.
95
+ *
96
+ * The specific operation of `console.clear()` can vary across operating systems
97
+ * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the
98
+ * current terminal viewport for the Node.js
99
+ * binary.
100
+ * @since v8.3.0
101
+ */
102
+ clear(): void;
103
+ /**
104
+ * Maintains an internal counter specific to `label` and outputs to `stdout` the
105
+ * number of times `console.count()` has been called with the given `label`.
106
+ *
107
+ * ```js
108
+ * > console.count()
109
+ * default: 1
110
+ * undefined
111
+ * > console.count('default')
112
+ * default: 2
113
+ * undefined
114
+ * > console.count('abc')
115
+ * abc: 1
116
+ * undefined
117
+ * > console.count('xyz')
118
+ * xyz: 1
119
+ * undefined
120
+ * > console.count('abc')
121
+ * abc: 2
122
+ * undefined
123
+ * > console.count()
124
+ * default: 3
125
+ * undefined
126
+ * >
127
+ * ```
128
+ * @since v8.3.0
129
+ * @param label The display label for the counter.
130
+ */
131
+ count(label?: string): void;
132
+ /**
133
+ * Resets the internal counter specific to `label`.
134
+ *
135
+ * ```js
136
+ * > console.count('abc');
137
+ * abc: 1
138
+ * undefined
139
+ * > console.countReset('abc');
140
+ * undefined
141
+ * > console.count('abc');
142
+ * abc: 1
143
+ * undefined
144
+ * >
145
+ * ```
146
+ * @since v8.3.0
147
+ * @param label The display label for the counter.
148
+ */
149
+ countReset(label?: string): void;
150
+ /**
151
+ * The `console.debug()` function is an alias for {@link log}.
152
+ * @since v8.0.0
153
+ */
154
+ debug(message?: any, ...optionalParams: any[]): void;
155
+ /**
156
+ * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`.
157
+ * This function bypasses any custom `inspect()` function defined on `obj`.
158
+ * @since v0.1.101
159
+ */
160
+ dir(obj: any, options?: InspectOptions): void;
161
+ /**
162
+ * This method calls `console.log()` passing it the arguments received.
163
+ * This method does not produce any XML formatting.
164
+ * @since v8.0.0
165
+ */
166
+ dirxml(...data: any[]): void;
167
+ /**
168
+ * Prints to `stderr` with newline. Multiple arguments can be passed, with the
169
+ * first used as the primary message and all additional used as substitution
170
+ * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`).
171
+ *
172
+ * ```js
173
+ * const code = 5;
174
+ * console.error('error #%d', code);
175
+ * // Prints: error #5, to stderr
176
+ * console.error('error', code);
177
+ * // Prints: error 5, to stderr
178
+ * ```
179
+ *
180
+ * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string
181
+ * values are concatenated. See `util.format()` for more information.
182
+ * @since v0.1.100
183
+ */
184
+ error(message?: any, ...optionalParams: any[]): void;
185
+ /**
186
+ * Increases indentation of subsequent lines by spaces for `groupIndentation`length.
187
+ *
188
+ * If one or more `label`s are provided, those are printed first without the
189
+ * additional indentation.
190
+ * @since v8.5.0
191
+ */
192
+ group(...label: any[]): void;
193
+ /**
194
+ * An alias for {@link group}.
195
+ * @since v8.5.0
196
+ */
197
+ groupCollapsed(...label: any[]): void;
198
+ /**
199
+ * Decreases indentation of subsequent lines by spaces for `groupIndentation`length.
200
+ * @since v8.5.0
201
+ */
202
+ groupEnd(): void;
203
+ /**
204
+ * The `console.info()` function is an alias for {@link log}.
205
+ * @since v0.1.100
206
+ */
207
+ info(message?: any, ...optionalParams: any[]): void;
208
+ /**
209
+ * Prints to `stdout` with newline. Multiple arguments can be passed, with the
210
+ * first used as the primary message and all additional used as substitution
211
+ * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`).
212
+ *
213
+ * ```js
214
+ * const count = 5;
215
+ * console.log('count: %d', count);
216
+ * // Prints: count: 5, to stdout
217
+ * console.log('count:', count);
218
+ * // Prints: count: 5, to stdout
219
+ * ```
220
+ *
221
+ * See `util.format()` for more information.
222
+ * @since v0.1.100
223
+ */
224
+ log(message?: any, ...optionalParams: any[]): void;
225
+ /**
226
+ * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just
227
+ * logging the argument if it can’t be parsed as tabular.
228
+ *
229
+ * ```js
230
+ * // These can't be parsed as tabular data
231
+ * console.table(Symbol());
232
+ * // Symbol()
233
+ *
234
+ * console.table(undefined);
235
+ * // undefined
236
+ *
237
+ * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]);
238
+ * // ┌─────────┬─────┬─────┐
239
+ * // │ (index) │ a │ b │
240
+ * // ├─────────┼─────┼─────┤
241
+ * // │ 0 │ 1 │ 'Y' │
242
+ * // │ 1 │ 'Z' │ 2 │
243
+ * // └─────────┴─────┴─────┘
244
+ *
245
+ * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']);
246
+ * // ┌─────────┬─────┐
247
+ * // │ (index) │ a │
248
+ * // ├─────────┼─────┤
249
+ * // │ 0 │ 1 │
250
+ * // │ 1 │ 'Z' │
251
+ * // └─────────┴─────┘
252
+ * ```
253
+ * @since v10.0.0
254
+ * @param properties Alternate properties for constructing the table.
255
+ */
256
+ table(tabularData: any, properties?: ReadonlyArray<string>): void;
257
+ /**
258
+ * Starts a timer that can be used to compute the duration of an operation. Timers
259
+ * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in
260
+ * suitable time units to `stdout`. For example, if the elapsed
261
+ * time is 3869ms, `console.timeEnd()` displays "3.869s".
262
+ * @since v0.1.104
263
+ */
264
+ time(label?: string): void;
265
+ /**
266
+ * Stops a timer that was previously started by calling {@link time} and
267
+ * prints the result to `stdout`:
268
+ *
269
+ * ```js
270
+ * console.time('100-elements');
271
+ * for (let i = 0; i < 100; i++) {}
272
+ * console.timeEnd('100-elements');
273
+ * // prints 100-elements: 225.438ms
274
+ * ```
275
+ * @since v0.1.104
276
+ */
277
+ timeEnd(label?: string): void;
278
+ /**
279
+ * For a timer that was previously started by calling {@link time}, prints
280
+ * the elapsed time and other `data` arguments to `stdout`:
281
+ *
282
+ * ```js
283
+ * console.time('process');
284
+ * const value = expensiveProcess1(); // Returns 42
285
+ * console.timeLog('process', value);
286
+ * // Prints "process: 365.227ms 42".
287
+ * doExpensiveProcess2(value);
288
+ * console.timeEnd('process');
289
+ * ```
290
+ * @since v10.7.0
291
+ */
292
+ timeLog(label?: string, ...data: any[]): void;
293
+ /**
294
+ * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code.
295
+ *
296
+ * ```js
297
+ * console.trace('Show me');
298
+ * // Prints: (stack trace will vary based on where trace is called)
299
+ * // Trace: Show me
300
+ * // at repl:2:9
301
+ * // at REPLServer.defaultEval (repl.js:248:27)
302
+ * // at bound (domain.js:287:14)
303
+ * // at REPLServer.runBound [as eval] (domain.js:300:12)
304
+ * // at REPLServer.<anonymous> (repl.js:412:12)
305
+ * // at emitOne (events.js:82:20)
306
+ * // at REPLServer.emit (events.js:169:7)
307
+ * // at REPLServer.Interface._onLine (readline.js:210:10)
308
+ * // at REPLServer.Interface._line (readline.js:549:8)
309
+ * // at REPLServer.Interface._ttyWrite (readline.js:826:14)
310
+ * ```
311
+ * @since v0.1.104
312
+ */
313
+ trace(message?: any, ...optionalParams: any[]): void;
314
+ /**
315
+ * The `console.warn()` function is an alias for {@link error}.
316
+ * @since v0.1.100
317
+ */
318
+ warn(message?: any, ...optionalParams: any[]): void;
319
+ // --- Inspector mode only ---
320
+ /**
321
+ * This method does not display anything unless used in the inspector.
322
+ * Starts a JavaScript CPU profile with an optional label.
323
+ */
324
+ profile(label?: string): void;
325
+ /**
326
+ * This method does not display anything unless used in the inspector.
327
+ * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
328
+ */
329
+ profileEnd(label?: string): void;
330
+ /**
331
+ * This method does not display anything unless used in the inspector.
332
+ * Adds an event with the label `label` to the Timeline panel of the inspector.
333
+ */
334
+ timeStamp(label?: string): void;
335
+ }
336
+ /**
337
+ * The `console` module provides a simple debugging console that is similar to the
338
+ * JavaScript console mechanism provided by web browsers.
339
+ *
340
+ * The module exports two specific components:
341
+ *
342
+ * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream.
343
+ * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`.
344
+ *
345
+ * _**Warning**_: The global console object's methods are neither consistently
346
+ * synchronous like the browser APIs they resemble, nor are they consistently
347
+ * asynchronous like all other Node.js streams. See the `note on process I/O` for
348
+ * more information.
349
+ *
350
+ * Example using the global `console`:
351
+ *
352
+ * ```js
353
+ * console.log('hello world');
354
+ * // Prints: hello world, to stdout
355
+ * console.log('hello %s', 'world');
356
+ * // Prints: hello world, to stdout
357
+ * console.error(new Error('Whoops, something bad happened'));
358
+ * // Prints error message and stack trace to stderr:
359
+ * // Error: Whoops, something bad happened
360
+ * // at [eval]:5:15
361
+ * // at Script.runInThisContext (node:vm:132:18)
362
+ * // at Object.runInThisContext (node:vm:309:38)
363
+ * // at node:internal/process/execution:77:19
364
+ * // at [eval]-wrapper:6:22
365
+ * // at evalScript (node:internal/process/execution:76:60)
366
+ * // at node:internal/main/eval_string:23:3
367
+ *
368
+ * const name = 'Will Robinson';
369
+ * console.warn(`Danger ${name}! Danger!`);
370
+ * // Prints: Danger Will Robinson! Danger!, to stderr
371
+ * ```
372
+ *
373
+ * Example using the `Console` class:
374
+ *
375
+ * ```js
376
+ * const out = getStreamSomehow();
377
+ * const err = getStreamSomehow();
378
+ * const myConsole = new console.Console(out, err);
379
+ *
380
+ * myConsole.log('hello world');
381
+ * // Prints: hello world, to out
382
+ * myConsole.log('hello %s', 'world');
383
+ * // Prints: hello world, to out
384
+ * myConsole.error(new Error('Whoops, something bad happened'));
385
+ * // Prints: [Error: Whoops, something bad happened], to err
386
+ *
387
+ * const name = 'Will Robinson';
388
+ * myConsole.warn(`Danger ${name}! Danger!`);
389
+ * // Prints: Danger Will Robinson! Danger!, to err
390
+ * ```
391
+ * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js)
392
+ */
393
+ namespace console {
394
+ interface ConsoleConstructorOptions {
395
+ stdout: NodeJS.WritableStream;
396
+ stderr?: NodeJS.WritableStream | undefined;
397
+ ignoreErrors?: boolean | undefined;
398
+ colorMode?: boolean | 'auto' | undefined;
399
+ inspectOptions?: InspectOptions | undefined;
400
+ /**
401
+ * Set group indentation
402
+ * @default 2
403
+ */
404
+ groupIndentation?: number | undefined;
405
+ }
406
+ interface ConsoleConstructor {
407
+ prototype: Console;
408
+ new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
409
+ new (options: ConsoleConstructorOptions): Console;
410
+ }
411
+ }
412
+ var console: Console;
413
+ }
414
+ export = globalThis.console;
415
+ }