@idlebox/stripe-node-types 24.0.14-patch.0 → 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 +113 -1
- package/assert.d.ts +162 -248
- package/async_hooks.d.ts +20 -5
- package/buffer.buffer.d.ts +24 -6
- package/buffer.d.ts +63 -168
- package/child_process.d.ts +117 -223
- package/cluster.d.ts +251 -329
- package/compatibility/iterators.d.ts +15 -0
- package/console.d.ts +60 -346
- package/constants.d.ts +15 -1
- package/crypto.d.ts +713 -1149
- package/dgram.d.ts +30 -50
- package/diagnostics_channel.d.ts +16 -3
- package/dns/promises.d.ts +15 -0
- package/dns.d.ts +150 -131
- package/domain.d.ts +25 -14
- package/events.d.ts +858 -719
- package/fs/promises.d.ts +117 -53
- package/fs.d.ts +729 -484
- package/globals.d.ts +142 -344
- package/globals.typedarray.d.ts +94 -0
- package/http.d.ts +358 -246
- package/http2.d.ts +578 -711
- package/https.d.ts +85 -216
- package/index.d.ts +39 -3
- package/inspector/promises.d.ts +54 -0
- package/inspector.d.ts +180 -3936
- package/inspector.generated.d.ts +4242 -0
- package/module.d.ts +60 -95
- package/my-shim.d.ts +15 -0
- package/net.d.ts +102 -186
- package/os.d.ts +32 -6
- package/package.json +3 -8
- package/path/posix.d.ts +20 -0
- package/path/win32.d.ts +20 -0
- package/path.d.ts +132 -122
- package/perf_hooks.d.ts +310 -644
- package/process.d.ts +192 -138
- package/punycode.d.ts +17 -2
- package/querystring.d.ts +16 -1
- package/quic.d.ts +926 -0
- package/readline/promises.d.ts +16 -1
- package/readline.d.ts +80 -118
- package/repl.d.ts +98 -96
- package/sea.d.ts +25 -1
- package/sqlite.d.ts +277 -13
- package/stream/consumers.d.ts +22 -7
- package/stream/promises.d.ts +148 -12
- package/stream/web.d.ts +187 -494
- package/stream.d.ts +608 -490
- package/string_decoder.d.ts +18 -3
- package/test/reporters.d.ts +112 -0
- package/test.d.ts +238 -199
- package/timers/promises.d.ts +16 -1
- package/timers.d.ts +16 -129
- package/tls.d.ts +163 -163
- package/trace_events.d.ts +21 -6
- package/ts5.6/buffer.buffer.d.ts +25 -8
- package/ts5.6/compatibility/float16array.d.ts +15 -0
- package/ts5.6/globals.typedarray.d.ts +31 -0
- package/ts5.6/index.d.ts +39 -3
- package/ts5.7/compatibility/float16array.d.ts +15 -0
- package/ts5.7/index.d.ts +39 -3
- package/tty.d.ts +70 -13
- package/undici-types/agent.d.ts +20 -4
- package/undici-types/api.d.ts +15 -0
- package/undici-types/balanced-pool.d.ts +15 -0
- package/undici-types/cache-interceptor.d.ts +15 -0
- package/undici-types/cache.d.ts +15 -0
- package/undici-types/client-stats.d.ts +31 -0
- package/undici-types/client.d.ts +21 -5
- package/undici-types/connector.d.ts +15 -0
- package/undici-types/content-type.d.ts +15 -0
- package/undici-types/cookies.d.ts +15 -0
- package/undici-types/diagnostics-channel.d.ts +24 -1
- package/undici-types/dispatcher.d.ts +18 -8
- package/undici-types/env-http-proxy-agent.d.ts +17 -1
- package/undici-types/errors.d.ts +20 -15
- package/undici-types/eventsource.d.ts +24 -4
- package/undici-types/fetch.d.ts +16 -0
- package/undici-types/formdata.d.ts +15 -0
- package/undici-types/global-dispatcher.d.ts +15 -0
- package/undici-types/global-origin.d.ts +15 -0
- package/undici-types/h2c-client.d.ts +15 -2
- package/undici-types/handlers.d.ts +16 -1
- package/undici-types/header.d.ts +15 -0
- package/undici-types/index.d.ts +21 -1
- package/undici-types/interceptors.d.ts +20 -0
- package/undici-types/mock-agent.d.ts +18 -0
- package/undici-types/mock-call-history.d.ts +15 -0
- package/undici-types/mock-client.d.ts +17 -0
- package/undici-types/mock-errors.d.ts +15 -0
- package/undici-types/mock-interceptor.d.ts +17 -1
- package/undici-types/mock-pool.d.ts +17 -0
- package/undici-types/package.json +1 -1
- package/undici-types/patch.d.ts +15 -0
- package/undici-types/pool-stats.d.ts +15 -0
- package/undici-types/pool.d.ts +17 -0
- package/undici-types/proxy-agent.d.ts +16 -0
- package/undici-types/readable.d.ts +15 -0
- package/undici-types/retry-agent.d.ts +15 -0
- package/undici-types/retry-handler.d.ts +24 -0
- package/undici-types/snapshot-agent.d.ts +125 -0
- package/undici-types/util.d.ts +15 -0
- package/undici-types/utility.d.ts +15 -0
- package/undici-types/webidl.d.ts +126 -36
- package/undici-types/websocket.d.ts +18 -1
- package/url.d.ts +107 -587
- package/util/types.d.ts +571 -0
- package/util.d.ts +158 -792
- package/v8.d.ts +82 -7
- package/vm.d.ts +267 -108
- package/wasi.d.ts +38 -2
- package/web-globals/abortcontroller.d.ts +75 -0
- package/web-globals/blob.d.ts +39 -0
- package/web-globals/console.d.ts +25 -0
- 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} +72 -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 +306 -349
- package/zlib.d.ts +59 -94
- package/ts5.1/compatibility/disposable.d.ts +0 -13
- package/ts5.1/index.d.ts +0 -100
package/readline/promises.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
// biome-ignore-all lint: generated file
|
|
2
|
+
// biome-ignore-all assist: generated file
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
8
|
+
* 这是生成的文件,千万不要修改
|
|
9
|
+
*
|
|
10
|
+
* @build-script/codegen - The Simple Code Generater
|
|
11
|
+
* https://github.com/GongT/baobao
|
|
12
|
+
*
|
|
13
|
+
******************************************************************************/
|
|
14
|
+
|
|
15
|
+
|
|
1
16
|
/**
|
|
2
17
|
* @since v17.0.0
|
|
3
18
|
*/
|
|
@@ -65,7 +80,7 @@ declare module "node:readline/promises" {
|
|
|
65
80
|
constructor(
|
|
66
81
|
stream: NodeJS.WritableStream,
|
|
67
82
|
options?: {
|
|
68
|
-
autoCommit?: boolean;
|
|
83
|
+
autoCommit?: boolean | undefined;
|
|
69
84
|
},
|
|
70
85
|
);
|
|
71
86
|
/**
|
package/readline.d.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
// biome-ignore-all lint: generated file
|
|
2
|
+
// biome-ignore-all assist: generated file
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
8
|
+
* 这是生成的文件,千万不要修改
|
|
9
|
+
*
|
|
10
|
+
* @build-script/codegen - The Simple Code Generater
|
|
11
|
+
* https://github.com/GongT/baobao
|
|
12
|
+
*
|
|
13
|
+
******************************************************************************/
|
|
14
|
+
|
|
15
|
+
|
|
1
16
|
/**
|
|
2
|
-
* The `node:readline` module provides an interface for reading data from a [Readable](https://nodejs.org/docs/latest-
|
|
3
|
-
* (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.
|
|
4
19
|
*
|
|
5
20
|
* To use the promise-based APIs:
|
|
6
21
|
*
|
|
@@ -31,28 +46,59 @@
|
|
|
31
46
|
*
|
|
32
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
|
|
33
48
|
* received on the `input` stream.
|
|
34
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
49
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/readline.js)
|
|
35
50
|
*/
|
|
36
51
|
|
|
37
52
|
declare module "_not-use-node-type_readline" {
|
|
38
|
-
import { Abortable, EventEmitter } from 'node:events';
|
|
39
|
-
|
|
40
|
-
export { promises };
|
|
41
|
-
export interface Key {
|
|
53
|
+
import { Abortable, EventEmitter, InternalEventEmitter } from 'node:events';
|
|
54
|
+
interface Key {
|
|
42
55
|
sequence?: string | undefined;
|
|
43
56
|
name?: string | undefined;
|
|
44
57
|
ctrl?: boolean | undefined;
|
|
45
58
|
meta?: boolean | undefined;
|
|
46
59
|
shift?: boolean | undefined;
|
|
47
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
|
+
}
|
|
48
71
|
/**
|
|
49
72
|
* Instances of the `readline.Interface` class are constructed using the `readline.createInterface()` method. Every instance is associated with a
|
|
50
|
-
* 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.
|
|
51
74
|
* The `output` stream is used to print prompts for user input that arrives on,
|
|
52
75
|
* and is read from, the `input` stream.
|
|
53
76
|
* @since v0.1.104
|
|
54
77
|
*/
|
|
55
|
-
|
|
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);
|
|
56
102
|
readonly terminal: boolean;
|
|
57
103
|
/**
|
|
58
104
|
* The current input data being processed by node.
|
|
@@ -95,29 +141,6 @@ declare module "_not-use-node-type_readline" {
|
|
|
95
141
|
* @since v0.1.98
|
|
96
142
|
*/
|
|
97
143
|
readonly cursor: number;
|
|
98
|
-
/**
|
|
99
|
-
* NOTE: According to the documentation:
|
|
100
|
-
*
|
|
101
|
-
* > Instances of the `readline.Interface` class are constructed using the
|
|
102
|
-
* > `readline.createInterface()` method.
|
|
103
|
-
*
|
|
104
|
-
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
|
105
|
-
*/
|
|
106
|
-
protected constructor(
|
|
107
|
-
input: NodeJS.ReadableStream,
|
|
108
|
-
output?: NodeJS.WritableStream,
|
|
109
|
-
completer?: Completer | AsyncCompleter,
|
|
110
|
-
terminal?: boolean,
|
|
111
|
-
);
|
|
112
|
-
/**
|
|
113
|
-
* NOTE: According to the documentation:
|
|
114
|
-
*
|
|
115
|
-
* > Instances of the `readline.Interface` class are constructed using the
|
|
116
|
-
* > `readline.createInterface()` method.
|
|
117
|
-
*
|
|
118
|
-
* @see https://nodejs.org/dist/latest-v24.x/docs/api/readline.html#class-interfaceconstructor
|
|
119
|
-
*/
|
|
120
|
-
protected constructor(options: ReadLineOptions);
|
|
121
144
|
/**
|
|
122
145
|
* The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`.
|
|
123
146
|
* @since v15.3.0, v14.17.0
|
|
@@ -245,87 +268,23 @@ declare module "_not-use-node-type_readline" {
|
|
|
245
268
|
* @since v13.5.0, v12.16.0
|
|
246
269
|
*/
|
|
247
270
|
getCursorPos(): CursorPos;
|
|
248
|
-
/**
|
|
249
|
-
* events.EventEmitter
|
|
250
|
-
* 1. close
|
|
251
|
-
* 2. line
|
|
252
|
-
* 3. pause
|
|
253
|
-
* 4. resume
|
|
254
|
-
* 5. SIGCONT
|
|
255
|
-
* 6. SIGINT
|
|
256
|
-
* 7. SIGTSTP
|
|
257
|
-
* 8. history
|
|
258
|
-
*/
|
|
259
|
-
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
260
|
-
addListener(event: "close", listener: () => void): this;
|
|
261
|
-
addListener(event: "line", listener: (input: string) => void): this;
|
|
262
|
-
addListener(event: "pause", listener: () => void): this;
|
|
263
|
-
addListener(event: "resume", listener: () => void): this;
|
|
264
|
-
addListener(event: "SIGCONT", listener: () => void): this;
|
|
265
|
-
addListener(event: "SIGINT", listener: () => void): this;
|
|
266
|
-
addListener(event: "SIGTSTP", listener: () => void): this;
|
|
267
|
-
addListener(event: "history", listener: (history: string[]) => void): this;
|
|
268
|
-
emit(event: string | symbol, ...args: any[]): boolean;
|
|
269
|
-
emit(event: "close"): boolean;
|
|
270
|
-
emit(event: "line", input: string): boolean;
|
|
271
|
-
emit(event: "pause"): boolean;
|
|
272
|
-
emit(event: "resume"): boolean;
|
|
273
|
-
emit(event: "SIGCONT"): boolean;
|
|
274
|
-
emit(event: "SIGINT"): boolean;
|
|
275
|
-
emit(event: "SIGTSTP"): boolean;
|
|
276
|
-
emit(event: "history", history: string[]): boolean;
|
|
277
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
278
|
-
on(event: "close", listener: () => void): this;
|
|
279
|
-
on(event: "line", listener: (input: string) => void): this;
|
|
280
|
-
on(event: "pause", listener: () => void): this;
|
|
281
|
-
on(event: "resume", listener: () => void): this;
|
|
282
|
-
on(event: "SIGCONT", listener: () => void): this;
|
|
283
|
-
on(event: "SIGINT", listener: () => void): this;
|
|
284
|
-
on(event: "SIGTSTP", listener: () => void): this;
|
|
285
|
-
on(event: "history", listener: (history: string[]) => void): this;
|
|
286
|
-
once(event: string, listener: (...args: any[]) => void): this;
|
|
287
|
-
once(event: "close", listener: () => void): this;
|
|
288
|
-
once(event: "line", listener: (input: string) => void): this;
|
|
289
|
-
once(event: "pause", listener: () => void): this;
|
|
290
|
-
once(event: "resume", listener: () => void): this;
|
|
291
|
-
once(event: "SIGCONT", listener: () => void): this;
|
|
292
|
-
once(event: "SIGINT", listener: () => void): this;
|
|
293
|
-
once(event: "SIGTSTP", listener: () => void): this;
|
|
294
|
-
once(event: "history", listener: (history: string[]) => void): this;
|
|
295
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
296
|
-
prependListener(event: "close", listener: () => void): this;
|
|
297
|
-
prependListener(event: "line", listener: (input: string) => void): this;
|
|
298
|
-
prependListener(event: "pause", listener: () => void): this;
|
|
299
|
-
prependListener(event: "resume", listener: () => void): this;
|
|
300
|
-
prependListener(event: "SIGCONT", listener: () => void): this;
|
|
301
|
-
prependListener(event: "SIGINT", listener: () => void): this;
|
|
302
|
-
prependListener(event: "SIGTSTP", listener: () => void): this;
|
|
303
|
-
prependListener(event: "history", listener: (history: string[]) => void): this;
|
|
304
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
305
|
-
prependOnceListener(event: "close", listener: () => void): this;
|
|
306
|
-
prependOnceListener(event: "line", listener: (input: string) => void): this;
|
|
307
|
-
prependOnceListener(event: "pause", listener: () => void): this;
|
|
308
|
-
prependOnceListener(event: "resume", listener: () => void): this;
|
|
309
|
-
prependOnceListener(event: "SIGCONT", listener: () => void): this;
|
|
310
|
-
prependOnceListener(event: "SIGINT", listener: () => void): this;
|
|
311
|
-
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
|
312
|
-
prependOnceListener(event: "history", listener: (history: string[]) => void): this;
|
|
313
271
|
[Symbol.asyncIterator](): NodeJS.AsyncIterator<string>;
|
|
314
272
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
273
|
+
interface Interface extends InternalEventEmitter<InterfaceEventMap> {}
|
|
274
|
+
type ReadLine = Interface; // type forwarded for backwards compatibility
|
|
275
|
+
type Completer = (line: string) => CompleterResult;
|
|
276
|
+
type AsyncCompleter = (
|
|
318
277
|
line: string,
|
|
319
278
|
callback: (err?: null | Error, result?: CompleterResult) => void,
|
|
320
279
|
) => void;
|
|
321
|
-
|
|
322
|
-
|
|
280
|
+
type CompleterResult = [string[], string];
|
|
281
|
+
interface ReadLineOptions {
|
|
323
282
|
/**
|
|
324
|
-
* 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
|
|
325
284
|
*/
|
|
326
285
|
input: NodeJS.ReadableStream;
|
|
327
286
|
/**
|
|
328
|
-
* 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.
|
|
329
288
|
*/
|
|
330
289
|
output?: NodeJS.WritableStream | undefined;
|
|
331
290
|
/**
|
|
@@ -370,7 +329,7 @@ declare module "_not-use-node-type_readline" {
|
|
|
370
329
|
* `crlfDelay` will be coerced to a number no less than `100`.
|
|
371
330
|
* It can be set to `Infinity`, in which case
|
|
372
331
|
* `\r` followed by `\n` will always be considered a single newline
|
|
373
|
-
* (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).
|
|
374
333
|
* @default 100
|
|
375
334
|
*/
|
|
376
335
|
crlfDelay?: number | undefined;
|
|
@@ -423,13 +382,13 @@ declare module "_not-use-node-type_readline" {
|
|
|
423
382
|
* waiting for user input, call `process.stdin.unref()`.
|
|
424
383
|
* @since v0.1.98
|
|
425
384
|
*/
|
|
426
|
-
|
|
385
|
+
function createInterface(
|
|
427
386
|
input: NodeJS.ReadableStream,
|
|
428
387
|
output?: NodeJS.WritableStream,
|
|
429
388
|
completer?: Completer | AsyncCompleter,
|
|
430
389
|
terminal?: boolean,
|
|
431
390
|
): Interface;
|
|
432
|
-
|
|
391
|
+
function createInterface(options: ReadLineOptions): Interface;
|
|
433
392
|
/**
|
|
434
393
|
* The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input.
|
|
435
394
|
*
|
|
@@ -551,42 +510,45 @@ declare module "_not-use-node-type_readline" {
|
|
|
551
510
|
* ```
|
|
552
511
|
* @since v0.7.7
|
|
553
512
|
*/
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
513
|
+
function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
|
|
514
|
+
type Direction = -1 | 0 | 1;
|
|
515
|
+
interface CursorPos {
|
|
557
516
|
rows: number;
|
|
558
517
|
cols: number;
|
|
559
518
|
}
|
|
560
519
|
/**
|
|
561
|
-
* 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
|
|
562
521
|
* in a specified direction identified by `dir`.
|
|
563
522
|
* @since v0.7.7
|
|
564
523
|
* @param callback Invoked once the operation completes.
|
|
565
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`.
|
|
566
525
|
*/
|
|
567
|
-
|
|
526
|
+
function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
|
|
568
527
|
/**
|
|
569
|
-
* 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
|
|
570
529
|
* the current position of the cursor down.
|
|
571
530
|
* @since v0.7.7
|
|
572
531
|
* @param callback Invoked once the operation completes.
|
|
573
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`.
|
|
574
533
|
*/
|
|
575
|
-
|
|
534
|
+
function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
|
|
576
535
|
/**
|
|
577
536
|
* The `readline.cursorTo()` method moves cursor to the specified position in a
|
|
578
|
-
* given [TTY](https://nodejs.org/docs/latest-
|
|
537
|
+
* given [TTY](https://nodejs.org/docs/latest-v25.x/api/tty.html) `stream`.
|
|
579
538
|
* @since v0.7.7
|
|
580
539
|
* @param callback Invoked once the operation completes.
|
|
581
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`.
|
|
582
541
|
*/
|
|
583
|
-
|
|
542
|
+
function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
|
|
584
543
|
/**
|
|
585
544
|
* The `readline.moveCursor()` method moves the cursor _relative_ to its current
|
|
586
|
-
* 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`.
|
|
587
546
|
* @since v0.7.7
|
|
588
547
|
* @param callback Invoked once the operation completes.
|
|
589
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`.
|
|
590
549
|
*/
|
|
591
|
-
|
|
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";
|
|
592
554
|
}
|
package/repl.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
// biome-ignore-all lint: generated file
|
|
2
|
+
// biome-ignore-all assist: generated file
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
|
|
6
|
+
/******************************************************************************
|
|
7
|
+
* GENERATED FILE, DO NOT MODIFY
|
|
8
|
+
* 这是生成的文件,千万不要修改
|
|
9
|
+
*
|
|
10
|
+
* @build-script/codegen - The Simple Code Generater
|
|
11
|
+
* https://github.com/GongT/baobao
|
|
12
|
+
*
|
|
13
|
+
******************************************************************************/
|
|
14
|
+
|
|
15
|
+
|
|
1
16
|
/**
|
|
2
17
|
* The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation
|
|
3
18
|
* that is available both as a standalone program or includible in other
|
|
@@ -6,13 +21,13 @@
|
|
|
6
21
|
* ```js
|
|
7
22
|
* import repl from 'node:repl';
|
|
8
23
|
* ```
|
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
24
|
+
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/repl.js)
|
|
10
25
|
*/
|
|
11
26
|
|
|
12
27
|
declare module "node:repl" {
|
|
13
|
-
import { AsyncCompleter, Completer, Interface } from '_not-use-node-type_readline';
|
|
14
|
-
import { Context } from 'node:vm';
|
|
28
|
+
import { AsyncCompleter, Completer, Interface, InterfaceEventMap } from '_not-use-node-type_readline';
|
|
15
29
|
import { InspectOptions } from 'node:util';
|
|
30
|
+
import { Context } from 'node:vm';
|
|
16
31
|
interface ReplOptions {
|
|
17
32
|
/**
|
|
18
33
|
* The input prompt to display.
|
|
@@ -40,7 +55,7 @@ declare module "node:repl" {
|
|
|
40
55
|
* The function to be used when evaluating each given line of input.
|
|
41
56
|
* **Default:** an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
|
42
57
|
* error with `repl.Recoverable` to indicate the input was incomplete and prompt for
|
|
43
|
-
* 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)
|
|
44
59
|
* section for more details.
|
|
45
60
|
*/
|
|
46
61
|
eval?: REPLEval | undefined;
|
|
@@ -73,13 +88,13 @@ declare module "node:repl" {
|
|
|
73
88
|
* The function to invoke to format the output of each command before writing to `output`.
|
|
74
89
|
* @default a wrapper for `util.inspect`
|
|
75
90
|
*
|
|
76
|
-
* @see https://nodejs.org/dist/latest-
|
|
91
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_customizing_repl_output
|
|
77
92
|
*/
|
|
78
93
|
writer?: REPLWriter | undefined;
|
|
79
94
|
/**
|
|
80
95
|
* An optional function used for custom Tab auto completion.
|
|
81
96
|
*
|
|
82
|
-
* @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
|
|
83
98
|
*/
|
|
84
99
|
completer?: Completer | AsyncCompleter | undefined;
|
|
85
100
|
/**
|
|
@@ -124,6 +139,16 @@ declare module "node:repl" {
|
|
|
124
139
|
*/
|
|
125
140
|
action: REPLCommandAction;
|
|
126
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
|
+
}
|
|
127
152
|
/**
|
|
128
153
|
* Instances of `repl.REPLServer` are created using the {@link start} method
|
|
129
154
|
* or directly using the JavaScript `new` keyword.
|
|
@@ -139,6 +164,17 @@ declare module "node:repl" {
|
|
|
139
164
|
* @since v0.1.91
|
|
140
165
|
*/
|
|
141
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();
|
|
142
178
|
/**
|
|
143
179
|
* The `vm.Context` provided to the `eval` function to be used for JavaScript
|
|
144
180
|
* evaluation.
|
|
@@ -167,33 +203,33 @@ declare module "node:repl" {
|
|
|
167
203
|
/**
|
|
168
204
|
* A value indicating whether the REPL is currently in "editor mode".
|
|
169
205
|
*
|
|
170
|
-
* @see https://nodejs.org/dist/latest-
|
|
206
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_commands_and_special_keys
|
|
171
207
|
*/
|
|
172
208
|
readonly editorMode: boolean;
|
|
173
209
|
/**
|
|
174
210
|
* A value indicating whether the `_` variable has been assigned.
|
|
175
211
|
*
|
|
176
|
-
* @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
|
|
177
213
|
*/
|
|
178
214
|
readonly underscoreAssigned: boolean;
|
|
179
215
|
/**
|
|
180
216
|
* The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
|
|
181
217
|
*
|
|
182
|
-
* @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
|
|
183
219
|
*/
|
|
184
220
|
readonly last: any;
|
|
185
221
|
/**
|
|
186
222
|
* A value indicating whether the `_error` variable has been assigned.
|
|
187
223
|
*
|
|
188
224
|
* @since v9.8.0
|
|
189
|
-
* @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
|
|
190
226
|
*/
|
|
191
227
|
readonly underscoreErrAssigned: boolean;
|
|
192
228
|
/**
|
|
193
229
|
* The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
|
|
194
230
|
*
|
|
195
231
|
* @since v9.8.0
|
|
196
|
-
* @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
|
|
197
233
|
*/
|
|
198
234
|
readonly lastError: any;
|
|
199
235
|
/**
|
|
@@ -237,17 +273,6 @@ declare module "node:repl" {
|
|
|
237
273
|
* prefacing every repl statement with `'use strict'`.
|
|
238
274
|
*/
|
|
239
275
|
readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
|
|
240
|
-
/**
|
|
241
|
-
* NOTE: According to the documentation:
|
|
242
|
-
*
|
|
243
|
-
* > Instances of `repl.REPLServer` are created using the `repl.start()` method and
|
|
244
|
-
* > _should not_ be created directly using the JavaScript `new` keyword.
|
|
245
|
-
*
|
|
246
|
-
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
|
247
|
-
*
|
|
248
|
-
* @see https://nodejs.org/dist/latest-v24.x/docs/api/repl.html#repl_class_replserver
|
|
249
|
-
*/
|
|
250
|
-
private constructor();
|
|
251
276
|
/**
|
|
252
277
|
* The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands
|
|
253
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
|
|
@@ -317,79 +342,56 @@ declare module "node:repl" {
|
|
|
317
342
|
* @param historyPath the path to the history file
|
|
318
343
|
* @param callback called when history writes are ready or upon error
|
|
319
344
|
*/
|
|
320
|
-
setupHistory(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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
|
-
once(event: "SIGTSTP", listener: () => void): this;
|
|
371
|
-
once(event: "exit", listener: () => void): this;
|
|
372
|
-
once(event: "reset", listener: (context: Context) => void): this;
|
|
373
|
-
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
374
|
-
prependListener(event: "close", listener: () => void): this;
|
|
375
|
-
prependListener(event: "line", listener: (input: string) => void): this;
|
|
376
|
-
prependListener(event: "pause", listener: () => void): this;
|
|
377
|
-
prependListener(event: "resume", listener: () => void): this;
|
|
378
|
-
prependListener(event: "SIGCONT", listener: () => void): this;
|
|
379
|
-
prependListener(event: "SIGINT", listener: () => void): this;
|
|
380
|
-
prependListener(event: "SIGTSTP", listener: () => void): this;
|
|
381
|
-
prependListener(event: "exit", listener: () => void): this;
|
|
382
|
-
prependListener(event: "reset", listener: (context: Context) => void): this;
|
|
383
|
-
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
384
|
-
prependOnceListener(event: "close", listener: () => void): this;
|
|
385
|
-
prependOnceListener(event: "line", listener: (input: string) => void): this;
|
|
386
|
-
prependOnceListener(event: "pause", listener: () => void): this;
|
|
387
|
-
prependOnceListener(event: "resume", listener: () => void): this;
|
|
388
|
-
prependOnceListener(event: "SIGCONT", listener: () => void): this;
|
|
389
|
-
prependOnceListener(event: "SIGINT", listener: () => void): this;
|
|
390
|
-
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
|
391
|
-
prependOnceListener(event: "exit", listener: () => void): this;
|
|
392
|
-
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
|
|
393
395
|
}
|
|
394
396
|
/**
|
|
395
397
|
* A flag passed in the REPL options. Evaluates expressions in sloppy mode.
|
|
@@ -417,7 +419,7 @@ declare module "node:repl" {
|
|
|
417
419
|
/**
|
|
418
420
|
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
|
419
421
|
*
|
|
420
|
-
* @see https://nodejs.org/dist/latest-
|
|
422
|
+
* @see https://nodejs.org/dist/latest-v25.x/docs/api/repl.html#repl_recoverable_errors
|
|
421
423
|
*/
|
|
422
424
|
class Recoverable extends SyntaxError {
|
|
423
425
|
err: Error;
|