@idlebox/stripe-node-types 24.0.14 → 24.0.15
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.
- package/README.md +1 -1
- package/assert/strict.d.ts +98 -1
- package/assert.d.ts +147 -248
- package/async_hooks.d.ts +5 -5
- package/buffer.buffer.d.ts +9 -6
- package/buffer.d.ts +49 -169
- package/child_process.d.ts +102 -223
- package/cluster.d.ts +236 -329
- package/console.d.ts +45 -346
- package/constants.d.ts +0 -1
- package/crypto.d.ts +698 -1149
- package/dgram.d.ts +15 -50
- package/diagnostics_channel.d.ts +1 -3
- package/dns.d.ts +135 -131
- package/domain.d.ts +10 -14
- package/events.d.ts +846 -722
- package/fs/promises.d.ts +102 -53
- package/fs.d.ts +714 -484
- package/globals.d.ts +130 -347
- package/globals.typedarray.d.ts +79 -0
- package/http.d.ts +343 -246
- package/http2.d.ts +563 -711
- package/https.d.ts +70 -216
- package/index.d.ts +24 -3
- package/inspector/promises.d.ts +54 -0
- package/inspector.d.ts +167 -3938
- package/inspector.generated.d.ts +4242 -0
- package/module.d.ts +45 -95
- package/net.d.ts +87 -186
- package/os.d.ts +17 -6
- package/package.json +3 -8
- package/path/posix.d.ts +20 -0
- package/path/win32.d.ts +20 -0
- package/path.d.ts +117 -122
- package/perf_hooks.d.ts +295 -644
- package/process.d.ts +177 -138
- package/punycode.d.ts +2 -2
- package/querystring.d.ts +1 -1
- package/quic.d.ts +926 -0
- package/readline/promises.d.ts +1 -1
- package/readline.d.ts +65 -118
- package/repl.d.ts +83 -96
- package/sea.d.ts +10 -1
- package/sqlite.d.ts +262 -13
- package/stream/consumers.d.ts +7 -7
- package/stream/promises.d.ts +133 -12
- package/stream/web.d.ts +173 -495
- package/stream.d.ts +593 -490
- package/string_decoder.d.ts +3 -3
- package/test/reporters.d.ts +112 -0
- package/test.d.ts +223 -199
- package/timers/promises.d.ts +1 -1
- package/timers.d.ts +1 -129
- package/tls.d.ts +148 -163
- package/trace_events.d.ts +6 -6
- package/ts5.6/buffer.buffer.d.ts +10 -8
- package/ts5.6/globals.typedarray.d.ts +16 -0
- package/ts5.6/index.d.ts +24 -3
- package/ts5.7/index.d.ts +24 -3
- package/tty.d.ts +55 -13
- package/url.d.ts +92 -587
- package/util/types.d.ts +571 -0
- package/util.d.ts +143 -792
- package/v8.d.ts +67 -7
- package/vm.d.ts +252 -108
- package/wasi.d.ts +23 -2
- package/web-globals/abortcontroller.d.ts +75 -0
- package/web-globals/blob.d.ts +39 -0
- package/{ts5.1/compatibility/disposable.d.ts → web-globals/console.d.ts} +6 -9
- package/web-globals/crypto.d.ts +55 -0
- package/web-globals/domexception.d.ts +84 -0
- package/web-globals/encoding.d.ts +27 -0
- package/{dom-events.d.ts → web-globals/events.d.ts} +57 -50
- package/web-globals/fetch.d.ts +70 -0
- package/web-globals/importmeta.d.ts +29 -0
- package/web-globals/messaging.d.ts +39 -0
- package/web-globals/navigator.d.ts +41 -0
- package/web-globals/performance.d.ts +61 -0
- package/web-globals/storage.d.ts +40 -0
- package/web-globals/streams.d.ts +131 -0
- package/web-globals/timers.d.ts +60 -0
- package/web-globals/url.d.ts +40 -0
- package/worker_threads.d.ts +291 -349
- package/zlib.d.ts +44 -94
- package/ts5.1/index.d.ts +0 -115
package/readline/promises.d.ts
CHANGED
package/readline.d.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-
|
|
18
|
-
* (such as [`process.stdin`](https://nodejs.org/docs/latest-
|
|
17
|
+
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream
|
|
18
|
+
* (such as [`process.stdin`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdin)) one line at a time.
|
|
19
19
|
*
|
|
20
20
|
* To use the promise-based APIs:
|
|
21
21
|
*
|
|
@@ -46,28 +46,59 @@
|
|
|
46
46
|
*
|
|
47
47
|
* 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
|
|
48
48
|
* received on the `input` stream.
|
|
49
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
49
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/readline.js)
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
52
|
declare module "_not-use-node-type_readline" {
|
|
53
|
-
import { Abortable, EventEmitter } from 'node:events';
|
|
54
|
-
|
|
55
|
-
export { promises };
|
|
56
|
-
export interface Key {
|
|
53
|
+
import { Abortable, EventEmitter, InternalEventEmitter } from 'node:events';
|
|
54
|
+
interface Key {
|
|
57
55
|
sequence?: string | undefined;
|
|
58
56
|
name?: string | undefined;
|
|
59
57
|
ctrl?: boolean | undefined;
|
|
60
58
|
meta?: boolean | undefined;
|
|
61
59
|
shift?: boolean | undefined;
|
|
62
60
|
}
|
|
61
|
+
interface InterfaceEventMap {
|
|
62
|
+
"close": [];
|
|
63
|
+
"history": [history: string[]];
|
|
64
|
+
"line": [input: string];
|
|
65
|
+
"pause": [];
|
|
66
|
+
"resume": [];
|
|
67
|
+
"SIGCONT": [];
|
|
68
|
+
"SIGINT": [];
|
|
69
|
+
"SIGTSTP": [];
|
|
70
|
+
}
|
|
63
71
|
/**
|
|
64
72
|
* Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a
|
|
65
|
-
* single `input` [Readable](https://nodejs.org/docs/latest-
|
|
73
|
+
* single `input` [Readable](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream and a single `output` [Writable](https://nodejs.org/docs/latest-v25.x/api/stream.html#writable-streams) stream.
|
|
66
74
|
* The `output` stream is used to print prompts for user input that arrives on,
|
|
67
75
|
* and is read from, the `input` stream.
|
|
68
76
|
* @since v0.1.104
|
|
69
77
|
*/
|
|
70
|
-
|
|
78
|
+
class Interface implements EventEmitter, Disposable {
|
|
79
|
+
/**
|
|
80
|
+
* NOTE: According to the documentation:
|
|
81
|
+
*
|
|
82
|
+
* > Instances of the `readline.Interface` class are constructed using the
|
|
83
|
+
* > `readline.createInterface()` method.
|
|
84
|
+
*
|
|
85
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#class-interfaceconstructor
|
|
86
|
+
*/
|
|
87
|
+
protected constructor(
|
|
88
|
+
input: NodeJS.ReadableStream,
|
|
89
|
+
output?: NodeJS.WritableStream,
|
|
90
|
+
completer?: Completer | AsyncCompleter,
|
|
91
|
+
terminal?: boolean,
|
|
92
|
+
);
|
|
93
|
+
/**
|
|
94
|
+
* NOTE: According to the documentation:
|
|
95
|
+
*
|
|
96
|
+
* > Instances of the `readline.Interface` class are constructed using the
|
|
97
|
+
* > `readline.createInterface()` method.
|
|
98
|
+
*
|
|
99
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#class-interfaceconstructor
|
|
100
|
+
*/
|
|
101
|
+
protected constructor(options: ReadLineOptions);
|
|
71
102
|
readonly terminal: boolean;
|
|
72
103
|
/**
|
|
73
104
|
* The current input data being processed by node.
|
|
@@ -110,29 +141,6 @@ declare module "_not-use-node-type_readline" {
|
|
|
110
141
|
* @since v0.1.98
|
|
111
142
|
*/
|
|
112
143
|
readonly cursor: number;
|
|
113
|
-
/**
|
|
114
|
-
* NOTE: According to the documentation:
|
|
115
|
-
*
|
|
116
|
-
* > Instances of the `readline.Interface` class are constructed using the
|
|
117
|
-
* > `readline.createInterface()` method.
|
|
118
|
-
*
|
|
119
|
-
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
|
120
|
-
*/
|
|
121
|
-
protected constructor(
|
|
122
|
-
input: NodeJS.ReadableStream,
|
|
123
|
-
output?: NodeJS.WritableStream,
|
|
124
|
-
completer?: Completer | AsyncCompleter,
|
|
125
|
-
terminal?: boolean,
|
|
126
|
-
);
|
|
127
|
-
/**
|
|
128
|
-
* NOTE: According to the documentation:
|
|
129
|
-
*
|
|
130
|
-
* > Instances of the `readline.Interface` class are constructed using the
|
|
131
|
-
* > `readline.createInterface()` method.
|
|
132
|
-
*
|
|
133
|
-
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
|
134
|
-
*/
|
|
135
|
-
protected constructor(options: ReadLineOptions);
|
|
136
144
|
/**
|
|
137
145
|
* The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
|
|
138
146
|
* @since v15.3.0, v14.17.0
|
|
@@ -260,87 +268,23 @@ declare module "_not-use-node-type_readline" {
|
|
|
260
268
|
* @since v13.5.0, v12.16.0
|
|
261
269
|
*/
|
|
262
270
|
getCursorPos(): CursorPos;
|
|
263
|
-
/**
|
|
264
|
-
* events.EventEmitter
|
|
265
|
-
* 1. close
|
|
266
|
-
* 2. line
|
|
267
|
-
* 3. pause
|
|
268
|
-
* 4. resume
|
|
269
|
-
* 5. SIGCONT
|
|
270
|
-
* 6. SIGINT
|
|
271
|
-
* 7. SIGTSTP
|
|
272
|
-
* 8. history
|
|
273
|
-
*/
|
|
274
|
-
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
275
|
-
addListener(event: "close", listener: () => void): this;
|
|
276
|
-
addListener(event: "line", listener: (input: string) => void): this;
|
|
277
|
-
addListener(event: "pause", listener: () => void): this;
|
|
278
|
-
addListener(event: "resume", listener: () => void): this;
|
|
279
|
-
addListener(event: "SIGCONT", listener: () => void): this;
|
|
280
|
-
addListener(event: "SIGINT", listener: () => void): this;
|
|
281
|
-
addListener(event: "SIGTSTP", listener: () => void): this;
|
|
282
|
-
addListener(event: "history", listener: (history: string[]) => void): this;
|
|
283
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
284
|
-
emit(event: "close"): boolean;
|
|
285
|
-
emit(event: "line", input: string): boolean;
|
|
286
|
-
emit(event: "pause"): boolean;
|
|
287
|
-
emit(event: "resume"): boolean;
|
|
288
|
-
emit(event: "SIGCONT"): boolean;
|
|
289
|
-
emit(event: "SIGINT"): boolean;
|
|
290
|
-
emit(event: "SIGTSTP"): boolean;
|
|
291
|
-
emit(event: "history", history: string[]): boolean;
|
|
292
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
293
|
-
on(event: "close", listener: () => void): this;
|
|
294
|
-
on(event: "line", listener: (input: string) => void): this;
|
|
295
|
-
on(event: "pause", listener: () => void): this;
|
|
296
|
-
on(event: "resume", listener: () => void): this;
|
|
297
|
-
on(event: "SIGCONT", listener: () => void): this;
|
|
298
|
-
on(event: "SIGINT", listener: () => void): this;
|
|
299
|
-
on(event: "SIGTSTP", listener: () => void): this;
|
|
300
|
-
on(event: "history", listener: (history: string[]) => void): this;
|
|
301
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
302
|
-
once(event: "close", listener: () => void): this;
|
|
303
|
-
once(event: "line", listener: (input: string) => void): this;
|
|
304
|
-
once(event: "pause", listener: () => void): this;
|
|
305
|
-
once(event: "resume", listener: () => void): this;
|
|
306
|
-
once(event: "SIGCONT", listener: () => void): this;
|
|
307
|
-
once(event: "SIGINT", listener: () => void): this;
|
|
308
|
-
once(event: "SIGTSTP", listener: () => void): this;
|
|
309
|
-
once(event: "history", listener: (history: string[]) => void): this;
|
|
310
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
311
|
-
prependListener(event: "close", listener: () => void): this;
|
|
312
|
-
prependListener(event: "line", listener: (input: string) => void): this;
|
|
313
|
-
prependListener(event: "pause", listener: () => void): this;
|
|
314
|
-
prependListener(event: "resume", listener: () => void): this;
|
|
315
|
-
prependListener(event: "SIGCONT", listener: () => void): this;
|
|
316
|
-
prependListener(event: "SIGINT", listener: () => void): this;
|
|
317
|
-
prependListener(event: "SIGTSTP", listener: () => void): this;
|
|
318
|
-
prependListener(event: "history", listener: (history: string[]) => void): this;
|
|
319
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
320
|
-
prependOnceListener(event: "close", listener: () => void): this;
|
|
321
|
-
prependOnceListener(event: "line", listener: (input: string) => void): this;
|
|
322
|
-
prependOnceListener(event: "pause", listener: () => void): this;
|
|
323
|
-
prependOnceListener(event: "resume", listener: () => void): this;
|
|
324
|
-
prependOnceListener(event: "SIGCONT", listener: () => void): this;
|
|
325
|
-
prependOnceListener(event: "SIGINT", listener: () => void): this;
|
|
326
|
-
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
|
327
|
-
prependOnceListener(event: "history", listener: (history: string[]) => void): this;
|
|
328
271
|
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string>;
|
|
329
272
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
273
|
+
interface Interface extends InternalEventEmitter<InterfaceEventMap> {}
|
|
274
|
+
type ReadLine = Interface; // type forwarded for backwards compatibility
|
|
275
|
+
type Completer = (line: string) => CompleterResult;
|
|
276
|
+
type AsyncCompleter = (
|
|
333
277
|
line: string,
|
|
334
278
|
callback: (err?: null | Error, result?: CompleterResult) => void,
|
|
335
279
|
) => void;
|
|
336
|
-
|
|
337
|
-
|
|
280
|
+
type CompleterResult = [string[], string];
|
|
281
|
+
interface ReadLineOptions {
|
|
338
282
|
/**
|
|
339
|
-
* The [`Readable`](https://nodejs.org/docs/latest-
|
|
283
|
+
* The [`Readable`](https://nodejs.org/docs/latest-v25.x/api/stream.html#readable-streams) stream to listen to
|
|
340
284
|
*/
|
|
341
285
|
input: NodeJS.ReadableStream;
|
|
342
286
|
/**
|
|
343
|
-
* The [`Writable`](https://nodejs.org/docs/latest-
|
|
287
|
+
* The [`Writable`](https://nodejs.org/docs/latest-v25.x/api/stream.html#writable-streams) stream to write readline data to.
|
|
344
288
|
*/
|
|
345
289
|
output?: NodeJS.WritableStream | undefined;
|
|
346
290
|
/**
|
|
@@ -385,7 +329,7 @@ declare module "_not-use-node-type_readline" {
|
|
|
385
329
|
* `crlfDelay` will be coerced to a number no less than `100`.
|
|
386
330
|
* It can be set to `Infinity`, in which case
|
|
387
331
|
* `\r` followed by `\n` will always be considered a single newline
|
|
388
|
-
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-
|
|
332
|
+
* (which may be reasonable for [reading files](https://nodejs.org/docs/latest-v25.x/api/readline.html#example-read-file-stream-line-by-line) with `\r\n` line delimiter).
|
|
389
333
|
* @default 100
|
|
390
334
|
*/
|
|
391
335
|
crlfDelay?: number | undefined;
|
|
@@ -438,13 +382,13 @@ declare module "_not-use-node-type_readline" {
|
|
|
438
382
|
* waiting for user input, call `process.stdin.unref()`.
|
|
439
383
|
* @since v0.1.98
|
|
440
384
|
*/
|
|
441
|
-
|
|
385
|
+
function createInterface(
|
|
442
386
|
input: NodeJS.ReadableStream,
|
|
443
387
|
output?: NodeJS.WritableStream,
|
|
444
388
|
completer?: Completer | AsyncCompleter,
|
|
445
389
|
terminal?: boolean,
|
|
446
390
|
): Interface;
|
|
447
|
-
|
|
391
|
+
function createInterface(options: ReadLineOptions): Interface;
|
|
448
392
|
/**
|
|
449
393
|
* The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
|
|
450
394
|
*
|
|
@@ -566,42 +510,45 @@ declare module "_not-use-node-type_readline" {
|
|
|
566
510
|
* ```
|
|
567
511
|
* @since v0.7.7
|
|
568
512
|
*/
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
513
|
+
function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
|
|
514
|
+
type Direction = -1 | 0 | 1;
|
|
515
|
+
interface CursorPos {
|
|
572
516
|
rows: number;
|
|
573
517
|
cols: number;
|
|
574
518
|
}
|
|
575
519
|
/**
|
|
576
|
-
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-
|
|
520
|
+
* The `readline.clearLine()` method clears current line of given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) stream
|
|
577
521
|
* in a specified direction identified by `dir`.
|
|
578
522
|
* @since v0.7.7
|
|
579
523
|
* @param callback Invoked once the operation completes.
|
|
580
524
|
* @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`.
|
|
581
525
|
*/
|
|
582
|
-
|
|
526
|
+
function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
|
|
583
527
|
/**
|
|
584
|
-
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-
|
|
528
|
+
* The `readline.clearScreenDown()` method clears the given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) stream from
|
|
585
529
|
* the current position of the cursor down.
|
|
586
530
|
* @since v0.7.7
|
|
587
531
|
* @param callback Invoked once the operation completes.
|
|
588
532
|
* @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`.
|
|
589
533
|
*/
|
|
590
|
-
|
|
534
|
+
function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
|
|
591
535
|
/**
|
|
592
536
|
* The `readline.cursorTo()` method moves cursor to the specified position in a
|
|
593
|
-
* given [TTY](https://nodejs.org/docs/latest-
|
|
537
|
+
* given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`.
|
|
594
538
|
* @since v0.7.7
|
|
595
539
|
* @param callback Invoked once the operation completes.
|
|
596
540
|
* @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`.
|
|
597
541
|
*/
|
|
598
|
-
|
|
542
|
+
function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
|
|
599
543
|
/**
|
|
600
544
|
* The `readline.moveCursor()` method moves the cursor _relative_ to its current
|
|
601
|
-
* position in a given [TTY](https://nodejs.org/docs/latest-
|
|
545
|
+
* position in a given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`.
|
|
602
546
|
* @since v0.7.7
|
|
603
547
|
* @param callback Invoked once the operation completes.
|
|
604
548
|
* @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`.
|
|
605
549
|
*/
|
|
606
|
-
|
|
550
|
+
function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
|
|
551
|
+
}
|
|
552
|
+
declare module "_not-use-node-type_readline" {
|
|
553
|
+
export * as promises from "node:readline/promises";
|
|
607
554
|
}
|
package/repl.d.ts
CHANGED
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
* ```js
|
|
22
22
|
* import repl from 'node:repl';
|
|
23
23
|
* ```
|
|
24
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
24
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/repl.js)
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
declare module "node:repl" {
|
|
28
|
-
import { AsyncCompleter, Completer, Interface } from '_not-use-node-type_readline';
|
|
29
|
-
import { Context } from 'node:vm';
|
|
28
|
+
import { AsyncCompleter, Completer, Interface, InterfaceEventMap } from '_not-use-node-type_readline';
|
|
30
29
|
import { InspectOptions } from 'node:util';
|
|
30
|
+
import { Context } from 'node:vm';
|
|
31
31
|
interface ReplOptions {
|
|
32
32
|
/**
|
|
33
33
|
* The input prompt to display.
|
|
@@ -55,7 +55,7 @@ declare module "node:repl" {
|
|
|
55
55
|
* The function to be used when evaluating each given line of input.
|
|
56
56
|
* **Default:** an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
|
57
57
|
* error with `repl.Recoverable` to indicate the input was incomplete and prompt for
|
|
58
|
-
* additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-
|
|
58
|
+
* additional lines. See the [custom evaluation functions](https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#custom-evaluation-functions)
|
|
59
59
|
* section for more details.
|
|
60
60
|
*/
|
|
61
61
|
eval?: REPLEval | undefined;
|
|
@@ -88,13 +88,13 @@ declare module "node:repl" {
|
|
|
88
88
|
* The function to invoke to format the output of each command before writing to `output`.
|
|
89
89
|
* @default a wrapper for `util.inspect`
|
|
90
90
|
*
|
|
91
|
-
* @see https://nodejs.org/dist/latest-
|
|
91
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_customizing_repl_output
|
|
92
92
|
*/
|
|
93
93
|
writer?: REPLWriter | undefined;
|
|
94
94
|
/**
|
|
95
95
|
* An optional function used for custom Tab auto completion.
|
|
96
96
|
*
|
|
97
|
-
* @see https://nodejs.org/dist/latest-
|
|
97
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/readline.html#readline_use_of_the_completer_function
|
|
98
98
|
*/
|
|
99
99
|
completer?: Completer | AsyncCompleter | undefined;
|
|
100
100
|
/**
|
|
@@ -139,6 +139,16 @@ declare module "node:repl" {
|
|
|
139
139
|
*/
|
|
140
140
|
action: REPLCommandAction;
|
|
141
141
|
}
|
|
142
|
+
interface REPLServerSetupHistoryOptions {
|
|
143
|
+
filePath?: string | undefined;
|
|
144
|
+
size?: number | undefined;
|
|
145
|
+
removeHistoryDuplicates?: boolean | undefined;
|
|
146
|
+
onHistoryFileLoaded?: ((err: Error | null, repl: REPLServer) => void) | undefined;
|
|
147
|
+
}
|
|
148
|
+
interface REPLServerEventMap extends InterfaceEventMap {
|
|
149
|
+
"exit": [];
|
|
150
|
+
"reset": [context: Context];
|
|
151
|
+
}
|
|
142
152
|
/**
|
|
143
153
|
* Instances of `repl.REPLServer` are created using the {@link start} method
|
|
144
154
|
* or directly using the JavaScript `new` keyword.
|
|
@@ -154,6 +164,17 @@ declare module "node:repl" {
|
|
|
154
164
|
* @since v0.1.91
|
|
155
165
|
*/
|
|
156
166
|
class REPLServer extends Interface {
|
|
167
|
+
/**
|
|
168
|
+
* NOTE: According to the documentation:
|
|
169
|
+
*
|
|
170
|
+
* > Instances of `repl.REPLServer` are created using the `repl.start()` method and
|
|
171
|
+
* > _should not_ be created directly using the JavaScript `new` keyword.
|
|
172
|
+
*
|
|
173
|
+
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
|
174
|
+
*
|
|
175
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_class_replserver
|
|
176
|
+
*/
|
|
177
|
+
private constructor();
|
|
157
178
|
/**
|
|
158
179
|
* The `vm.Context` provided to the `eval` function to be used for JavaScript
|
|
159
180
|
* evaluation.
|
|
@@ -182,33 +203,33 @@ declare module "node:repl" {
|
|
|
182
203
|
/**
|
|
183
204
|
* A value indicating whether the REPL is currently in "editor mode".
|
|
184
205
|
*
|
|
185
|
-
* @see https://nodejs.org/dist/latest-
|
|
206
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_commands_and_special_keys
|
|
186
207
|
*/
|
|
187
208
|
readonly editorMode: boolean;
|
|
188
209
|
/**
|
|
189
210
|
* A value indicating whether the `_` variable has been assigned.
|
|
190
211
|
*
|
|
191
|
-
* @see https://nodejs.org/dist/latest-
|
|
212
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
192
213
|
*/
|
|
193
214
|
readonly underscoreAssigned: boolean;
|
|
194
215
|
/**
|
|
195
216
|
* The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
|
|
196
217
|
*
|
|
197
|
-
* @see https://nodejs.org/dist/latest-
|
|
218
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
198
219
|
*/
|
|
199
220
|
readonly last: any;
|
|
200
221
|
/**
|
|
201
222
|
* A value indicating whether the `_error` variable has been assigned.
|
|
202
223
|
*
|
|
203
224
|
* @since v9.8.0
|
|
204
|
-
* @see https://nodejs.org/dist/latest-
|
|
225
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
205
226
|
*/
|
|
206
227
|
readonly underscoreErrAssigned: boolean;
|
|
207
228
|
/**
|
|
208
229
|
* The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
|
|
209
230
|
*
|
|
210
231
|
* @since v9.8.0
|
|
211
|
-
* @see https://nodejs.org/dist/latest-
|
|
232
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
212
233
|
*/
|
|
213
234
|
readonly lastError: any;
|
|
214
235
|
/**
|
|
@@ -252,17 +273,6 @@ declare module "node:repl" {
|
|
|
252
273
|
* prefacing every repl statement with `'use strict'`.
|
|
253
274
|
*/
|
|
254
275
|
readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
|
|
255
|
-
/**
|
|
256
|
-
* NOTE: According to the documentation:
|
|
257
|
-
*
|
|
258
|
-
* > Instances of `repl.REPLServer` are created using the `repl.start()` method and
|
|
259
|
-
* > _should not_ be created directly using the JavaScript `new` keyword.
|
|
260
|
-
*
|
|
261
|
-
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
|
262
|
-
*
|
|
263
|
-
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_class_replserver
|
|
264
|
-
*/
|
|
265
|
-
private constructor();
|
|
266
276
|
/**
|
|
267
277
|
* The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands
|
|
268
278
|
* to the REPL instance. Such commands are invoked by typing a `.` followed by the `keyword`. The `cmd` is either a `Function` or an `Object` with the following
|
|
@@ -332,79 +342,56 @@ declare module "node:repl" {
|
|
|
332
342
|
* @param historyPath the path to the history file
|
|
333
343
|
* @param callback called when history writes are ready or upon error
|
|
334
344
|
*/
|
|
335
|
-
setupHistory(
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
once(event: "SIGTSTP", listener: () => void): this;
|
|
386
|
-
once(event: "exit", listener: () => void): this;
|
|
387
|
-
once(event: "reset", listener: (context: Context) => void): this;
|
|
388
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
389
|
-
prependListener(event: "close", listener: () => void): this;
|
|
390
|
-
prependListener(event: "line", listener: (input: string) => void): this;
|
|
391
|
-
prependListener(event: "pause", listener: () => void): this;
|
|
392
|
-
prependListener(event: "resume", listener: () => void): this;
|
|
393
|
-
prependListener(event: "SIGCONT", listener: () => void): this;
|
|
394
|
-
prependListener(event: "SIGINT", listener: () => void): this;
|
|
395
|
-
prependListener(event: "SIGTSTP", listener: () => void): this;
|
|
396
|
-
prependListener(event: "exit", listener: () => void): this;
|
|
397
|
-
prependListener(event: "reset", listener: (context: Context) => void): this;
|
|
398
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
399
|
-
prependOnceListener(event: "close", listener: () => void): this;
|
|
400
|
-
prependOnceListener(event: "line", listener: (input: string) => void): this;
|
|
401
|
-
prependOnceListener(event: "pause", listener: () => void): this;
|
|
402
|
-
prependOnceListener(event: "resume", listener: () => void): this;
|
|
403
|
-
prependOnceListener(event: "SIGCONT", listener: () => void): this;
|
|
404
|
-
prependOnceListener(event: "SIGINT", listener: () => void): this;
|
|
405
|
-
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
|
406
|
-
prependOnceListener(event: "exit", listener: () => void): this;
|
|
407
|
-
prependOnceListener(event: "reset", listener: (context: Context) => void): this;
|
|
345
|
+
setupHistory(historyPath: string, callback: (err: Error | null, repl: this) => void): void;
|
|
346
|
+
setupHistory(
|
|
347
|
+
historyConfig?: REPLServerSetupHistoryOptions,
|
|
348
|
+
callback?: (err: Error | null, repl: this) => void,
|
|
349
|
+
): void;
|
|
350
|
+
// #region InternalEventEmitter
|
|
351
|
+
addListener<E extends keyof REPLServerEventMap>(
|
|
352
|
+
eventName: E,
|
|
353
|
+
listener: (...args: REPLServerEventMap[E]) => void,
|
|
354
|
+
): this;
|
|
355
|
+
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
356
|
+
emit<E extends keyof REPLServerEventMap>(eventName: E, ...args: REPLServerEventMap[E]): boolean;
|
|
357
|
+
emit(eventName: string | symbol, ...args: any[]): boolean;
|
|
358
|
+
listenerCount<E extends keyof REPLServerEventMap>(
|
|
359
|
+
eventName: E,
|
|
360
|
+
listener?: (...args: REPLServerEventMap[E]) => void,
|
|
361
|
+
): number;
|
|
362
|
+
listenerCount(eventName: string | symbol, listener?: (...args: any[]) => void): number;
|
|
363
|
+
listeners<E extends keyof REPLServerEventMap>(eventName: E): ((...args: REPLServerEventMap[E]) => void)[];
|
|
364
|
+
listeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
365
|
+
off<E extends keyof REPLServerEventMap>(eventName: E, listener: (...args: REPLServerEventMap[E]) => void): this;
|
|
366
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
367
|
+
on<E extends keyof REPLServerEventMap>(eventName: E, listener: (...args: REPLServerEventMap[E]) => void): this;
|
|
368
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
369
|
+
once<E extends keyof REPLServerEventMap>(
|
|
370
|
+
eventName: E,
|
|
371
|
+
listener: (...args: REPLServerEventMap[E]) => void,
|
|
372
|
+
): this;
|
|
373
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
374
|
+
prependListener<E extends keyof REPLServerEventMap>(
|
|
375
|
+
eventName: E,
|
|
376
|
+
listener: (...args: REPLServerEventMap[E]) => void,
|
|
377
|
+
): this;
|
|
378
|
+
prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
379
|
+
prependOnceListener<E extends keyof REPLServerEventMap>(
|
|
380
|
+
eventName: E,
|
|
381
|
+
listener: (...args: REPLServerEventMap[E]) => void,
|
|
382
|
+
): this;
|
|
383
|
+
prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
384
|
+
rawListeners<E extends keyof REPLServerEventMap>(eventName: E): ((...args: REPLServerEventMap[E]) => void)[];
|
|
385
|
+
rawListeners(eventName: string | symbol): ((...args: any[]) => void)[];
|
|
386
|
+
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
|
|
387
|
+
removeAllListeners<E extends keyof REPLServerEventMap>(eventName?: E): this;
|
|
388
|
+
removeAllListeners(eventName?: string | symbol): this;
|
|
389
|
+
removeListener<E extends keyof REPLServerEventMap>(
|
|
390
|
+
eventName: E,
|
|
391
|
+
listener: (...args: REPLServerEventMap[E]) => void,
|
|
392
|
+
): this;
|
|
393
|
+
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
394
|
+
// #endregion
|
|
408
395
|
}
|
|
409
396
|
/**
|
|
410
397
|
* A flag passed in the REPL options. Evaluates expressions in sloppy mode.
|
|
@@ -432,7 +419,7 @@ declare module "node:repl" {
|
|
|
432
419
|
/**
|
|
433
420
|
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
|
434
421
|
*
|
|
435
|
-
* @see https://nodejs.org/dist/latest-
|
|
422
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_recoverable_errors
|
|
436
423
|
*/
|
|
437
424
|
class Recoverable extends SyntaxError {
|
|
438
425
|
err: Error;
|
package/sea.d.ts
CHANGED
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
* ```
|
|
127
127
|
* @since v19.7.0, v18.16.0
|
|
128
128
|
* @experimental
|
|
129
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
129
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/src/node_sea.cc)
|
|
130
130
|
*/
|
|
131
131
|
|
|
132
132
|
declare module "node:sea" {
|
|
@@ -166,4 +166,13 @@ declare module "node:sea" {
|
|
|
166
166
|
* @since v20.12.0
|
|
167
167
|
*/
|
|
168
168
|
function getRawAsset(key: AssetKey): ArrayBuffer;
|
|
169
|
+
/**
|
|
170
|
+
* This method can be used to retrieve an array of all the keys of assets
|
|
171
|
+
* embedded into the single-executable application.
|
|
172
|
+
* An error is thrown when not running inside a single-executable application.
|
|
173
|
+
* @since v24.8.0
|
|
174
|
+
* @returns An array containing all the keys of the assets
|
|
175
|
+
* embedded in the executable. If no assets are embedded, returns an empty array.
|
|
176
|
+
*/
|
|
177
|
+
function getAssetKeys(): string[];
|
|
169
178
|
}
|