@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/stream/promises.d.ts
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
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
|
declare module "node:stream/promises" {
|
|
18
|
+
import { Abortable } from 'node:events';
|
|
3
19
|
import {
|
|
4
20
|
FinishedOptions as _FinishedOptions,
|
|
5
21
|
PipelineDestination,
|
|
6
|
-
PipelineOptions,
|
|
7
|
-
PipelinePromise,
|
|
8
22
|
PipelineSource,
|
|
9
23
|
PipelineTransform,
|
|
10
24
|
} from 'node:stream';
|
|
25
|
+
import { ReadableStream, WritableStream } from 'node:stream/web';
|
|
11
26
|
interface FinishedOptions extends _FinishedOptions {
|
|
12
27
|
/**
|
|
13
28
|
* If true, removes the listeners registered by this function before the promise is fulfilled.
|
|
@@ -15,15 +30,130 @@ declare module "node:stream/promises" {
|
|
|
15
30
|
*/
|
|
16
31
|
cleanup?: boolean | undefined;
|
|
17
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* ```js
|
|
35
|
+
* import { finished } from 'node:stream/promises';
|
|
36
|
+
* import { createReadStream } from 'node:fs';
|
|
37
|
+
*
|
|
38
|
+
* const rs = createReadStream('archive.tar');
|
|
39
|
+
*
|
|
40
|
+
* async function run() {
|
|
41
|
+
* await finished(rs);
|
|
42
|
+
* console.log('Stream is done reading.');
|
|
43
|
+
* }
|
|
44
|
+
*
|
|
45
|
+
* run().catch(console.error);
|
|
46
|
+
* rs.resume(); // Drain the stream.
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* The `finished` API also provides a [callback version](https://nodejs.org/docs/latest-v25.x/api/stream.html#streamfinishedstream-options-callback).
|
|
50
|
+
*
|
|
51
|
+
* `stream.finished()` leaves dangling event listeners (in particular
|
|
52
|
+
* `'error'`, `'end'`, `'finish'` and `'close'`) after the returned promise is
|
|
53
|
+
* resolved or rejected. The reason for this is so that unexpected `'error'`
|
|
54
|
+
* events (due to incorrect stream implementations) do not cause unexpected
|
|
55
|
+
* crashes. If this is unwanted behavior then `options.cleanup` should be set to
|
|
56
|
+
* `true`:
|
|
57
|
+
*
|
|
58
|
+
* ```js
|
|
59
|
+
* await finished(rs, { cleanup: true });
|
|
60
|
+
* ```
|
|
61
|
+
* @since v15.0.0
|
|
62
|
+
* @returns Fulfills when the stream is no longer readable or writable.
|
|
63
|
+
*/
|
|
18
64
|
function finished(
|
|
19
|
-
stream: NodeJS.ReadableStream | NodeJS.WritableStream |
|
|
65
|
+
stream: NodeJS.ReadableStream | NodeJS.WritableStream | ReadableStream | WritableStream,
|
|
20
66
|
options?: FinishedOptions,
|
|
21
67
|
): Promise<void>;
|
|
68
|
+
interface PipelineOptions extends Abortable {
|
|
69
|
+
end?: boolean | undefined;
|
|
70
|
+
}
|
|
71
|
+
type PipelineResult<S extends PipelineDestination<any, any>> = S extends (...args: any[]) => PromiseLike<infer R>
|
|
72
|
+
? Promise<R>
|
|
73
|
+
: Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* ```js
|
|
76
|
+
* import { pipeline } from 'node:stream/promises';
|
|
77
|
+
* import { createReadStream, createWriteStream } from 'node:fs';
|
|
78
|
+
* import { createGzip } from 'node:zlib';
|
|
79
|
+
*
|
|
80
|
+
* await pipeline(
|
|
81
|
+
* createReadStream('archive.tar'),
|
|
82
|
+
* createGzip(),
|
|
83
|
+
* createWriteStream('archive.tar.gz'),
|
|
84
|
+
* );
|
|
85
|
+
* console.log('Pipeline succeeded.');
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* To use an `AbortSignal`, pass it inside an options object, as the last argument.
|
|
89
|
+
* When the signal is aborted, `destroy` will be called on the underlying pipeline,
|
|
90
|
+
* with an `AbortError`.
|
|
91
|
+
*
|
|
92
|
+
* ```js
|
|
93
|
+
* import { pipeline } from 'node:stream/promises';
|
|
94
|
+
* import { createReadStream, createWriteStream } from 'node:fs';
|
|
95
|
+
* import { createGzip } from 'node:zlib';
|
|
96
|
+
*
|
|
97
|
+
* const ac = new AbortController();
|
|
98
|
+
* const { signal } = ac;
|
|
99
|
+
* setImmediate(() => ac.abort());
|
|
100
|
+
* try {
|
|
101
|
+
* await pipeline(
|
|
102
|
+
* createReadStream('archive.tar'),
|
|
103
|
+
* createGzip(),
|
|
104
|
+
* createWriteStream('archive.tar.gz'),
|
|
105
|
+
* { signal },
|
|
106
|
+
* );
|
|
107
|
+
* } catch (err) {
|
|
108
|
+
* console.error(err); // AbortError
|
|
109
|
+
* }
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* The `pipeline` API also supports async generators:
|
|
113
|
+
*
|
|
114
|
+
* ```js
|
|
115
|
+
* import { pipeline } from 'node:stream/promises';
|
|
116
|
+
* import { createReadStream, createWriteStream } from 'node:fs';
|
|
117
|
+
*
|
|
118
|
+
* await pipeline(
|
|
119
|
+
* createReadStream('lowercase.txt'),
|
|
120
|
+
* async function* (source, { signal }) {
|
|
121
|
+
* source.setEncoding('utf8'); // Work with strings rather than `Buffer`s.
|
|
122
|
+
* for await (const chunk of source) {
|
|
123
|
+
* yield await processChunk(chunk, { signal });
|
|
124
|
+
* }
|
|
125
|
+
* },
|
|
126
|
+
* createWriteStream('uppercase.txt'),
|
|
127
|
+
* );
|
|
128
|
+
* console.log('Pipeline succeeded.');
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* Remember to handle the `signal` argument passed into the async generator.
|
|
132
|
+
* Especially in the case where the async generator is the source for the
|
|
133
|
+
* pipeline (i.e. first argument) or the pipeline will never complete.
|
|
134
|
+
*
|
|
135
|
+
* ```js
|
|
136
|
+
* import { pipeline } from 'node:stream/promises';
|
|
137
|
+
* import fs from 'node:fs';
|
|
138
|
+
* await pipeline(
|
|
139
|
+
* async function* ({ signal }) {
|
|
140
|
+
* await someLongRunningfn({ signal });
|
|
141
|
+
* yield 'asd';
|
|
142
|
+
* },
|
|
143
|
+
* fs.createWriteStream('uppercase.txt'),
|
|
144
|
+
* );
|
|
145
|
+
* console.log('Pipeline succeeded.');
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* The `pipeline` API provides [callback version](https://nodejs.org/docs/latest-v25.x/api/stream.html#streampipelinesource-transforms-destination-callback):
|
|
149
|
+
* @since v15.0.0
|
|
150
|
+
* @returns Fulfills when the pipeline is complete.
|
|
151
|
+
*/
|
|
22
152
|
function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
|
|
23
153
|
source: A,
|
|
24
154
|
destination: B,
|
|
25
155
|
options?: PipelineOptions,
|
|
26
|
-
):
|
|
156
|
+
): PipelineResult<B>;
|
|
27
157
|
function pipeline<
|
|
28
158
|
A extends PipelineSource<any>,
|
|
29
159
|
T1 extends PipelineTransform<A, any>,
|
|
@@ -33,7 +163,7 @@ declare module "node:stream/promises" {
|
|
|
33
163
|
transform1: T1,
|
|
34
164
|
destination: B,
|
|
35
165
|
options?: PipelineOptions,
|
|
36
|
-
):
|
|
166
|
+
): PipelineResult<B>;
|
|
37
167
|
function pipeline<
|
|
38
168
|
A extends PipelineSource<any>,
|
|
39
169
|
T1 extends PipelineTransform<A, any>,
|
|
@@ -45,7 +175,7 @@ declare module "node:stream/promises" {
|
|
|
45
175
|
transform2: T2,
|
|
46
176
|
destination: B,
|
|
47
177
|
options?: PipelineOptions,
|
|
48
|
-
):
|
|
178
|
+
): PipelineResult<B>;
|
|
49
179
|
function pipeline<
|
|
50
180
|
A extends PipelineSource<any>,
|
|
51
181
|
T1 extends PipelineTransform<A, any>,
|
|
@@ -59,7 +189,7 @@ declare module "node:stream/promises" {
|
|
|
59
189
|
transform3: T3,
|
|
60
190
|
destination: B,
|
|
61
191
|
options?: PipelineOptions,
|
|
62
|
-
):
|
|
192
|
+
): PipelineResult<B>;
|
|
63
193
|
function pipeline<
|
|
64
194
|
A extends PipelineSource<any>,
|
|
65
195
|
T1 extends PipelineTransform<A, any>,
|
|
@@ -75,14 +205,20 @@ declare module "node:stream/promises" {
|
|
|
75
205
|
transform4: T4,
|
|
76
206
|
destination: B,
|
|
77
207
|
options?: PipelineOptions,
|
|
78
|
-
):
|
|
208
|
+
): PipelineResult<B>;
|
|
79
209
|
function pipeline(
|
|
80
|
-
streams:
|
|
210
|
+
streams: readonly [PipelineSource<any>, ...PipelineTransform<any, any>[], PipelineDestination<any, any>],
|
|
81
211
|
options?: PipelineOptions,
|
|
82
212
|
): Promise<void>;
|
|
83
213
|
function pipeline(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
214
|
+
...streams: [PipelineSource<any>, ...PipelineTransform<any, any>[], PipelineDestination<any, any>]
|
|
215
|
+
): Promise<void>;
|
|
216
|
+
function pipeline(
|
|
217
|
+
...streams: [
|
|
218
|
+
PipelineSource<any>,
|
|
219
|
+
...PipelineTransform<any, any>[],
|
|
220
|
+
PipelineDestination<any, any>,
|
|
221
|
+
options: PipelineOptions,
|
|
222
|
+
]
|
|
87
223
|
): Promise<void>;
|
|
88
224
|
}
|