@rio-cloud/cdk-v2-constructs 8.2.0 → 8.2.1-alpha.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 (179) hide show
  1. package/.jsii +2 -2
  2. package/node_modules/@types/node/README.md +3 -3
  3. package/node_modules/@types/node/assert/strict.d.ts +105 -2
  4. package/node_modules/@types/node/assert.d.ts +211 -92
  5. package/node_modules/@types/node/async_hooks.d.ts +103 -19
  6. package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
  7. package/node_modules/@types/node/buffer.d.ts +88 -516
  8. package/node_modules/@types/node/child_process.d.ts +167 -231
  9. package/node_modules/@types/node/cluster.d.ts +172 -26
  10. package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  11. package/node_modules/@types/node/console.d.ts +66 -28
  12. package/node_modules/@types/node/constants.d.ts +14 -12
  13. package/node_modules/@types/node/crypto.d.ts +1458 -497
  14. package/node_modules/@types/node/dgram.d.ts +44 -30
  15. package/node_modules/@types/node/diagnostics_channel.d.ts +389 -4
  16. package/node_modules/@types/node/dns/promises.d.ts +120 -42
  17. package/node_modules/@types/node/dns.d.ts +209 -95
  18. package/node_modules/@types/node/domain.d.ts +14 -18
  19. package/node_modules/@types/node/events.d.ts +245 -113
  20. package/node_modules/@types/node/fs/promises.d.ts +194 -96
  21. package/node_modules/@types/node/fs.d.ts +695 -270
  22. package/node_modules/@types/node/globals.d.ts +97 -308
  23. package/node_modules/@types/node/globals.typedarray.d.ts +41 -0
  24. package/node_modules/@types/node/http.d.ts +363 -97
  25. package/node_modules/@types/node/http2.d.ts +684 -231
  26. package/node_modules/@types/node/https.d.ts +122 -87
  27. package/node_modules/@types/node/index.d.ts +24 -11
  28. package/node_modules/@types/node/inspector.d.ts +220 -2690
  29. package/node_modules/@types/node/inspector.generated.d.ts +4239 -0
  30. package/node_modules/@types/node/module.d.ts +705 -149
  31. package/node_modules/@types/node/net.d.ts +178 -54
  32. package/node_modules/@types/node/os.d.ts +47 -17
  33. package/node_modules/@types/node/package.json +22 -97
  34. package/node_modules/@types/node/path.d.ts +12 -3
  35. package/node_modules/@types/node/perf_hooks.d.ts +500 -97
  36. package/node_modules/@types/node/process.d.ts +657 -87
  37. package/node_modules/@types/node/punycode.d.ts +5 -5
  38. package/node_modules/@types/node/querystring.d.ts +24 -13
  39. package/node_modules/@types/node/readline/promises.d.ts +25 -14
  40. package/node_modules/@types/node/readline.d.ts +102 -41
  41. package/node_modules/@types/node/repl.d.ts +38 -30
  42. package/node_modules/@types/node/sea.d.ts +162 -0
  43. package/node_modules/@types/node/sqlite.d.ts +1040 -0
  44. package/node_modules/@types/node/stream/consumers.d.ts +33 -7
  45. package/node_modules/@types/node/stream/promises.d.ts +8 -1
  46. package/node_modules/@types/node/stream/web.d.ts +251 -28
  47. package/node_modules/@types/node/stream.d.ts +1060 -1055
  48. package/node_modules/@types/node/string_decoder.d.ts +8 -8
  49. package/node_modules/@types/node/test.d.ts +2133 -1166
  50. package/node_modules/@types/node/timers/promises.d.ts +31 -16
  51. package/node_modules/@types/node/timers.d.ts +159 -114
  52. package/node_modules/@types/node/tls.d.ts +232 -163
  53. package/node_modules/@types/node/trace_events.d.ts +43 -28
  54. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  55. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  56. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  57. package/node_modules/@types/node/ts5.6/index.d.ts +103 -0
  58. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  59. package/node_modules/@types/node/ts5.7/index.d.ts +103 -0
  60. package/node_modules/@types/node/tty.d.ts +9 -9
  61. package/node_modules/@types/node/url.d.ts +236 -84
  62. package/node_modules/@types/node/util.d.ts +562 -412
  63. package/node_modules/@types/node/v8.d.ts +368 -21
  64. package/node_modules/@types/node/vm.d.ts +443 -149
  65. package/node_modules/@types/node/wasi.d.ts +62 -18
  66. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  67. package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  68. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  69. package/node_modules/@types/node/web-globals/events.d.ts +97 -0
  70. package/node_modules/@types/node/web-globals/fetch.d.ts +62 -0
  71. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  72. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  73. package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  74. package/node_modules/@types/node/worker_threads.d.ts +310 -107
  75. package/node_modules/@types/node/zlib.d.ts +301 -73
  76. package/node_modules/undici-types/LICENSE +21 -0
  77. package/node_modules/undici-types/agent.d.ts +13 -12
  78. package/node_modules/undici-types/api.d.ts +26 -26
  79. package/node_modules/undici-types/balanced-pool.d.ts +19 -7
  80. package/node_modules/undici-types/cache-interceptor.d.ts +173 -0
  81. package/node_modules/undici-types/client-stats.d.ts +15 -0
  82. package/node_modules/undici-types/client.d.ts +26 -15
  83. package/node_modules/undici-types/connector.d.ts +2 -2
  84. package/node_modules/undici-types/cookies.d.ts +2 -0
  85. package/node_modules/undici-types/diagnostics-channel.d.ts +19 -12
  86. package/node_modules/undici-types/dispatcher.d.ts +148 -113
  87. package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  88. package/node_modules/undici-types/errors.d.ts +79 -46
  89. package/node_modules/undici-types/eventsource.d.ts +66 -0
  90. package/node_modules/undici-types/fetch.d.ts +41 -39
  91. package/node_modules/undici-types/formdata.d.ts +8 -8
  92. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  93. package/node_modules/undici-types/global-origin.d.ts +5 -5
  94. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  95. package/node_modules/undici-types/handlers.d.ts +11 -5
  96. package/node_modules/undici-types/header.d.ts +157 -1
  97. package/node_modules/undici-types/index.d.ts +68 -43
  98. package/node_modules/undici-types/interceptors.d.ts +71 -3
  99. package/node_modules/undici-types/mock-agent.d.ts +36 -18
  100. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  101. package/node_modules/undici-types/mock-client.d.ts +6 -4
  102. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  103. package/node_modules/undici-types/mock-interceptor.d.ts +24 -23
  104. package/node_modules/undici-types/mock-pool.d.ts +6 -4
  105. package/node_modules/undici-types/package.json +1 -1
  106. package/node_modules/undici-types/patch.d.ts +0 -42
  107. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  108. package/node_modules/undici-types/pool.d.ts +21 -8
  109. package/node_modules/undici-types/proxy-agent.d.ts +5 -6
  110. package/node_modules/undici-types/readable.d.ts +24 -17
  111. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  112. package/node_modules/undici-types/retry-handler.d.ts +125 -0
  113. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  114. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  115. package/node_modules/undici-types/util.d.ts +18 -0
  116. package/node_modules/undici-types/utility.d.ts +7 -0
  117. package/node_modules/undici-types/webidl.d.ts +157 -36
  118. package/node_modules/undici-types/websocket.d.ts +67 -12
  119. package/package.json +9 -60
  120. package/version.json +1 -1
  121. package/node_modules/@types/node/dom-events.d.ts +0 -122
  122. package/node_modules/@types/node/globals.global.d.ts +0 -1
  123. package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
  124. package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
  125. package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
  126. package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
  127. package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
  128. package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
  129. package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
  130. package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  131. package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4455
  132. package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
  133. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -191
  134. package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
  135. package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
  136. package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
  137. package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
  138. package/node_modules/@types/node/ts4.8/events.d.ts +0 -796
  139. package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1232
  140. package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4289
  141. package/node_modules/@types/node/ts4.8/globals.d.ts +0 -381
  142. package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  143. package/node_modules/@types/node/ts4.8/http.d.ts +0 -1888
  144. package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
  145. package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
  146. package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
  147. package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
  148. package/node_modules/@types/node/ts4.8/module.d.ts +0 -287
  149. package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
  150. package/node_modules/@types/node/ts4.8/os.d.ts +0 -477
  151. package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
  152. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -639
  153. package/node_modules/@types/node/ts4.8/process.d.ts +0 -1532
  154. package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
  155. package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
  156. package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
  157. package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
  158. package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
  159. package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
  160. package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
  161. package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -350
  162. package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
  163. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
  164. package/node_modules/@types/node/ts4.8/test.d.ts +0 -1382
  165. package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
  166. package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
  167. package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
  168. package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
  169. package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
  170. package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
  171. package/node_modules/@types/node/ts4.8/util.d.ts +0 -2186
  172. package/node_modules/@types/node/ts4.8/v8.d.ts +0 -635
  173. package/node_modules/@types/node/ts4.8/vm.d.ts +0 -901
  174. package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
  175. package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
  176. package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
  177. package/node_modules/argparse/CHANGELOG.md +0 -216
  178. package/node_modules/undici-types/file.d.ts +0 -39
  179. package/node_modules/undici-types/filereader.d.ts +0 -54
@@ -1,10 +1,15 @@
1
1
  /**
2
- * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives sandboxed WebAssembly applications access to the
3
- * underlying operating system via a collection of POSIX-like functions.
2
+ * **The `node:wasi` module does not currently provide the**
3
+ * **comprehensive file system security properties provided by some WASI runtimes.**
4
+ * **Full support for secure file system sandboxing may or may not be implemented in**
5
+ * **future. In the mean time, do not rely on it to run untrusted code.**
6
+ *
7
+ * The WASI API provides an implementation of the [WebAssembly System Interface](https://wasi.dev/) specification. WASI gives WebAssembly applications access to the underlying
8
+ * operating system via a collection of POSIX-like functions.
4
9
  *
5
10
  * ```js
6
11
  * import { readFile } from 'node:fs/promises';
7
- * import { WASI } from 'wasi';
12
+ * import { WASI } from 'node:wasi';
8
13
  * import { argv, env } from 'node:process';
9
14
  *
10
15
  * const wasi = new WASI({
@@ -12,7 +17,7 @@
12
17
  * args: argv,
13
18
  * env,
14
19
  * preopens: {
15
- * '/sandbox': '/some/real/path/that/wasm/can/access',
20
+ * '/local': '/some/real/path/that/wasm/can/access',
16
21
  * },
17
22
  * });
18
23
  *
@@ -24,7 +29,7 @@
24
29
  * wasi.start(instance);
25
30
  * ```
26
31
  *
27
- * To run the above example, create a new WebAssembly text format file named`demo.wat`:
32
+ * To run the above example, create a new WebAssembly text format file named `demo.wat`:
28
33
  *
29
34
  * ```text
30
35
  * (module
@@ -62,7 +67,7 @@
62
67
  * wat2wasm demo.wat
63
68
  * ```
64
69
  * @experimental
65
- * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/wasi.js)
70
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/wasi.js)
66
71
  */
67
72
  declare module "wasi" {
68
73
  interface WASIOptions {
@@ -70,11 +75,13 @@ declare module "wasi" {
70
75
  * An array of strings that the WebAssembly application will
71
76
  * see as command line arguments. The first argument is the virtual path to the
72
77
  * WASI command itself.
78
+ * @default []
73
79
  */
74
- args?: string[] | undefined;
80
+ args?: readonly string[] | undefined;
75
81
  /**
76
82
  * An object similar to `process.env` that the WebAssembly
77
83
  * application will see as its environment.
84
+ * @default {}
78
85
  */
79
86
  env?: object | undefined;
80
87
  /**
@@ -86,7 +93,7 @@ declare module "wasi" {
86
93
  preopens?: NodeJS.Dict<string> | undefined;
87
94
  /**
88
95
  * By default, when WASI applications call `__wasi_proc_exit()`
89
- * `wasi.start()` will return with the exit code specified rather than terminatng the process.
96
+ * `wasi.start()` will return with the exit code specified rather than terminatng the process.
90
97
  * Setting this option to `false` will cause the Node.js process to exit with
91
98
  * the specified exit code instead.
92
99
  * @default true
@@ -109,41 +116,78 @@ declare module "wasi" {
109
116
  stderr?: number | undefined;
110
117
  /**
111
118
  * The version of WASI requested.
112
- * Currently the only supported versions are `'unstable'` and `'preview1'`.
113
- * @since v20.0.0
119
+ * Currently the only supported versions are `'unstable'` and `'preview1'`. This option is mandatory.
120
+ * @since v19.8.0
121
+ */
122
+ version: "unstable" | "preview1";
123
+ }
124
+ interface FinalizeBindingsOptions {
125
+ /**
126
+ * @default instance.exports.memory
114
127
  */
115
- version: string;
128
+ memory?: object | undefined;
116
129
  }
117
130
  /**
118
131
  * The `WASI` class provides the WASI system call API and additional convenience
119
132
  * methods for working with WASI-based applications. Each `WASI` instance
120
- * represents a distinct sandbox environment. For security purposes, each `WASI`instance must have its command-line arguments, environment variables, and
121
- * sandbox directory structure configured explicitly.
133
+ * represents a distinct environment.
122
134
  * @since v13.3.0, v12.16.0
123
135
  */
124
136
  class WASI {
125
137
  constructor(options?: WASIOptions);
126
138
  /**
127
- * Attempt to begin execution of `instance` as a WASI command by invoking its`_start()` export. If `instance` does not contain a `_start()` export, or if`instance` contains an `_initialize()`
139
+ * Return an import object that can be passed to `WebAssembly.instantiate()` if no other WASM imports are needed beyond those provided by WASI.
140
+ *
141
+ * If version `unstable` was passed into the constructor it will return:
142
+ *
143
+ * ```js
144
+ * { wasi_unstable: wasi.wasiImport }
145
+ * ```
146
+ *
147
+ * If version `preview1` was passed into the constructor or no version was specified it will return:
148
+ *
149
+ * ```js
150
+ * { wasi_snapshot_preview1: wasi.wasiImport }
151
+ * ```
152
+ * @since v19.8.0
153
+ */
154
+ getImportObject(): object;
155
+ /**
156
+ * Attempt to begin execution of `instance` as a WASI command by invoking its `_start()` export. If `instance` does not contain a `_start()` export, or if `instance` contains an `_initialize()`
128
157
  * export, then an exception is thrown.
129
158
  *
130
- * `start()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named`memory`. If
159
+ * `start()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named `memory`. If
131
160
  * `instance` does not have a `memory` export an exception is thrown.
132
161
  *
133
162
  * If `start()` is called more than once, an exception is thrown.
134
163
  * @since v13.3.0, v12.16.0
135
164
  */
136
- start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
165
+ start(instance: object): number; // TODO: avoid DOM dependency until WASM moved to own lib.
137
166
  /**
138
- * Attempt to initialize `instance` as a WASI reactor by invoking its`_initialize()` export, if it is present. If `instance` contains a `_start()`export, then an exception is thrown.
167
+ * Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present. If `instance` contains a `_start()` export, then an exception is thrown.
139
168
  *
140
- * `initialize()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named`memory`.
169
+ * `initialize()` requires that `instance` exports a [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named `memory`.
141
170
  * If `instance` does not have a `memory` export an exception is thrown.
142
171
  *
143
172
  * If `initialize()` is called more than once, an exception is thrown.
144
173
  * @since v14.6.0, v12.19.0
145
174
  */
146
175
  initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
176
+ /**
177
+ * Set up WASI host bindings to `instance` without calling `initialize()`
178
+ * or `start()`. This method is useful when the WASI module is instantiated in
179
+ * child threads for sharing the memory across threads.
180
+ *
181
+ * `finalizeBindings()` requires that either `instance` exports a
182
+ * [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) named `memory` or user specify a
183
+ * [`WebAssembly.Memory`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) object in `options.memory`. If the `memory` is invalid
184
+ * an exception is thrown.
185
+ *
186
+ * `start()` and `initialize()` will call `finalizeBindings()` internally.
187
+ * If `finalizeBindings()` is called more than once, an exception is thrown.
188
+ * @since v24.4.0
189
+ */
190
+ finalizeBindings(instance: object, options?: FinalizeBindingsOptions): void;
147
191
  /**
148
192
  * `wasiImport` is an object that implements the WASI system call API. This object
149
193
  * should be passed as the `wasi_snapshot_preview1` import during the instantiation
@@ -0,0 +1,34 @@
1
+ export {};
2
+
3
+ type _AbortController = typeof globalThis extends { onmessage: any } ? {} : AbortController;
4
+ interface AbortController {
5
+ readonly signal: AbortSignal;
6
+ abort(reason?: any): void;
7
+ }
8
+
9
+ type _AbortSignal = typeof globalThis extends { onmessage: any } ? {} : AbortSignal;
10
+ interface AbortSignal extends EventTarget {
11
+ readonly aborted: boolean;
12
+ onabort: ((this: AbortSignal, ev: Event) => any) | null;
13
+ readonly reason: any;
14
+ throwIfAborted(): void;
15
+ }
16
+
17
+ declare global {
18
+ interface AbortController extends _AbortController {}
19
+ var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
20
+ : {
21
+ prototype: AbortController;
22
+ new(): AbortController;
23
+ };
24
+
25
+ interface AbortSignal extends _AbortSignal {}
26
+ var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
27
+ : {
28
+ prototype: AbortSignal;
29
+ new(): AbortSignal;
30
+ abort(reason?: any): AbortSignal;
31
+ any(signals: AbortSignal[]): AbortSignal;
32
+ timeout(milliseconds: number): AbortSignal;
33
+ };
34
+ }
@@ -0,0 +1,32 @@
1
+ export {};
2
+
3
+ import { webcrypto } from "crypto";
4
+
5
+ declare global {
6
+ var Crypto: typeof globalThis extends { onmessage: any; Crypto: infer T } ? T : {
7
+ prototype: webcrypto.Crypto;
8
+ new(): webcrypto.Crypto;
9
+ };
10
+
11
+ var CryptoKey: typeof globalThis extends { onmessage: any; CryptoKey: infer T } ? T : {
12
+ prototype: webcrypto.CryptoKey;
13
+ new(): webcrypto.CryptoKey;
14
+ };
15
+
16
+ var SubtleCrypto: typeof globalThis extends { onmessage: any; SubtleCrypto: infer T } ? T : {
17
+ prototype: webcrypto.SubtleCrypto;
18
+ new(): webcrypto.SubtleCrypto;
19
+ supports(
20
+ operation: string,
21
+ algorithm: webcrypto.AlgorithmIdentifier,
22
+ length?: number,
23
+ ): boolean;
24
+ supports(
25
+ operation: string,
26
+ algorithm: webcrypto.AlgorithmIdentifier,
27
+ additionalAlgorithm: webcrypto.AlgorithmIdentifier,
28
+ ): boolean;
29
+ };
30
+
31
+ var crypto: typeof globalThis extends { onmessage: any; crypto: infer T } ? T : webcrypto.Crypto;
32
+ }
@@ -0,0 +1,68 @@
1
+ export {};
2
+
3
+ type _DOMException = typeof globalThis extends { onmessage: any } ? {} : DOMException;
4
+ interface DOMException extends Error {
5
+ readonly code: number;
6
+ readonly message: string;
7
+ readonly name: string;
8
+ readonly INDEX_SIZE_ERR: 1;
9
+ readonly DOMSTRING_SIZE_ERR: 2;
10
+ readonly HIERARCHY_REQUEST_ERR: 3;
11
+ readonly WRONG_DOCUMENT_ERR: 4;
12
+ readonly INVALID_CHARACTER_ERR: 5;
13
+ readonly NO_DATA_ALLOWED_ERR: 6;
14
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
15
+ readonly NOT_FOUND_ERR: 8;
16
+ readonly NOT_SUPPORTED_ERR: 9;
17
+ readonly INUSE_ATTRIBUTE_ERR: 10;
18
+ readonly INVALID_STATE_ERR: 11;
19
+ readonly SYNTAX_ERR: 12;
20
+ readonly INVALID_MODIFICATION_ERR: 13;
21
+ readonly NAMESPACE_ERR: 14;
22
+ readonly INVALID_ACCESS_ERR: 15;
23
+ readonly VALIDATION_ERR: 16;
24
+ readonly TYPE_MISMATCH_ERR: 17;
25
+ readonly SECURITY_ERR: 18;
26
+ readonly NETWORK_ERR: 19;
27
+ readonly ABORT_ERR: 20;
28
+ readonly URL_MISMATCH_ERR: 21;
29
+ readonly QUOTA_EXCEEDED_ERR: 22;
30
+ readonly TIMEOUT_ERR: 23;
31
+ readonly INVALID_NODE_TYPE_ERR: 24;
32
+ readonly DATA_CLONE_ERR: 25;
33
+ }
34
+
35
+ declare global {
36
+ interface DOMException extends _DOMException {}
37
+ var DOMException: typeof globalThis extends { onmessage: any; DOMException: infer T } ? T
38
+ : {
39
+ prototype: DOMException;
40
+ new(message?: string, name?: string): DOMException;
41
+ new(message?: string, options?: { name?: string; cause?: unknown }): DOMException;
42
+ readonly INDEX_SIZE_ERR: 1;
43
+ readonly DOMSTRING_SIZE_ERR: 2;
44
+ readonly HIERARCHY_REQUEST_ERR: 3;
45
+ readonly WRONG_DOCUMENT_ERR: 4;
46
+ readonly INVALID_CHARACTER_ERR: 5;
47
+ readonly NO_DATA_ALLOWED_ERR: 6;
48
+ readonly NO_MODIFICATION_ALLOWED_ERR: 7;
49
+ readonly NOT_FOUND_ERR: 8;
50
+ readonly NOT_SUPPORTED_ERR: 9;
51
+ readonly INUSE_ATTRIBUTE_ERR: 10;
52
+ readonly INVALID_STATE_ERR: 11;
53
+ readonly SYNTAX_ERR: 12;
54
+ readonly INVALID_MODIFICATION_ERR: 13;
55
+ readonly NAMESPACE_ERR: 14;
56
+ readonly INVALID_ACCESS_ERR: 15;
57
+ readonly VALIDATION_ERR: 16;
58
+ readonly TYPE_MISMATCH_ERR: 17;
59
+ readonly SECURITY_ERR: 18;
60
+ readonly NETWORK_ERR: 19;
61
+ readonly ABORT_ERR: 20;
62
+ readonly URL_MISMATCH_ERR: 21;
63
+ readonly QUOTA_EXCEEDED_ERR: 22;
64
+ readonly TIMEOUT_ERR: 23;
65
+ readonly INVALID_NODE_TYPE_ERR: 24;
66
+ readonly DATA_CLONE_ERR: 25;
67
+ };
68
+ }
@@ -0,0 +1,97 @@
1
+ export {};
2
+
3
+ interface AddEventListenerOptions extends EventListenerOptions {
4
+ once?: boolean;
5
+ passive?: boolean;
6
+ signal?: AbortSignal;
7
+ }
8
+
9
+ type _CustomEvent<T = any> = typeof globalThis extends { onmessage: any } ? {} : CustomEvent<T>;
10
+ interface CustomEvent<T = any> extends Event {
11
+ readonly detail: T;
12
+ }
13
+
14
+ interface CustomEventInit<T = any> extends EventInit {
15
+ detail?: T;
16
+ }
17
+
18
+ type _Event = typeof globalThis extends { onmessage: any } ? {} : Event;
19
+ interface Event {
20
+ readonly bubbles: boolean;
21
+ cancelBubble: boolean;
22
+ readonly cancelable: boolean;
23
+ readonly composed: boolean;
24
+ readonly currentTarget: EventTarget | null;
25
+ readonly defaultPrevented: boolean;
26
+ readonly eventPhase: 0 | 2;
27
+ readonly isTrusted: boolean;
28
+ returnValue: boolean;
29
+ readonly srcElement: EventTarget | null;
30
+ readonly target: EventTarget | null;
31
+ readonly timeStamp: number;
32
+ readonly type: string;
33
+ composedPath(): [EventTarget?];
34
+ initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
35
+ preventDefault(): void;
36
+ stopImmediatePropagation(): void;
37
+ stopPropagation(): void;
38
+ }
39
+
40
+ interface EventInit {
41
+ bubbles?: boolean;
42
+ cancelable?: boolean;
43
+ composed?: boolean;
44
+ }
45
+
46
+ interface EventListener {
47
+ (evt: Event): void;
48
+ }
49
+
50
+ interface EventListenerObject {
51
+ handleEvent(object: Event): void;
52
+ }
53
+
54
+ type _EventListenerOptions = typeof globalThis extends { onmessage: any } ? {} : EventListenerOptions;
55
+ interface EventListenerOptions {
56
+ capture?: boolean;
57
+ }
58
+
59
+ type _EventTarget = typeof globalThis extends { onmessage: any } ? {} : EventTarget;
60
+ interface EventTarget {
61
+ addEventListener(
62
+ type: string,
63
+ listener: EventListener | EventListenerObject,
64
+ options?: AddEventListenerOptions | boolean,
65
+ ): void;
66
+ dispatchEvent(event: Event): boolean;
67
+ removeEventListener(
68
+ type: string,
69
+ listener: EventListener | EventListenerObject,
70
+ options?: EventListenerOptions | boolean,
71
+ ): void;
72
+ }
73
+
74
+ declare global {
75
+ interface CustomEvent<T = any> extends _CustomEvent<T> {}
76
+ var CustomEvent: typeof globalThis extends { onmessage: any; CustomEvent: infer T } ? T
77
+ : {
78
+ prototype: CustomEvent;
79
+ new<T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
80
+ };
81
+
82
+ interface Event extends _Event {}
83
+ var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
84
+ : {
85
+ prototype: Event;
86
+ new(type: string, eventInitDict?: EventInit): Event;
87
+ };
88
+
89
+ interface EventListenerOptions extends _EventListenerOptions {}
90
+
91
+ interface EventTarget extends _EventTarget {}
92
+ var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
93
+ : {
94
+ prototype: EventTarget;
95
+ new(): EventTarget;
96
+ };
97
+ }
@@ -0,0 +1,62 @@
1
+ export {};
2
+
3
+ import * as undici from "undici-types";
4
+
5
+ type _CloseEvent = typeof globalThis extends { onmessage: any } ? {} : undici.CloseEvent;
6
+ type _CloseEventInit = typeof globalThis extends { onmessage: any } ? {} : undici.CloseEventInit;
7
+ type _EventSource = typeof globalThis extends { onmessage: any } ? {} : undici.EventSource;
8
+ type _EventSourceInit = typeof globalThis extends { onmessage: any } ? {} : undici.EventSourceInit;
9
+ type _FormData = typeof globalThis extends { onmessage: any } ? {} : undici.FormData;
10
+ type _Headers = typeof globalThis extends { onmessage: any } ? {} : undici.Headers;
11
+ type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : undici.MessageEvent;
12
+ type _MessageEventInit = typeof globalThis extends { onmessage: any } ? {} : undici.MessageEventInit;
13
+ type _Request = typeof globalThis extends { onmessage: any } ? {} : undici.Request;
14
+ type _RequestInit = typeof globalThis extends { onmessage: any } ? {} : undici.RequestInit;
15
+ type _Response = typeof globalThis extends { onmessage: any } ? {} : undici.Response;
16
+ type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} : undici.ResponseInit;
17
+ type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : undici.WebSocket;
18
+ type _WebSocketInit = typeof globalThis extends { onmessage: any } ? {} : undici.WebSocketInit;
19
+
20
+ declare global {
21
+ function fetch(
22
+ input: string | URL | Request,
23
+ init?: RequestInit,
24
+ ): Promise<Response>;
25
+
26
+ interface CloseEvent extends _CloseEvent {}
27
+ var CloseEvent: typeof globalThis extends { onmessage: any; CloseEvent: infer T } ? T : typeof undici.CloseEvent;
28
+
29
+ interface CloseEventInit extends _CloseEventInit {}
30
+
31
+ interface EventSource extends _EventSource {}
32
+ var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T : typeof undici.EventSource;
33
+
34
+ interface EventSourceInit extends _EventSourceInit {}
35
+
36
+ interface FormData extends _FormData {}
37
+ var FormData: typeof globalThis extends { onmessage: any; FormData: infer T } ? T : typeof undici.FormData;
38
+
39
+ interface Headers extends _Headers {}
40
+ var Headers: typeof globalThis extends { onmessage: any; Headers: infer T } ? T : typeof undici.Headers;
41
+
42
+ interface MessageEvent extends _MessageEvent {}
43
+ var MessageEvent: typeof globalThis extends { onmessage: any; MessageEvent: infer T } ? T
44
+ : typeof undici.MessageEvent;
45
+
46
+ interface MessageEventInit extends _MessageEventInit {}
47
+
48
+ interface Request extends _Request {}
49
+ var Request: typeof globalThis extends { onmessage: any; Request: infer T } ? T : typeof undici.Request;
50
+
51
+ interface RequestInit extends _RequestInit {}
52
+
53
+ interface Response extends _Response {}
54
+ var Response: typeof globalThis extends { onmessage: any; Response: infer T } ? T : typeof undici.Response;
55
+
56
+ interface ResponseInit extends _ResponseInit {}
57
+
58
+ interface WebSocket extends _WebSocket {}
59
+ var WebSocket: typeof globalThis extends { onmessage: any; WebSocket: infer T } ? T : typeof undici.WebSocket;
60
+
61
+ interface WebSocketInit extends _WebSocketInit {}
62
+ }
@@ -0,0 +1,25 @@
1
+ export {};
2
+
3
+ import { LockManager } from "worker_threads";
4
+
5
+ // lib.webworker has `WorkerNavigator` rather than `Navigator`, so conditionals use `onabort` instead of `onmessage`
6
+ type _Navigator = typeof globalThis extends { onabort: any } ? {} : Navigator;
7
+ interface Navigator {
8
+ readonly hardwareConcurrency: number;
9
+ readonly language: string;
10
+ readonly languages: readonly string[];
11
+ readonly locks: LockManager;
12
+ readonly platform: string;
13
+ readonly userAgent: string;
14
+ }
15
+
16
+ declare global {
17
+ interface Navigator extends _Navigator {}
18
+ var Navigator: typeof globalThis extends { onabort: any; Navigator: infer T } ? T : {
19
+ prototype: Navigator;
20
+ new(): Navigator;
21
+ };
22
+
23
+ // Needs conditional inference for lib.dom and lib.webworker compatibility
24
+ var navigator: typeof globalThis extends { onmessage: any; navigator: infer T } ? T : Navigator;
25
+ }
@@ -0,0 +1,24 @@
1
+ export {};
2
+
3
+ // These interfaces are absent from lib.webworker, so the conditionals use `onabort` rather than `onmessage`
4
+ type _Storage = typeof globalThis extends { onabort: any } ? {} : Storage;
5
+ interface Storage {
6
+ readonly length: number;
7
+ clear(): void;
8
+ getItem(key: string): string | null;
9
+ key(index: number): string | null;
10
+ removeItem(key: string): void;
11
+ setItem(key: string, value: string): void;
12
+ [key: string]: any;
13
+ }
14
+
15
+ declare global {
16
+ interface Storage extends _Storage {}
17
+ var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T : {
18
+ prototype: Storage;
19
+ new(): Storage;
20
+ };
21
+
22
+ var localStorage: Storage;
23
+ var sessionStorage: Storage;
24
+ }
@@ -0,0 +1,22 @@
1
+ export {};
2
+
3
+ import * as webstreams from "stream/web";
4
+
5
+ type _CompressionStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.CompressionStream;
6
+ type _DecompressionStream = typeof globalThis extends { onmessage: any } ? {} : webstreams.DecompressionStream;
7
+
8
+ declare global {
9
+ interface CompressionStream extends _CompressionStream {}
10
+ var CompressionStream: typeof globalThis extends {
11
+ onmessage: any;
12
+ CompressionStream: infer T;
13
+ } ? T
14
+ : typeof webstreams.CompressionStream;
15
+
16
+ interface DecompressionStream extends _DecompressionStream {}
17
+ var DecompressionStream: typeof globalThis extends {
18
+ onmessage: any;
19
+ DecompressionStream: infer T;
20
+ } ? T
21
+ : typeof webstreams.DecompressionStream;
22
+ }