@types/node 18.16.3 → 20.1.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 (96) hide show
  1. node/README.md +1 -1
  2. node/assert.d.ts +71 -75
  3. node/async_hooks.d.ts +62 -42
  4. node/buffer.d.ts +127 -99
  5. node/child_process.d.ts +50 -54
  6. node/cluster.d.ts +12 -12
  7. node/console.d.ts +5 -5
  8. node/crypto.d.ts +209 -220
  9. node/dgram.d.ts +15 -15
  10. node/diagnostics_channel.d.ts +25 -26
  11. node/dns/promises.d.ts +6 -6
  12. node/dns.d.ts +24 -16
  13. node/domain.d.ts +4 -4
  14. node/events.d.ts +60 -60
  15. node/fs/promises.d.ts +78 -48
  16. node/fs.d.ts +117 -81
  17. node/http.d.ts +158 -147
  18. node/http2.d.ts +42 -46
  19. node/https.d.ts +52 -153
  20. node/index.d.ts +1 -1
  21. node/inspector.d.ts +10 -3
  22. node/module.d.ts +5 -4
  23. node/net.d.ts +21 -18
  24. node/os.d.ts +22 -18
  25. node/package.json +2 -2
  26. node/path.d.ts +4 -4
  27. node/perf_hooks.d.ts +28 -15
  28. node/process.d.ts +43 -46
  29. node/punycode.d.ts +1 -1
  30. node/querystring.d.ts +5 -5
  31. node/readline/promises.d.ts +6 -4
  32. node/readline.d.ts +15 -15
  33. node/repl.d.ts +9 -9
  34. node/stream/consumers.d.ts +1 -1
  35. node/stream.d.ts +88 -136
  36. node/string_decoder.d.ts +6 -6
  37. node/test.d.ts +423 -186
  38. node/timers/promises.d.ts +3 -3
  39. node/timers.d.ts +2 -2
  40. node/tls.d.ts +24 -16
  41. node/trace_events.d.ts +20 -9
  42. node/ts4.8/assert.d.ts +71 -75
  43. node/ts4.8/async_hooks.d.ts +62 -42
  44. node/ts4.8/buffer.d.ts +127 -99
  45. node/ts4.8/child_process.d.ts +50 -54
  46. node/ts4.8/cluster.d.ts +12 -12
  47. node/ts4.8/console.d.ts +5 -5
  48. node/ts4.8/crypto.d.ts +209 -220
  49. node/ts4.8/dgram.d.ts +15 -15
  50. node/ts4.8/diagnostics_channel.d.ts +25 -26
  51. node/ts4.8/dns/promises.d.ts +6 -6
  52. node/ts4.8/dns.d.ts +24 -16
  53. node/ts4.8/domain.d.ts +4 -4
  54. node/ts4.8/events.d.ts +60 -60
  55. node/ts4.8/fs/promises.d.ts +96 -45
  56. node/ts4.8/fs.d.ts +203 -67
  57. node/ts4.8/globals.d.ts +29 -28
  58. node/ts4.8/http.d.ts +198 -126
  59. node/ts4.8/http2.d.ts +42 -46
  60. node/ts4.8/https.d.ts +52 -153
  61. node/ts4.8/inspector.d.ts +10 -3
  62. node/ts4.8/module.d.ts +5 -4
  63. node/ts4.8/net.d.ts +24 -21
  64. node/ts4.8/os.d.ts +22 -18
  65. node/ts4.8/path.d.ts +4 -4
  66. node/ts4.8/perf_hooks.d.ts +28 -15
  67. node/ts4.8/process.d.ts +43 -46
  68. node/ts4.8/punycode.d.ts +1 -1
  69. node/ts4.8/querystring.d.ts +5 -5
  70. node/ts4.8/readline/promises.d.ts +6 -4
  71. node/ts4.8/readline.d.ts +15 -15
  72. node/ts4.8/repl.d.ts +9 -9
  73. node/ts4.8/stream/consumers.d.ts +1 -1
  74. node/ts4.8/stream.d.ts +91 -139
  75. node/ts4.8/string_decoder.d.ts +6 -6
  76. node/ts4.8/test.d.ts +423 -186
  77. node/ts4.8/timers/promises.d.ts +3 -3
  78. node/ts4.8/timers.d.ts +9 -2
  79. node/ts4.8/tls.d.ts +24 -16
  80. node/ts4.8/trace_events.d.ts +20 -9
  81. node/ts4.8/tty.d.ts +4 -5
  82. node/ts4.8/url.d.ts +26 -36
  83. node/ts4.8/util.d.ts +143 -116
  84. node/ts4.8/v8.d.ts +110 -16
  85. node/ts4.8/vm.d.ts +292 -42
  86. node/ts4.8/wasi.d.ts +13 -19
  87. node/ts4.8/worker_threads.d.ts +32 -34
  88. node/ts4.8/zlib.d.ts +11 -11
  89. node/tty.d.ts +4 -5
  90. node/url.d.ts +26 -36
  91. node/util.d.ts +146 -111
  92. node/v8.d.ts +110 -16
  93. node/vm.d.ts +292 -42
  94. node/wasi.d.ts +13 -19
  95. node/worker_threads.d.ts +32 -34
  96. node/zlib.d.ts +11 -11
node/ts4.8/globals.d.ts CHANGED
@@ -45,42 +45,42 @@ declare var gc: undefined | (() => void);
45
45
  // from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib
46
46
  /** A controller object that allows you to abort one or more DOM requests as and when desired. */
47
47
  interface AbortController {
48
- /**
49
- * Returns the AbortSignal object associated with this object.
50
- */
51
-
52
- readonly signal: AbortSignal;
53
- /**
54
- * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
55
- */
56
- abort(reason?: any): void;
48
+ /**
49
+ * Returns the AbortSignal object associated with this object.
50
+ */
51
+
52
+ readonly signal: AbortSignal;
53
+ /**
54
+ * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
55
+ */
56
+ abort(reason?: any): void;
57
57
  }
58
58
 
59
59
  /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */
60
60
  interface AbortSignal extends EventTarget {
61
- /**
62
- * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
63
- */
64
- readonly aborted: boolean;
65
- readonly reason: any;
66
- onabort: null | ((this: AbortSignal, event: Event) => any);
61
+ /**
62
+ * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise.
63
+ */
64
+ readonly aborted: boolean;
65
+ readonly reason: any;
66
+ onabort: null | ((this: AbortSignal, event: Event) => any);
67
67
  }
68
68
 
69
69
  declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T}
70
- ? T
71
- : {
72
- prototype: AbortController;
73
- new(): AbortController;
74
- };
70
+ ? T
71
+ : {
72
+ prototype: AbortController;
73
+ new(): AbortController;
74
+ };
75
75
 
76
76
  declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T}
77
- ? T
78
- : {
79
- prototype: AbortSignal;
80
- new(): AbortSignal;
81
- abort(reason?: any): AbortSignal;
82
- timeout(milliseconds: number): AbortSignal;
83
- };
77
+ ? T
78
+ : {
79
+ prototype: AbortSignal;
80
+ new(): AbortSignal;
81
+ abort(reason?: any): AbortSignal;
82
+ timeout(milliseconds: number): AbortSignal;
83
+ };
84
84
  //#endregion borrowed
85
85
 
86
86
  //#region ArrayLike.at()
@@ -94,6 +94,7 @@ interface RelativeIndexable<T> {
94
94
  }
95
95
  interface String extends RelativeIndexable<string> {}
96
96
  interface Array<T> extends RelativeIndexable<T> {}
97
+ interface ReadonlyArray<T> extends RelativeIndexable<T> {}
97
98
  interface Int8Array extends RelativeIndexable<number> {}
98
99
  interface Uint8Array extends RelativeIndexable<number> {}
99
100
  interface Uint8ClampedArray extends RelativeIndexable<number> {}
@@ -158,7 +159,7 @@ declare namespace NodeJS {
158
159
  /**
159
160
  * Name of the script [if this function was defined in a script]
160
161
  */
161
- getFileName(): string | null;
162
+ getFileName(): string | undefined;
162
163
 
163
164
  /**
164
165
  * Current line number [if this function was defined in a script]