@types/node 16.18.87 → 16.18.88

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