@idlebox/stripe-node-types 24.0.14-patch.0

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 (113) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +16 -0
  3. package/assert/strict.d.ts +5 -0
  4. package/assert.d.ts +1053 -0
  5. package/async_hooks.d.ts +621 -0
  6. package/buffer.buffer.d.ts +464 -0
  7. package/buffer.d.ts +1928 -0
  8. package/child_process.d.ts +1547 -0
  9. package/cluster.d.ts +576 -0
  10. package/compatibility/iterators.d.ts +22 -0
  11. package/console.d.ts +449 -0
  12. package/constants.d.ts +18 -0
  13. package/crypto.d.ts +4514 -0
  14. package/dgram.d.ts +597 -0
  15. package/diagnostics_channel.d.ts +576 -0
  16. package/dns/promises.d.ts +501 -0
  17. package/dns.d.ts +916 -0
  18. package/dom-events.d.ts +100 -0
  19. package/domain.d.ts +168 -0
  20. package/events.d.ts +927 -0
  21. package/fs/promises.d.ts +1278 -0
  22. package/fs.d.ts +4444 -0
  23. package/globals.d.ts +368 -0
  24. package/globals.typedarray.d.ts +23 -0
  25. package/http.d.ts +2044 -0
  26. package/http2.d.ts +2626 -0
  27. package/https.d.ts +543 -0
  28. package/index.d.ts +96 -0
  29. package/inspector.d.ts +3993 -0
  30. package/module.d.ts +866 -0
  31. package/my-shim.d.ts +57 -0
  32. package/net.d.ts +1030 -0
  33. package/os.d.ts +494 -0
  34. package/package.json +158 -0
  35. package/path.d.ts +189 -0
  36. package/perf_hooks.d.ts +968 -0
  37. package/process.d.ts +2016 -0
  38. package/punycode.d.ts +115 -0
  39. package/querystring.d.ts +150 -0
  40. package/readline/promises.d.ts +159 -0
  41. package/readline.d.ts +592 -0
  42. package/repl.d.ts +426 -0
  43. package/sea.d.ts +154 -0
  44. package/sqlite.d.ts +689 -0
  45. package/stream/consumers.d.ts +36 -0
  46. package/stream/promises.d.ts +88 -0
  47. package/stream/web.d.ts +616 -0
  48. package/stream.d.ts +1654 -0
  49. package/string_decoder.d.ts +65 -0
  50. package/test.d.ts +2216 -0
  51. package/timers/promises.d.ts +106 -0
  52. package/timers.d.ts +285 -0
  53. package/tls.d.ts +1211 -0
  54. package/trace_events.d.ts +195 -0
  55. package/ts5.1/compatibility/disposable.d.ts +13 -0
  56. package/ts5.1/index.d.ts +100 -0
  57. package/ts5.6/buffer.buffer.d.ts +461 -0
  58. package/ts5.6/compatibility/float16array.d.ts +72 -0
  59. package/ts5.6/globals.typedarray.d.ts +21 -0
  60. package/ts5.6/index.d.ts +98 -0
  61. package/ts5.7/compatibility/float16array.d.ts +73 -0
  62. package/ts5.7/index.d.ts +98 -0
  63. package/tty.d.ts +206 -0
  64. package/undici-types/LICENSE +22 -0
  65. package/undici-types/README.md +7 -0
  66. package/undici-types/agent.d.ts +32 -0
  67. package/undici-types/api.d.ts +44 -0
  68. package/undici-types/balanced-pool.d.ts +30 -0
  69. package/undici-types/cache-interceptor.d.ts +173 -0
  70. package/undici-types/cache.d.ts +37 -0
  71. package/undici-types/client.d.ts +108 -0
  72. package/undici-types/connector.d.ts +35 -0
  73. package/undici-types/content-type.d.ts +22 -0
  74. package/undici-types/cookies.d.ts +31 -0
  75. package/undici-types/diagnostics-channel.d.ts +67 -0
  76. package/undici-types/dispatcher.d.ts +282 -0
  77. package/undici-types/env-http-proxy-agent.d.ts +22 -0
  78. package/undici-types/errors.d.ts +172 -0
  79. package/undici-types/eventsource.d.ts +62 -0
  80. package/undici-types/fetch.d.ts +211 -0
  81. package/undici-types/formdata.d.ts +109 -0
  82. package/undici-types/global-dispatcher.d.ts +10 -0
  83. package/undici-types/global-origin.d.ts +8 -0
  84. package/undici-types/h2c-client.d.ts +76 -0
  85. package/undici-types/handlers.d.ts +16 -0
  86. package/undici-types/header.d.ts +161 -0
  87. package/undici-types/index.d.ts +76 -0
  88. package/undici-types/interceptors.d.ts +35 -0
  89. package/undici-types/mock-agent.d.ts +66 -0
  90. package/undici-types/mock-call-history.d.ts +112 -0
  91. package/undici-types/mock-client.d.ts +26 -0
  92. package/undici-types/mock-errors.d.ts +13 -0
  93. package/undici-types/mock-interceptor.d.ts +94 -0
  94. package/undici-types/mock-pool.d.ts +26 -0
  95. package/undici-types/package.json +55 -0
  96. package/undici-types/patch.d.ts +30 -0
  97. package/undici-types/pool-stats.d.ts +20 -0
  98. package/undici-types/pool.d.ts +40 -0
  99. package/undici-types/proxy-agent.d.ts +29 -0
  100. package/undici-types/readable.d.ts +69 -0
  101. package/undici-types/retry-agent.d.ts +9 -0
  102. package/undici-types/retry-handler.d.ts +117 -0
  103. package/undici-types/util.d.ts +19 -0
  104. package/undici-types/utility.d.ts +8 -0
  105. package/undici-types/webidl.d.ts +267 -0
  106. package/undici-types/websocket.d.ts +185 -0
  107. package/url.d.ts +1012 -0
  108. package/util.d.ts +2300 -0
  109. package/v8.d.ts +917 -0
  110. package/vm.d.ts +1034 -0
  111. package/wasi.d.ts +179 -0
  112. package/worker_threads.d.ts +773 -0
  113. package/zlib.d.ts +666 -0
@@ -0,0 +1,106 @@
1
+ /**
2
+ * The `timers/promises` API provides an alternative set of timer functions
3
+ * that return `Promise` objects. The API is accessible via
4
+ * `require('node:timers/promises')`.
5
+ *
6
+ * ```js
7
+ * import {
8
+ * setTimeout,
9
+ * setImmediate,
10
+ * setInterval,
11
+ * } from 'node:timers/promises';
12
+ * ```
13
+ * @since v15.0.0
14
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers/promises.js)
15
+ */
16
+
17
+ declare module "node:timers/promises" {
18
+ import { TimerOptions } from 'node:timers';
19
+ /**
20
+ * ```js
21
+ * import {
22
+ * setTimeout,
23
+ * } from 'node:timers/promises';
24
+ *
25
+ * const res = await setTimeout(100, 'result');
26
+ *
27
+ * console.log(res); // Prints 'result'
28
+ * ```
29
+ * @since v15.0.0
30
+ * @param delay The number of milliseconds to wait before fulfilling the
31
+ * promise. **Default:** `1`.
32
+ * @param value A value with which the promise is fulfilled.
33
+ */
34
+ function setTimeout<T = void>(delay?: number, value?: T, options?: TimerOptions): Promise<T>;
35
+ /**
36
+ * ```js
37
+ * import {
38
+ * setImmediate,
39
+ * } from 'node:timers/promises';
40
+ *
41
+ * const res = await setImmediate('result');
42
+ *
43
+ * console.log(res); // Prints 'result'
44
+ * ```
45
+ * @since v15.0.0
46
+ * @param value A value with which the promise is fulfilled.
47
+ */
48
+ function setImmediate<T = void>(value?: T, options?: TimerOptions): Promise<T>;
49
+ /**
50
+ * Returns an async iterator that generates values in an interval of `delay` ms.
51
+ * If `ref` is `true`, you need to call `next()` of async iterator explicitly
52
+ * or implicitly to keep the event loop alive.
53
+ *
54
+ * ```js
55
+ * import {
56
+ * setInterval,
57
+ * } from 'node:timers/promises';
58
+ *
59
+ * const interval = 100;
60
+ * for await (const startTime of setInterval(interval, Date.now())) {
61
+ * const now = Date.now();
62
+ * console.log(now);
63
+ * if ((now - startTime) > 1000)
64
+ * break;
65
+ * }
66
+ * console.log(Date.now());
67
+ * ```
68
+ * @since v15.9.0
69
+ * @param delay The number of milliseconds to wait between iterations.
70
+ * **Default:** `1`.
71
+ * @param value A value with which the iterator returns.
72
+ */
73
+ function setInterval<T = void>(delay?: number, value?: T, options?: TimerOptions): NodeJS.AsyncIterator<T>;
74
+ interface Scheduler {
75
+ /**
76
+ * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification
77
+ * being developed as a standard Web Platform API.
78
+ *
79
+ * Calling `timersPromises.scheduler.wait(delay, options)` is roughly equivalent
80
+ * to calling `timersPromises.setTimeout(delay, undefined, options)` except that
81
+ * the `ref` option is not supported.
82
+ *
83
+ * ```js
84
+ * import { scheduler } from 'node:timers/promises';
85
+ *
86
+ * await scheduler.wait(1000); // Wait one second before continuing
87
+ * ```
88
+ * @since v17.3.0, v16.14.0
89
+ * @experimental
90
+ * @param delay The number of milliseconds to wait before resolving the
91
+ * promise.
92
+ */
93
+ wait(delay: number, options?: { signal?: AbortSignal }): Promise<void>;
94
+ /**
95
+ * An experimental API defined by the [Scheduling APIs](https://github.com/WICG/scheduling-apis) draft specification
96
+ * being developed as a standard Web Platform API.
97
+ *
98
+ * Calling `timersPromises.scheduler.yield()` is equivalent to calling
99
+ * `timersPromises.setImmediate()` with no arguments.
100
+ * @since v17.3.0, v16.14.0
101
+ * @experimental
102
+ */
103
+ yield(): Promise<void>;
104
+ }
105
+ const scheduler: Scheduler;
106
+ }
package/timers.d.ts ADDED
@@ -0,0 +1,285 @@
1
+ /**
2
+ * The `timer` module exposes a global API for scheduling functions to
3
+ * be called at some future period of time. Because the timer functions are
4
+ * globals, there is no need to import `node:timers` to use the API.
5
+ *
6
+ * The timer functions within Node.js implement a similar API as the timers API
7
+ * provided by Web Browsers but use a different internal implementation that is
8
+ * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
9
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/timers.js)
10
+ */
11
+
12
+ declare module "node:timers" {
13
+ import { Abortable } from 'node:events';
14
+ import * as promises from 'node:timers/promises';
15
+ export interface TimerOptions extends Abortable {
16
+ /**
17
+ * Set to `false` to indicate that the scheduled `Timeout`
18
+ * should not require the Node.js event loop to remain active.
19
+ * @default true
20
+ */
21
+ ref?: boolean | undefined;
22
+ }
23
+ global {
24
+ namespace NodeJS {
25
+ /**
26
+ * This object is created internally and is returned from `setImmediate()`. It
27
+ * can be passed to `clearImmediate()` in order to cancel the scheduled
28
+ * actions.
29
+ *
30
+ * By default, when an immediate is scheduled, the Node.js event loop will continue
31
+ * running as long as the immediate is active. The `Immediate` object returned by
32
+ * `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`
33
+ * functions that can be used to control this default behavior.
34
+ */
35
+ interface Immediate extends RefCounted, Disposable {
36
+ /**
37
+ * If true, the `Immediate` object will keep the Node.js event loop active.
38
+ * @since v11.0.0
39
+ */
40
+ hasRef(): boolean;
41
+ /**
42
+ * When called, requests that the Node.js event loop _not_ exit so long as the
43
+ * `Immediate` is active. Calling `immediate.ref()` multiple times will have no
44
+ * effect.
45
+ *
46
+ * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary
47
+ * to call `immediate.ref()` unless `immediate.unref()` had been called previously.
48
+ * @since v9.7.0
49
+ * @returns a reference to `immediate`
50
+ */
51
+ ref(): this;
52
+ /**
53
+ * When called, the active `Immediate` object will not require the Node.js event
54
+ * loop to remain active. If there is no other activity keeping the event loop
55
+ * running, the process may exit before the `Immediate` object's callback is
56
+ * invoked. Calling `immediate.unref()` multiple times will have no effect.
57
+ * @since v9.7.0
58
+ * @returns a reference to `immediate`
59
+ */
60
+ unref(): this;
61
+ /**
62
+ * Cancels the immediate. This is similar to calling `clearImmediate()`.
63
+ * @since v20.5.0, v18.18.0
64
+ * @experimental
65
+ */
66
+ [Symbol.dispose](): void;
67
+ _onImmediate(...args: any[]): void;
68
+ }
69
+ // Legacy interface used in Node.js v9 and prior
70
+ // TODO: remove in a future major version bump
71
+ /** @deprecated Use `NodeJS.Timeout` instead. */
72
+ interface Timer extends RefCounted {
73
+ hasRef(): boolean;
74
+ refresh(): this;
75
+ [Symbol.toPrimitive](): number;
76
+ }
77
+ /**
78
+ * This object is created internally and is returned from `setTimeout()` and
79
+ * `setInterval()`. It can be passed to either `clearTimeout()` or
80
+ * `clearInterval()` in order to cancel the scheduled actions.
81
+ *
82
+ * By default, when a timer is scheduled using either `setTimeout()` or
83
+ * `setInterval()`, the Node.js event loop will continue running as long as the
84
+ * timer is active. Each of the `Timeout` objects returned by these functions
85
+ * export both `timeout.ref()` and `timeout.unref()` functions that can be used to
86
+ * control this default behavior.
87
+ */
88
+ interface Timeout extends RefCounted, Disposable, Timer {
89
+ /**
90
+ * Cancels the timeout.
91
+ * @since v0.9.1
92
+ * @legacy Use `clearTimeout()` instead.
93
+ * @returns a reference to `timeout`
94
+ */
95
+ close(): this;
96
+ /**
97
+ * If true, the `Timeout` object will keep the Node.js event loop active.
98
+ * @since v11.0.0
99
+ */
100
+ hasRef(): boolean;
101
+ /**
102
+ * When called, requests that the Node.js event loop _not_ exit so long as the
103
+ * `Timeout` is active. Calling `timeout.ref()` multiple times will have no effect.
104
+ *
105
+ * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary
106
+ * to call `timeout.ref()` unless `timeout.unref()` had been called previously.
107
+ * @since v0.9.1
108
+ * @returns a reference to `timeout`
109
+ */
110
+ ref(): this;
111
+ /**
112
+ * Sets the timer's start time to the current time, and reschedules the timer to
113
+ * call its callback at the previously specified duration adjusted to the current
114
+ * time. This is useful for refreshing a timer without allocating a new
115
+ * JavaScript object.
116
+ *
117
+ * Using this on a timer that has already called its callback will reactivate the
118
+ * timer.
119
+ * @since v10.2.0
120
+ * @returns a reference to `timeout`
121
+ */
122
+ refresh(): this;
123
+ /**
124
+ * When called, the active `Timeout` object will not require the Node.js event loop
125
+ * to remain active. If there is no other activity keeping the event loop running,
126
+ * the process may exit before the `Timeout` object's callback is invoked. Calling
127
+ * `timeout.unref()` multiple times will have no effect.
128
+ * @since v0.9.1
129
+ * @returns a reference to `timeout`
130
+ */
131
+ unref(): this;
132
+ /**
133
+ * Coerce a `Timeout` to a primitive. The primitive can be used to
134
+ * clear the `Timeout`. The primitive can only be used in the
135
+ * same thread where the timeout was created. Therefore, to use it
136
+ * across `worker_threads` it must first be passed to the correct
137
+ * thread. This allows enhanced compatibility with browser
138
+ * `setTimeout()` and `setInterval()` implementations.
139
+ * @since v14.9.0, v12.19.0
140
+ */
141
+ [Symbol.toPrimitive](): number;
142
+ /**
143
+ * Cancels the timeout.
144
+ * @since v20.5.0, v18.18.0
145
+ * @experimental
146
+ */
147
+ [Symbol.dispose](): void;
148
+ _onTimeout(...args: any[]): void;
149
+ }
150
+ }
151
+ /**
152
+ * Schedules the "immediate" execution of the `callback` after I/O events'
153
+ * callbacks.
154
+ *
155
+ * When multiple calls to `setImmediate()` are made, the `callback` functions are
156
+ * queued for execution in the order in which they are created. The entire callback
157
+ * queue is processed every event loop iteration. If an immediate timer is queued
158
+ * from inside an executing callback, that timer will not be triggered until the
159
+ * next event loop iteration.
160
+ *
161
+ * If `callback` is not a function, a `TypeError` will be thrown.
162
+ *
163
+ * This method has a custom variant for promises that is available using
164
+ * `timersPromises.setImmediate()`.
165
+ * @since v0.9.1
166
+ * @param callback The function to call at the end of this turn of
167
+ * the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout)
168
+ * @param args Optional arguments to pass when the `callback` is called.
169
+ * @returns for use with `clearImmediate()`
170
+ */
171
+ function setImmediate<TArgs extends any[]>(
172
+ callback: (...args: TArgs) => void,
173
+ ...args: TArgs
174
+ ): NodeJS.Immediate;
175
+ // Allow a single void-accepting argument to be optional in arguments lists.
176
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
177
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
178
+ function setImmediate(callback: (_: void) => void): NodeJS.Immediate;
179
+ namespace setImmediate {
180
+ import __promisify__ = promises.setImmediate;
181
+ export { __promisify__ };
182
+ }
183
+ /**
184
+ * Schedules repeated execution of `callback` every `delay` milliseconds.
185
+ *
186
+ * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
187
+ * will be set to `1`. Non-integer delays are truncated to an integer.
188
+ *
189
+ * If `callback` is not a function, a `TypeError` will be thrown.
190
+ *
191
+ * This method has a custom variant for promises that is available using
192
+ * `timersPromises.setInterval()`.
193
+ * @since v0.0.1
194
+ * @param callback The function to call when the timer elapses.
195
+ * @param delay The number of milliseconds to wait before calling the
196
+ * `callback`. **Default:** `1`.
197
+ * @param args Optional arguments to pass when the `callback` is called.
198
+ * @returns for use with `clearInterval()`
199
+ */
200
+ function setInterval<TArgs extends any[]>(
201
+ callback: (...args: TArgs) => void,
202
+ delay?: number,
203
+ ...args: TArgs
204
+ ): NodeJS.Timeout;
205
+ // Allow a single void-accepting argument to be optional in arguments lists.
206
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
207
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
208
+ function setInterval(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
209
+ /**
210
+ * Schedules execution of a one-time `callback` after `delay` milliseconds.
211
+ *
212
+ * The `callback` will likely not be invoked in precisely `delay` milliseconds.
213
+ * Node.js makes no guarantees about the exact timing of when callbacks will fire,
214
+ * nor of their ordering. The callback will be called as close as possible to the
215
+ * time specified.
216
+ *
217
+ * When `delay` is larger than `2147483647` or less than `1` or `NaN`, the `delay`
218
+ * will be set to `1`. Non-integer delays are truncated to an integer.
219
+ *
220
+ * If `callback` is not a function, a `TypeError` will be thrown.
221
+ *
222
+ * This method has a custom variant for promises that is available using
223
+ * `timersPromises.setTimeout()`.
224
+ * @since v0.0.1
225
+ * @param callback The function to call when the timer elapses.
226
+ * @param delay The number of milliseconds to wait before calling the
227
+ * `callback`. **Default:** `1`.
228
+ * @param args Optional arguments to pass when the `callback` is called.
229
+ * @returns for use with `clearTimeout()`
230
+ */
231
+ function setTimeout<TArgs extends any[]>(
232
+ callback: (...args: TArgs) => void,
233
+ delay?: number,
234
+ ...args: TArgs
235
+ ): NodeJS.Timeout;
236
+ // Allow a single void-accepting argument to be optional in arguments lists.
237
+ // Allows usage such as `new Promise(resolve => setTimeout(resolve, ms))` (#54258)
238
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
239
+ function setTimeout(callback: (_: void) => void, delay?: number): NodeJS.Timeout;
240
+ namespace setTimeout {
241
+ import __promisify__ = promises.setTimeout;
242
+ export { __promisify__ };
243
+ }
244
+ /**
245
+ * Cancels an `Immediate` object created by `setImmediate()`.
246
+ * @since v0.9.1
247
+ * @param immediate An `Immediate` object as returned by `setImmediate()`.
248
+ */
249
+ function clearImmediate(immediate: NodeJS.Immediate | undefined): void;
250
+ /**
251
+ * Cancels a `Timeout` object created by `setInterval()`.
252
+ * @since v0.0.1
253
+ * @param timeout A `Timeout` object as returned by `setInterval()`
254
+ * or the primitive of the `Timeout` object as a string or a number.
255
+ */
256
+ function clearInterval(timeout: NodeJS.Timeout | string | number | undefined): void;
257
+ /**
258
+ * Cancels a `Timeout` object created by `setTimeout()`.
259
+ * @since v0.0.1
260
+ * @param timeout A `Timeout` object as returned by `setTimeout()`
261
+ * or the primitive of the `Timeout` object as a string or a number.
262
+ */
263
+ function clearTimeout(timeout: NodeJS.Timeout | string | number | undefined): void;
264
+ /**
265
+ * The `queueMicrotask()` method queues a microtask to invoke `callback`. If
266
+ * `callback` throws an exception, the `process` object `'uncaughtException'`
267
+ * event will be emitted.
268
+ *
269
+ * The microtask queue is managed by V8 and may be used in a similar manner to
270
+ * the `process.nextTick()` queue, which is managed by Node.js. The
271
+ * `process.nextTick()` queue is always processed before the microtask queue
272
+ * within each turn of the Node.js event loop.
273
+ * @since v11.0.0
274
+ * @param callback Function to be queued.
275
+ */
276
+ function queueMicrotask(callback: () => void): void;
277
+ }
278
+ import clearImmediate = globalThis.clearImmediate;
279
+ import clearInterval = globalThis.clearInterval;
280
+ import clearTimeout = globalThis.clearTimeout;
281
+ import setImmediate = globalThis.setImmediate;
282
+ import setInterval = globalThis.setInterval;
283
+ import setTimeout = globalThis.setTimeout;
284
+ export { clearImmediate, clearInterval, clearTimeout, promises, setImmediate, setInterval, setTimeout };
285
+ }