@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/fs/promises.d.ts CHANGED
@@ -25,9 +25,9 @@
25
25
  */
26
26
 
27
27
  declare module "node:fs/promises" {
28
+ import { NonSharedBuffer } from 'node:buffer';
28
29
  import { Abortable } from 'node:events';
29
- import { Stream } from 'node:stream';
30
- import { ReadableStream } from 'node:stream/web';
30
+ import { Interface as ReadlineInterface } from '_not-use-node-type_readline';
31
31
  import {
32
32
  BigIntStats,
33
33
  BigIntStatsFs,
@@ -36,6 +36,7 @@ declare module "node:fs/promises" {
36
36
  CopyOptions,
37
37
  Dir,
38
38
  Dirent,
39
+ EncodingOption,
39
40
  GlobOptions,
40
41
  GlobOptionsWithFileTypes,
41
42
  GlobOptionsWithoutFileTypes,
@@ -45,10 +46,11 @@ declare module "node:fs/promises" {
45
46
  OpenDirOptions,
46
47
  OpenMode,
47
48
  PathLike,
49
+ ReadOptions,
50
+ ReadOptionsWithBuffer,
48
51
  ReadPosition,
49
52
  ReadStream,
50
53
  ReadVResult,
51
- RmDirOptions,
52
54
  RmOptions,
53
55
  StatFsOptions,
54
56
  StatOptions,
@@ -56,11 +58,12 @@ declare module "node:fs/promises" {
56
58
  StatsFs,
57
59
  TimeLike,
58
60
  WatchEventType,
59
- WatchOptions,
61
+ WatchOptions as _WatchOptions,
60
62
  WriteStream,
61
63
  WriteVResult,
62
64
  } from '_not-use-node-type_fs';
63
- import { Interface as ReadlineInterface } from '_not-use-node-type_readline';
65
+ import { Stream } from 'node:stream';
66
+ import { ReadableStream } from 'node:stream/web';
64
67
  interface FileChangeInfo<T extends string | Buffer> {
65
68
  eventType: WatchEventType;
66
69
  filename: T | null;
@@ -73,6 +76,7 @@ declare module "node:fs/promises" {
73
76
  bytesRead: number;
74
77
  buffer: T;
75
78
  }
79
+ /** @deprecated This interface will be removed in a future version. Use `import { ReadOptionsWithBuffer } from "node:fs"` instead. */
76
80
  interface FileReadOptions<T extends NodeJS.ArrayBufferView = Buffer> {
77
81
  /**
78
82
  * @default `Buffer.alloc(0xffff)`
@@ -104,6 +108,9 @@ declare module "node:fs/promises" {
104
108
  highWaterMark?: number | undefined;
105
109
  flush?: boolean | undefined;
106
110
  }
111
+ interface ReadableWebStreamOptions {
112
+ autoClose?: boolean | undefined;
113
+ }
107
114
  // TODO: Add `EventEmitter` close
108
115
  interface FileHandle {
109
116
  /**
@@ -248,11 +255,13 @@ declare module "node:fs/promises" {
248
255
  length?: number | null,
249
256
  position?: ReadPosition | null,
250
257
  ): Promise<FileReadResult<T>>;
251
- read<T extends NodeJS.ArrayBufferView = Buffer>(
258
+ read<T extends NodeJS.ArrayBufferView>(
252
259
  buffer: T,
253
- options?: FileReadOptions<T>,
260
+ options?: ReadOptions,
261
+ ): Promise<FileReadResult<T>>;
262
+ read<T extends NodeJS.ArrayBufferView = NonSharedBuffer>(
263
+ options?: ReadOptionsWithBuffer<T>,
254
264
  ): Promise<FileReadResult<T>>;
255
- read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
256
265
  /**
257
266
  * Returns a byte-oriented `ReadableStream` that may be used to read the file's
258
267
  * contents.
@@ -277,7 +286,7 @@ declare module "node:fs/promises" {
277
286
  * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method.
278
287
  * @since v17.0.0
279
288
  */
280
- readableWebStream(): ReadableStream;
289
+ readableWebStream(options?: ReadableWebStreamOptions): ReadableStream;
281
290
  /**
282
291
  * Asynchronously reads the entire contents of a file.
283
292
  *
@@ -296,7 +305,7 @@ declare module "node:fs/promises" {
296
305
  options?:
297
306
  | ({ encoding?: null | undefined } & Abortable)
298
307
  | null,
299
- ): Promise<Buffer>;
308
+ ): Promise<NonSharedBuffer>;
300
309
  /**
301
310
  * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
302
311
  * The `FileHandle` must have been opened for reading.
@@ -315,7 +324,7 @@ declare module "node:fs/promises" {
315
324
  | (ObjectEncodingOptions & Abortable)
316
325
  | BufferEncoding
317
326
  | null,
318
- ): Promise<string | Buffer>;
327
+ ): Promise<string | NonSharedBuffer>;
319
328
  /**
320
329
  * Convenience method to create a `readline` interface and stream over the file.
321
330
  * See `filehandle.createReadStream()` for the options.
@@ -424,7 +433,7 @@ declare module "node:fs/promises" {
424
433
  * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current
425
434
  * position. See the POSIX pwrite(2) documentation for more detail.
426
435
  */
427
- write<TBuffer extends Uint8Array>(
436
+ write<TBuffer extends NodeJS.ArrayBufferView>(
428
437
  buffer: TBuffer,
429
438
  offset?: number | null,
430
439
  length?: number | null,
@@ -463,14 +472,20 @@ declare module "node:fs/promises" {
463
472
  * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
464
473
  * position.
465
474
  */
466
- writev(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<WriteVResult>;
475
+ writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
476
+ buffers: TBuffers,
477
+ position?: number,
478
+ ): Promise<WriteVResult<TBuffers>>;
467
479
  /**
468
480
  * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
469
481
  * @since v13.13.0, v12.17.0
470
482
  * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
471
483
  * @return Fulfills upon success an object containing two properties:
472
484
  */
473
- readv(buffers: readonly NodeJS.ArrayBufferView[], position?: number): Promise<ReadVResult>;
485
+ readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(
486
+ buffers: TBuffers,
487
+ position?: number,
488
+ ): Promise<ReadVResult<TBuffers>>;
474
489
  /**
475
490
  * Closes the file handle after waiting for any pending operation on the handle to
476
491
  * complete.
@@ -490,8 +505,9 @@ declare module "node:fs/promises" {
490
505
  */
491
506
  close(): Promise<void>;
492
507
  /**
493
- * An alias for {@link FileHandle.close()}.
494
- * @since v20.4.0
508
+ * Calls `filehandle.close()` and returns a promise that fulfills when the
509
+ * filehandle is closed.
510
+ * @since v20.4.0, v18.8.0
495
511
  */
496
512
  [Symbol.asyncDispose](): Promise<void>;
497
513
  }
@@ -600,7 +616,7 @@ declare module "node:fs/promises" {
600
616
  * @since v10.0.0
601
617
  * @return Fulfills with `undefined` upon success.
602
618
  */
603
- function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
619
+ function rmdir(path: PathLike): Promise<void>;
604
620
  /**
605
621
  * Removes files and directories (modeled on the standard POSIX `rm` utility).
606
622
  * @since v14.14.0
@@ -706,7 +722,7 @@ declare module "node:fs/promises" {
706
722
  recursive?: boolean | undefined;
707
723
  }
708
724
  | "buffer",
709
- ): Promise<Buffer[]>;
725
+ ): Promise<NonSharedBuffer[]>;
710
726
  /**
711
727
  * Asynchronous readdir(3) - read a directory.
712
728
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -721,7 +737,7 @@ declare module "node:fs/promises" {
721
737
  })
722
738
  | BufferEncoding
723
739
  | null,
724
- ): Promise<string[] | Buffer[]>;
740
+ ): Promise<string[] | NonSharedBuffer[]>;
725
741
  /**
726
742
  * Asynchronous readdir(3) - read a directory.
727
743
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -746,7 +762,7 @@ declare module "node:fs/promises" {
746
762
  withFileTypes: true;
747
763
  recursive?: boolean | undefined;
748
764
  },
749
- ): Promise<Dirent<Buffer>[]>;
765
+ ): Promise<Dirent<NonSharedBuffer>[]>;
750
766
  /**
751
767
  * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
752
768
  * fulfilled with the`linkString` upon success.
@@ -764,13 +780,16 @@ declare module "node:fs/promises" {
764
780
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
765
781
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
766
782
  */
767
- function readlink(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
783
+ function readlink(path: PathLike, options: BufferEncodingOption): Promise<NonSharedBuffer>;
768
784
  /**
769
785
  * Asynchronous readlink(2) - read value of a symbolic link.
770
786
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
771
787
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
772
788
  */
773
- function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise<string | Buffer>;
789
+ function readlink(
790
+ path: PathLike,
791
+ options?: ObjectEncodingOptions | string | null,
792
+ ): Promise<string | NonSharedBuffer>;
774
793
  /**
775
794
  * Creates a symbolic link.
776
795
  *
@@ -921,7 +940,7 @@ declare module "node:fs/promises" {
921
940
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
922
941
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
923
942
  */
924
- function realpath(path: PathLike, options: BufferEncodingOption): Promise<Buffer>;
943
+ function realpath(path: PathLike, options: BufferEncodingOption): Promise<NonSharedBuffer>;
925
944
  /**
926
945
  * Asynchronous realpath(3) - return the canonicalized absolute pathname.
927
946
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -930,7 +949,7 @@ declare module "node:fs/promises" {
930
949
  function realpath(
931
950
  path: PathLike,
932
951
  options?: ObjectEncodingOptions | BufferEncoding | null,
933
- ): Promise<string | Buffer>;
952
+ ): Promise<string | NonSharedBuffer>;
934
953
  /**
935
954
  * Creates a unique temporary directory. A unique directory name is generated by
936
955
  * appending six random characters to the end of the provided `prefix`. Due to
@@ -966,13 +985,50 @@ declare module "node:fs/promises" {
966
985
  * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
967
986
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
968
987
  */
969
- function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<Buffer>;
988
+ function mkdtemp(prefix: string, options: BufferEncodingOption): Promise<NonSharedBuffer>;
970
989
  /**
971
990
  * Asynchronously creates a unique temporary directory.
972
991
  * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
973
992
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
974
993
  */
975
- function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
994
+ function mkdtemp(
995
+ prefix: string,
996
+ options?: ObjectEncodingOptions | BufferEncoding | null,
997
+ ): Promise<string | NonSharedBuffer>;
998
+ interface DisposableTempDir extends AsyncDisposable {
999
+ /**
1000
+ * The path of the created directory.
1001
+ */
1002
+ path: string;
1003
+ /**
1004
+ * A function which removes the created directory.
1005
+ */
1006
+ remove(): Promise<void>;
1007
+ /**
1008
+ * The same as `remove`.
1009
+ */
1010
+ [Symbol.asyncDispose](): Promise<void>;
1011
+ }
1012
+ /**
1013
+ * The resulting Promise holds an async-disposable object whose `path` property
1014
+ * holds the created directory path. When the object is disposed, the directory
1015
+ * and its contents will be removed asynchronously if it still exists. If the
1016
+ * directory cannot be deleted, disposal will throw an error. The object has an
1017
+ * async `remove()` method which will perform the same task.
1018
+ *
1019
+ * Both this function and the disposal function on the resulting object are
1020
+ * async, so it should be used with `await` + `await using` as in
1021
+ * `await using dir = await fsPromises.mkdtempDisposable('prefix')`.
1022
+ *
1023
+ * <!-- TODO: link MDN docs for disposables once https://github.com/mdn/content/pull/38027 lands -->
1024
+ *
1025
+ * For detailed information, see the documentation of `fsPromises.mkdtemp()`.
1026
+ *
1027
+ * The optional `options` argument can be a string specifying an encoding, or an
1028
+ * object with an `encoding` property specifying the character encoding to use.
1029
+ * @since v24.4.0
1030
+ */
1031
+ function mkdtempDisposable(prefix: PathLike, options?: EncodingOption): Promise<DisposableTempDir>;
976
1032
  /**
977
1033
  * Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an
978
1034
  * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
@@ -1128,7 +1184,7 @@ declare module "node:fs/promises" {
1128
1184
  flag?: OpenMode | undefined;
1129
1185
  } & Abortable)
1130
1186
  | null,
1131
- ): Promise<Buffer>;
1187
+ ): Promise<NonSharedBuffer>;
1132
1188
  /**
1133
1189
  * Asynchronously reads the entire contents of a file.
1134
1190
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
@@ -1164,7 +1220,7 @@ declare module "node:fs/promises" {
1164
1220
  )
1165
1221
  | BufferEncoding
1166
1222
  | null,
1167
- ): Promise<string | Buffer>;
1223
+ ): Promise<string | NonSharedBuffer>;
1168
1224
  /**
1169
1225
  * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.
1170
1226
  *
@@ -1194,6 +1250,16 @@ declare module "node:fs/promises" {
1194
1250
  * @return Fulfills with an {fs.Dir}.
1195
1251
  */
1196
1252
  function opendir(path: PathLike, options?: OpenDirOptions): Promise<Dir>;
1253
+ interface WatchOptions extends _WatchOptions {
1254
+ maxQueue?: number | undefined;
1255
+ overflow?: "ignore" | "throw" | undefined;
1256
+ }
1257
+ interface WatchOptionsWithBufferEncoding extends WatchOptions {
1258
+ encoding: "buffer";
1259
+ }
1260
+ interface WatchOptionsWithStringEncoding extends WatchOptions {
1261
+ encoding?: BufferEncoding | undefined;
1262
+ }
1197
1263
  /**
1198
1264
  * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory.
1199
1265
  *
@@ -1226,33 +1292,16 @@ declare module "node:fs/promises" {
1226
1292
  */
1227
1293
  function watch(
1228
1294
  filename: PathLike,
1229
- options:
1230
- | (WatchOptions & {
1231
- encoding: "buffer";
1232
- })
1233
- | "buffer",
1234
- ): AsyncIterable<FileChangeInfo<Buffer>>;
1235
- /**
1236
- * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
1237
- * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1238
- * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
1239
- * If `encoding` is not supplied, the default of `'utf8'` is used.
1240
- * If `persistent` is not supplied, the default of `true` is used.
1241
- * If `recursive` is not supplied, the default of `false` is used.
1242
- */
1243
- function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
1244
- /**
1245
- * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
1246
- * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
1247
- * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
1248
- * If `encoding` is not supplied, the default of `'utf8'` is used.
1249
- * If `persistent` is not supplied, the default of `true` is used.
1250
- * If `recursive` is not supplied, the default of `false` is used.
1251
- */
1295
+ options?: WatchOptionsWithStringEncoding | BufferEncoding,
1296
+ ): NodeJS.AsyncIterator<FileChangeInfo<string>>;
1297
+ function watch(
1298
+ filename: PathLike,
1299
+ options: WatchOptionsWithBufferEncoding | "buffer",
1300
+ ): NodeJS.AsyncIterator<FileChangeInfo<NonSharedBuffer>>;
1252
1301
  function watch(
1253
1302
  filename: PathLike,
1254
- options: WatchOptions | string,
1255
- ): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
1303
+ options: WatchOptions | BufferEncoding | "buffer",
1304
+ ): NodeJS.AsyncIterator<FileChangeInfo<string | NonSharedBuffer>>;
1256
1305
  /**
1257
1306
  * Asynchronously copies the entire directory structure from `src` to `dest`,
1258
1307
  * including subdirectories and files.