@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,100 +1,321 @@
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 `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/v16.9.0/lib/console.js)
60
+ */
4
61
  declare module 'console' {
5
62
  import console = require('node:console');
6
63
  export = console;
7
64
  }
8
65
  declare module 'node:console' {
9
- import { InspectOptions } from 'util';
10
-
66
+ import { InspectOptions } from 'node:util';
11
67
  global {
12
68
  // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
13
69
  interface Console {
14
- Console: NodeJS.ConsoleConstructor;
70
+ Console: console.ConsoleConstructor;
15
71
  /**
16
- * A simple assertion test that verifies whether `value` is truthy.
17
- * If it is not, an `AssertionError` is thrown.
18
- * If provided, the error `message` is formatted using `util.format()` and used as the error message.
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.
19
90
  */
20
91
  assert(value: any, message?: string, ...optionalParams: any[]): void;
21
92
  /**
22
- * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY.
23
- * When `stdout` is not a TTY, this method does nothing.
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
24
101
  */
25
102
  clear(): void;
26
103
  /**
27
- * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`.
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.
28
130
  */
29
131
  count(label?: string): void;
30
132
  /**
31
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.
32
148
  */
33
149
  countReset(label?: string): void;
34
150
  /**
35
- * The `console.debug()` function is an alias for {@link console.log}.
151
+ * The `console.debug()` function is an alias for {@link log}.
152
+ * @since v8.0.0
36
153
  */
37
154
  debug(message?: any, ...optionalParams: any[]): void;
38
155
  /**
39
- * Uses {@link util.inspect} on `obj` and prints the resulting string to `stdout`.
156
+ * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`.
40
157
  * This function bypasses any custom `inspect()` function defined on `obj`.
158
+ * @since v0.1.101
41
159
  */
42
160
  dir(obj: any, options?: InspectOptions): void;
43
161
  /**
44
- * This method calls {@link console.log} passing it the arguments received. Please note that this method does not produce any XML formatting
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
45
165
  */
46
166
  dirxml(...data: any[]): void;
47
167
  /**
48
- * Prints to `stderr` with newline.
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
49
183
  */
50
184
  error(message?: any, ...optionalParams: any[]): void;
51
185
  /**
52
- * Increases indentation of subsequent lines by two spaces.
53
- * If one or more `label`s are provided, those are printed first without the additional indentation.
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
54
191
  */
55
192
  group(...label: any[]): void;
56
193
  /**
57
- * The `console.groupCollapsed()` function is an alias for {@link console.group}.
194
+ * An alias for {@link group}.
195
+ * @since v8.5.0
58
196
  */
59
197
  groupCollapsed(...label: any[]): void;
60
198
  /**
61
- * Decreases indentation of subsequent lines by two spaces.
199
+ * Decreases indentation of subsequent lines by spaces for `groupIndentation`length.
200
+ * @since v8.5.0
62
201
  */
63
202
  groupEnd(): void;
64
203
  /**
65
- * The {@link console.info} function is an alias for {@link console.log}.
204
+ * The `console.info()` function is an alias for {@link log}.
205
+ * @since v0.1.100
66
206
  */
67
207
  info(message?: any, ...optionalParams: any[]): void;
68
208
  /**
69
- * Prints to `stdout` with newline.
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
70
223
  */
71
224
  log(message?: any, ...optionalParams: any[]): void;
72
225
  /**
73
- * This method does not display anything unless used in the inspector.
74
- * Prints to `stdout` the array `array` formatted as a table.
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.
75
255
  */
76
256
  table(tabularData: any, properties?: ReadonlyArray<string>): void;
77
257
  /**
78
- * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
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
79
263
  */
80
264
  time(label?: string): void;
81
265
  /**
82
- * Stops a timer that was previously started by calling {@link console.time} and prints the result to `stdout`.
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
83
276
  */
84
277
  timeEnd(label?: string): void;
85
278
  /**
86
- * For a timer that was previously started by calling {@link console.time}, prints the elapsed time and other `data` arguments to `stdout`.
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
87
291
  */
88
292
  timeLog(label?: string, ...data: any[]): void;
89
293
  /**
90
- * Prints to `stderr` the string 'Trace :', followed by the {@link util.format} formatted message and stack trace to the current position in the code.
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
91
312
  */
92
313
  trace(message?: any, ...optionalParams: any[]): void;
93
314
  /**
94
- * The {@link console.warn} function is an alias for {@link console.error}.
315
+ * The `console.warn()` function is an alias for {@link error}.
316
+ * @since v0.1.100
95
317
  */
96
318
  warn(message?: any, ...optionalParams: any[]): void;
97
-
98
319
  // --- Inspector mode only ---
99
320
  /**
100
321
  * This method does not display anything unless used in the inspector.
@@ -112,13 +333,67 @@ declare module 'node:console' {
112
333
  */
113
334
  timeStamp(label?: string): void;
114
335
  }
115
-
116
- var console: Console;
117
-
118
- namespace NodeJS {
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 {
119
394
  interface ConsoleConstructorOptions {
120
- stdout: WritableStream;
121
- stderr?: WritableStream | undefined;
395
+ stdout: NodeJS.WritableStream;
396
+ stderr?: NodeJS.WritableStream | undefined;
122
397
  ignoreErrors?: boolean | undefined;
123
398
  colorMode?: boolean | 'auto' | undefined;
124
399
  inspectOptions?: InspectOptions | undefined;
@@ -126,20 +401,15 @@ declare module 'node:console' {
126
401
  * Set group indentation
127
402
  * @default 2
128
403
  */
129
- groupIndentation?: number | undefined;
404
+ groupIndentation?: number | undefined;
130
405
  }
131
-
132
406
  interface ConsoleConstructor {
133
407
  prototype: Console;
134
- new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
135
- new(options: ConsoleConstructorOptions): Console;
136
- }
137
-
138
- interface Global {
139
- console: typeof console;
408
+ new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
409
+ new (options: ConsoleConstructorOptions): Console;
140
410
  }
141
411
  }
412
+ var console: Console;
142
413
  }
143
-
144
- export = console;
414
+ export = globalThis.console;
145
415
  }