@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,23 +1,22 @@
1
1
  // These types are not exported, and are only used internally
2
+ import * as undici from './index'
2
3
 
3
4
  /**
4
5
  * Take in an unknown value and return one that is of type T
5
6
  */
6
7
  type Converter<T> = (object: unknown) => T
7
8
 
8
- type SequenceConverter<T> = (object: unknown) => T[]
9
+ type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
9
10
 
10
11
  type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
11
12
 
12
- interface ConvertToIntOpts {
13
- clamp?: boolean
14
- enforceRange?: boolean
15
- }
16
-
17
13
  interface WebidlErrors {
14
+ /**
15
+ * @description Instantiate an error
16
+ */
18
17
  exception (opts: { header: string, message: string }): TypeError
19
18
  /**
20
- * @description Throw an error when conversion from one type to another has failed
19
+ * @description Instantiate an error when conversion from one type to another has failed
21
20
  */
22
21
  conversionFailed (opts: {
23
22
  prefix: string
@@ -34,11 +33,24 @@ interface WebidlErrors {
34
33
  }): TypeError
35
34
  }
36
35
 
36
+ interface WebIDLTypes {
37
+ UNDEFINED: 1,
38
+ BOOLEAN: 2,
39
+ STRING: 3,
40
+ SYMBOL: 4,
41
+ NUMBER: 5,
42
+ BIGINT: 6,
43
+ NULL: 7
44
+ OBJECT: 8
45
+ }
46
+
37
47
  interface WebidlUtil {
38
48
  /**
39
49
  * @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
40
50
  */
41
- Type (object: unknown):
51
+ Type (object: unknown): WebIDLTypes[keyof WebIDLTypes]
52
+
53
+ TypeValueToString (o: unknown):
42
54
  | 'Undefined'
43
55
  | 'Boolean'
44
56
  | 'String'
@@ -48,6 +60,8 @@ interface WebidlUtil {
48
60
  | 'Null'
49
61
  | 'Object'
50
62
 
63
+ Types: WebIDLTypes
64
+
51
65
  /**
52
66
  * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
53
67
  */
@@ -55,27 +69,42 @@ interface WebidlUtil {
55
69
  V: unknown,
56
70
  bitLength: number,
57
71
  signedness: 'signed' | 'unsigned',
58
- opts?: ConvertToIntOpts
72
+ flags?: number
59
73
  ): number
60
74
 
61
75
  /**
62
- * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
76
+ * @see https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
63
77
  */
64
78
  IntegerPart (N: number): number
79
+
80
+ /**
81
+ * Stringifies {@param V}
82
+ */
83
+ Stringify (V: any): string
84
+
85
+ MakeTypeAssertion <I>(I: I): (arg: any) => arg is I
86
+
87
+ /**
88
+ * Mark a value as uncloneable for Node.js.
89
+ * This is only effective in some newer Node.js versions.
90
+ */
91
+ markAsUncloneable (V: any): void
92
+
93
+ IsResizableArrayBuffer (V: ArrayBufferLike): boolean
94
+
95
+ HasFlag (flag: number, attributes: number): boolean
65
96
  }
66
97
 
67
98
  interface WebidlConverters {
68
99
  /**
69
100
  * @see https://webidl.spec.whatwg.org/#es-DOMString
70
101
  */
71
- DOMString (V: unknown, opts?: {
72
- legacyNullToEmptyString: boolean
73
- }): string
102
+ DOMString (V: unknown, prefix: string, argument: string, flags?: number): string
74
103
 
75
104
  /**
76
105
  * @see https://webidl.spec.whatwg.org/#es-ByteString
77
106
  */
78
- ByteString (V: unknown): string
107
+ ByteString (V: unknown, prefix: string, argument: string): string
79
108
 
80
109
  /**
81
110
  * @see https://webidl.spec.whatwg.org/#es-USVString
@@ -110,59 +139,140 @@ interface WebidlConverters {
110
139
  /**
111
140
  * @see https://webidl.spec.whatwg.org/#es-unsigned-short
112
141
  */
113
- ['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number
142
+ ['unsigned short'] (V: unknown, flags?: number): number
114
143
 
115
144
  /**
116
145
  * @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer
117
146
  */
118
- ArrayBuffer (V: unknown): ArrayBufferLike
119
- ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer
147
+ ArrayBuffer (
148
+ V: unknown,
149
+ prefix: string,
150
+ argument: string,
151
+ options?: { allowResizable: boolean }
152
+ ): ArrayBuffer
153
+
154
+ /**
155
+ * @see https://webidl.spec.whatwg.org/#idl-SharedArrayBuffer
156
+ */
157
+ SharedArrayBuffer (
158
+ V: unknown,
159
+ prefix: string,
160
+ argument: string,
161
+ options?: { allowResizable: boolean }
162
+ ): SharedArrayBuffer
120
163
 
121
164
  /**
122
165
  * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
123
166
  */
124
167
  TypedArray (
125
168
  V: unknown,
126
- TypedArray: NodeJS.TypedArray | ArrayBufferLike
127
- ): NodeJS.TypedArray | ArrayBufferLike
128
- TypedArray (
169
+ T: new () => NodeJS.TypedArray,
170
+ prefix: string,
171
+ argument: string,
172
+ flags?: number
173
+ ): NodeJS.TypedArray
174
+
175
+ /**
176
+ * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
177
+ */
178
+ DataView (
129
179
  V: unknown,
130
- TypedArray: NodeJS.TypedArray | ArrayBufferLike,
131
- opts?: { allowShared: false }
132
- ): NodeJS.TypedArray | ArrayBuffer
180
+ prefix: string,
181
+ argument: string,
182
+ flags?: number
183
+ ): DataView
133
184
 
134
185
  /**
135
186
  * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
136
187
  */
137
- DataView (V: unknown, opts?: { allowShared: boolean }): DataView
188
+ ArrayBufferView (
189
+ V: unknown,
190
+ prefix: string,
191
+ argument: string,
192
+ flags?: number
193
+ ): NodeJS.ArrayBufferView
138
194
 
139
195
  /**
140
196
  * @see https://webidl.spec.whatwg.org/#BufferSource
141
197
  */
142
198
  BufferSource (
143
199
  V: unknown,
144
- opts?: { allowShared: boolean }
145
- ): NodeJS.TypedArray | ArrayBufferLike | DataView
200
+ prefix: string,
201
+ argument: string,
202
+ flags?: number
203
+ ): ArrayBuffer | NodeJS.ArrayBufferView
204
+
205
+ /**
206
+ * @see https://webidl.spec.whatwg.org/#AllowSharedBufferSource
207
+ */
208
+ AllowSharedBufferSource (
209
+ V: unknown,
210
+ prefix: string,
211
+ argument: string,
212
+ flags?: number
213
+ ): ArrayBuffer | SharedArrayBuffer | NodeJS.ArrayBufferView
146
214
 
147
215
  ['sequence<ByteString>']: SequenceConverter<string>
148
-
216
+
149
217
  ['sequence<sequence<ByteString>>']: SequenceConverter<string[]>
150
218
 
151
219
  ['record<ByteString, ByteString>']: RecordConverter<string, string>
152
220
 
221
+ /**
222
+ * @see https://fetch.spec.whatwg.org/#requestinfo
223
+ */
224
+ RequestInfo (V: unknown): undici.Request | string
225
+
226
+ /**
227
+ * @see https://fetch.spec.whatwg.org/#requestinit
228
+ */
229
+ RequestInit (V: unknown): undici.RequestInit
230
+
231
+ /**
232
+ * @see https://html.spec.whatwg.org/multipage/webappapis.html#eventhandlernonnull
233
+ */
234
+ EventHandlerNonNull (V: unknown): Function | null
235
+
236
+ WebSocketStreamWrite (V: unknown): ArrayBuffer | NodeJS.TypedArray | string
237
+
153
238
  [Key: string]: (...args: any[]) => unknown
154
239
  }
155
240
 
241
+ type WebidlIsFunction<T> = (arg: any) => arg is T
242
+
243
+ interface WebidlIs {
244
+ Request: WebidlIsFunction<undici.Request>
245
+ Response: WebidlIsFunction<undici.Response>
246
+ ReadableStream: WebidlIsFunction<ReadableStream>
247
+ Blob: WebidlIsFunction<Blob>
248
+ URLSearchParams: WebidlIsFunction<URLSearchParams>
249
+ File: WebidlIsFunction<File>
250
+ FormData: WebidlIsFunction<undici.FormData>
251
+ URL: WebidlIsFunction<URL>
252
+ WebSocketError: WebidlIsFunction<undici.WebSocketError>
253
+ AbortSignal: WebidlIsFunction<AbortSignal>
254
+ MessagePort: WebidlIsFunction<MessagePort>
255
+ USVString: WebidlIsFunction<string>
256
+ /**
257
+ * @see https://webidl.spec.whatwg.org/#BufferSource
258
+ */
259
+ BufferSource: WebidlIsFunction<ArrayBuffer | NodeJS.TypedArray>
260
+ }
261
+
156
262
  export interface Webidl {
157
263
  errors: WebidlErrors
158
264
  util: WebidlUtil
159
265
  converters: WebidlConverters
266
+ is: WebidlIs
267
+ attributes: WebIDLExtendedAttributes
160
268
 
161
269
  /**
162
270
  * @description Performs a brand-check on {@param V} to ensure it is a
163
271
  * {@param cls} object.
164
272
  */
165
- brandCheck <Interface>(V: unknown, cls: Interface, opts?: { strict?: boolean }): asserts V is Interface
273
+ brandCheck <Interface extends new () => unknown>(V: unknown, cls: Interface): asserts V is Interface
274
+
275
+ brandCheckMultiple <Interfaces extends (new () => unknown)[]> (list: Interfaces): (V: any) => asserts V is Interfaces[number]
166
276
 
167
277
  /**
168
278
  * @see https://webidl.spec.whatwg.org/#es-sequence
@@ -185,10 +295,11 @@ export interface Webidl {
185
295
  * Similar to {@link Webidl.brandCheck} but allows skipping the check if third party
186
296
  * interfaces are allowed.
187
297
  */
188
- interfaceConverter <Interface>(cls: Interface): (
298
+ interfaceConverter <Interface>(typeCheck: WebidlIsFunction<Interface>, name: string): (
189
299
  V: unknown,
190
- opts?: { strict: boolean }
191
- ) => asserts V is typeof cls
300
+ prefix: string,
301
+ argument: string
302
+ ) => asserts V is Interface
192
303
 
193
304
  // TODO(@KhafraDev): a type could likely be implemented that can infer the return type
194
305
  // from the converters given?
@@ -199,7 +310,7 @@ export interface Webidl {
199
310
  */
200
311
  dictionaryConverter (converters: {
201
312
  key: string,
202
- defaultValue?: unknown,
313
+ defaultValue?: () => unknown,
203
314
  required?: boolean,
204
315
  converter: (...args: unknown[]) => unknown,
205
316
  allowedValues?: unknown[]
@@ -213,8 +324,18 @@ export interface Webidl {
213
324
  converter: Converter<T>
214
325
  ): (V: unknown) => ReturnType<typeof converter> | null
215
326
 
216
- argumentLengthCheck (args: { length: number }, min: number, context: {
217
- header: string
218
- message?: string
219
- }): void
327
+ argumentLengthCheck (args: { length: number }, min: number, context: string): void
328
+ }
329
+
330
+ interface WebIDLExtendedAttributes {
331
+ /** https://webidl.spec.whatwg.org/#Clamp */
332
+ Clamp: number
333
+ /** https://webidl.spec.whatwg.org/#EnforceRange */
334
+ EnforceRange: number
335
+ /** https://webidl.spec.whatwg.org/#AllowShared */
336
+ AllowShared: number
337
+ /** https://webidl.spec.whatwg.org/#AllowResizable */
338
+ AllowResizable: number
339
+ /** https://webidl.spec.whatwg.org/#LegacyNullToEmptyString */
340
+ LegacyNullToEmptyString: number
220
341
  }
@@ -1,10 +1,9 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import type { Blob } from 'buffer'
4
- import type { MessagePort } from 'worker_threads'
3
+ import type { Blob } from 'node:buffer'
4
+ import type { ReadableStream, WritableStream } from 'node:stream/web'
5
+ import type { MessagePort } from 'node:worker_threads'
5
6
  import {
6
- EventTarget,
7
- Event,
8
7
  EventInit,
9
8
  EventListenerOptions,
10
9
  AddEventListenerOptions,
@@ -17,14 +16,14 @@ export type BinaryType = 'blob' | 'arraybuffer'
17
16
 
18
17
  interface WebSocketEventMap {
19
18
  close: CloseEvent
20
- error: Event
19
+ error: ErrorEvent
21
20
  message: MessageEvent
22
21
  open: Event
23
22
  }
24
23
 
25
24
  interface WebSocket extends EventTarget {
26
25
  binaryType: BinaryType
27
-
26
+
28
27
  readonly bufferedAmount: number
29
28
  readonly extensions: string
30
29
 
@@ -97,16 +96,16 @@ interface MessageEventInit<T = any> extends EventInit {
97
96
  data?: T
98
97
  lastEventId?: string
99
98
  origin?: string
100
- ports?: (typeof MessagePort)[]
101
- source?: typeof MessagePort | null
99
+ ports?: MessagePort[]
100
+ source?: MessagePort | null
102
101
  }
103
102
 
104
103
  interface MessageEvent<T = any> extends Event {
105
104
  readonly data: T
106
105
  readonly lastEventId: string
107
106
  readonly origin: string
108
- readonly ports: ReadonlyArray<typeof MessagePort>
109
- readonly source: typeof MessagePort | null
107
+ readonly ports: readonly MessagePort[]
108
+ readonly source: MessagePort | null
110
109
  initMessageEvent(
111
110
  type: string,
112
111
  bubbles?: boolean,
@@ -114,8 +113,8 @@ interface MessageEvent<T = any> extends Event {
114
113
  data?: any,
115
114
  origin?: string,
116
115
  lastEventId?: string,
117
- source?: typeof MessagePort | null,
118
- ports?: (typeof MessagePort)[]
116
+ source?: MessagePort | null,
117
+ ports?: MessagePort[]
119
118
  ): void;
120
119
  }
121
120
 
@@ -124,8 +123,64 @@ export declare const MessageEvent: {
124
123
  new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
125
124
  }
126
125
 
126
+ interface ErrorEventInit extends EventInit {
127
+ message?: string
128
+ filename?: string
129
+ lineno?: number
130
+ colno?: number
131
+ error?: any
132
+ }
133
+
134
+ interface ErrorEvent extends Event {
135
+ readonly message: string
136
+ readonly filename: string
137
+ readonly lineno: number
138
+ readonly colno: number
139
+ readonly error: Error
140
+ }
141
+
142
+ export declare const ErrorEvent: {
143
+ prototype: ErrorEvent
144
+ new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent
145
+ }
146
+
127
147
  interface WebSocketInit {
128
148
  protocols?: string | string[],
129
149
  dispatcher?: Dispatcher,
130
150
  headers?: HeadersInit
131
151
  }
152
+
153
+ interface WebSocketStreamOptions {
154
+ protocols?: string | string[]
155
+ signal?: AbortSignal
156
+ }
157
+
158
+ interface WebSocketCloseInfo {
159
+ closeCode: number
160
+ reason: string
161
+ }
162
+
163
+ interface WebSocketStream {
164
+ closed: Promise<WebSocketCloseInfo>
165
+ opened: Promise<{
166
+ extensions: string
167
+ protocol: string
168
+ readable: ReadableStream
169
+ writable: WritableStream
170
+ }>
171
+ url: string
172
+ }
173
+
174
+ export declare const WebSocketStream: {
175
+ prototype: WebSocketStream
176
+ new (url: string | URL, options?: WebSocketStreamOptions): WebSocketStream
177
+ }
178
+
179
+ interface WebSocketError extends Event, WebSocketCloseInfo {}
180
+
181
+ export declare const WebSocketError: {
182
+ prototype: WebSocketError
183
+ new (type: string, init?: WebSocketCloseInfo): WebSocketError
184
+ }
185
+
186
+ export declare const ping: (ws: WebSocket, body?: Buffer) => void
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "main": "lib/index.js",
17
17
  "license": "Apache-2.0",
18
- "version": "8.2.0",
18
+ "version": "8.2.1-alpha.0",
19
19
  "types": "lib/index.d.ts",
20
20
  "stability": "stable",
21
21
  "exports": {
@@ -66,8 +66,8 @@
66
66
  "watch": "jsii -w",
67
67
  "bump": "commit-and-tag-version -a -i docs/changelog.md",
68
68
  "bump:alpha": "commit-and-tag-version -a -i docs/changelog.md --prerelease alpha",
69
- "test": "node --max-old-space-size=4096 ./node_modules/jest/bin/jest.js",
70
- "test:watch": "jest --watch",
69
+ "test": "vitest run",
70
+ "test:watch": "vitest",
71
71
  "docgen": "jsii-docgen -o ./docs/API.md",
72
72
  "cdk": "cdk",
73
73
  "vulnerability-check": "npm audit --registry https://registry.npmjs.org --parseable --audit-level=moderate --omit=dev",
@@ -84,29 +84,26 @@
84
84
  "devDependencies": {
85
85
  "@biomejs/biome": "2.5.0",
86
86
  "@rio-cloud/biome-config-claid": "1.0.0",
87
- "@types/jest": "29.5.13",
88
87
  "@types/js-yaml": "4.0.9",
89
- "@types/node": "20.9.4",
88
+ "@types/node": "24.13.2",
90
89
  "@types/tmp": "^0.2.6",
91
90
  "aws-cdk": "^2.177.0",
92
- "aws-cdk-lib": "2.258.0",
91
+ "aws-cdk-lib": "2.259.0",
93
92
  "aws-sdk-client-mock": "^4.1.0",
94
93
  "commit-and-tag-version": "^12.5.0",
95
94
  "constructs": "10.5.1",
96
95
  "datadog-cdk-constructs-v2": "4.0.0",
97
96
  "esbuild": "0.25.0",
98
- "jest": "~29.7.0",
99
- "jest-junit": "16.0.0",
100
97
  "jsii": "5.9.31",
101
98
  "jsii-diff": "1.127.0",
102
99
  "jsii-docgen": "10.11.14",
103
100
  "tmp": "^0.2.3",
104
- "ts-jest": "^29.2.5",
105
101
  "ts-node": "^10.9.2",
106
- "typescript": "~5.6.3"
102
+ "typescript": "~5.6.3",
103
+ "vitest": "4.1.9"
107
104
  },
108
105
  "peerDependencies": {
109
- "aws-cdk-lib": "^2.254.0",
106
+ "aws-cdk-lib": "^2.259.0",
110
107
  "constructs": "^10.5.1",
111
108
  "datadog-cdk-constructs-v2": "^4.0.0"
112
109
  },
@@ -136,53 +133,5 @@
136
133
  "@smithy/util-retry",
137
134
  "@types/aws-lambda",
138
135
  "js-yaml"
139
- ],
140
- "jest": {
141
- "testMatch": [
142
- "<rootDir>/src/**/__tests__/**/*.ts?(x)",
143
- "<rootDir>/(test|src)/**/?(*.)+(spec|test).ts?(x)"
144
- ],
145
- "clearMocks": true,
146
- "collectCoverage": true,
147
- "silent": true,
148
- "coverageReporters": [
149
- "json",
150
- "lcov",
151
- "clover",
152
- "cobertura",
153
- "text"
154
- ],
155
- "coverageDirectory": "coverage",
156
- "coveragePathIgnorePatterns": [
157
- "/node_modules/",
158
- "infrastructure"
159
- ],
160
- "testPathIgnorePatterns": [
161
- "/node_modules/",
162
- "infrastructure"
163
- ],
164
- "watchPathIgnorePatterns": [
165
- "/node_modules/"
166
- ],
167
- "reporters": [
168
- "default",
169
- [
170
- "jest-junit",
171
- {
172
- "outputDirectory": "test-reports"
173
- }
174
- ]
175
- ],
176
- "maxWorkers": 2,
177
- "workerIdleMemoryLimit": "512MB",
178
- "preset": "ts-jest",
179
- "transform": {
180
- "^.+\\.tsx?$": [
181
- "ts-jest",
182
- {
183
- "tsconfig": "tsconfig.dev.json"
184
- }
185
- ]
186
- }
187
- }
136
+ ]
188
137
  }
package/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "8.2.0"
2
+ "version": "8.2.1-alpha.0"
3
3
  }
@@ -1,122 +0,0 @@
1
- export {}; // Don't export anything!
2
-
3
- //// DOM-like Events
4
- // NB: The Event / EventTarget / EventListener implementations below were copied
5
- // from lib.dom.d.ts, then edited to reflect Node's documentation at
6
- // https://nodejs.org/api/events.html#class-eventtarget.
7
- // Please read that link to understand important implementation differences.
8
-
9
- // This conditional type will be the existing global Event in a browser, or
10
- // the copy below in a Node environment.
11
- type __Event = typeof globalThis extends { onmessage: any; Event: any } ? {}
12
- : {
13
- /** This is not used in Node.js and is provided purely for completeness. */
14
- readonly bubbles: boolean;
15
- /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */
16
- cancelBubble: () => void;
17
- /** True if the event was created with the cancelable option */
18
- readonly cancelable: boolean;
19
- /** This is not used in Node.js and is provided purely for completeness. */
20
- readonly composed: boolean;
21
- /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */
22
- composedPath(): [EventTarget?];
23
- /** Alias for event.target. */
24
- readonly currentTarget: EventTarget | null;
25
- /** Is true if cancelable is true and event.preventDefault() has been called. */
26
- readonly defaultPrevented: boolean;
27
- /** This is not used in Node.js and is provided purely for completeness. */
28
- readonly eventPhase: 0 | 2;
29
- /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */
30
- readonly isTrusted: boolean;
31
- /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */
32
- preventDefault(): void;
33
- /** This is not used in Node.js and is provided purely for completeness. */
34
- returnValue: boolean;
35
- /** Alias for event.target. */
36
- readonly srcElement: EventTarget | null;
37
- /** Stops the invocation of event listeners after the current one completes. */
38
- stopImmediatePropagation(): void;
39
- /** This is not used in Node.js and is provided purely for completeness. */
40
- stopPropagation(): void;
41
- /** The `EventTarget` dispatching the event */
42
- readonly target: EventTarget | null;
43
- /** The millisecond timestamp when the Event object was created. */
44
- readonly timeStamp: number;
45
- /** Returns the type of event, e.g. "click", "hashchange", or "submit". */
46
- readonly type: string;
47
- };
48
-
49
- // See comment above explaining conditional type
50
- type __EventTarget = typeof globalThis extends { onmessage: any; EventTarget: any } ? {}
51
- : {
52
- /**
53
- * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value.
54
- *
55
- * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched.
56
- *
57
- * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification.
58
- * Specifically, the `capture` option is used as part of the key when registering a `listener`.
59
- * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`.
60
- */
61
- addEventListener(
62
- type: string,
63
- listener: EventListener | EventListenerObject,
64
- options?: AddEventListenerOptions | boolean,
65
- ): void;
66
- /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */
67
- dispatchEvent(event: Event): boolean;
68
- /** Removes the event listener in target's event listener list with the same type, callback, and options. */
69
- removeEventListener(
70
- type: string,
71
- listener: EventListener | EventListenerObject,
72
- options?: EventListenerOptions | boolean,
73
- ): void;
74
- };
75
-
76
- interface EventInit {
77
- bubbles?: boolean;
78
- cancelable?: boolean;
79
- composed?: boolean;
80
- }
81
-
82
- interface EventListenerOptions {
83
- /** Not directly used by Node.js. Added for API completeness. Default: `false`. */
84
- capture?: boolean;
85
- }
86
-
87
- interface AddEventListenerOptions extends EventListenerOptions {
88
- /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */
89
- once?: boolean;
90
- /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */
91
- passive?: boolean;
92
- }
93
-
94
- interface EventListener {
95
- (evt: Event): void;
96
- }
97
-
98
- interface EventListenerObject {
99
- handleEvent(object: Event): void;
100
- }
101
-
102
- import {} from "events"; // Make this an ambient declaration
103
- declare global {
104
- /** An event which takes place in the DOM. */
105
- interface Event extends __Event {}
106
- var Event: typeof globalThis extends { onmessage: any; Event: infer T } ? T
107
- : {
108
- prototype: __Event;
109
- new(type: string, eventInitDict?: EventInit): __Event;
110
- };
111
-
112
- /**
113
- * EventTarget is a DOM interface implemented by objects that can
114
- * receive events and may have listeners for them.
115
- */
116
- interface EventTarget extends __EventTarget {}
117
- var EventTarget: typeof globalThis extends { onmessage: any; EventTarget: infer T } ? T
118
- : {
119
- prototype: __EventTarget;
120
- new(): __EventTarget;
121
- };
122
- }
@@ -1 +0,0 @@
1
- declare var global: typeof globalThis;
@@ -1,8 +0,0 @@
1
- declare module "assert/strict" {
2
- import { strict } from "node:assert";
3
- export = strict;
4
- }
5
- declare module "node:assert/strict" {
6
- import { strict } from "node:assert";
7
- export = strict;
8
- }