@types/node 22.8.6 → 22.8.7
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.
- node/README.md +1 -1
- node/package.json +2 -2
- node/readline/promises.d.ts +14 -2
- node/readline.d.ts +57 -8
node/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Sun, 03 Nov 2024 04:02:17 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.8.
|
3
|
+
"version": "22.8.7",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -220,6 +220,6 @@
|
|
220
220
|
"undici-types": "~6.19.8"
|
221
221
|
},
|
222
222
|
"peerDependencies": {},
|
223
|
-
"typesPublisherContentHash": "
|
223
|
+
"typesPublisherContentHash": "eb4a12d3db7d5c2f973b35f0ccc659d77637fdcdc340900124be3f5602cc29bc",
|
224
224
|
"typeScriptVersion": "4.8"
|
225
225
|
}
|
node/readline/promises.d.ts
CHANGED
@@ -3,8 +3,13 @@
|
|
3
3
|
* @experimental
|
4
4
|
*/
|
5
5
|
declare module "readline/promises" {
|
6
|
-
import { AsyncCompleter, Completer, Direction, Interface as _Interface, ReadLineOptions } from "node:readline";
|
7
6
|
import { Abortable } from "node:events";
|
7
|
+
import {
|
8
|
+
CompleterResult,
|
9
|
+
Direction,
|
10
|
+
Interface as _Interface,
|
11
|
+
ReadLineOptions as _ReadLineOptions,
|
12
|
+
} from "node:readline";
|
8
13
|
/**
|
9
14
|
* Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a
|
10
15
|
* single `input` `Readable` stream and a single `output` `Writable` stream.
|
@@ -111,6 +116,13 @@ declare module "readline/promises" {
|
|
111
116
|
*/
|
112
117
|
rollback(): this;
|
113
118
|
}
|
119
|
+
type Completer = (line: string) => CompleterResult | Promise<CompleterResult>;
|
120
|
+
interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> {
|
121
|
+
/**
|
122
|
+
* An optional function used for Tab autocompletion.
|
123
|
+
*/
|
124
|
+
completer?: Completer | undefined;
|
125
|
+
}
|
114
126
|
/**
|
115
127
|
* The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
|
116
128
|
*
|
@@ -140,7 +152,7 @@ declare module "readline/promises" {
|
|
140
152
|
function createInterface(
|
141
153
|
input: NodeJS.ReadableStream,
|
142
154
|
output?: NodeJS.WritableStream,
|
143
|
-
completer?: Completer
|
155
|
+
completer?: Completer,
|
144
156
|
terminal?: boolean,
|
145
157
|
): Interface;
|
146
158
|
function createInterface(options: ReadLineOptions): Interface;
|
node/readline.d.ts
CHANGED
@@ -314,29 +314,78 @@ declare module "readline" {
|
|
314
314
|
) => void;
|
315
315
|
export type CompleterResult = [string[], string];
|
316
316
|
export interface ReadLineOptions {
|
317
|
+
/**
|
318
|
+
* The [`Readable`](https://nodejs.org/docs/latest-v22.x/api/stream.html#readable-streams) stream to listen to
|
319
|
+
*/
|
317
320
|
input: NodeJS.ReadableStream;
|
321
|
+
/**
|
322
|
+
* The [`Writable`](https://nodejs.org/docs/latest-v22.x/api/stream.html#writable-streams) stream to write readline data to.
|
323
|
+
*/
|
318
324
|
output?: NodeJS.WritableStream | undefined;
|
325
|
+
/**
|
326
|
+
* An optional function used for Tab autocompletion.
|
327
|
+
*/
|
319
328
|
completer?: Completer | AsyncCompleter | undefined;
|
329
|
+
/**
|
330
|
+
* `true` if the `input` and `output` streams should be treated like a TTY,
|
331
|
+
* and have ANSI/VT100 escape codes written to it.
|
332
|
+
* Default: checking `isTTY` on the `output` stream upon instantiation.
|
333
|
+
*/
|
320
334
|
terminal?: boolean | undefined;
|
321
335
|
/**
|
322
|
-
*
|
323
|
-
* only if `terminal` is set to `true` by the user or by an internal `output`
|
324
|
-
*
|
336
|
+
* Initial list of history lines.
|
337
|
+
* This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check,
|
338
|
+
* otherwise the history caching mechanism is not initialized at all.
|
325
339
|
* @default []
|
326
340
|
*/
|
327
341
|
history?: string[] | undefined;
|
342
|
+
/**
|
343
|
+
* Maximum number of history lines retained.
|
344
|
+
* To disable the history set this value to `0`.
|
345
|
+
* This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check,
|
346
|
+
* otherwise the history caching mechanism is not initialized at all.
|
347
|
+
* @default 30
|
348
|
+
*/
|
328
349
|
historySize?: number | undefined;
|
329
|
-
prompt?: string | undefined;
|
330
|
-
crlfDelay?: number | undefined;
|
331
350
|
/**
|
332
|
-
* If `true`, when a new input line added
|
333
|
-
*
|
334
|
-
* from the list.
|
351
|
+
* If `true`, when a new input line added to the history list duplicates an older one,
|
352
|
+
* this removes the older line from the list.
|
335
353
|
* @default false
|
336
354
|
*/
|
337
355
|
removeHistoryDuplicates?: boolean | undefined;
|
356
|
+
/**
|
357
|
+
* The prompt string to use.
|
358
|
+
* @default "> "
|
359
|
+
*/
|
360
|
+
prompt?: string | undefined;
|
361
|
+
/**
|
362
|
+
* If the delay between `\r` and `\n` exceeds `crlfDelay` milliseconds,
|
363
|
+
* both `\r` and `\n` will be treated as separate end-of-line input.
|
364
|
+
* `crlfDelay` will be coerced to a number no less than `100`.
|
365
|
+
* It can be set to `Infinity`, in which case
|
366
|
+
* `\r` followed by `\n` will always be considered a single newline
|
367
|
+
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v22.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
|
368
|
+
* @default 100
|
369
|
+
*/
|
370
|
+
crlfDelay?: number | undefined;
|
371
|
+
/**
|
372
|
+
* The duration `readline` will wait for a character
|
373
|
+
* (when reading an ambiguous key sequence in milliseconds
|
374
|
+
* one that can both form a complete key sequence using the input read so far
|
375
|
+
* and can take additional input to complete a longer key sequence).
|
376
|
+
* @default 500
|
377
|
+
*/
|
338
378
|
escapeCodeTimeout?: number | undefined;
|
379
|
+
/**
|
380
|
+
* The number of spaces a tab is equal to (minimum 1).
|
381
|
+
* @default 8
|
382
|
+
*/
|
339
383
|
tabSize?: number | undefined;
|
384
|
+
/**
|
385
|
+
* Allows closing the interface using an AbortSignal.
|
386
|
+
* Aborting the signal will internally call `close` on the interface.
|
387
|
+
*/
|
388
|
+
signal?: AbortSignal | undefined;
|
340
389
|
}
|
341
390
|
/**
|
342
391
|
* The `readline.createInterface()` method creates a new `readline.Interface` instance.
|