@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.
Files changed (85) hide show
  1. package/README.md +1 -1
  2. package/assert/strict.d.ts +98 -1
  3. package/assert.d.ts +147 -248
  4. package/async_hooks.d.ts +5 -5
  5. package/buffer.buffer.d.ts +9 -6
  6. package/buffer.d.ts +49 -169
  7. package/child_process.d.ts +102 -223
  8. package/cluster.d.ts +236 -329
  9. package/console.d.ts +45 -346
  10. package/constants.d.ts +0 -1
  11. package/crypto.d.ts +698 -1149
  12. package/dgram.d.ts +15 -50
  13. package/diagnostics_channel.d.ts +1 -3
  14. package/dns.d.ts +135 -131
  15. package/domain.d.ts +10 -14
  16. package/events.d.ts +846 -722
  17. package/fs/promises.d.ts +102 -53
  18. package/fs.d.ts +714 -484
  19. package/globals.d.ts +130 -347
  20. package/globals.typedarray.d.ts +79 -0
  21. package/http.d.ts +343 -246
  22. package/http2.d.ts +563 -711
  23. package/https.d.ts +70 -216
  24. package/index.d.ts +24 -3
  25. package/inspector/promises.d.ts +54 -0
  26. package/inspector.d.ts +167 -3938
  27. package/inspector.generated.d.ts +4242 -0
  28. package/module.d.ts +45 -95
  29. package/net.d.ts +87 -186
  30. package/os.d.ts +17 -6
  31. package/package.json +3 -8
  32. package/path/posix.d.ts +20 -0
  33. package/path/win32.d.ts +20 -0
  34. package/path.d.ts +117 -122
  35. package/perf_hooks.d.ts +295 -644
  36. package/process.d.ts +177 -138
  37. package/punycode.d.ts +2 -2
  38. package/querystring.d.ts +1 -1
  39. package/quic.d.ts +926 -0
  40. package/readline/promises.d.ts +1 -1
  41. package/readline.d.ts +65 -118
  42. package/repl.d.ts +83 -96
  43. package/sea.d.ts +10 -1
  44. package/sqlite.d.ts +262 -13
  45. package/stream/consumers.d.ts +7 -7
  46. package/stream/promises.d.ts +133 -12
  47. package/stream/web.d.ts +173 -495
  48. package/stream.d.ts +593 -490
  49. package/string_decoder.d.ts +3 -3
  50. package/test/reporters.d.ts +112 -0
  51. package/test.d.ts +223 -199
  52. package/timers/promises.d.ts +1 -1
  53. package/timers.d.ts +1 -129
  54. package/tls.d.ts +148 -163
  55. package/trace_events.d.ts +6 -6
  56. package/ts5.6/buffer.buffer.d.ts +10 -8
  57. package/ts5.6/globals.typedarray.d.ts +16 -0
  58. package/ts5.6/index.d.ts +24 -3
  59. package/ts5.7/index.d.ts +24 -3
  60. package/tty.d.ts +55 -13
  61. package/url.d.ts +92 -587
  62. package/util/types.d.ts +571 -0
  63. package/util.d.ts +143 -792
  64. package/v8.d.ts +67 -7
  65. package/vm.d.ts +252 -108
  66. package/wasi.d.ts +23 -2
  67. package/web-globals/abortcontroller.d.ts +75 -0
  68. package/web-globals/blob.d.ts +39 -0
  69. package/{ts5.1/compatibility/disposable.d.ts → web-globals/console.d.ts} +6 -9
  70. package/web-globals/crypto.d.ts +55 -0
  71. package/web-globals/domexception.d.ts +84 -0
  72. package/web-globals/encoding.d.ts +27 -0
  73. package/{dom-events.d.ts → web-globals/events.d.ts} +57 -50
  74. package/web-globals/fetch.d.ts +70 -0
  75. package/web-globals/importmeta.d.ts +29 -0
  76. package/web-globals/messaging.d.ts +39 -0
  77. package/web-globals/navigator.d.ts +41 -0
  78. package/web-globals/performance.d.ts +61 -0
  79. package/web-globals/storage.d.ts +40 -0
  80. package/web-globals/streams.d.ts +131 -0
  81. package/web-globals/timers.d.ts +60 -0
  82. package/web-globals/url.d.ts +40 -0
  83. package/worker_threads.d.ts +291 -349
  84. package/zlib.d.ts +44 -94
  85. package/ts5.1/index.d.ts +0 -115
package/buffer.d.ts CHANGED
@@ -13,11 +13,6 @@
13
13
  ******************************************************************************/
14
14
 
15
15
 
16
- // If lib.dom.d.ts or lib.webworker.d.ts is loaded, then use the global types.
17
- // Otherwise, use the types from node.
18
- type _Blob = typeof globalThis extends { onmessage: any; Blob: any } ? {} : import('node:buffer').Blob;
19
- type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : import('node:buffer').File;
20
-
21
16
  /**
22
17
  * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
23
18
  * Node.js APIs support `Buffer`s.
@@ -61,12 +56,11 @@ type _File = typeof globalThis extends { onmessage: any; File: any } ? {} : impo
61
56
  * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
62
57
  * const buf7 = Buffer.from('tést', 'latin1');
63
58
  * ```
64
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/buffer.js)
59
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/buffer.js)
65
60
  */
66
61
 
67
62
  declare module "node:buffer" {
68
- import { BinaryLike } from 'node:crypto';
69
- import { ReadableStream as WebReadableStream } from 'node:stream/web';
63
+ import { ReadableStream } from 'node:stream/web';
70
64
  /**
71
65
  * This function returns `true` if `input` contains only valid UTF-8-encoded data,
72
66
  * including the case in which `input` is empty.
@@ -75,7 +69,7 @@ declare module "node:buffer" {
75
69
  * @since v19.4.0, v18.14.0
76
70
  * @param input The input to validate.
77
71
  */
78
- export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
72
+ export function isUtf8(input: ArrayBuffer | NodeJS.TypedArray): boolean;
79
73
  /**
80
74
  * This function returns `true` if `input` contains only valid ASCII-encoded data,
81
75
  * including the case in which `input` is empty.
@@ -84,7 +78,7 @@ declare module "node:buffer" {
84
78
  * @since v19.6.0, v18.15.0
85
79
  * @param input The input to validate.
86
80
  */
87
- export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
81
+ export function isAscii(input: ArrayBuffer | NodeJS.TypedArray): boolean;
88
82
  export let INSPECT_MAX_BYTES: number;
89
83
  export const kMaxLength: number;
90
84
  export const kStringMaxLength: number;
@@ -129,7 +123,11 @@ declare module "node:buffer" {
129
123
  * @param fromEnc The current encoding.
130
124
  * @param toEnc To target encoding.
131
125
  */
132
- export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
126
+ export function transcode(
127
+ source: Uint8Array,
128
+ fromEnc: TranscodeEncoding,
129
+ toEnc: TranscodeEncoding,
130
+ ): NonSharedBuffer;
133
131
  /**
134
132
  * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
135
133
  * a prior call to `URL.createObjectURL()`.
@@ -138,115 +136,11 @@ declare module "node:buffer" {
138
136
  */
139
137
  export function resolveObjectURL(id: string): Blob | undefined;
140
138
  export { type AllowSharedBuffer, Buffer, type NonSharedBuffer };
141
- /**
142
- * @experimental
143
- */
144
- export interface BlobOptions {
145
- /**
146
- * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts
147
- * will be converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
148
- */
149
- endings?: "transparent" | "native";
150
- /**
151
- * The Blob content-type. The intent is for `type` to convey
152
- * the MIME media type of the data, however no validation of the type format
153
- * is performed.
154
- */
155
- type?: string | undefined;
156
- }
157
- /**
158
- * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across
159
- * multiple worker threads.
160
- * @since v15.7.0, v14.18.0
161
- */
162
- export class Blob {
163
- /**
164
- * The total size of the `Blob` in bytes.
165
- * @since v15.7.0, v14.18.0
166
- */
167
- readonly size: number;
168
- /**
169
- * The content-type of the `Blob`.
170
- * @since v15.7.0, v14.18.0
171
- */
172
- readonly type: string;
173
- /**
174
- * Creates a new `Blob` object containing a concatenation of the given sources.
175
- *
176
- * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
177
- * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
178
- *
179
- * String sources are also copied into the `Blob`.
180
- */
181
- constructor(sources: Array<ArrayBuffer | BinaryLike | Blob>, options?: BlobOptions);
182
- /**
183
- * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of
184
- * the `Blob` data.
185
- * @since v15.7.0, v14.18.0
186
- */
187
- arrayBuffer(): Promise<ArrayBuffer>;
188
- /**
189
- * The `blob.bytes()` method returns the byte of the `Blob` object as a `Promise<Uint8Array>`.
190
- *
191
- * ```js
192
- * const blob = new Blob(['hello']);
193
- * blob.bytes().then((bytes) => {
194
- * console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
195
- * });
196
- * ```
197
- */
198
- bytes(): Promise<Uint8Array>;
199
- /**
200
- * Creates and returns a new `Blob` containing a subset of this `Blob` objects
201
- * data. The original `Blob` is not altered.
202
- * @since v15.7.0, v14.18.0
203
- * @param start The starting index.
204
- * @param end The ending index.
205
- * @param type The content-type for the new `Blob`
206
- */
207
- slice(start?: number, end?: number, type?: string): Blob;
208
- /**
209
- * Returns a promise that fulfills with the contents of the `Blob` decoded as a
210
- * UTF-8 string.
211
- * @since v15.7.0, v14.18.0
212
- */
213
- text(): Promise<string>;
214
- /**
215
- * Returns a new `ReadableStream` that allows the content of the `Blob` to be read.
216
- * @since v16.7.0
217
- */
218
- stream(): WebReadableStream;
219
- }
220
- export interface FileOptions {
221
- /**
222
- * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
223
- * converted to the platform native line-ending as specified by `import { EOL } from 'node:os'`.
224
- */
225
- endings?: "native" | "transparent";
226
- /** The File content-type. */
227
- type?: string;
228
- /** The last modified date of the file. `Default`: Date.now(). */
229
- lastModified?: number;
230
- }
231
- /**
232
- * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files.
233
- * @since v19.2.0, v18.13.0
234
- */
235
- export class File extends Blob {
236
- constructor(sources: Array<BinaryLike | Blob>, fileName: string, options?: FileOptions);
237
- /**
238
- * The name of the `File`.
239
- * @since v19.2.0, v18.13.0
240
- */
241
- readonly name: string;
242
- /**
243
- * The last modified date of the `File`.
244
- * @since v19.2.0, v18.13.0
245
- */
246
- readonly lastModified: number;
247
- }
248
- export import atob = globalThis.atob;
249
- export import btoa = globalThis.btoa;
139
+ /** @deprecated This alias will be removed in a future version. Use the canonical `BlobPropertyBag` instead. */
140
+ // TODO: remove in future major
141
+ export interface BlobOptions extends BlobPropertyBag {}
142
+ /** @deprecated This alias will be removed in a future version. Use the canonical `FilePropertyBag` instead. */
143
+ export interface FileOptions extends FilePropertyBag {}
250
144
  export type WithImplicitCoercion<T> =
251
145
  | T
252
146
  | { valueOf(): T }
@@ -346,7 +240,7 @@ declare module "node:buffer" {
346
240
  * @return The number of bytes contained within `string`.
347
241
  */
348
242
  byteLength(
349
- string: string | Buffer | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
243
+ string: string | NodeJS.ArrayBufferView | ArrayBufferLike,
350
244
  encoding?: BufferEncoding,
351
245
  ): number;
352
246
  /**
@@ -1891,53 +1785,39 @@ declare module "node:buffer" {
1891
1785
  includes(value: string | number | Buffer, encoding: BufferEncoding): boolean;
1892
1786
  }
1893
1787
  var Buffer: BufferConstructor;
1894
- /**
1895
- * Decodes a string of Base64-encoded data into bytes, and encodes those bytes
1896
- * into a string using Latin-1 (ISO-8859-1).
1897
- *
1898
- * The `data` may be any JavaScript-value that can be coerced into a string.
1899
- *
1900
- * **This function is only provided for compatibility with legacy web platform APIs**
1901
- * **and should never be used in new code, because they use strings to represent**
1902
- * **binary data and predate the introduction of typed arrays in JavaScript.**
1903
- * **For code running using Node.js APIs, converting between base64-encoded strings**
1904
- * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.**
1905
- * @since v15.13.0, v14.17.0
1906
- * @legacy Use `Buffer.from(data, 'base64')` instead.
1907
- * @param data The Base64-encoded input string.
1908
- */
1909
- function atob(data: string): string;
1910
- /**
1911
- * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes
1912
- * into a string using Base64.
1913
- *
1914
- * The `data` may be any JavaScript-value that can be coerced into a string.
1915
- *
1916
- * **This function is only provided for compatibility with legacy web platform APIs**
1917
- * **and should never be used in new code, because they use strings to represent**
1918
- * **binary data and predate the introduction of typed arrays in JavaScript.**
1919
- * **For code running using Node.js APIs, converting between base64-encoded strings**
1920
- * **and binary data should be performed using `Buffer.from(str, 'base64')` and `buf.toString('base64')`.**
1921
- * @since v15.13.0, v14.17.0
1922
- * @legacy Use `buf.toString('base64')` instead.
1923
- * @param data An ASCII (Latin1) string.
1924
- */
1925
- function btoa(data: string): string;
1926
- interface Blob extends _Blob {}
1927
- /**
1928
- * `Blob` class is a global reference for `import { Blob } from 'node:buffer'`
1929
- * https://nodejs.org/api/buffer.html#class-blob
1930
- * @since v18.0.0
1931
- */
1932
- var Blob: typeof globalThis extends { onmessage: any; Blob: infer T } ? T
1933
- : typeof import('node:buffer').Blob;
1934
- interface File extends _File {}
1935
- /**
1936
- * `File` class is a global reference for `import { File } from 'node:buffer'`
1937
- * https://nodejs.org/api/buffer.html#class-file
1938
- * @since v20.0.0
1939
- */
1940
- var File: typeof globalThis extends { onmessage: any; File: infer T } ? T
1941
- : typeof import('node:buffer').File;
1942
1788
  }
1789
+ // #region web types
1790
+ export type BlobPart = NodeJS.BufferSource | Blob | string;
1791
+ export interface BlobPropertyBag {
1792
+ endings?: "native" | "transparent";
1793
+ type?: string;
1794
+ }
1795
+ export interface FilePropertyBag extends BlobPropertyBag {
1796
+ lastModified?: number;
1797
+ }
1798
+ export interface Blob {
1799
+ readonly size: number;
1800
+ readonly type: string;
1801
+ arrayBuffer(): Promise<ArrayBuffer>;
1802
+ bytes(): Promise<NodeJS.NonSharedUint8Array>;
1803
+ slice(start?: number, end?: number, contentType?: string): Blob;
1804
+ stream(): ReadableStream<NodeJS.NonSharedUint8Array>;
1805
+ text(): Promise<string>;
1806
+ }
1807
+ export var Blob: {
1808
+ prototype: Blob;
1809
+ new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
1810
+ };
1811
+ export interface File extends Blob {
1812
+ readonly lastModified: number;
1813
+ readonly name: string;
1814
+ readonly webkitRelativePath: string;
1815
+ }
1816
+ export var File: {
1817
+ prototype: File;
1818
+ new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
1819
+ };
1820
+ export import atob = globalThis.atob;
1821
+ export import btoa = globalThis.btoa;
1822
+ // #endregion
1943
1823
  }