@nocobase/plugin-multi-app-manager 2.0.0-beta.9 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/client/{db3a142b120d6553.js → 00b71fff3c8c7167.js} +1 -1
  2. package/dist/client/Migrate.d.ts +10 -0
  3. package/dist/client/index.js +1 -1
  4. package/dist/externalVersion.js +7 -7
  5. package/dist/locale/en-US.json +3 -2
  6. package/dist/locale/zh-CN.json +3 -2
  7. package/dist/node_modules/p-queue/dist/index.d.ts +101 -0
  8. package/dist/node_modules/p-queue/dist/index.js +1 -0
  9. package/dist/node_modules/p-queue/dist/lower-bound.d.ts +1 -0
  10. package/dist/node_modules/p-queue/dist/lower-bound.js +21 -0
  11. package/dist/node_modules/p-queue/dist/options.d.ts +64 -0
  12. package/dist/node_modules/p-queue/dist/options.js +2 -0
  13. package/dist/node_modules/p-queue/dist/priority-queue.d.ts +12 -0
  14. package/dist/node_modules/p-queue/dist/priority-queue.js +32 -0
  15. package/dist/node_modules/p-queue/dist/queue.d.ts +7 -0
  16. package/dist/node_modules/p-queue/dist/queue.js +2 -0
  17. package/dist/node_modules/p-queue/license +9 -0
  18. package/dist/node_modules/p-queue/node_modules/eventemitter3/index.d.ts +134 -0
  19. package/dist/node_modules/p-queue/node_modules/eventemitter3/index.js +336 -0
  20. package/dist/node_modules/p-queue/node_modules/eventemitter3/package.json +56 -0
  21. package/dist/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.js +340 -0
  22. package/dist/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.min.js +1 -0
  23. package/dist/node_modules/p-queue/package.json +1 -0
  24. package/dist/server/adapters/legacy-adapter.d.ts +43 -0
  25. package/dist/server/adapters/legacy-adapter.js +207 -0
  26. package/dist/server/server.d.ts +4 -6
  27. package/dist/server/server.js +38 -191
  28. package/package.json +2 -2
  29. package/dist/node_modules/mariadb/LICENSE +0 -502
  30. package/dist/node_modules/mariadb/callback.js +0 -41
  31. package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +0 -278
  32. package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +0 -372
  33. package/dist/node_modules/mariadb/lib/cmd/change-user.js +0 -149
  34. package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +0 -17
  35. package/dist/node_modules/mariadb/lib/cmd/column-definition.js +0 -102
  36. package/dist/node_modules/mariadb/lib/cmd/command.js +0 -168
  37. package/dist/node_modules/mariadb/lib/cmd/common-binary-cmd.js +0 -327
  38. package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +0 -427
  39. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +0 -168
  40. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +0 -23
  41. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +0 -761
  42. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +0 -55
  43. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +0 -58
  44. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +0 -19
  45. package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +0 -142
  46. package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +0 -74
  47. package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +0 -126
  48. package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +0 -292
  49. package/dist/node_modules/mariadb/lib/cmd/handshake/initial-handshake.js +0 -74
  50. package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +0 -29
  51. package/dist/node_modules/mariadb/lib/cmd/ping.js +0 -52
  52. package/dist/node_modules/mariadb/lib/cmd/query.js +0 -255
  53. package/dist/node_modules/mariadb/lib/cmd/quit.js +0 -28
  54. package/dist/node_modules/mariadb/lib/cmd/reset.js +0 -54
  55. package/dist/node_modules/mariadb/lib/cmd/resultset.js +0 -607
  56. package/dist/node_modules/mariadb/lib/cmd/stream.js +0 -45
  57. package/dist/node_modules/mariadb/lib/config/connection-options.js +0 -258
  58. package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +0 -19
  59. package/dist/node_modules/mariadb/lib/config/pool-options.js +0 -47
  60. package/dist/node_modules/mariadb/lib/connection-callback.js +0 -160
  61. package/dist/node_modules/mariadb/lib/connection.js +0 -1460
  62. package/dist/node_modules/mariadb/lib/const/capabilities.js +0 -64
  63. package/dist/node_modules/mariadb/lib/const/collations.js +0 -473
  64. package/dist/node_modules/mariadb/lib/const/connection_status.js +0 -13
  65. package/dist/node_modules/mariadb/lib/const/error-code.js +0 -1282
  66. package/dist/node_modules/mariadb/lib/const/field-detail.js +0 -35
  67. package/dist/node_modules/mariadb/lib/const/field-type.js +0 -71
  68. package/dist/node_modules/mariadb/lib/const/server-status.js +0 -30
  69. package/dist/node_modules/mariadb/lib/const/state-change.js +0 -12
  70. package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +0 -81
  71. package/dist/node_modules/mariadb/lib/io/bulk-packet.js +0 -590
  72. package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +0 -141
  73. package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +0 -171
  74. package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +0 -193
  75. package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +0 -36
  76. package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +0 -37
  77. package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +0 -502
  78. package/dist/node_modules/mariadb/lib/io/packet.js +0 -515
  79. package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +0 -481
  80. package/dist/node_modules/mariadb/lib/misc/connection-information.js +0 -96
  81. package/dist/node_modules/mariadb/lib/misc/errors.js +0 -123
  82. package/dist/node_modules/mariadb/lib/misc/parse.js +0 -1033
  83. package/dist/node_modules/mariadb/lib/misc/utils.js +0 -298
  84. package/dist/node_modules/mariadb/lib/pool-base.js +0 -611
  85. package/dist/node_modules/mariadb/lib/pool-callback.js +0 -202
  86. package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +0 -66
  87. package/dist/node_modules/mariadb/lib/pool-cluster.js +0 -407
  88. package/dist/node_modules/mariadb/lib/pool-promise.js +0 -108
  89. package/dist/node_modules/mariadb/node_modules/@types/node/assert/strict.d.ts +0 -8
  90. package/dist/node_modules/mariadb/node_modules/@types/node/assert.d.ts +0 -912
  91. package/dist/node_modules/mariadb/node_modules/@types/node/async_hooks.d.ts +0 -501
  92. package/dist/node_modules/mariadb/node_modules/@types/node/buffer.d.ts +0 -2232
  93. package/dist/node_modules/mariadb/node_modules/@types/node/child_process.d.ts +0 -1366
  94. package/dist/node_modules/mariadb/node_modules/@types/node/cluster.d.ts +0 -414
  95. package/dist/node_modules/mariadb/node_modules/@types/node/console.d.ts +0 -412
  96. package/dist/node_modules/mariadb/node_modules/@types/node/constants.d.ts +0 -18
  97. package/dist/node_modules/mariadb/node_modules/@types/node/crypto.d.ts +0 -3338
  98. package/dist/node_modules/mariadb/node_modules/@types/node/dgram.d.ts +0 -545
  99. package/dist/node_modules/mariadb/node_modules/@types/node/diagnostics_channel.d.ts +0 -152
  100. package/dist/node_modules/mariadb/node_modules/@types/node/dns/promises.d.ts +0 -370
  101. package/dist/node_modules/mariadb/node_modules/@types/node/dns.d.ts +0 -659
  102. package/dist/node_modules/mariadb/node_modules/@types/node/domain.d.ts +0 -169
  103. package/dist/node_modules/mariadb/node_modules/@types/node/events.d.ts +0 -651
  104. package/dist/node_modules/mariadb/node_modules/@types/node/fs/promises.d.ts +0 -1091
  105. package/dist/node_modules/mariadb/node_modules/@types/node/fs.d.ts +0 -3869
  106. package/dist/node_modules/mariadb/node_modules/@types/node/globals.d.ts +0 -294
  107. package/dist/node_modules/mariadb/node_modules/@types/node/globals.global.d.ts +0 -1
  108. package/dist/node_modules/mariadb/node_modules/@types/node/http.d.ts +0 -1396
  109. package/dist/node_modules/mariadb/node_modules/@types/node/http2.d.ts +0 -2101
  110. package/dist/node_modules/mariadb/node_modules/@types/node/https.d.ts +0 -391
  111. package/dist/node_modules/mariadb/node_modules/@types/node/index.d.ts +0 -129
  112. package/dist/node_modules/mariadb/node_modules/@types/node/inspector.d.ts +0 -2744
  113. package/dist/node_modules/mariadb/node_modules/@types/node/module.d.ts +0 -114
  114. package/dist/node_modules/mariadb/node_modules/@types/node/net.d.ts +0 -791
  115. package/dist/node_modules/mariadb/node_modules/@types/node/os.d.ts +0 -455
  116. package/dist/node_modules/mariadb/node_modules/@types/node/package.json +0 -220
  117. package/dist/node_modules/mariadb/node_modules/@types/node/path.d.ts +0 -180
  118. package/dist/node_modules/mariadb/node_modules/@types/node/perf_hooks.d.ts +0 -557
  119. package/dist/node_modules/mariadb/node_modules/@types/node/process.d.ts +0 -1481
  120. package/dist/node_modules/mariadb/node_modules/@types/node/punycode.d.ts +0 -117
  121. package/dist/node_modules/mariadb/node_modules/@types/node/querystring.d.ts +0 -131
  122. package/dist/node_modules/mariadb/node_modules/@types/node/readline.d.ts +0 -650
  123. package/dist/node_modules/mariadb/node_modules/@types/node/repl.d.ts +0 -424
  124. package/dist/node_modules/mariadb/node_modules/@types/node/stream/consumers.d.ts +0 -24
  125. package/dist/node_modules/mariadb/node_modules/@types/node/stream/promises.d.ts +0 -42
  126. package/dist/node_modules/mariadb/node_modules/@types/node/stream/web.d.ts +0 -330
  127. package/dist/node_modules/mariadb/node_modules/@types/node/stream.d.ts +0 -1249
  128. package/dist/node_modules/mariadb/node_modules/@types/node/string_decoder.d.ts +0 -67
  129. package/dist/node_modules/mariadb/node_modules/@types/node/timers/promises.d.ts +0 -68
  130. package/dist/node_modules/mariadb/node_modules/@types/node/timers.d.ts +0 -94
  131. package/dist/node_modules/mariadb/node_modules/@types/node/tls.d.ts +0 -1020
  132. package/dist/node_modules/mariadb/node_modules/@types/node/trace_events.d.ts +0 -161
  133. package/dist/node_modules/mariadb/node_modules/@types/node/tty.d.ts +0 -204
  134. package/dist/node_modules/mariadb/node_modules/@types/node/url.d.ts +0 -891
  135. package/dist/node_modules/mariadb/node_modules/@types/node/util.d.ts +0 -1594
  136. package/dist/node_modules/mariadb/node_modules/@types/node/v8.d.ts +0 -378
  137. package/dist/node_modules/mariadb/node_modules/@types/node/vm.d.ts +0 -507
  138. package/dist/node_modules/mariadb/node_modules/@types/node/wasi.d.ts +0 -158
  139. package/dist/node_modules/mariadb/node_modules/@types/node/worker_threads.d.ts +0 -649
  140. package/dist/node_modules/mariadb/node_modules/@types/node/zlib.d.ts +0 -517
  141. package/dist/node_modules/mariadb/package.json +0 -1
  142. package/dist/node_modules/mariadb/promise.js +0 -34
  143. package/dist/node_modules/mariadb/types/index.d.ts +0 -870
@@ -1,650 +0,0 @@
1
- /**
2
- * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time.
3
- *
4
- * To use the promise-based APIs:
5
- *
6
- * ```js
7
- * import * as readline from 'node:readline/promises';
8
- * ```
9
- *
10
- * To use the callback and sync APIs:
11
- *
12
- * ```js
13
- * import * as readline from 'node:readline';
14
- * ```
15
- *
16
- * The following simple example illustrates the basic use of the `readline` module.
17
- *
18
- * ```js
19
- * import * as readline from 'node:readline/promises';
20
- * import { stdin as input, stdout as output } from 'process';
21
- *
22
- * const rl = readline.createInterface({ input, output });
23
- *
24
- * const answer = await rl.question('What do you think of Node.js? ');
25
- *
26
- * console.log(`Thank you for your valuable feedback: ${answer}`);
27
- *
28
- * rl.close();
29
- * ```
30
- *
31
- * 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
32
- * received on the `input` stream.
33
- * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/readline.js)
34
- */
35
- declare module 'readline' {
36
- import { Abortable, EventEmitter } from 'node:events';
37
- interface Key {
38
- sequence?: string | undefined;
39
- name?: string | undefined;
40
- ctrl?: boolean | undefined;
41
- meta?: boolean | undefined;
42
- shift?: boolean | undefined;
43
- }
44
- /**
45
- * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a
46
- * single `input` `Readable` stream and a single `output` `Writable` stream.
47
- * The `output` stream is used to print prompts for user input that arrives on,
48
- * and is read from, the `input` stream.
49
- * @since v0.1.104
50
- */
51
- class Interface extends EventEmitter {
52
- readonly terminal: boolean;
53
- /**
54
- * The current input data being processed by node.
55
- *
56
- * This can be used when collecting input from a TTY stream to retrieve the
57
- * current value that has been processed thus far, prior to the `line` event
58
- * being emitted. Once the `line` event has been emitted, this property will
59
- * be an empty string.
60
- *
61
- * Be aware that modifying the value during the instance runtime may have
62
- * unintended consequences if `rl.cursor` is not also controlled.
63
- *
64
- * **If not using a TTY stream for input, use the `'line'` event.**
65
- *
66
- * One possible use case would be as follows:
67
- *
68
- * ```js
69
- * const values = ['lorem ipsum', 'dolor sit amet'];
70
- * const rl = readline.createInterface(process.stdin);
71
- * const showResults = debounce(() => {
72
- * console.log(
73
- * '\n',
74
- * values.filter((val) => val.startsWith(rl.line)).join(' ')
75
- * );
76
- * }, 300);
77
- * process.stdin.on('keypress', (c, k) => {
78
- * showResults();
79
- * });
80
- * ```
81
- * @since v0.1.98
82
- */
83
- readonly line: string;
84
- /**
85
- * The cursor position relative to `rl.line`.
86
- *
87
- * This will track where the current cursor lands in the input string, when
88
- * reading input from a TTY stream. The position of cursor determines the
89
- * portion of the input string that will be modified as input is processed,
90
- * as well as the column where the terminal caret will be rendered.
91
- * @since v0.1.98
92
- */
93
- readonly cursor: number;
94
- /**
95
- * NOTE: According to the documentation:
96
- *
97
- * > Instances of the `readline.Interface` class are constructed using the
98
- * > `readline.createInterface()` method.
99
- *
100
- * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
101
- */
102
- protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
103
- /**
104
- * NOTE: According to the documentation:
105
- *
106
- * > Instances of the `readline.Interface` class are constructed using the
107
- * > `readline.createInterface()` method.
108
- *
109
- * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
110
- */
111
- protected constructor(options: ReadLineOptions);
112
- /**
113
- * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
114
- * @since v15.3.0
115
- * @return the current prompt string
116
- */
117
- getPrompt(): string;
118
- /**
119
- * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called.
120
- * @since v0.1.98
121
- */
122
- setPrompt(prompt: string): void;
123
- /**
124
- * 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
125
- * location at which to provide input.
126
- *
127
- * When called, `rl.prompt()` will resume the `input` stream if it has been
128
- * paused.
129
- *
130
- * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written.
131
- * @since v0.1.98
132
- * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`.
133
- */
134
- prompt(preserveCursor?: boolean): void;
135
- /**
136
- * The `rl.question()` method displays the `query` by writing it to the `output`,
137
- * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument.
138
- *
139
- * When called, `rl.question()` will resume the `input` stream if it has been
140
- * paused.
141
- *
142
- * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written.
143
- *
144
- * The `callback` function passed to `rl.question()` does not follow the typical
145
- * pattern of accepting an `Error` object or `null` as the first argument.
146
- * The `callback` is called with the provided answer as the only argument.
147
- *
148
- * Example usage:
149
- *
150
- * ```js
151
- * rl.question('What is your favorite food? ', (answer) => {
152
- * console.log(`Oh, so your favorite food is ${answer}`);
153
- * });
154
- * ```
155
- *
156
- * Using an `AbortController` to cancel a question.
157
- *
158
- * ```js
159
- * const ac = new AbortController();
160
- * const signal = ac.signal;
161
- *
162
- * rl.question('What is your favorite food? ', { signal }, (answer) => {
163
- * console.log(`Oh, so your favorite food is ${answer}`);
164
- * });
165
- *
166
- * signal.addEventListener('abort', () => {
167
- * console.log('The food question timed out');
168
- * }, { once: true });
169
- *
170
- * setTimeout(() => ac.abort(), 10000);
171
- * ```
172
- *
173
- * If this method is invoked as it's util.promisify()ed version, it returns a
174
- * Promise that fulfills with the answer. If the question is canceled using
175
- * an `AbortController` it will reject with an `AbortError`.
176
- *
177
- * ```js
178
- * const util = require('util');
179
- * const question = util.promisify(rl.question).bind(rl);
180
- *
181
- * async function questionExample() {
182
- * try {
183
- * const answer = await question('What is you favorite food? ');
184
- * console.log(`Oh, so your favorite food is ${answer}`);
185
- * } catch (err) {
186
- * console.error('Question rejected', err);
187
- * }
188
- * }
189
- * questionExample();
190
- * ```
191
- * @since v0.3.3
192
- * @param query A statement or query to write to `output`, prepended to the prompt.
193
- * @param callback A callback function that is invoked with the user's input in response to the `query`.
194
- */
195
- question(query: string, callback: (answer: string) => void): void;
196
- question(query: string, options: Abortable, callback: (answer: string) => void): void;
197
- /**
198
- * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed
199
- * later if necessary.
200
- *
201
- * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance.
202
- * @since v0.3.4
203
- */
204
- pause(): this;
205
- /**
206
- * The `rl.resume()` method resumes the `input` stream if it has been paused.
207
- * @since v0.3.4
208
- */
209
- resume(): this;
210
- /**
211
- * The `rl.close()` method closes the `readline.Interface` instance and
212
- * relinquishes control over the `input` and `output` streams. When called,
213
- * the `'close'` event will be emitted.
214
- *
215
- * Calling `rl.close()` does not immediately stop other events (including `'line'`)
216
- * from being emitted by the `readline.Interface` instance.
217
- * @since v0.1.98
218
- */
219
- close(): void;
220
- /**
221
- * The `rl.write()` method will write either `data` or a key sequence identified
222
- * by `key` to the `output`. The `key` argument is supported only if `output` is
223
- * a `TTY` text terminal. See `TTY keybindings` for a list of key
224
- * combinations.
225
- *
226
- * If `key` is specified, `data` is ignored.
227
- *
228
- * When called, `rl.write()` will resume the `input` stream if it has been
229
- * paused.
230
- *
231
- * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written.
232
- *
233
- * ```js
234
- * rl.write('Delete this!');
235
- * // Simulate Ctrl+U to delete the line written previously
236
- * rl.write(null, { ctrl: true, name: 'u' });
237
- * ```
238
- *
239
- * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_.
240
- * @since v0.1.98
241
- */
242
- write(data: string | Buffer, key?: Key): void;
243
- write(data: undefined | null | string | Buffer, key: Key): void;
244
- /**
245
- * Returns the real position of the cursor in relation to the input
246
- * prompt + string. Long input (wrapping) strings, as well as multiple
247
- * line prompts are included in the calculations.
248
- * @since v13.5.0, v12.16.0
249
- */
250
- getCursorPos(): CursorPos;
251
- /**
252
- * events.EventEmitter
253
- * 1. close
254
- * 2. line
255
- * 3. pause
256
- * 4. resume
257
- * 5. SIGCONT
258
- * 6. SIGINT
259
- * 7. SIGTSTP
260
- * 8. history
261
- */
262
- addListener(event: string, listener: (...args: any[]) => void): this;
263
- addListener(event: 'close', listener: () => void): this;
264
- addListener(event: 'line', listener: (input: string) => void): this;
265
- addListener(event: 'pause', listener: () => void): this;
266
- addListener(event: 'resume', listener: () => void): this;
267
- addListener(event: 'SIGCONT', listener: () => void): this;
268
- addListener(event: 'SIGINT', listener: () => void): this;
269
- addListener(event: 'SIGTSTP', listener: () => void): this;
270
- addListener(event: 'history', listener: (history: string[]) => void): this;
271
- emit(event: string | symbol, ...args: any[]): boolean;
272
- emit(event: 'close'): boolean;
273
- emit(event: 'line', input: string): boolean;
274
- emit(event: 'pause'): boolean;
275
- emit(event: 'resume'): boolean;
276
- emit(event: 'SIGCONT'): boolean;
277
- emit(event: 'SIGINT'): boolean;
278
- emit(event: 'SIGTSTP'): boolean;
279
- emit(event: 'history', history: string[]): boolean;
280
- on(event: string, listener: (...args: any[]) => void): this;
281
- on(event: 'close', listener: () => void): this;
282
- on(event: 'line', listener: (input: string) => void): this;
283
- on(event: 'pause', listener: () => void): this;
284
- on(event: 'resume', listener: () => void): this;
285
- on(event: 'SIGCONT', listener: () => void): this;
286
- on(event: 'SIGINT', listener: () => void): this;
287
- on(event: 'SIGTSTP', listener: () => void): this;
288
- on(event: 'history', listener: (history: string[]) => void): this;
289
- once(event: string, listener: (...args: any[]) => void): this;
290
- once(event: 'close', listener: () => void): this;
291
- once(event: 'line', listener: (input: string) => void): this;
292
- once(event: 'pause', listener: () => void): this;
293
- once(event: 'resume', listener: () => void): this;
294
- once(event: 'SIGCONT', listener: () => void): this;
295
- once(event: 'SIGINT', listener: () => void): this;
296
- once(event: 'SIGTSTP', listener: () => void): this;
297
- once(event: 'history', listener: (history: string[]) => void): this;
298
- prependListener(event: string, listener: (...args: any[]) => void): this;
299
- prependListener(event: 'close', listener: () => void): this;
300
- prependListener(event: 'line', listener: (input: string) => void): this;
301
- prependListener(event: 'pause', listener: () => void): this;
302
- prependListener(event: 'resume', listener: () => void): this;
303
- prependListener(event: 'SIGCONT', listener: () => void): this;
304
- prependListener(event: 'SIGINT', listener: () => void): this;
305
- prependListener(event: 'SIGTSTP', listener: () => void): this;
306
- prependListener(event: 'history', listener: (history: string[]) => void): this;
307
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
308
- prependOnceListener(event: 'close', listener: () => void): this;
309
- prependOnceListener(event: 'line', listener: (input: string) => void): this;
310
- prependOnceListener(event: 'pause', listener: () => void): this;
311
- prependOnceListener(event: 'resume', listener: () => void): this;
312
- prependOnceListener(event: 'SIGCONT', listener: () => void): this;
313
- prependOnceListener(event: 'SIGINT', listener: () => void): this;
314
- prependOnceListener(event: 'SIGTSTP', listener: () => void): this;
315
- prependOnceListener(event: 'history', listener: (history: string[]) => void): this;
316
- [Symbol.asyncIterator](): AsyncIterableIterator<string>;
317
- }
318
- type ReadLine = Interface; // type forwarded for backwards compatibility
319
- type Completer = (line: string) => CompleterResult;
320
- type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void;
321
- type CompleterResult = [string[], string];
322
- interface ReadLineOptions {
323
- input: NodeJS.ReadableStream;
324
- output?: NodeJS.WritableStream | undefined;
325
- completer?: Completer | AsyncCompleter | undefined;
326
- terminal?: boolean | undefined;
327
- /**
328
- * Initial list of history lines. This option makes sense
329
- * only if `terminal` is set to `true` by the user or by an internal `output`
330
- * check, otherwise the history caching mechanism is not initialized at all.
331
- * @default []
332
- */
333
- history?: string[] | undefined;
334
- historySize?: number | undefined;
335
- prompt?: string | undefined;
336
- crlfDelay?: number | undefined;
337
- /**
338
- * If `true`, when a new input line added
339
- * to the history list duplicates an older one, this removes the older line
340
- * from the list.
341
- * @default false
342
- */
343
- removeHistoryDuplicates?: boolean | undefined;
344
- escapeCodeTimeout?: number | undefined;
345
- tabSize?: number | undefined;
346
- }
347
- /**
348
- * The `readline.createInterface()` method creates a new `readline.Interface`instance.
349
- *
350
- * ```js
351
- * const readline = require('readline');
352
- * const rl = readline.createInterface({
353
- * input: process.stdin,
354
- * output: process.stdout
355
- * });
356
- * ```
357
- *
358
- * Once the `readline.Interface` instance is created, the most common case is to
359
- * listen for the `'line'` event:
360
- *
361
- * ```js
362
- * rl.on('line', (line) => {
363
- * console.log(`Received: ${line}`);
364
- * });
365
- * ```
366
- *
367
- * If `terminal` is `true` for this instance then the `output` stream will get
368
- * the best compatibility if it defines an `output.columns` property and emits
369
- * a `'resize'` event on the `output` if or when the columns ever change
370
- * (`process.stdout` does this automatically when it is a TTY).
371
- *
372
- * When creating a `readline.Interface` using `stdin` as input, the program
373
- * will not terminate until it receives `EOF` (Ctrl+D on
374
- * Linux/macOS, Ctrl+Z followed by Return on
375
- * Windows).
376
- * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream:
377
- *
378
- * ```js
379
- * process.stdin.unref();
380
- * ```
381
- * @since v0.1.98
382
- */
383
- function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
384
- function createInterface(options: ReadLineOptions): Interface;
385
- /**
386
- * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
387
- *
388
- * Optionally, `interface` specifies a `readline.Interface` instance for which
389
- * autocompletion is disabled when copy-pasted input is detected.
390
- *
391
- * If the `stream` is a `TTY`, then it must be in raw mode.
392
- *
393
- * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop
394
- * the `input` from emitting `'keypress'` events.
395
- *
396
- * ```js
397
- * readline.emitKeypressEvents(process.stdin);
398
- * if (process.stdin.isTTY)
399
- * process.stdin.setRawMode(true);
400
- * ```
401
- *
402
- * ## Example: Tiny CLI
403
- *
404
- * The following example illustrates the use of `readline.Interface` class to
405
- * implement a small command-line interface:
406
- *
407
- * ```js
408
- * const readline = require('readline');
409
- * const rl = readline.createInterface({
410
- * input: process.stdin,
411
- * output: process.stdout,
412
- * prompt: 'OHAI> '
413
- * });
414
- *
415
- * rl.prompt();
416
- *
417
- * rl.on('line', (line) => {
418
- * switch (line.trim()) {
419
- * case 'hello':
420
- * console.log('world!');
421
- * break;
422
- * default:
423
- * console.log(`Say what? I might have heard '${line.trim()}'`);
424
- * break;
425
- * }
426
- * rl.prompt();
427
- * }).on('close', () => {
428
- * console.log('Have a great day!');
429
- * process.exit(0);
430
- * });
431
- * ```
432
- *
433
- * ## Example: Read file stream line-by-Line
434
- *
435
- * A common use case for `readline` is to consume an input file one line at a
436
- * time. The easiest way to do so is leveraging the `fs.ReadStream` API as
437
- * well as a `for await...of` loop:
438
- *
439
- * ```js
440
- * const fs = require('fs');
441
- * const readline = require('readline');
442
- *
443
- * async function processLineByLine() {
444
- * const fileStream = fs.createReadStream('input.txt');
445
- *
446
- * const rl = readline.createInterface({
447
- * input: fileStream,
448
- * crlfDelay: Infinity
449
- * });
450
- * // Note: we use the crlfDelay option to recognize all instances of CR LF
451
- * // ('\r\n') in input.txt as a single line break.
452
- *
453
- * for await (const line of rl) {
454
- * // Each line in input.txt will be successively available here as `line`.
455
- * console.log(`Line from file: ${line}`);
456
- * }
457
- * }
458
- *
459
- * processLineByLine();
460
- * ```
461
- *
462
- * Alternatively, one could use the `'line'` event:
463
- *
464
- * ```js
465
- * const fs = require('fs');
466
- * const readline = require('readline');
467
- *
468
- * const rl = readline.createInterface({
469
- * input: fs.createReadStream('sample.txt'),
470
- * crlfDelay: Infinity
471
- * });
472
- *
473
- * rl.on('line', (line) => {
474
- * console.log(`Line from file: ${line}`);
475
- * });
476
- * ```
477
- *
478
- * 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:
479
- *
480
- * ```js
481
- * const { once } = require('events');
482
- * const { createReadStream } = require('fs');
483
- * const { createInterface } = require('readline');
484
- *
485
- * (async function processLineByLine() {
486
- * try {
487
- * const rl = createInterface({
488
- * input: createReadStream('big-file.txt'),
489
- * crlfDelay: Infinity
490
- * });
491
- *
492
- * rl.on('line', (line) => {
493
- * // Process the line.
494
- * });
495
- *
496
- * await once(rl, 'close');
497
- *
498
- * console.log('File processed.');
499
- * } catch (err) {
500
- * console.error(err);
501
- * }
502
- * })();
503
- * ```
504
- * @since v0.7.7
505
- */
506
- function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
507
- type Direction = -1 | 0 | 1;
508
- interface CursorPos {
509
- rows: number;
510
- cols: number;
511
- }
512
- /**
513
- * The `readline.clearLine()` method clears current line of given `TTY` stream
514
- * in a specified direction identified by `dir`.
515
- * @since v0.7.7
516
- * @param callback Invoked once the operation completes.
517
- * @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`.
518
- */
519
- function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
520
- /**
521
- * The `readline.clearScreenDown()` method clears the given `TTY` stream from
522
- * the current position of the cursor down.
523
- * @since v0.7.7
524
- * @param callback Invoked once the operation completes.
525
- * @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`.
526
- */
527
- function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
528
- /**
529
- * The `readline.cursorTo()` method moves cursor to the specified position in a
530
- * given `TTY` `stream`.
531
- * @since v0.7.7
532
- * @param callback Invoked once the operation completes.
533
- * @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`.
534
- */
535
- function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
536
- /**
537
- * The `readline.moveCursor()` method moves the cursor _relative_ to its current
538
- * position in a given `TTY` `stream`.
539
- *
540
- * ## Example: Tiny CLI
541
- *
542
- * The following example illustrates the use of `readline.Interface` class to
543
- * implement a small command-line interface:
544
- *
545
- * ```js
546
- * const readline = require('readline');
547
- * const rl = readline.createInterface({
548
- * input: process.stdin,
549
- * output: process.stdout,
550
- * prompt: 'OHAI> '
551
- * });
552
- *
553
- * rl.prompt();
554
- *
555
- * rl.on('line', (line) => {
556
- * switch (line.trim()) {
557
- * case 'hello':
558
- * console.log('world!');
559
- * break;
560
- * default:
561
- * console.log(`Say what? I might have heard '${line.trim()}'`);
562
- * break;
563
- * }
564
- * rl.prompt();
565
- * }).on('close', () => {
566
- * console.log('Have a great day!');
567
- * process.exit(0);
568
- * });
569
- * ```
570
- *
571
- * ## Example: Read file stream line-by-Line
572
- *
573
- * A common use case for `readline` is to consume an input file one line at a
574
- * time. The easiest way to do so is leveraging the `fs.ReadStream` API as
575
- * well as a `for await...of` loop:
576
- *
577
- * ```js
578
- * const fs = require('fs');
579
- * const readline = require('readline');
580
- *
581
- * async function processLineByLine() {
582
- * const fileStream = fs.createReadStream('input.txt');
583
- *
584
- * const rl = readline.createInterface({
585
- * input: fileStream,
586
- * crlfDelay: Infinity
587
- * });
588
- * // Note: we use the crlfDelay option to recognize all instances of CR LF
589
- * // ('\r\n') in input.txt as a single line break.
590
- *
591
- * for await (const line of rl) {
592
- * // Each line in input.txt will be successively available here as `line`.
593
- * console.log(`Line from file: ${line}`);
594
- * }
595
- * }
596
- *
597
- * processLineByLine();
598
- * ```
599
- *
600
- * Alternatively, one could use the `'line'` event:
601
- *
602
- * ```js
603
- * const fs = require('fs');
604
- * const readline = require('readline');
605
- *
606
- * const rl = readline.createInterface({
607
- * input: fs.createReadStream('sample.txt'),
608
- * crlfDelay: Infinity
609
- * });
610
- *
611
- * rl.on('line', (line) => {
612
- * console.log(`Line from file: ${line}`);
613
- * });
614
- * ```
615
- *
616
- * 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:
617
- *
618
- * ```js
619
- * const { once } = require('events');
620
- * const { createReadStream } = require('fs');
621
- * const { createInterface } = require('readline');
622
- *
623
- * (async function processLineByLine() {
624
- * try {
625
- * const rl = createInterface({
626
- * input: createReadStream('big-file.txt'),
627
- * crlfDelay: Infinity
628
- * });
629
- *
630
- * rl.on('line', (line) => {
631
- * // Process the line.
632
- * });
633
- *
634
- * await once(rl, 'close');
635
- *
636
- * console.log('File processed.');
637
- * } catch (err) {
638
- * console.error(err);
639
- * }
640
- * })();
641
- * ```
642
- * @since v0.7.7
643
- * @param callback Invoked once the operation completes.
644
- * @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`.
645
- */
646
- function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
647
- }
648
- declare module 'node:readline' {
649
- export * from 'readline';
650
- }