cdk-common 2.0.915 → 2.0.917

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 (203) hide show
  1. package/.jsii +8 -2
  2. package/API.md +5 -0
  3. package/lib/main.js +1 -1
  4. package/lib/managed-policies.d.ts +2 -1
  5. package/lib/managed-policies.js +2 -1
  6. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/README.md +1 -1
  7. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/assert.d.ts +5 -5
  8. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/async_hooks.d.ts +5 -5
  9. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/buffer.d.ts +1 -1
  10. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/child_process.d.ts +2 -2
  11. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/cluster.d.ts +15 -15
  12. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/console.d.ts +17 -17
  13. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/crypto.d.ts +5 -78
  14. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/dgram.d.ts +1 -1
  15. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/diagnostics_channel.d.ts +1 -1
  16. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/dns.d.ts +17 -17
  17. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/domain.d.ts +1 -1
  18. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/events.d.ts +1 -1
  19. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/fs/promises.d.ts +16 -0
  20. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/fs.d.ts +60 -2
  21. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/http.d.ts +2 -2
  22. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/http2.d.ts +2 -2
  23. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/https.d.ts +1 -1
  24. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/inspector.d.ts +1 -1
  25. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/module.d.ts +0 -14
  26. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/net.d.ts +1 -1
  27. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/os.d.ts +3 -3
  28. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/package.json +3 -3
  29. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/path.d.ts +1 -1
  30. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/perf_hooks.d.ts +8 -8
  31. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/process.d.ts +2 -2
  32. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/punycode.d.ts +1 -1
  33. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/querystring.d.ts +1 -1
  34. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/readline.d.ts +10 -10
  35. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/repl.d.ts +12 -12
  36. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/sea.d.ts +1 -1
  37. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/stream.d.ts +9 -9
  38. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/string_decoder.d.ts +1 -1
  39. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/test.d.ts +12 -11
  40. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/timers.d.ts +1 -1
  41. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/tls.d.ts +2 -2
  42. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/trace_events.d.ts +6 -6
  43. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/tty.d.ts +1 -1
  44. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/url.d.ts +1 -1
  45. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/util.d.ts +2 -2
  46. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/v8.d.ts +2 -2
  47. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/vm.d.ts +5 -7
  48. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/wasi.d.ts +1 -1
  49. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/worker_threads.d.ts +1 -1
  50. package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/zlib.d.ts +3 -3
  51. package/node_modules/@types/concat-stream/node_modules/undici-types/LICENSE +21 -0
  52. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/balanced-pool.d.ts +11 -0
  53. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/client.d.ts +12 -1
  54. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/diagnostics-channel.d.ts +1 -2
  55. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/dispatcher.d.ts +17 -3
  56. package/node_modules/@types/concat-stream/node_modules/undici-types/eventsource.d.ts +61 -0
  57. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/fetch.d.ts +22 -23
  58. package/node_modules/@types/concat-stream/node_modules/undici-types/handlers.d.ts +15 -0
  59. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/index.d.ts +6 -1
  60. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/package.json +1 -1
  61. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/pool.d.ts +11 -0
  62. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/proxy-agent.d.ts +0 -2
  63. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/readable.d.ts +2 -3
  64. package/node_modules/@types/concat-stream/node_modules/undici-types/retry-agent.d.ts +11 -0
  65. package/node_modules/@types/concat-stream/node_modules/undici-types/retry-handler.d.ts +116 -0
  66. package/node_modules/@types/concat-stream/node_modules/undici-types/util.d.ts +31 -0
  67. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/webidl.d.ts +6 -1
  68. package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/websocket.d.ts +22 -1
  69. package/node_modules/@types/form-data/node_modules/@types/node/LICENSE +21 -0
  70. package/node_modules/@types/form-data/node_modules/@types/node/README.md +15 -0
  71. package/node_modules/@types/form-data/node_modules/@types/node/assert/strict.d.ts +8 -0
  72. package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +1040 -0
  73. package/node_modules/@types/form-data/node_modules/@types/node/async_hooks.d.ts +541 -0
  74. package/node_modules/@types/form-data/node_modules/@types/node/buffer.d.ts +2282 -0
  75. package/node_modules/@types/form-data/node_modules/@types/node/child_process.d.ts +1544 -0
  76. package/node_modules/@types/form-data/node_modules/@types/node/cluster.d.ts +578 -0
  77. package/node_modules/@types/form-data/node_modules/@types/node/console.d.ts +452 -0
  78. package/node_modules/@types/form-data/node_modules/@types/node/constants.d.ts +19 -0
  79. package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +4451 -0
  80. package/node_modules/@types/form-data/node_modules/@types/node/dgram.d.ts +596 -0
  81. package/node_modules/@types/form-data/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  82. package/node_modules/@types/form-data/node_modules/@types/node/dns/promises.d.ts +476 -0
  83. package/node_modules/@types/form-data/node_modules/@types/node/dns.d.ts +864 -0
  84. package/node_modules/@types/form-data/node_modules/@types/node/dom-events.d.ts +124 -0
  85. package/node_modules/@types/form-data/node_modules/@types/node/domain.d.ts +170 -0
  86. package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +931 -0
  87. package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +1261 -0
  88. package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +4375 -0
  89. package/node_modules/@types/form-data/node_modules/@types/node/globals.d.ts +412 -0
  90. package/node_modules/@types/form-data/node_modules/@types/node/globals.global.d.ts +1 -0
  91. package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +1908 -0
  92. package/node_modules/@types/form-data/node_modules/@types/node/http2.d.ts +2418 -0
  93. package/node_modules/@types/form-data/node_modules/@types/node/https.d.ts +550 -0
  94. package/node_modules/@types/form-data/node_modules/@types/node/index.d.ts +89 -0
  95. package/node_modules/@types/form-data/node_modules/@types/node/inspector.d.ts +2746 -0
  96. package/node_modules/@types/form-data/node_modules/@types/node/module.d.ts +301 -0
  97. package/node_modules/@types/form-data/node_modules/@types/node/net.d.ts +999 -0
  98. package/node_modules/@types/form-data/node_modules/@types/node/os.d.ts +495 -0
  99. package/node_modules/@types/form-data/node_modules/@types/node/package.json +217 -0
  100. package/node_modules/@types/form-data/node_modules/@types/node/path.d.ts +191 -0
  101. package/node_modules/@types/form-data/node_modules/@types/node/perf_hooks.d.ts +905 -0
  102. package/node_modules/@types/form-data/node_modules/@types/node/process.d.ts +1754 -0
  103. package/node_modules/@types/form-data/node_modules/@types/node/punycode.d.ts +117 -0
  104. package/node_modules/@types/form-data/node_modules/@types/node/querystring.d.ts +153 -0
  105. package/node_modules/@types/form-data/node_modules/@types/node/readline/promises.d.ts +150 -0
  106. package/node_modules/@types/form-data/node_modules/@types/node/readline.d.ts +540 -0
  107. package/node_modules/@types/form-data/node_modules/@types/node/repl.d.ts +430 -0
  108. package/node_modules/@types/form-data/node_modules/@types/node/sea.d.ts +153 -0
  109. package/node_modules/@types/form-data/node_modules/@types/node/stream/consumers.d.ts +12 -0
  110. package/node_modules/@types/form-data/node_modules/@types/node/stream/promises.d.ts +83 -0
  111. package/node_modules/@types/form-data/node_modules/@types/node/stream/web.d.ts +367 -0
  112. package/node_modules/@types/form-data/node_modules/@types/node/stream.d.ts +1707 -0
  113. package/node_modules/@types/form-data/node_modules/@types/node/string_decoder.d.ts +67 -0
  114. package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +1730 -0
  115. package/node_modules/@types/form-data/node_modules/@types/node/timers/promises.d.ts +97 -0
  116. package/node_modules/@types/form-data/node_modules/@types/node/timers.d.ts +240 -0
  117. package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +1217 -0
  118. package/node_modules/@types/form-data/node_modules/@types/node/trace_events.d.ts +197 -0
  119. package/node_modules/@types/form-data/node_modules/@types/node/tty.d.ts +208 -0
  120. package/node_modules/@types/form-data/node_modules/@types/node/url.d.ts +952 -0
  121. package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +2292 -0
  122. package/node_modules/@types/form-data/node_modules/@types/node/v8.d.ts +808 -0
  123. package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +922 -0
  124. package/node_modules/@types/form-data/node_modules/@types/node/wasi.d.ts +181 -0
  125. package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +694 -0
  126. package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +530 -0
  127. package/node_modules/@types/form-data/node_modules/undici-types/LICENSE +21 -0
  128. package/node_modules/@types/form-data/node_modules/undici-types/README.md +6 -0
  129. package/node_modules/@types/form-data/node_modules/undici-types/agent.d.ts +31 -0
  130. package/node_modules/@types/form-data/node_modules/undici-types/api.d.ts +43 -0
  131. package/node_modules/@types/form-data/node_modules/undici-types/balanced-pool.d.ts +29 -0
  132. package/node_modules/@types/form-data/node_modules/undici-types/cache.d.ts +36 -0
  133. package/node_modules/@types/form-data/node_modules/undici-types/client.d.ts +108 -0
  134. package/node_modules/@types/form-data/node_modules/undici-types/connector.d.ts +34 -0
  135. package/node_modules/@types/form-data/node_modules/undici-types/content-type.d.ts +21 -0
  136. package/node_modules/@types/form-data/node_modules/undici-types/cookies.d.ts +28 -0
  137. package/node_modules/@types/form-data/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  138. package/node_modules/@types/form-data/node_modules/undici-types/dispatcher.d.ts +255 -0
  139. package/node_modules/@types/form-data/node_modules/undici-types/errors.d.ts +128 -0
  140. package/node_modules/@types/form-data/node_modules/undici-types/eventsource.d.ts +61 -0
  141. package/node_modules/@types/form-data/node_modules/undici-types/fetch.d.ts +208 -0
  142. package/node_modules/@types/form-data/node_modules/undici-types/file.d.ts +39 -0
  143. package/node_modules/@types/form-data/node_modules/undici-types/filereader.d.ts +54 -0
  144. package/node_modules/@types/form-data/node_modules/undici-types/formdata.d.ts +108 -0
  145. package/node_modules/@types/form-data/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  146. package/node_modules/@types/form-data/node_modules/undici-types/global-origin.d.ts +7 -0
  147. package/node_modules/@types/form-data/node_modules/undici-types/handlers.d.ts +15 -0
  148. package/node_modules/@types/form-data/node_modules/undici-types/header.d.ts +4 -0
  149. package/node_modules/@types/form-data/node_modules/undici-types/index.d.ts +68 -0
  150. package/node_modules/@types/form-data/node_modules/undici-types/interceptors.d.ts +5 -0
  151. package/node_modules/@types/form-data/node_modules/undici-types/mock-agent.d.ts +50 -0
  152. package/node_modules/@types/form-data/node_modules/undici-types/mock-client.d.ts +25 -0
  153. package/node_modules/@types/form-data/node_modules/undici-types/mock-errors.d.ts +12 -0
  154. package/node_modules/@types/form-data/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  155. package/node_modules/@types/form-data/node_modules/undici-types/mock-pool.d.ts +25 -0
  156. package/node_modules/@types/form-data/node_modules/undici-types/package.json +55 -0
  157. package/node_modules/@types/form-data/node_modules/undici-types/patch.d.ts +71 -0
  158. package/node_modules/@types/form-data/node_modules/undici-types/pool-stats.d.ts +19 -0
  159. package/node_modules/@types/form-data/node_modules/undici-types/pool.d.ts +39 -0
  160. package/node_modules/@types/form-data/node_modules/undici-types/proxy-agent.d.ts +28 -0
  161. package/node_modules/@types/form-data/node_modules/undici-types/readable.d.ts +60 -0
  162. package/node_modules/@types/form-data/node_modules/undici-types/retry-agent.d.ts +11 -0
  163. package/node_modules/@types/form-data/node_modules/undici-types/retry-handler.d.ts +116 -0
  164. package/node_modules/@types/form-data/node_modules/undici-types/util.d.ts +31 -0
  165. package/node_modules/@types/form-data/node_modules/undici-types/webidl.d.ts +225 -0
  166. package/node_modules/@types/form-data/node_modules/undici-types/websocket.d.ts +152 -0
  167. package/package.json +1 -1
  168. package/node_modules/undici-types/handlers.d.ts +0 -9
  169. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/LICENSE +0 -0
  170. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/assert/strict.d.ts +0 -0
  171. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/constants.d.ts +0 -0
  172. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/dns/promises.d.ts +0 -0
  173. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/dom-events.d.ts +0 -0
  174. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/globals.d.ts +0 -0
  175. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/globals.global.d.ts +0 -0
  176. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/index.d.ts +0 -0
  177. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/readline/promises.d.ts +0 -0
  178. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/stream/consumers.d.ts +0 -0
  179. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/stream/promises.d.ts +0 -0
  180. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/stream/web.d.ts +0 -0
  181. /package/node_modules/@types/{node → concat-stream/node_modules/@types/node}/timers/promises.d.ts +0 -0
  182. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/README.md +0 -0
  183. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/agent.d.ts +0 -0
  184. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/api.d.ts +0 -0
  185. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/cache.d.ts +0 -0
  186. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/connector.d.ts +0 -0
  187. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/content-type.d.ts +0 -0
  188. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/cookies.d.ts +0 -0
  189. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/errors.d.ts +0 -0
  190. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/file.d.ts +0 -0
  191. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/filereader.d.ts +0 -0
  192. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/formdata.d.ts +0 -0
  193. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/global-dispatcher.d.ts +0 -0
  194. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/global-origin.d.ts +0 -0
  195. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/header.d.ts +0 -0
  196. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/interceptors.d.ts +0 -0
  197. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/mock-agent.d.ts +0 -0
  198. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/mock-client.d.ts +0 -0
  199. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/mock-errors.d.ts +0 -0
  200. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/mock-interceptor.d.ts +0 -0
  201. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/mock-pool.d.ts +0 -0
  202. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/patch.d.ts +0 -0
  203. /package/node_modules/{undici-types → @types/concat-stream/node_modules/undici-types}/pool-stats.d.ts +0 -0
@@ -0,0 +1,225 @@
1
+ // These types are not exported, and are only used internally
2
+
3
+ /**
4
+ * Take in an unknown value and return one that is of type T
5
+ */
6
+ type Converter<T> = (object: unknown) => T
7
+
8
+ type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
9
+
10
+ type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
11
+
12
+ interface ConvertToIntOpts {
13
+ clamp?: boolean
14
+ enforceRange?: boolean
15
+ }
16
+
17
+ interface WebidlErrors {
18
+ exception (opts: { header: string, message: string }): TypeError
19
+ /**
20
+ * @description Throw an error when conversion from one type to another has failed
21
+ */
22
+ conversionFailed (opts: {
23
+ prefix: string
24
+ argument: string
25
+ types: string[]
26
+ }): TypeError
27
+ /**
28
+ * @description Throw an error when an invalid argument is provided
29
+ */
30
+ invalidArgument (opts: {
31
+ prefix: string
32
+ value: string
33
+ type: string
34
+ }): TypeError
35
+ }
36
+
37
+ interface WebidlUtil {
38
+ /**
39
+ * @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
40
+ */
41
+ Type (object: unknown):
42
+ | 'Undefined'
43
+ | 'Boolean'
44
+ | 'String'
45
+ | 'Symbol'
46
+ | 'Number'
47
+ | 'BigInt'
48
+ | 'Null'
49
+ | 'Object'
50
+
51
+ /**
52
+ * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
53
+ */
54
+ ConvertToInt (
55
+ V: unknown,
56
+ bitLength: number,
57
+ signedness: 'signed' | 'unsigned',
58
+ opts?: ConvertToIntOpts
59
+ ): number
60
+
61
+ /**
62
+ * @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
63
+ */
64
+ IntegerPart (N: number): number
65
+
66
+ /**
67
+ * Stringifies {@param V}
68
+ */
69
+ Stringify (V: any): string
70
+ }
71
+
72
+ interface WebidlConverters {
73
+ /**
74
+ * @see https://webidl.spec.whatwg.org/#es-DOMString
75
+ */
76
+ DOMString (V: unknown, opts?: {
77
+ legacyNullToEmptyString: boolean
78
+ }): string
79
+
80
+ /**
81
+ * @see https://webidl.spec.whatwg.org/#es-ByteString
82
+ */
83
+ ByteString (V: unknown): string
84
+
85
+ /**
86
+ * @see https://webidl.spec.whatwg.org/#es-USVString
87
+ */
88
+ USVString (V: unknown): string
89
+
90
+ /**
91
+ * @see https://webidl.spec.whatwg.org/#es-boolean
92
+ */
93
+ boolean (V: unknown): boolean
94
+
95
+ /**
96
+ * @see https://webidl.spec.whatwg.org/#es-any
97
+ */
98
+ any <Value>(V: Value): Value
99
+
100
+ /**
101
+ * @see https://webidl.spec.whatwg.org/#es-long-long
102
+ */
103
+ ['long long'] (V: unknown): number
104
+
105
+ /**
106
+ * @see https://webidl.spec.whatwg.org/#es-unsigned-long-long
107
+ */
108
+ ['unsigned long long'] (V: unknown): number
109
+
110
+ /**
111
+ * @see https://webidl.spec.whatwg.org/#es-unsigned-long
112
+ */
113
+ ['unsigned long'] (V: unknown): number
114
+
115
+ /**
116
+ * @see https://webidl.spec.whatwg.org/#es-unsigned-short
117
+ */
118
+ ['unsigned short'] (V: unknown, opts?: ConvertToIntOpts): number
119
+
120
+ /**
121
+ * @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer
122
+ */
123
+ ArrayBuffer (V: unknown): ArrayBufferLike
124
+ ArrayBuffer (V: unknown, opts: { allowShared: false }): ArrayBuffer
125
+
126
+ /**
127
+ * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
128
+ */
129
+ TypedArray (
130
+ V: unknown,
131
+ TypedArray: NodeJS.TypedArray | ArrayBufferLike
132
+ ): NodeJS.TypedArray | ArrayBufferLike
133
+ TypedArray (
134
+ V: unknown,
135
+ TypedArray: NodeJS.TypedArray | ArrayBufferLike,
136
+ opts?: { allowShared: false }
137
+ ): NodeJS.TypedArray | ArrayBuffer
138
+
139
+ /**
140
+ * @see https://webidl.spec.whatwg.org/#es-buffer-source-types
141
+ */
142
+ DataView (V: unknown, opts?: { allowShared: boolean }): DataView
143
+
144
+ /**
145
+ * @see https://webidl.spec.whatwg.org/#BufferSource
146
+ */
147
+ BufferSource (
148
+ V: unknown,
149
+ opts?: { allowShared: boolean }
150
+ ): NodeJS.TypedArray | ArrayBufferLike | DataView
151
+
152
+ ['sequence<ByteString>']: SequenceConverter<string>
153
+
154
+ ['sequence<sequence<ByteString>>']: SequenceConverter<string[]>
155
+
156
+ ['record<ByteString, ByteString>']: RecordConverter<string, string>
157
+
158
+ [Key: string]: (...args: any[]) => unknown
159
+ }
160
+
161
+ export interface Webidl {
162
+ errors: WebidlErrors
163
+ util: WebidlUtil
164
+ converters: WebidlConverters
165
+
166
+ /**
167
+ * @description Performs a brand-check on {@param V} to ensure it is a
168
+ * {@param cls} object.
169
+ */
170
+ brandCheck <Interface>(V: unknown, cls: Interface, opts?: { strict?: boolean }): asserts V is Interface
171
+
172
+ /**
173
+ * @see https://webidl.spec.whatwg.org/#es-sequence
174
+ * @description Convert a value, V, to a WebIDL sequence type.
175
+ */
176
+ sequenceConverter <Type>(C: Converter<Type>): SequenceConverter<Type>
177
+
178
+ illegalConstructor (): never
179
+
180
+ /**
181
+ * @see https://webidl.spec.whatwg.org/#es-to-record
182
+ * @description Convert a value, V, to a WebIDL record type.
183
+ */
184
+ recordConverter <K extends string, V>(
185
+ keyConverter: Converter<K>,
186
+ valueConverter: Converter<V>
187
+ ): RecordConverter<K, V>
188
+
189
+ /**
190
+ * Similar to {@link Webidl.brandCheck} but allows skipping the check if third party
191
+ * interfaces are allowed.
192
+ */
193
+ interfaceConverter <Interface>(cls: Interface): (
194
+ V: unknown,
195
+ opts?: { strict: boolean }
196
+ ) => asserts V is typeof cls
197
+
198
+ // TODO(@KhafraDev): a type could likely be implemented that can infer the return type
199
+ // from the converters given?
200
+ /**
201
+ * Converts a value, V, to a WebIDL dictionary types. Allows limiting which keys are
202
+ * allowed, values allowed, optional and required keys. Auto converts the value to
203
+ * a type given a converter.
204
+ */
205
+ dictionaryConverter (converters: {
206
+ key: string,
207
+ defaultValue?: unknown,
208
+ required?: boolean,
209
+ converter: (...args: unknown[]) => unknown,
210
+ allowedValues?: unknown[]
211
+ }[]): (V: unknown) => Record<string, unknown>
212
+
213
+ /**
214
+ * @see https://webidl.spec.whatwg.org/#idl-nullable-type
215
+ * @description allows a type, V, to be null
216
+ */
217
+ nullableConverter <T>(
218
+ converter: Converter<T>
219
+ ): (V: unknown) => ReturnType<typeof converter> | null
220
+
221
+ argumentLengthCheck (args: { length: number }, min: number, context: {
222
+ header: string
223
+ message?: string
224
+ }): void
225
+ }
@@ -0,0 +1,152 @@
1
+ /// <reference types="node" />
2
+
3
+ import type { Blob } from 'buffer'
4
+ import type { MessagePort } from 'worker_threads'
5
+ import {
6
+ EventTarget,
7
+ Event,
8
+ EventInit,
9
+ EventListenerOptions,
10
+ AddEventListenerOptions,
11
+ EventListenerOrEventListenerObject
12
+ } from './patch'
13
+ import Dispatcher from './dispatcher'
14
+ import { HeadersInit } from './fetch'
15
+
16
+ export type BinaryType = 'blob' | 'arraybuffer'
17
+
18
+ interface WebSocketEventMap {
19
+ close: CloseEvent
20
+ error: ErrorEvent
21
+ message: MessageEvent
22
+ open: Event
23
+ }
24
+
25
+ interface WebSocket extends EventTarget {
26
+ binaryType: BinaryType
27
+
28
+ readonly bufferedAmount: number
29
+ readonly extensions: string
30
+
31
+ onclose: ((this: WebSocket, ev: WebSocketEventMap['close']) => any) | null
32
+ onerror: ((this: WebSocket, ev: WebSocketEventMap['error']) => any) | null
33
+ onmessage: ((this: WebSocket, ev: WebSocketEventMap['message']) => any) | null
34
+ onopen: ((this: WebSocket, ev: WebSocketEventMap['open']) => any) | null
35
+
36
+ readonly protocol: string
37
+ readonly readyState: number
38
+ readonly url: string
39
+
40
+ close(code?: number, reason?: string): void
41
+ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void
42
+
43
+ readonly CLOSED: number
44
+ readonly CLOSING: number
45
+ readonly CONNECTING: number
46
+ readonly OPEN: number
47
+
48
+ addEventListener<K extends keyof WebSocketEventMap>(
49
+ type: K,
50
+ listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
51
+ options?: boolean | AddEventListenerOptions
52
+ ): void
53
+ addEventListener(
54
+ type: string,
55
+ listener: EventListenerOrEventListenerObject,
56
+ options?: boolean | AddEventListenerOptions
57
+ ): void
58
+ removeEventListener<K extends keyof WebSocketEventMap>(
59
+ type: K,
60
+ listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any,
61
+ options?: boolean | EventListenerOptions
62
+ ): void
63
+ removeEventListener(
64
+ type: string,
65
+ listener: EventListenerOrEventListenerObject,
66
+ options?: boolean | EventListenerOptions
67
+ ): void
68
+ }
69
+
70
+ export declare const WebSocket: {
71
+ prototype: WebSocket
72
+ new (url: string | URL, protocols?: string | string[] | WebSocketInit): WebSocket
73
+ readonly CLOSED: number
74
+ readonly CLOSING: number
75
+ readonly CONNECTING: number
76
+ readonly OPEN: number
77
+ }
78
+
79
+ interface CloseEventInit extends EventInit {
80
+ code?: number
81
+ reason?: string
82
+ wasClean?: boolean
83
+ }
84
+
85
+ interface CloseEvent extends Event {
86
+ readonly code: number
87
+ readonly reason: string
88
+ readonly wasClean: boolean
89
+ }
90
+
91
+ export declare const CloseEvent: {
92
+ prototype: CloseEvent
93
+ new (type: string, eventInitDict?: CloseEventInit): CloseEvent
94
+ }
95
+
96
+ interface MessageEventInit<T = any> extends EventInit {
97
+ data?: T
98
+ lastEventId?: string
99
+ origin?: string
100
+ ports?: (typeof MessagePort)[]
101
+ source?: typeof MessagePort | null
102
+ }
103
+
104
+ interface MessageEvent<T = any> extends Event {
105
+ readonly data: T
106
+ readonly lastEventId: string
107
+ readonly origin: string
108
+ readonly ports: ReadonlyArray<typeof MessagePort>
109
+ readonly source: typeof MessagePort | null
110
+ initMessageEvent(
111
+ type: string,
112
+ bubbles?: boolean,
113
+ cancelable?: boolean,
114
+ data?: any,
115
+ origin?: string,
116
+ lastEventId?: string,
117
+ source?: typeof MessagePort | null,
118
+ ports?: (typeof MessagePort)[]
119
+ ): void;
120
+ }
121
+
122
+ export declare const MessageEvent: {
123
+ prototype: MessageEvent
124
+ new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
125
+ }
126
+
127
+ interface ErrorEventInit extends EventInit {
128
+ message?: string
129
+ filename?: string
130
+ lineno?: number
131
+ colno?: number
132
+ error?: any
133
+ }
134
+
135
+ interface ErrorEvent extends Event {
136
+ readonly message: string
137
+ readonly filename: string
138
+ readonly lineno: number
139
+ readonly colno: number
140
+ readonly error: any
141
+ }
142
+
143
+ export declare const ErrorEvent: {
144
+ prototype: ErrorEvent
145
+ new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent
146
+ }
147
+
148
+ interface WebSocketInit {
149
+ protocols?: string | string[],
150
+ dispatcher?: Dispatcher,
151
+ headers?: HeadersInit
152
+ }
package/package.json CHANGED
@@ -87,7 +87,7 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "version": "2.0.915",
90
+ "version": "2.0.917",
91
91
  "jest": {
92
92
  "coverageProvider": "v8",
93
93
  "testMatch": [
@@ -1,9 +0,0 @@
1
- import Dispatcher from "./dispatcher";
2
-
3
- export declare class RedirectHandler implements Dispatcher.DispatchHandlers{
4
- constructor (dispatch: Dispatcher, maxRedirections: number, opts: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers)
5
- }
6
-
7
- export declare class DecoratorHandler implements Dispatcher.DispatchHandlers{
8
- constructor (handler: Dispatcher.DispatchHandlers)
9
- }