@powerlines/plugin-env 0.15.4 → 0.15.6

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 (264) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/babel/index.cjs +1 -0
  3. package/dist/babel/index.d.cts +1 -0
  4. package/dist/babel/index.d.mts +1 -0
  5. package/dist/babel/index.mjs +3 -0
  6. package/dist/babel/plugin.cjs +200 -0
  7. package/dist/babel/plugin.d.cts +8 -0
  8. package/dist/babel/plugin.d.mts +9 -0
  9. package/dist/babel/plugin.mjs +198 -0
  10. package/dist/components/docs.cjs +70 -3
  11. package/dist/components/docs.d.cts +8 -1
  12. package/dist/components/docs.d.mts +8 -1
  13. package/dist/components/docs.mjs +68 -2
  14. package/dist/components/env.cjs +574 -4
  15. package/dist/components/env.d.cts +19 -2
  16. package/dist/components/env.d.mts +19 -3
  17. package/dist/components/env.mjs +570 -2
  18. package/dist/components/index.cjs +5 -7
  19. package/dist/components/index.d.cts +2 -4
  20. package/dist/components/index.d.mts +2 -5
  21. package/dist/components/index.mjs +2 -4
  22. package/dist/deepkit/schemas/reflection.cjs +5368 -0
  23. package/dist/{plugin-BwuEBScL.d.cts → deepkit/schemas/reflection.d.cts} +1 -268
  24. package/dist/{plugin-BaInAuAh.d.mts → deepkit/schemas/reflection.d.mts} +59 -326
  25. package/dist/deepkit/schemas/reflection.mjs +5365 -0
  26. package/dist/deepkit/schemas/reflection2.cjs +4112 -0
  27. package/dist/deepkit/schemas/reflection2.mjs +4110 -0
  28. package/dist/deepkit/src/capnp.cjs +1692 -0
  29. package/dist/deepkit/src/capnp.mjs +1690 -0
  30. package/dist/deepkit/src/esbuild-plugin.cjs +99 -0
  31. package/dist/deepkit/src/esbuild-plugin.mjs +98 -0
  32. package/dist/deepkit/src/reflect-type.cjs +40 -0
  33. package/dist/deepkit/src/reflect-type.mjs +38 -0
  34. package/dist/deepkit/src/resolve-reflections.cjs +23 -0
  35. package/dist/deepkit/src/resolve-reflections.mjs +22 -0
  36. package/dist/deepkit/src/transformer.cjs +92 -0
  37. package/dist/deepkit/src/transformer.mjs +89 -0
  38. package/dist/deepkit/src/transpile.cjs +39 -0
  39. package/dist/deepkit/src/transpile.mjs +37 -0
  40. package/dist/deepkit/src/types.cjs +22 -0
  41. package/dist/deepkit/src/types.d.cts +10 -0
  42. package/dist/deepkit/src/types.d.mts +10 -0
  43. package/dist/deepkit/src/types.mjs +21 -0
  44. package/dist/deepkit/src/utilities.cjs +182 -0
  45. package/dist/deepkit/src/utilities.mjs +181 -0
  46. package/dist/helpers/automd-generator.cjs +32 -0
  47. package/dist/helpers/automd-generator.mjs +31 -0
  48. package/dist/helpers/create-reflection-resource.cjs +98 -0
  49. package/dist/helpers/create-reflection-resource.d.cts +15 -0
  50. package/dist/helpers/create-reflection-resource.d.mts +15 -0
  51. package/dist/helpers/create-reflection-resource.mjs +97 -0
  52. package/dist/helpers/index.cjs +6 -0
  53. package/dist/helpers/index.d.cts +6 -0
  54. package/dist/helpers/index.d.mts +6 -0
  55. package/dist/helpers/index.mjs +8 -0
  56. package/dist/helpers/load.cjs +134 -0
  57. package/dist/helpers/load.d.cts +35 -0
  58. package/dist/helpers/load.d.mts +36 -0
  59. package/dist/helpers/load.mjs +131 -0
  60. package/dist/helpers/persistence.cjs +320 -0
  61. package/dist/helpers/persistence.d.cts +84 -0
  62. package/dist/helpers/persistence.d.mts +84 -0
  63. package/dist/helpers/persistence.mjs +308 -0
  64. package/dist/helpers/reflect.cjs +263 -0
  65. package/dist/helpers/reflect.d.cts +46 -0
  66. package/dist/helpers/reflect.d.mts +46 -0
  67. package/dist/helpers/reflect.mjs +254 -0
  68. package/dist/helpers/source-file-env.cjs +58 -0
  69. package/dist/helpers/source-file-env.d.cts +8 -0
  70. package/dist/helpers/source-file-env.d.mts +8 -0
  71. package/dist/helpers/source-file-env.mjs +56 -0
  72. package/dist/helpers/template-helpers.cjs +70 -0
  73. package/dist/helpers/template-helpers.d.cts +15 -0
  74. package/dist/helpers/template-helpers.d.mts +15 -0
  75. package/dist/helpers/template-helpers.mjs +69 -0
  76. package/dist/index.cjs +82 -696
  77. package/dist/index.d.cts +16 -185
  78. package/dist/index.d.mts +17 -190
  79. package/dist/index.mjs +31 -648
  80. package/dist/plugin-alloy/src/core/components/output.cjs +45 -0
  81. package/dist/plugin-alloy/src/core/components/output.mjs +44 -0
  82. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +22 -0
  83. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +21 -0
  84. package/dist/plugin-alloy/src/core/components/source-file.cjs +64 -0
  85. package/dist/plugin-alloy/src/core/components/source-file.d.cts +23 -0
  86. package/dist/plugin-alloy/src/core/components/source-file.d.mts +23 -0
  87. package/dist/plugin-alloy/src/core/components/source-file.mjs +62 -0
  88. package/dist/plugin-alloy/src/core/contexts/context.cjs +136 -0
  89. package/dist/plugin-alloy/src/core/contexts/context.mjs +128 -0
  90. package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
  91. package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
  92. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +110 -0
  93. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +101 -0
  94. package/dist/plugin-alloy/src/helpers/refkey.cjs +23 -0
  95. package/dist/plugin-alloy/src/helpers/refkey.mjs +22 -0
  96. package/dist/plugin-alloy/src/index.cjs +93 -0
  97. package/dist/plugin-alloy/src/index.mjs +91 -0
  98. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +115 -0
  99. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +114 -0
  100. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +39 -0
  101. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +38 -0
  102. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +72 -0
  103. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +71 -0
  104. package/dist/plugin-alloy/src/types/components.cjs +22 -0
  105. package/dist/plugin-alloy/src/types/components.d.cts +22 -0
  106. package/dist/{components-8W0Zgj0y.d.mts → plugin-alloy/src/types/components.d.mts} +2 -1
  107. package/dist/plugin-alloy/src/types/components.mjs +21 -0
  108. package/dist/plugin-alloy/src/types/index.d.mts +2 -0
  109. package/dist/plugin-alloy/src/types/plugin.cjs +55 -0
  110. package/dist/plugin-alloy/src/types/plugin.d.cts +37 -0
  111. package/dist/plugin-alloy/src/types/plugin.d.mts +37 -0
  112. package/dist/plugin-alloy/src/types/plugin.mjs +52 -0
  113. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +57 -0
  114. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +25 -0
  115. package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +26 -0
  116. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +56 -0
  117. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +126 -0
  118. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +124 -0
  119. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +442 -0
  120. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +27 -0
  121. package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +28 -0
  122. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +433 -0
  123. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +194 -0
  124. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +14 -0
  125. package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +15 -0
  126. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +191 -0
  127. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +68 -0
  128. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +11 -0
  129. package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +12 -0
  130. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +67 -0
  131. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +124 -0
  132. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +123 -0
  133. package/dist/plugin-automd/src/index.cjs +127 -0
  134. package/dist/plugin-automd/src/index.mjs +124 -0
  135. package/dist/plugin-automd/src/types/plugin.cjs +47 -0
  136. package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
  137. package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
  138. package/dist/plugin-automd/src/types/plugin.mjs +47 -0
  139. package/dist/plugin-automd/src/types/toc.cjs +26 -0
  140. package/dist/plugin-automd/src/types/toc.d.cts +33 -0
  141. package/dist/plugin-automd/src/types/toc.d.mts +33 -0
  142. package/dist/plugin-automd/src/types/toc.mjs +25 -0
  143. package/dist/plugin-babel/src/helpers/ast-utils.cjs +74 -0
  144. package/dist/plugin-babel/src/helpers/ast-utils.mjs +70 -0
  145. package/dist/plugin-babel/src/helpers/create-plugin.cjs +71 -0
  146. package/dist/plugin-babel/src/helpers/create-plugin.mjs +69 -0
  147. package/dist/plugin-babel/src/helpers/filters.cjs +158 -0
  148. package/dist/plugin-babel/src/helpers/filters.mjs +154 -0
  149. package/dist/plugin-babel/src/helpers/index.cjs +5 -0
  150. package/dist/plugin-babel/src/helpers/index.mjs +7 -0
  151. package/dist/plugin-babel/src/helpers/module-helpers.cjs +200 -0
  152. package/dist/plugin-babel/src/helpers/module-helpers.mjs +192 -0
  153. package/dist/plugin-babel/src/helpers/options.cjs +74 -0
  154. package/dist/plugin-babel/src/helpers/options.mjs +71 -0
  155. package/dist/plugin-babel/src/index.cjs +134 -0
  156. package/dist/plugin-babel/src/index.mjs +132 -0
  157. package/dist/plugin-babel/src/types/index.d.mts +1 -0
  158. package/dist/plugin-babel/src/types/plugin.cjs +42 -0
  159. package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
  160. package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
  161. package/dist/plugin-babel/src/types/plugin.mjs +39 -0
  162. package/dist/powerlines/schemas/fs.d.mts +1 -0
  163. package/dist/powerlines/src/api.d.mts +7 -0
  164. package/dist/powerlines/src/index.d.mts +12 -0
  165. package/dist/powerlines/src/internal/helpers/hooks.cjs +119 -0
  166. package/dist/powerlines/src/internal/helpers/hooks.d.mts +5 -0
  167. package/dist/powerlines/src/internal/helpers/hooks.mjs +118 -0
  168. package/dist/powerlines/src/lib/build/esbuild.cjs +161 -0
  169. package/dist/powerlines/src/lib/build/esbuild.mjs +159 -0
  170. package/dist/powerlines/src/lib/entry.cjs +203 -0
  171. package/dist/powerlines/src/lib/entry.mjs +201 -0
  172. package/dist/powerlines/src/lib/logger.cjs +108 -0
  173. package/dist/powerlines/src/lib/logger.mjs +106 -0
  174. package/dist/powerlines/src/lib/utilities/bundle.cjs +67 -0
  175. package/dist/powerlines/src/lib/utilities/bundle.mjs +66 -0
  176. package/dist/powerlines/src/lib/utilities/resolve.cjs +49 -0
  177. package/dist/powerlines/src/lib/utilities/resolve.mjs +48 -0
  178. package/dist/powerlines/src/plugin-utils/paths.cjs +46 -0
  179. package/dist/powerlines/src/plugin-utils/paths.mjs +45 -0
  180. package/dist/powerlines/src/types/api.cjs +1 -0
  181. package/dist/powerlines/src/types/api.d.mts +5 -0
  182. package/dist/powerlines/src/types/api.mjs +3 -0
  183. package/dist/powerlines/src/types/babel.cjs +156 -0
  184. package/dist/powerlines/src/types/babel.d.cts +23 -0
  185. package/dist/powerlines/src/types/babel.d.mts +23 -0
  186. package/dist/powerlines/src/types/babel.mjs +147 -0
  187. package/dist/powerlines/src/types/build.cjs +105 -0
  188. package/dist/powerlines/src/types/build.d.cts +145 -0
  189. package/dist/powerlines/src/types/build.d.mts +147 -0
  190. package/dist/powerlines/src/types/build.mjs +101 -0
  191. package/dist/powerlines/src/types/commands.cjs +16 -0
  192. package/dist/powerlines/src/types/commands.d.cts +8 -0
  193. package/dist/powerlines/src/types/commands.d.mts +9 -0
  194. package/dist/powerlines/src/types/commands.mjs +15 -0
  195. package/dist/powerlines/src/types/config.cjs +306 -0
  196. package/dist/powerlines/src/types/config.d.cts +387 -0
  197. package/dist/powerlines/src/types/config.d.mts +388 -0
  198. package/dist/powerlines/src/types/config.mjs +293 -0
  199. package/dist/powerlines/src/types/context.cjs +324 -0
  200. package/dist/powerlines/src/types/context.d.cts +414 -0
  201. package/dist/powerlines/src/types/context.d.mts +416 -0
  202. package/dist/powerlines/src/types/context.mjs +311 -0
  203. package/dist/powerlines/src/types/fs.cjs +78 -0
  204. package/dist/powerlines/src/types/fs.d.cts +486 -0
  205. package/dist/powerlines/src/types/fs.d.mts +486 -0
  206. package/dist/powerlines/src/types/fs.mjs +75 -0
  207. package/dist/powerlines/src/types/hooks.cjs +52 -0
  208. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  209. package/dist/powerlines/src/types/hooks.mjs +48 -0
  210. package/dist/powerlines/src/types/index.cjs +11 -0
  211. package/dist/powerlines/src/types/index.d.mts +12 -0
  212. package/dist/powerlines/src/types/index.mjs +13 -0
  213. package/dist/powerlines/src/types/plugin.cjs +249 -0
  214. package/dist/powerlines/src/types/plugin.d.cts +231 -0
  215. package/dist/powerlines/src/types/plugin.d.mts +231 -0
  216. package/dist/powerlines/src/types/plugin.mjs +240 -0
  217. package/dist/powerlines/src/types/resolved.cjs +153 -0
  218. package/dist/powerlines/src/types/resolved.d.cts +82 -0
  219. package/dist/powerlines/src/types/resolved.d.mts +83 -0
  220. package/dist/powerlines/src/types/resolved.mjs +148 -0
  221. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  222. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  223. package/dist/powerlines/src/types/unplugin.cjs +1 -0
  224. package/dist/powerlines/src/types/unplugin.d.mts +7 -0
  225. package/dist/powerlines/src/types/unplugin.mjs +3 -0
  226. package/dist/types/index.cjs +10 -3
  227. package/dist/types/index.d.cts +2 -4
  228. package/dist/types/index.d.mts +2 -5
  229. package/dist/types/index.mjs +3 -4
  230. package/dist/types/plugin.cjs +133 -1
  231. package/dist/types/plugin.d.cts +156 -3
  232. package/dist/types/plugin.d.mts +158 -4
  233. package/dist/types/plugin.mjs +128 -2
  234. package/dist/types/runtime.cjs +242 -1
  235. package/dist/types/runtime.d.cts +793 -2
  236. package/dist/types/runtime.d.mts +793 -2
  237. package/dist/types/runtime.mjs +240 -2
  238. package/package.json +13 -9
  239. package/dist/components-C9bYrQVK.cjs +0 -0
  240. package/dist/components-CNIQFfeK.mjs +0 -1
  241. package/dist/create-reflection-resource-BNYxBgW2.mjs +0 -9846
  242. package/dist/create-reflection-resource-BWYhmX7O.cjs +0 -10085
  243. package/dist/docs-5r844zC1.d.mts +0 -9
  244. package/dist/docs-B66b9li3.mjs +0 -219
  245. package/dist/docs-_MmTNBQX.d.cts +0 -9
  246. package/dist/docs-hBlKCRWK.cjs +0 -224
  247. package/dist/env-BPodCdD1.d.cts +0 -116
  248. package/dist/env-IQvgnabX.mjs +0 -1578
  249. package/dist/env-cO4BUDn1.cjs +0 -1596
  250. package/dist/env-zhzvpUI5.d.mts +0 -98
  251. package/dist/index-BXxhKmeA.d.mts +0 -1
  252. package/dist/index-Cc7fCJU9.d.mts +0 -1
  253. package/dist/index-CqdNToYT.d.cts +0 -1
  254. package/dist/index-DWPDThxu.d.cts +0 -1
  255. package/dist/plugin-D3B5E_Hg.mjs +0 -1
  256. package/dist/plugin-D5qyQPqC.cjs +0 -0
  257. package/dist/resolved-BZG2cwRG.d.cts +0 -1789
  258. package/dist/resolved-V5COsfDu.d.mts +0 -1791
  259. package/dist/runtime-Bisl_1Ja.cjs +0 -0
  260. package/dist/runtime-Q8Ni8SeN.d.cts +0 -794
  261. package/dist/runtime-azNoeKr-.mjs +0 -1
  262. package/dist/runtime-qZ0Z2kEd.d.mts +0 -794
  263. package/dist/types-DwElXV6q.mjs +0 -1
  264. package/dist/types-MYBaygjr.cjs +0 -0
@@ -0,0 +1,1692 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_reflection = require('../schemas/reflection.cjs');
3
+ let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
4
+ let __stryke_capnp = require("@stryke/capnp");
5
+ let __stryke_type_checks = require("@stryke/type-checks");
6
+
7
+ //#region ../deepkit/src/capnp.ts
8
+ function __assignType(fn, args) {
9
+ fn.__type = args;
10
+ return fn;
11
+ }
12
+ /**
13
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
14
+ *
15
+ * @param serializedTypes - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
16
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
17
+ */
18
+ function convertToCapnp(serializedTypes, result) {
19
+ if (!serializedTypes || !Array.isArray(serializedTypes) || serializedTypes.length === 0) throw new Error("Invalid serialized type provided for conversion.");
20
+ if (serializedTypes.length !== result.length) throw new Error(`Mismatch in length of serialized types: expected ${result.length}, got ${serializedTypes.length}.`);
21
+ serializedTypes.filter(__assignType((serializedType) => (0, __stryke_type_checks.isSetObject)(serializedType) && !(0, __stryke_type_checks.isUndefined)(serializedType.kind), [
22
+ "serializedType",
23
+ "",
24
+ "P\"2!\"/\""
25
+ ])).forEach(__assignType((serializedType, index) => {
26
+ convertToCapnpBase(serializedType, result.get(index)._initType());
27
+ }, [
28
+ "serializedType",
29
+ "index",
30
+ "",
31
+ "P\"2!\"2\"\"/#"
32
+ ]));
33
+ return result;
34
+ }
35
+ convertToCapnp.__type = [
36
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypes,
37
+ "serializedTypes",
38
+ () => __stryke_capnp.List,
39
+ "result",
40
+ () => __stryke_capnp.List,
41
+ "convertToCapnp",
42
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
43
+ "Pn!2\"P!7#2$P!7%/&?'"
44
+ ];
45
+ /**
46
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
47
+ *
48
+ * @param serializedTypes - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema
49
+ * @returns The [Deepkit](https://deepkit.io/) {@link SerializedTypes | serialized types} converted from the Cap'n Proto serialized type
50
+ */
51
+ function convertFromCapnp(serializedTypes) {
52
+ if (!serializedTypes) throw new Error("Invalid serialized type provided for conversion.");
53
+ const result = [];
54
+ serializedTypes.forEach(__assignType((serializedType) => {
55
+ const deserializedType = convertFromCapnpBase(serializedType.type);
56
+ result.push(deserializedType);
57
+ }, [
58
+ "serializedType",
59
+ "",
60
+ "P\"2!\"/\""
61
+ ]));
62
+ return result;
63
+ }
64
+ convertFromCapnp.__type = [
65
+ () => __stryke_capnp.List,
66
+ "serializedTypes",
67
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypes,
68
+ "convertFromCapnp",
69
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
70
+ "PP!7!2\"n#/$?%"
71
+ ];
72
+ /**
73
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
74
+ *
75
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
76
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
77
+ */
78
+ function convertToCapnpTagsReflection(result, serializedType) {
79
+ if (serializedType?.alias?.length) {
80
+ const alias = result._initAlias(serializedType.alias.length);
81
+ serializedType.alias.forEach(__assignType((a, index) => {
82
+ alias.set(index, a);
83
+ }, [
84
+ "a",
85
+ "index",
86
+ "",
87
+ "P\"2!\"2\"\"/#"
88
+ ]));
89
+ }
90
+ result.hidden = serializedType?.hidden ?? false;
91
+ result.ignore = serializedType?.ignore ?? false;
92
+ result.internal = serializedType?.internal ?? false;
93
+ result.readonly = serializedType?.readonly ?? false;
94
+ if (serializedType?.title) result.title = serializedType?.title;
95
+ if (serializedType?.domain) result.domain = serializedType?.domain;
96
+ if (serializedType?.permission?.length) {
97
+ const permission = result._initPermission(serializedType.permission.length);
98
+ serializedType.permission?.forEach(__assignType((p, index) => {
99
+ permission.set(index, p);
100
+ }, [
101
+ "p",
102
+ "index",
103
+ "",
104
+ "P\"2!\"2\"\"/#"
105
+ ]));
106
+ }
107
+ return result;
108
+ }
109
+ convertToCapnpTagsReflection.__type = [
110
+ "result",
111
+ () => __powerlines_deepkit_vendor_type.__ΩTagsReflection,
112
+ "serializedType",
113
+ "convertToCapnpTagsReflection",
114
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
115
+ "P!2!n\"2#8!/$?%"
116
+ ];
117
+ const __ΩWithTagsReflection = [
118
+ "",
119
+ "_hasTags",
120
+ "alias",
121
+ "hidden",
122
+ "domain",
123
+ "title",
124
+ "ignore",
125
+ "internal",
126
+ "readonly",
127
+ "permission",
128
+ "tags",
129
+ "WithTagsReflection",
130
+ "PP)/!4\"P&F4#)4$&4%&4&)4')4()4)&F4*M4+8Mw,y"
131
+ ];
132
+ function convertFromCapnpTagsReflection(serializedType) {
133
+ return serializedType._hasTags() ? {
134
+ alias: serializedType.tags?.alias?.length ? serializedType.tags?.alias.map(__assignType((value) => value, [
135
+ "value",
136
+ "",
137
+ "P\"2!\"/\""
138
+ ])) : void 0,
139
+ hidden: serializedType.tags?.hidden,
140
+ domain: serializedType.tags?.domain ? serializedType.tags.domain : void 0,
141
+ title: serializedType.tags?.title ? serializedType.tags.title : void 0,
142
+ ignore: serializedType.tags?.ignore,
143
+ internal: serializedType.tags?.internal,
144
+ readonly: serializedType.tags?.readonly,
145
+ permission: serializedType.tags?.permission?.length ? serializedType.tags?.permission?.map(__assignType((value) => value, [
146
+ "value",
147
+ "",
148
+ "P\"2!\"/\""
149
+ ])) : void 0
150
+ } : void 0;
151
+ }
152
+ convertFromCapnpTagsReflection.__type = [
153
+ () => __ΩWithTagsReflection,
154
+ "serializedType",
155
+ "convertFromCapnpTagsReflection",
156
+ "Pn!2\"\"/#"
157
+ ];
158
+ const __ΩCapnpIndexAccessOriginSerializedType = [
159
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeReference,
160
+ "container",
161
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeReference,
162
+ "index",
163
+ "CapnpIndexAccessOriginSerializedType",
164
+ "Pn!4\"n#4$Mw%y"
165
+ ];
166
+ /**
167
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
168
+ *
169
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
170
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
171
+ */
172
+ function convertToCapnpIndexAccessOrigin(result, serializedType) {
173
+ const indexAccessOriginIndex = result._initIndex();
174
+ indexAccessOriginIndex.id = serializedType?.index ?? 0;
175
+ const indexAccessOriginContainer = result._initContainer();
176
+ indexAccessOriginContainer.id = serializedType?.container ?? 0;
177
+ return result;
178
+ }
179
+ convertToCapnpIndexAccessOrigin.__type = [
180
+ "result",
181
+ () => __ΩCapnpIndexAccessOriginSerializedType,
182
+ "serializedType",
183
+ "convertToCapnpIndexAccessOrigin",
184
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
185
+ "P!2!n\"2#8!/$?%"
186
+ ];
187
+ const __ΩWithIndexAccessOrigin = [
188
+ "",
189
+ "_hasIndexAccessOrigin",
190
+ "id",
191
+ "container",
192
+ "index",
193
+ "indexAccessOrigin",
194
+ "WithIndexAccessOrigin",
195
+ "PP)/!4\"PP'4#M4$P'4#M4%M4&8Mw'y"
196
+ ];
197
+ function convertFromCapnpIndexAccessOrigin(serializedType) {
198
+ return serializedType._hasIndexAccessOrigin() ? {
199
+ container: Number(serializedType.indexAccessOrigin?.container.id),
200
+ index: Number(serializedType.indexAccessOrigin?.index.id)
201
+ } : void 0;
202
+ }
203
+ convertFromCapnpIndexAccessOrigin.__type = [
204
+ () => __ΩWithIndexAccessOrigin,
205
+ "serializedType",
206
+ "convertFromCapnpIndexAccessOrigin",
207
+ "Pn!2\"\"/#"
208
+ ];
209
+ /**
210
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
211
+ *
212
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
213
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
214
+ */
215
+ function convertToCapnpBase(serializedType, result) {
216
+ if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral) convertToCapnpObjectLiteral(serializedType, result._initObjectLiteral());
217
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.class) convertToCapnpClassType(serializedType, result._initClassType());
218
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.parameter) convertToCapnpParameter(serializedType, result._initParameter());
219
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.function) convertToCapnpFunction(serializedType, result._initFunction());
220
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.method) convertToCapnpMethod(serializedType, result._initMethod());
221
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.infer) convertToCapnpInfer(serializedType, result._initInfer());
222
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.union) convertToCapnpUnion(serializedType, result._initUnion());
223
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array) convertToCapnpArray(serializedType, result._initArray());
224
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.intersection) convertToCapnpIntersection(serializedType, result._initIntersection());
225
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.enum) convertToCapnpEnum(serializedType, result._initEnum());
226
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.property) convertToCapnpProperty(serializedType, result._initProperty());
227
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.tuple) convertToCapnpTuple(serializedType, result._initTuple());
228
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.tupleMember) convertToCapnpTupleMember(serializedType, result._initTupleMember());
229
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.propertySignature) convertToCapnpPropertySignature(serializedType, result._initPropertySignature());
230
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.methodSignature) convertToCapnpMethodSignature(serializedType, result._initMethodSignature());
231
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal) convertToCapnpLiteral(serializedType, result._initLiteral());
232
+ else if (serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.never || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.any || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.unknown || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.void || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.object || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.symbol || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.bigint || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.null || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.undefined || serializedType.kind === __powerlines_deepkit_vendor_type.ReflectionKind.regexp) convertToCapnpSimple(serializedType, result._initSimple());
233
+ else convertToCapnpOther(serializedType, result._initOther());
234
+ return result;
235
+ }
236
+ convertToCapnpBase.__type = [
237
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedType,
238
+ "serializedType",
239
+ () => require_reflection.SerializedType_Type,
240
+ "result",
241
+ () => require_reflection.SerializedType_Type,
242
+ "convertToCapnpBase",
243
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
244
+ "Pn!2\"P7#2$P7%/&?'"
245
+ ];
246
+ function convertFromCapnpBase(serializedType) {
247
+ if (serializedType._isObjectLiteral) return convertFromCapnpObjectLiteral(serializedType.objectLiteral);
248
+ else if (serializedType._isClassType) return convertFromCapnpClassType(serializedType.classType);
249
+ else if (serializedType._isParameter) return convertFromCapnpParameter(serializedType.parameter);
250
+ else if (serializedType._isFunction) return convertFromCapnpFunction(serializedType.function);
251
+ else if (serializedType._isInfer) return convertFromCapnpInfer(serializedType.infer);
252
+ else if (serializedType._isMethod) return convertFromCapnpMethod(serializedType.method);
253
+ else if (serializedType._isUnion) return convertFromCapnpUnion(serializedType.union);
254
+ else if (serializedType._isArray) return convertFromCapnpArray(serializedType.array);
255
+ else if (serializedType._isIntersection) return convertFromCapnpIntersection(serializedType.intersection);
256
+ else if (serializedType._isEnum) return convertFromCapnpEnum(serializedType.enum);
257
+ else if (serializedType._isProperty) return convertFromCapnpProperty(serializedType.property);
258
+ else if (serializedType._isTuple) return convertFromCapnpTuple(serializedType.tuple);
259
+ else if (serializedType._isTupleMember) return convertFromCapnpTupleMember(serializedType.tupleMember);
260
+ else if (serializedType._isPropertySignature) return convertFromCapnpPropertySignature(serializedType.propertySignature);
261
+ else if (serializedType._isMethodSignature) return convertFromCapnpMethodSignature(serializedType.methodSignature);
262
+ else if (serializedType._isLiteral) return convertFromCapnpLiteral(serializedType.literal);
263
+ else if (serializedType._isSimple) return convertFromCapnpSimple(serializedType.simple);
264
+ else if (serializedType._isOther) return convertFromCapnpOther(serializedType.other);
265
+ else throw new Error(`Unsupported serialized type kind: ${serializedType.toString()}`);
266
+ }
267
+ convertFromCapnpBase.__type = [
268
+ () => require_reflection.SerializedType_Type,
269
+ "serializedType",
270
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedType,
271
+ "convertFromCapnpBase",
272
+ "PP7!2\"n#/$"
273
+ ];
274
+ function convertFromCapnpOther(serializedType) {
275
+ return {
276
+ kind: serializedType.kind,
277
+ typeName: serializedType.typeName || void 0
278
+ };
279
+ }
280
+ convertFromCapnpOther.__type = [
281
+ "serializedType",
282
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedType,
283
+ "convertFromCapnpOther",
284
+ "P!2!n\"/#"
285
+ ];
286
+ function convertFromCapnpSimple(serializedType) {
287
+ const result = {
288
+ kind: serializedType.kind,
289
+ typeName: serializedType.typeName || void 0,
290
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
291
+ "d",
292
+ "",
293
+ "P\"2!\"/\""
294
+ ])) : void 0,
295
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
296
+ "t",
297
+ "",
298
+ "P\"2!\"/\""
299
+ ])) : void 0,
300
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
301
+ };
302
+ if (serializedType._hasOrigin()) result.origin = Number(serializedType.origin.id);
303
+ return result;
304
+ }
305
+ convertFromCapnpSimple.__type = [
306
+ "serializedType",
307
+ () => __powerlines_deepkit_vendor_type.__ΩSimpleSerializedType,
308
+ "convertFromCapnpSimple",
309
+ "P!2!n\"/#"
310
+ ];
311
+ function convertToCapnpOther(serializedType, result) {
312
+ result.kind = serializedType.kind;
313
+ result.typeName = serializedType.typeName || "";
314
+ return result;
315
+ }
316
+ convertToCapnpOther.__type = [
317
+ () => __powerlines_deepkit_vendor_type.__ΩReflectionKind,
318
+ "kind",
319
+ "typeName",
320
+ "serializedType",
321
+ "result",
322
+ "convertToCapnpOther",
323
+ "PPn!4\"&4#8M2$!2%!/&"
324
+ ];
325
+ function convertToCapnpSimple(serializedType, result) {
326
+ result.kind = serializedType.kind;
327
+ result.typeName = serializedType.typeName || "";
328
+ if (serializedType.origin) {
329
+ result._initOrigin();
330
+ result.origin.id = serializedType.origin ?? 0;
331
+ }
332
+ if (serializedType.decorators?.length) {
333
+ const decorators = result._initDecorators(serializedType.decorators.length);
334
+ serializedType.decorators.forEach(__assignType((d, index) => {
335
+ const decorator = decorators.get(index);
336
+ decorator.id = d;
337
+ }, [
338
+ "d",
339
+ "index",
340
+ "",
341
+ "P\"2!\"2\"\"/#"
342
+ ]));
343
+ }
344
+ if (serializedType.typeArguments?.length) {
345
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
346
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
347
+ const typeArgument = typeArguments.get(index);
348
+ typeArgument.id = t;
349
+ }, [
350
+ "t",
351
+ "index",
352
+ "",
353
+ "P\"2!\"2\"\"/#"
354
+ ]));
355
+ }
356
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
357
+ return result;
358
+ }
359
+ convertToCapnpSimple.__type = [
360
+ () => __powerlines_deepkit_vendor_type.__ΩSimpleSerializedType,
361
+ "serializedType",
362
+ "result",
363
+ "convertToCapnpSimple",
364
+ "Pn!2\"!2#!/$"
365
+ ];
366
+ function convertFromCapnpLiteral(serializedType) {
367
+ return {
368
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.literal,
369
+ literal: serializedType.literal._isString ? serializedType.literal.string : serializedType.literal._isNumber ? serializedType.literal.number : serializedType.literal._isBoolean ? serializedType.literal.boolean : serializedType.literal._isBigint ? {
370
+ type: "bigint",
371
+ value: serializedType.literal.bigint.value
372
+ } : serializedType.literal._isSymbol ? {
373
+ type: "symbol",
374
+ name: serializedType.literal.symbol.name
375
+ } : {
376
+ type: "regex",
377
+ regex: serializedType.literal.regex.regex
378
+ },
379
+ typeName: serializedType.typeName || void 0,
380
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
381
+ "d",
382
+ "",
383
+ "P\"2!\"/\""
384
+ ])) : void 0,
385
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
386
+ "t",
387
+ "",
388
+ "P\"2!\"/\""
389
+ ])) : void 0,
390
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
391
+ };
392
+ }
393
+ convertFromCapnpLiteral.__type = [
394
+ "serializedType",
395
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeLiteral,
396
+ "convertFromCapnpLiteral",
397
+ "P!2!n\"/#"
398
+ ];
399
+ function convertToCapnpLiteral(serializedType, result) {
400
+ result.kind = serializedType.kind;
401
+ result.typeName = serializedType.typeName || "";
402
+ const literalType = result._initLiteral();
403
+ if (typeof serializedType.literal === "boolean") literalType.boolean = serializedType.literal;
404
+ else if (typeof serializedType.literal === "number") literalType.number = serializedType.literal;
405
+ else if (typeof serializedType.literal === "string") literalType.string = serializedType.literal;
406
+ else if (serializedType.literal.type === "bigint") {
407
+ const literalTypeBigint = literalType._initBigint();
408
+ literalTypeBigint.type = "bigint";
409
+ literalTypeBigint.value = serializedType.literal.value;
410
+ } else if (serializedType.literal.type === "symbol") {
411
+ const literalTypeSymbol = literalType._initSymbol();
412
+ literalTypeSymbol.type = "symbol";
413
+ literalTypeSymbol.name = serializedType.literal.name.toString().slice(7, -1);
414
+ } else if (serializedType.literal.type === "regex") {
415
+ const literalTypeRegex = literalType._initRegex();
416
+ literalTypeRegex.type = "regex";
417
+ literalTypeRegex.regex = serializedType.literal.regex;
418
+ }
419
+ if (serializedType.decorators?.length) {
420
+ const decorators = result._initDecorators(serializedType.decorators.length);
421
+ serializedType.decorators.forEach(__assignType((d, index) => {
422
+ const decorator = decorators.get(index);
423
+ decorator.id = d;
424
+ }, [
425
+ "d",
426
+ "index",
427
+ "",
428
+ "P\"2!\"2\"\"/#"
429
+ ]));
430
+ }
431
+ if (serializedType.typeArguments?.length) {
432
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
433
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
434
+ const typeArgument = typeArguments.get(index);
435
+ typeArgument.id = t;
436
+ }, [
437
+ "t",
438
+ "index",
439
+ "",
440
+ "P\"2!\"2\"\"/#"
441
+ ]));
442
+ }
443
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
444
+ return result;
445
+ }
446
+ convertToCapnpLiteral.__type = [
447
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeLiteral,
448
+ "serializedType",
449
+ "result",
450
+ "convertToCapnpLiteral",
451
+ "Pn!2\"!2#!/$"
452
+ ];
453
+ function convertFromCapnpMethodSignature(serializedType) {
454
+ return {
455
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.methodSignature,
456
+ name: serializedType.name,
457
+ typeName: serializedType.typeName || void 0,
458
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
459
+ "d",
460
+ "",
461
+ "P\"2!\"/\""
462
+ ])) : void 0,
463
+ parameters: serializedType._hasParameters() ? serializedType.parameters.map(__assignType((p) => convertFromCapnpParameter(p), [
464
+ "p",
465
+ "",
466
+ "P\"2!\"/\""
467
+ ])) : [],
468
+ return: serializedType.return.id,
469
+ tags: convertFromCapnpTagsReflection(serializedType)
470
+ };
471
+ }
472
+ convertFromCapnpMethodSignature.__type = [
473
+ "serializedType",
474
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeMethodSignature,
475
+ "convertFromCapnpMethodSignature",
476
+ "P!2!n\"/#"
477
+ ];
478
+ function convertToCapnpMethodSignature(serializedType, result) {
479
+ result.kind = serializedType.kind;
480
+ result.name = String(serializedType.name);
481
+ result.typeName = serializedType.typeName || "";
482
+ if (serializedType.decorators?.length) {
483
+ const decorators = result._initDecorators(serializedType.decorators.length);
484
+ serializedType.decorators.forEach(__assignType((d, index) => {
485
+ const decorator = decorators.get(index);
486
+ decorator.id = d;
487
+ }, [
488
+ "d",
489
+ "index",
490
+ "",
491
+ "P\"2!\"2\"\"/#"
492
+ ]));
493
+ }
494
+ if (serializedType.typeArguments?.length) {
495
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
496
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
497
+ const typeArgument = typeArguments.get(index);
498
+ typeArgument.id = t;
499
+ }, [
500
+ "t",
501
+ "index",
502
+ "",
503
+ "P\"2!\"2\"\"/#"
504
+ ]));
505
+ }
506
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
507
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
508
+ return result;
509
+ }
510
+ convertToCapnpMethodSignature.__type = [
511
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeMethodSignature,
512
+ "serializedType",
513
+ "result",
514
+ "convertToCapnpMethodSignature",
515
+ "Pn!2\"!2#!/$"
516
+ ];
517
+ function convertFromCapnpPropertySignature(serializedType) {
518
+ return {
519
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.propertySignature,
520
+ name: serializedType.name,
521
+ typeName: serializedType.typeName || void 0,
522
+ description: serializedType.description,
523
+ default: convertFromCapnpDefault(serializedType.default),
524
+ optional: serializedType.optional ? true : void 0,
525
+ readonly: serializedType.readonly ? true : void 0,
526
+ type: serializedType.type.id,
527
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
528
+ "d",
529
+ "",
530
+ "P\"2!\"/\""
531
+ ])) : void 0,
532
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
533
+ "t",
534
+ "",
535
+ "P\"2!\"/\""
536
+ ])) : void 0,
537
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
538
+ tags: convertFromCapnpTagsReflection(serializedType)
539
+ };
540
+ }
541
+ convertFromCapnpPropertySignature.__type = [
542
+ "serializedType",
543
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypePropertySignature,
544
+ "convertFromCapnpPropertySignature",
545
+ "P!2!n\"/#"
546
+ ];
547
+ function convertToCapnpDefault(defaultValue, result) {
548
+ if (typeof defaultValue !== "undefined" && defaultValue !== "") {
549
+ result._initValue();
550
+ if (typeof defaultValue === "string") result.value.string = defaultValue;
551
+ else if (typeof defaultValue === "number") if ((0, __stryke_type_checks.isInteger)(defaultValue)) result.value.integer = defaultValue;
552
+ else result.value.float = defaultValue;
553
+ else if (typeof defaultValue === "boolean") result.value.boolean = defaultValue;
554
+ }
555
+ }
556
+ convertToCapnpDefault.__type = [
557
+ "defaultValue",
558
+ "result",
559
+ "convertToCapnpDefault",
560
+ "P\"2!!2\"\"/#"
561
+ ];
562
+ function convertFromCapnpDefault(serializedType) {
563
+ if (typeof serializedType.value === "undefined") return;
564
+ else if (serializedType.value._isBoolean) return serializedType.value.boolean;
565
+ else if (serializedType.value._isInteger) return serializedType.value.integer;
566
+ else if (serializedType.value._isFloat) return serializedType.value.float;
567
+ else if (serializedType.value._isString) return serializedType.value.string;
568
+ }
569
+ convertFromCapnpDefault.__type = [
570
+ "serializedType",
571
+ "convertFromCapnpDefault",
572
+ "P!2!\"/\""
573
+ ];
574
+ function convertToCapnpPropertySignature(serializedType, result) {
575
+ result.kind = serializedType.kind;
576
+ result.name = String(serializedType.name) || "";
577
+ result.typeName = serializedType.typeName || "";
578
+ result.description = serializedType.description || "";
579
+ result.optional = serializedType.optional ?? false;
580
+ result.readonly = serializedType.readonly ?? false;
581
+ if (typeof serializedType.default !== "undefined") {
582
+ const defaultValue = result._initDefault();
583
+ convertToCapnpDefault(serializedType.default, defaultValue);
584
+ }
585
+ const type = result._initType();
586
+ type.id = serializedType.type;
587
+ if (serializedType.decorators?.length) {
588
+ const decorators = result._initDecorators(serializedType.decorators.length);
589
+ serializedType.decorators.forEach(__assignType((d, index) => {
590
+ const decorator = decorators.get(index);
591
+ decorator.id = d;
592
+ }, [
593
+ "d",
594
+ "index",
595
+ "",
596
+ "P\"2!\"2\"\"/#"
597
+ ]));
598
+ }
599
+ if (serializedType.typeArguments?.length) {
600
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
601
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
602
+ const typeArgument = typeArguments.get(index);
603
+ typeArgument.id = t;
604
+ }, [
605
+ "t",
606
+ "index",
607
+ "",
608
+ "P\"2!\"2\"\"/#"
609
+ ]));
610
+ }
611
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
612
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
613
+ return result;
614
+ }
615
+ convertToCapnpPropertySignature.__type = [
616
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypePropertySignature,
617
+ "serializedType",
618
+ "result",
619
+ "convertToCapnpPropertySignature",
620
+ "Pn!2\"!2#!/$"
621
+ ];
622
+ function convertToCapnpTupleMember(serializedType, result) {
623
+ result.kind = serializedType.kind;
624
+ result.typeName = serializedType.typeName || "";
625
+ const type = result._initType();
626
+ type.id = serializedType.type;
627
+ if (serializedType.decorators?.length) {
628
+ const decorators = result._initDecorators(serializedType.decorators.length);
629
+ serializedType.decorators.forEach(__assignType((d, index) => {
630
+ const decorator = decorators.get(index);
631
+ decorator.id = d;
632
+ }, [
633
+ "d",
634
+ "index",
635
+ "",
636
+ "P\"2!\"2\"\"/#"
637
+ ]));
638
+ }
639
+ if (serializedType.typeArguments?.length) {
640
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
641
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
642
+ const typeArgument = typeArguments.get(index);
643
+ typeArgument.id = t;
644
+ }, [
645
+ "t",
646
+ "index",
647
+ "",
648
+ "P\"2!\"2\"\"/#"
649
+ ]));
650
+ }
651
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
652
+ return result;
653
+ }
654
+ convertToCapnpTupleMember.__type = [
655
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeTupleMember,
656
+ "serializedType",
657
+ "result",
658
+ "convertToCapnpTupleMember",
659
+ "Pn!2\"!2#!/$"
660
+ ];
661
+ function convertFromCapnpTupleMember(serializedType) {
662
+ return {
663
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.tupleMember,
664
+ type: serializedType.type.id,
665
+ typeName: serializedType.typeName || void 0,
666
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
667
+ "d",
668
+ "",
669
+ "P\"2!\"/\""
670
+ ])) : void 0,
671
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
672
+ "t",
673
+ "",
674
+ "P\"2!\"/\""
675
+ ])) : void 0,
676
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
677
+ };
678
+ }
679
+ convertFromCapnpTupleMember.__type = [
680
+ "serializedType",
681
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeTupleMember,
682
+ "convertFromCapnpTupleMember",
683
+ "P!2!n\"/#"
684
+ ];
685
+ function convertToCapnpTuple(serializedType, result) {
686
+ result.kind = serializedType.kind;
687
+ result.typeName = serializedType.typeName || "";
688
+ const types = result._initTypes(serializedType.types.length);
689
+ serializedType.types.forEach(__assignType((t, index) => {
690
+ convertToCapnpTupleMember(t, types.get(index));
691
+ }, [
692
+ "t",
693
+ "index",
694
+ "",
695
+ "P\"2!\"2\"\"/#"
696
+ ]));
697
+ if (serializedType.decorators?.length) {
698
+ const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
699
+ serializedType.decorators?.forEach(__assignType((d, index) => {
700
+ const decorator = decorators.get(index);
701
+ decorator.id = d;
702
+ }, [
703
+ "d",
704
+ "index",
705
+ "",
706
+ "P\"2!\"2\"\"/#"
707
+ ]));
708
+ }
709
+ if (serializedType.typeArguments?.length) {
710
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
711
+ serializedType.typeArguments?.forEach(__assignType((t, index) => {
712
+ const typeArgument = typeArguments.get(index);
713
+ typeArgument.id = t;
714
+ }, [
715
+ "t",
716
+ "index",
717
+ "",
718
+ "P\"2!\"2\"\"/#"
719
+ ]));
720
+ }
721
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
722
+ return result;
723
+ }
724
+ convertToCapnpTuple.__type = [
725
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeTuple,
726
+ "serializedType",
727
+ "result",
728
+ "convertToCapnpTuple",
729
+ "Pn!2\"!2#!/$"
730
+ ];
731
+ function convertFromCapnpTuple(serializedType) {
732
+ return {
733
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.tuple,
734
+ typeName: serializedType.typeName || void 0,
735
+ types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => convertFromCapnpTupleMember(t), [
736
+ "t",
737
+ "",
738
+ "P\"2!\"/\""
739
+ ])) : [],
740
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
741
+ "d",
742
+ "",
743
+ "P\"2!\"/\""
744
+ ])) : void 0,
745
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
746
+ "t",
747
+ "",
748
+ "P\"2!\"/\""
749
+ ])) : void 0,
750
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
751
+ };
752
+ }
753
+ convertFromCapnpTuple.__type = [
754
+ "serializedType",
755
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeTuple,
756
+ "convertFromCapnpTuple",
757
+ "P!2!n\"/#"
758
+ ];
759
+ function convertToCapnpProperty(serializedType, result) {
760
+ result.kind = serializedType.kind;
761
+ result.typeName = serializedType.typeName || "";
762
+ result.description = serializedType.description || "";
763
+ result.optional = serializedType.optional ?? false;
764
+ result.readonly = serializedType.readonly ?? false;
765
+ result.visibility = serializedType.visibility === __powerlines_deepkit_vendor_type.ReflectionVisibility.public ? require_reflection.ReflectionVisibility.PUBLIC : serializedType.visibility === __powerlines_deepkit_vendor_type.ReflectionVisibility.protected ? require_reflection.ReflectionVisibility.PROTECTED : require_reflection.ReflectionVisibility.PRIVATE;
766
+ result.abstract = serializedType.abstract ?? false;
767
+ result.name = String(serializedType.name) || "";
768
+ if (typeof serializedType.default !== "undefined") {
769
+ const defaultValue = result._initDefault();
770
+ convertToCapnpDefault(serializedType.default, defaultValue);
771
+ }
772
+ const type = result._initType();
773
+ type.id = serializedType.type;
774
+ if (serializedType.decorators?.length) {
775
+ const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
776
+ serializedType.decorators?.forEach(__assignType((d, index) => {
777
+ const decorator = decorators.get(index);
778
+ decorator.id = d;
779
+ }, [
780
+ "d",
781
+ "index",
782
+ "",
783
+ "P\"2!\"2\"\"/#"
784
+ ]));
785
+ }
786
+ if (serializedType.typeArguments?.length) {
787
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
788
+ serializedType.typeArguments?.forEach(__assignType((t, index) => {
789
+ const typeArgument = typeArguments.get(index);
790
+ typeArgument.id = t;
791
+ }, [
792
+ "t",
793
+ "index",
794
+ "",
795
+ "P\"2!\"2\"\"/#"
796
+ ]));
797
+ }
798
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
799
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
800
+ return result;
801
+ }
802
+ convertToCapnpProperty.__type = [
803
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeProperty,
804
+ "serializedType",
805
+ "result",
806
+ "convertToCapnpProperty",
807
+ "Pn!2\"!2#!/$"
808
+ ];
809
+ function convertFromCapnpProperty(serializedType) {
810
+ return {
811
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.property,
812
+ typeName: serializedType.typeName || void 0,
813
+ description: serializedType.description,
814
+ default: convertFromCapnpDefault(serializedType.default),
815
+ optional: serializedType.optional ? true : void 0,
816
+ readonly: serializedType.readonly ? true : void 0,
817
+ visibility: serializedType.visibility === require_reflection.ReflectionVisibility.PUBLIC ? __powerlines_deepkit_vendor_type.ReflectionVisibility.public : serializedType.visibility === require_reflection.ReflectionVisibility.PROTECTED ? __powerlines_deepkit_vendor_type.ReflectionVisibility.protected : __powerlines_deepkit_vendor_type.ReflectionVisibility.private,
818
+ abstract: serializedType.abstract ? true : void 0,
819
+ name: serializedType.name,
820
+ type: serializedType.type.id,
821
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
822
+ "d",
823
+ "",
824
+ "P\"2!\"/\""
825
+ ])) : void 0,
826
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
827
+ "t",
828
+ "",
829
+ "P\"2!\"/\""
830
+ ])) : void 0,
831
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
832
+ tags: convertFromCapnpTagsReflection(serializedType)
833
+ };
834
+ }
835
+ convertFromCapnpProperty.__type = [
836
+ "serializedType",
837
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeProperty,
838
+ "convertFromCapnpProperty",
839
+ "P!2!n\"/#"
840
+ ];
841
+ function convertToCapnpEnum(serializedType, result) {
842
+ result.kind = serializedType.kind;
843
+ result.typeName = serializedType.typeName || "";
844
+ const indexType = result._initIndexType();
845
+ indexType.id = serializedType.indexType;
846
+ if (serializedType.decorators?.length) {
847
+ const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
848
+ serializedType.decorators?.forEach(__assignType((d, index) => {
849
+ const decorator = decorators.get(index);
850
+ decorator.id = d;
851
+ }, [
852
+ "d",
853
+ "index",
854
+ "",
855
+ "P\"2!\"2\"\"/#"
856
+ ]));
857
+ }
858
+ if (serializedType.typeArguments?.length) {
859
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
860
+ serializedType.typeArguments?.forEach(__assignType((t, index) => {
861
+ const typeArgument = typeArguments.get(index);
862
+ typeArgument.id = t;
863
+ }, [
864
+ "t",
865
+ "index",
866
+ "",
867
+ "P\"2!\"2\"\"/#"
868
+ ]));
869
+ }
870
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
871
+ if (serializedType.values?.length) {
872
+ const values = result._initValues(serializedType.values?.length);
873
+ serializedType.values.forEach(__assignType((value, index) => {
874
+ values.set(index, String(value));
875
+ }, [
876
+ "value",
877
+ "index",
878
+ "",
879
+ "P\"2!\"2\"\"/#"
880
+ ]));
881
+ }
882
+ const enumEntries = result._initEnumEntries(Object.keys(serializedType.enum).length ?? 0);
883
+ Object.entries(serializedType.enum).forEach(__assignType(([key, value], index) => {
884
+ const enumEntry = enumEntries.get(index);
885
+ enumEntry.name = key;
886
+ enumEntry.value = String(value);
887
+ }, [
888
+ "param0",
889
+ "index",
890
+ "",
891
+ "P\"2!\"2\"\"/#"
892
+ ]));
893
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
894
+ return result;
895
+ }
896
+ convertToCapnpEnum.__type = [
897
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeEnum,
898
+ "serializedType",
899
+ "result",
900
+ "convertToCapnpEnum",
901
+ "Pn!2\"!2#!/$"
902
+ ];
903
+ function convertFromCapnpEnum(serializedType) {
904
+ return {
905
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.enum,
906
+ typeName: serializedType.typeName || void 0,
907
+ indexType: serializedType.indexType.id,
908
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
909
+ "d",
910
+ "",
911
+ "P\"2!\"/\""
912
+ ])) : void 0,
913
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
914
+ "t",
915
+ "",
916
+ "P\"2!\"/\""
917
+ ])) : void 0,
918
+ values: serializedType._hasValues() ? serializedType.values.map(__assignType((value) => value, [
919
+ "value",
920
+ "",
921
+ "P\"2!\"/\""
922
+ ])) : [],
923
+ enum: serializedType._hasEnumEntries() ? Object.entries(serializedType.enumEntries).reduce(__assignType((ret, [key, value]) => {
924
+ ret[key] = value.value;
925
+ return ret;
926
+ }, [
927
+ "ret",
928
+ "param1",
929
+ "",
930
+ "P\"2!\"2\"\"/#"
931
+ ]), {}) : {},
932
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
933
+ tags: convertFromCapnpTagsReflection(serializedType)
934
+ };
935
+ }
936
+ convertFromCapnpEnum.__type = [
937
+ "serializedType",
938
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeEnum,
939
+ "convertFromCapnpEnum",
940
+ "P!2!n\"/#"
941
+ ];
942
+ function convertToCapnpIntersection(serializedType, result) {
943
+ result.kind = serializedType.kind;
944
+ result.typeName = serializedType.typeName || "";
945
+ const types = result._initTypes(serializedType.types?.length ?? 0);
946
+ serializedType.types?.forEach(__assignType((t, index) => {
947
+ const serializedTypeType = types.get(index);
948
+ serializedTypeType.id = t;
949
+ }, [
950
+ "t",
951
+ "index",
952
+ "",
953
+ "P\"2!\"2\"\"/#"
954
+ ]));
955
+ if (serializedType.decorators?.length) {
956
+ const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
957
+ serializedType.decorators?.forEach(__assignType((d, index) => {
958
+ const decorator = decorators.get(index);
959
+ decorator.id = d;
960
+ }, [
961
+ "d",
962
+ "index",
963
+ "",
964
+ "P\"2!\"2\"\"/#"
965
+ ]));
966
+ }
967
+ if (serializedType.typeArguments?.length) {
968
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
969
+ serializedType.typeArguments?.forEach(__assignType((t, index) => {
970
+ const typeArgument = typeArguments.get(index);
971
+ typeArgument.id = t;
972
+ }, [
973
+ "t",
974
+ "index",
975
+ "",
976
+ "P\"2!\"2\"\"/#"
977
+ ]));
978
+ }
979
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
980
+ return result;
981
+ }
982
+ convertToCapnpIntersection.__type = [
983
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeIntersection,
984
+ "serializedType",
985
+ "result",
986
+ "convertToCapnpIntersection",
987
+ "Pn!2\"!2#!/$"
988
+ ];
989
+ function convertFromCapnpIntersection(serializedType) {
990
+ return {
991
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.intersection,
992
+ typeName: serializedType.typeName || void 0,
993
+ types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => t.id, [
994
+ "t",
995
+ "",
996
+ "P\"2!\"/\""
997
+ ])) : [],
998
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
999
+ "d",
1000
+ "",
1001
+ "P\"2!\"/\""
1002
+ ])) : void 0,
1003
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
1004
+ "t",
1005
+ "",
1006
+ "P\"2!\"/\""
1007
+ ])) : void 0,
1008
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
1009
+ };
1010
+ }
1011
+ convertFromCapnpIntersection.__type = [
1012
+ "serializedType",
1013
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeIntersection,
1014
+ "convertFromCapnpIntersection",
1015
+ "P!2!n\"/#"
1016
+ ];
1017
+ function convertToCapnpArray(serializedType, result) {
1018
+ result.kind = serializedType.kind;
1019
+ result.typeName = serializedType.typeName || "";
1020
+ const type = result._initType();
1021
+ type.id = serializedType.type;
1022
+ if (serializedType.decorators?.length) {
1023
+ const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
1024
+ serializedType.decorators?.forEach(__assignType((d, index) => {
1025
+ const decorator = decorators.get(index);
1026
+ decorator.id = d;
1027
+ }, [
1028
+ "d",
1029
+ "index",
1030
+ "",
1031
+ "P\"2!\"2\"\"/#"
1032
+ ]));
1033
+ }
1034
+ if (serializedType.typeArguments?.length) {
1035
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
1036
+ serializedType.typeArguments?.forEach(__assignType((t, index) => {
1037
+ const typeArgument = typeArguments.get(index);
1038
+ typeArgument.id = t;
1039
+ }, [
1040
+ "t",
1041
+ "index",
1042
+ "",
1043
+ "P\"2!\"2\"\"/#"
1044
+ ]));
1045
+ }
1046
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
1047
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
1048
+ return result;
1049
+ }
1050
+ convertToCapnpArray.__type = [
1051
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeArray,
1052
+ "serializedType",
1053
+ "result",
1054
+ "convertToCapnpArray",
1055
+ "Pn!2\"!2#!/$"
1056
+ ];
1057
+ function convertFromCapnpArray(serializedType) {
1058
+ return {
1059
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.array,
1060
+ typeName: serializedType.typeName || void 0,
1061
+ type: serializedType.type.id,
1062
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
1063
+ "d",
1064
+ "",
1065
+ "P\"2!\"/\""
1066
+ ])) : void 0,
1067
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
1068
+ "t",
1069
+ "",
1070
+ "P\"2!\"/\""
1071
+ ])) : void 0,
1072
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
1073
+ tags: convertFromCapnpTagsReflection(serializedType)
1074
+ };
1075
+ }
1076
+ convertFromCapnpArray.__type = [
1077
+ "serializedType",
1078
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeArray,
1079
+ "convertFromCapnpArray",
1080
+ "P!2!n\"/#"
1081
+ ];
1082
+ /**
1083
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
1084
+ *
1085
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
1086
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
1087
+ */
1088
+ function convertToCapnpUnion(serializedType, result) {
1089
+ result.kind = serializedType.kind;
1090
+ result.typeName = serializedType.typeName || "";
1091
+ const types = result._initTypes(serializedType.types?.length ?? 0);
1092
+ serializedType.types?.forEach(__assignType((t, index) => {
1093
+ const serializedTypeType = types.get(index);
1094
+ serializedTypeType.id = t;
1095
+ }, [
1096
+ "t",
1097
+ "index",
1098
+ "",
1099
+ "P\"2!\"2\"\"/#"
1100
+ ]));
1101
+ if (serializedType.decorators?.length) {
1102
+ const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
1103
+ serializedType.decorators?.forEach(__assignType((d, index) => {
1104
+ const decorator = decorators.get(index);
1105
+ decorator.id = d;
1106
+ }, [
1107
+ "d",
1108
+ "index",
1109
+ "",
1110
+ "P\"2!\"2\"\"/#"
1111
+ ]));
1112
+ }
1113
+ if (serializedType.typeArguments?.length) {
1114
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
1115
+ serializedType.typeArguments?.forEach(__assignType((t, index) => {
1116
+ const typeArgument = typeArguments.get(index);
1117
+ typeArgument.id = t;
1118
+ }, [
1119
+ "t",
1120
+ "index",
1121
+ "",
1122
+ "P\"2!\"2\"\"/#"
1123
+ ]));
1124
+ }
1125
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
1126
+ return result;
1127
+ }
1128
+ convertToCapnpUnion.__type = [
1129
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeUnion,
1130
+ "serializedType",
1131
+ "result",
1132
+ "convertToCapnpUnion",
1133
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
1134
+ "Pn!2\"!2#!/$?%"
1135
+ ];
1136
+ function convertFromCapnpUnion(serializedType) {
1137
+ return {
1138
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.union,
1139
+ typeName: serializedType.typeName || void 0,
1140
+ types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => t.id, [
1141
+ "t",
1142
+ "",
1143
+ "P\"2!\"/\""
1144
+ ])) : [],
1145
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
1146
+ "d",
1147
+ "",
1148
+ "P\"2!\"/\""
1149
+ ])) : void 0,
1150
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
1151
+ "t",
1152
+ "",
1153
+ "P\"2!\"/\""
1154
+ ])) : void 0,
1155
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
1156
+ };
1157
+ }
1158
+ convertFromCapnpUnion.__type = [
1159
+ "serializedType",
1160
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeUnion,
1161
+ "convertFromCapnpUnion",
1162
+ "P!2!n\"/#"
1163
+ ];
1164
+ /**
1165
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
1166
+ *
1167
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert.
1168
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
1169
+ */
1170
+ function convertToCapnpInfer(serializedType, result) {
1171
+ result.kind = serializedType.kind;
1172
+ result.typeName = serializedType.typeName || "";
1173
+ if (serializedType.decorators?.length) {
1174
+ const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
1175
+ serializedType.decorators?.forEach(__assignType((d, index) => {
1176
+ const decorator = decorators.get(index);
1177
+ decorator.id = d;
1178
+ }, [
1179
+ "d",
1180
+ "index",
1181
+ "",
1182
+ "P\"2!\"2\"\"/#"
1183
+ ]));
1184
+ }
1185
+ if (serializedType.typeArguments?.length) {
1186
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments?.length ?? 0);
1187
+ serializedType.typeArguments?.forEach(__assignType((t, index) => {
1188
+ const typeArgument = typeArguments.get(index);
1189
+ typeArgument.id = t;
1190
+ }, [
1191
+ "t",
1192
+ "index",
1193
+ "",
1194
+ "P\"2!\"2\"\"/#"
1195
+ ]));
1196
+ }
1197
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
1198
+ return result;
1199
+ }
1200
+ convertToCapnpInfer.__type = [
1201
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeInfer,
1202
+ "serializedType",
1203
+ "result",
1204
+ "convertToCapnpInfer",
1205
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
1206
+ "Pn!2\"!2#!/$?%"
1207
+ ];
1208
+ function convertFromCapnpInfer(serializedType) {
1209
+ return {
1210
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.infer,
1211
+ typeName: serializedType.typeName || void 0,
1212
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
1213
+ "d",
1214
+ "",
1215
+ "P\"2!\"/\""
1216
+ ])) : void 0,
1217
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
1218
+ "t",
1219
+ "",
1220
+ "P\"2!\"/\""
1221
+ ])) : void 0,
1222
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType)
1223
+ };
1224
+ }
1225
+ convertFromCapnpInfer.__type = [
1226
+ "serializedType",
1227
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeInfer,
1228
+ "convertFromCapnpInfer",
1229
+ "P!2!n\"/#"
1230
+ ];
1231
+ /**
1232
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
1233
+ *
1234
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
1235
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
1236
+ */
1237
+ function convertToCapnpFunction(serializedType, result) {
1238
+ result.name = String(serializedType.name) || "";
1239
+ result.kind = serializedType.kind;
1240
+ result.typeName = serializedType.typeName || "";
1241
+ if (serializedType.decorators?.length) {
1242
+ const decorators = result._initDecorators(serializedType.decorators.length);
1243
+ serializedType.decorators.forEach(__assignType((d, index) => {
1244
+ const decorator = decorators.get(index);
1245
+ decorator.id = d;
1246
+ }, [
1247
+ "d",
1248
+ "index",
1249
+ "",
1250
+ "P\"2!\"2\"\"/#"
1251
+ ]));
1252
+ }
1253
+ if (serializedType.typeArguments?.length) {
1254
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
1255
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
1256
+ const typeArgument = typeArguments.get(index);
1257
+ typeArgument.id = t;
1258
+ }, [
1259
+ "t",
1260
+ "index",
1261
+ "",
1262
+ "P\"2!\"2\"\"/#"
1263
+ ]));
1264
+ }
1265
+ if (serializedType.parameters?.length) {
1266
+ const parameters = result._initParameters(serializedType.parameters.length);
1267
+ serializedType.parameters.forEach(__assignType((p, index) => {
1268
+ convertToCapnpParameter(p, parameters.get(index));
1269
+ }, [
1270
+ "p",
1271
+ "index",
1272
+ "",
1273
+ "P\"2!\"2\"\"/#"
1274
+ ]));
1275
+ }
1276
+ const returnType = result._initReturn();
1277
+ returnType.id = serializedType.return;
1278
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
1279
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
1280
+ return result;
1281
+ }
1282
+ convertToCapnpFunction.__type = [
1283
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeFunction,
1284
+ "serializedType",
1285
+ "result",
1286
+ "convertToCapnpFunction",
1287
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
1288
+ "Pn!2\"!2#!/$?%"
1289
+ ];
1290
+ /**
1291
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
1292
+ *
1293
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
1294
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
1295
+ */
1296
+ function convertToCapnpMethod(serializedType, result) {
1297
+ result.name = String(serializedType.name) || "";
1298
+ result.kind = serializedType.kind;
1299
+ result.typeName = serializedType.typeName || "";
1300
+ result.abstract = serializedType.abstract ?? false;
1301
+ result.visibility = serializedType.visibility === __powerlines_deepkit_vendor_type.ReflectionVisibility.public ? require_reflection.ReflectionVisibility.PUBLIC : serializedType.visibility === __powerlines_deepkit_vendor_type.ReflectionVisibility.protected ? require_reflection.ReflectionVisibility.PROTECTED : require_reflection.ReflectionVisibility.PRIVATE;
1302
+ if (serializedType.decorators?.length) {
1303
+ const decorators = result._initDecorators(serializedType.decorators.length);
1304
+ serializedType.decorators.forEach(__assignType((d, index) => {
1305
+ const decorator = decorators.get(index);
1306
+ decorator.id = d;
1307
+ }, [
1308
+ "d",
1309
+ "index",
1310
+ "",
1311
+ "P\"2!\"2\"\"/#"
1312
+ ]));
1313
+ }
1314
+ if (serializedType.typeArguments?.length) {
1315
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
1316
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
1317
+ const typeArgument = typeArguments.get(index);
1318
+ typeArgument.id = t;
1319
+ }, [
1320
+ "t",
1321
+ "index",
1322
+ "",
1323
+ "P\"2!\"2\"\"/#"
1324
+ ]));
1325
+ }
1326
+ if (serializedType.parameters?.length) {
1327
+ const parameters = result._initParameters(serializedType.parameters.length);
1328
+ serializedType.parameters.forEach(__assignType((p, index) => {
1329
+ convertToCapnpParameter(p, parameters.get(index));
1330
+ }, [
1331
+ "p",
1332
+ "index",
1333
+ "",
1334
+ "P\"2!\"2\"\"/#"
1335
+ ]));
1336
+ }
1337
+ const returnType = result._initReturn();
1338
+ returnType.id = serializedType.return;
1339
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
1340
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
1341
+ return result;
1342
+ }
1343
+ convertToCapnpMethod.__type = [
1344
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeMethod,
1345
+ "serializedType",
1346
+ "result",
1347
+ "convertToCapnpMethod",
1348
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
1349
+ "Pn!2\"!2#!/$?%"
1350
+ ];
1351
+ function convertFromCapnpFunction(serializedType) {
1352
+ return {
1353
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.function,
1354
+ name: serializedType.name,
1355
+ typeName: serializedType.typeName || void 0,
1356
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
1357
+ "d",
1358
+ "",
1359
+ "P\"2!\"/\""
1360
+ ])) : void 0,
1361
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
1362
+ "t",
1363
+ "",
1364
+ "P\"2!\"/\""
1365
+ ])) : void 0,
1366
+ parameters: serializedType._hasParameters() ? serializedType.parameters.map(__assignType((p) => convertFromCapnpParameter(p), [
1367
+ "p",
1368
+ "",
1369
+ "P\"2!\"/\""
1370
+ ])) : [],
1371
+ return: serializedType.return.id,
1372
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
1373
+ tags: convertFromCapnpTagsReflection(serializedType)
1374
+ };
1375
+ }
1376
+ convertFromCapnpFunction.__type = [
1377
+ "serializedType",
1378
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeFunction,
1379
+ "convertFromCapnpFunction",
1380
+ "P!2!n\"/#"
1381
+ ];
1382
+ function convertFromCapnpMethod(serializedType) {
1383
+ return {
1384
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.method,
1385
+ name: serializedType.name,
1386
+ typeName: serializedType.typeName || void 0,
1387
+ abstract: serializedType.abstract ? true : void 0,
1388
+ return: serializedType.return.id,
1389
+ visibility: serializedType.visibility === require_reflection.ReflectionVisibility.PUBLIC ? __powerlines_deepkit_vendor_type.ReflectionVisibility.public : serializedType.visibility === require_reflection.ReflectionVisibility.PROTECTED ? __powerlines_deepkit_vendor_type.ReflectionVisibility.protected : __powerlines_deepkit_vendor_type.ReflectionVisibility.private,
1390
+ parameters: serializedType._hasParameters() ? serializedType.parameters.map(__assignType((parameter) => convertFromCapnpParameter(parameter), [
1391
+ "parameter",
1392
+ "",
1393
+ "P\"2!\"/\""
1394
+ ])) : []
1395
+ };
1396
+ }
1397
+ convertFromCapnpMethod.__type = [
1398
+ "serializedType",
1399
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeMethod,
1400
+ "convertFromCapnpMethod",
1401
+ "P!2!n\"/#"
1402
+ ];
1403
+ /**
1404
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
1405
+ *
1406
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
1407
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
1408
+ */
1409
+ function convertToCapnpClassType(serializedType, result) {
1410
+ result.kind = serializedType.kind;
1411
+ result.typeName = serializedType.typeName || "";
1412
+ result.classType = serializedType.classType || "";
1413
+ result.globalObject = serializedType.globalObject ?? false;
1414
+ if (serializedType.arguments?.length) {
1415
+ const _arguments = result._initArguments(serializedType.arguments.length);
1416
+ serializedType.arguments.forEach(__assignType((t, index) => {
1417
+ const serializedTypeArguments = _arguments.get(index);
1418
+ serializedTypeArguments.id = t;
1419
+ }, [
1420
+ "t",
1421
+ "index",
1422
+ "",
1423
+ "P\"2!\"2\"\"/#"
1424
+ ]));
1425
+ }
1426
+ if (serializedType.extendsArguments?.length) {
1427
+ const extendsArguments = result._initArguments(serializedType.extendsArguments.length);
1428
+ serializedType.extendsArguments.forEach(__assignType((t, index) => {
1429
+ const serializedTypeExtendsArguments = extendsArguments.get(index);
1430
+ serializedTypeExtendsArguments.id = t;
1431
+ }, [
1432
+ "t",
1433
+ "index",
1434
+ "",
1435
+ "P\"2!\"2\"\"/#"
1436
+ ]));
1437
+ }
1438
+ if (serializedType.decorators?.length) {
1439
+ const decorators = result._initDecorators(serializedType.decorators.length);
1440
+ serializedType.decorators.forEach(__assignType((d, index) => {
1441
+ const decorator = decorators.get(index);
1442
+ decorator.id = d;
1443
+ }, [
1444
+ "d",
1445
+ "index",
1446
+ "",
1447
+ "P\"2!\"2\"\"/#"
1448
+ ]));
1449
+ }
1450
+ if (serializedType.typeArguments?.length) {
1451
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
1452
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
1453
+ const typeArgument = typeArguments.get(index);
1454
+ typeArgument.id = t;
1455
+ }, [
1456
+ "t",
1457
+ "index",
1458
+ "",
1459
+ "P\"2!\"2\"\"/#"
1460
+ ]));
1461
+ }
1462
+ if (serializedType.superClass) {
1463
+ const superClass = result._initSuperClass();
1464
+ superClass.id = serializedType.superClass;
1465
+ }
1466
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
1467
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
1468
+ return result;
1469
+ }
1470
+ convertToCapnpClassType.__type = [
1471
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeClassType,
1472
+ "serializedType",
1473
+ "result",
1474
+ "convertToCapnpClassType",
1475
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
1476
+ "Pn!2\"!2#!/$?%"
1477
+ ];
1478
+ function convertFromCapnpClassType(serializedType) {
1479
+ return {
1480
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.class,
1481
+ typeName: serializedType.typeName || void 0,
1482
+ classType: serializedType.classType,
1483
+ globalObject: serializedType.globalObject ? true : void 0,
1484
+ arguments: serializedType._hasArguments() ? serializedType.arguments.map(__assignType((t) => t.id, [
1485
+ "t",
1486
+ "",
1487
+ "P\"2!\"/\""
1488
+ ])) : void 0,
1489
+ extendsArguments: serializedType._hasExtendsArguments() ? serializedType.extendsArguments.map(__assignType((t) => t.id, [
1490
+ "t",
1491
+ "",
1492
+ "P\"2!\"/\""
1493
+ ])) : void 0,
1494
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
1495
+ "d",
1496
+ "",
1497
+ "P\"2!\"/\""
1498
+ ])) : void 0,
1499
+ types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => t.id, [
1500
+ "t",
1501
+ "",
1502
+ "P\"2!\"/\""
1503
+ ])) : [],
1504
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
1505
+ "t",
1506
+ "",
1507
+ "P\"2!\"/\""
1508
+ ])) : void 0,
1509
+ superClass: serializedType._hasSuperClass() ? serializedType.superClass.id : void 0,
1510
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
1511
+ tags: convertFromCapnpTagsReflection(serializedType)
1512
+ };
1513
+ }
1514
+ convertFromCapnpClassType.__type = [
1515
+ "serializedType",
1516
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeClassType,
1517
+ "convertFromCapnpClassType",
1518
+ "P!2!n\"/#"
1519
+ ];
1520
+ /**
1521
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
1522
+ *
1523
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
1524
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
1525
+ */
1526
+ function convertToCapnpObjectLiteral(serializedType, result) {
1527
+ if (serializedType.decorators?.length) {
1528
+ const decorators = result._initDecorators(serializedType.decorators?.length ?? 0);
1529
+ serializedType.decorators.forEach(__assignType((d, index) => {
1530
+ const decorator = decorators.get(index);
1531
+ decorator.id = d;
1532
+ }, [
1533
+ "d",
1534
+ "index",
1535
+ "",
1536
+ "P\"2!\"2\"\"/#"
1537
+ ]));
1538
+ }
1539
+ if (serializedType.types?.length) {
1540
+ const types = result._initTypes(serializedType.types.length);
1541
+ serializedType.types.forEach(__assignType((t, index) => {
1542
+ const serializedTypeType = types.get(index);
1543
+ serializedTypeType.id = t;
1544
+ }, [
1545
+ "t",
1546
+ "index",
1547
+ "",
1548
+ "P\"2!\"2\"\"/#"
1549
+ ]));
1550
+ }
1551
+ if (serializedType.typeArguments?.length) {
1552
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
1553
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
1554
+ const serializedTypeTypeArguments = typeArguments.get(index);
1555
+ serializedTypeTypeArguments.id = t;
1556
+ }, [
1557
+ "t",
1558
+ "index",
1559
+ "",
1560
+ "P\"2!\"2\"\"/#"
1561
+ ]));
1562
+ }
1563
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
1564
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
1565
+ return result;
1566
+ }
1567
+ convertToCapnpObjectLiteral.__type = [
1568
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeObjectLiteral,
1569
+ "serializedType",
1570
+ "result",
1571
+ "convertToCapnpObjectLiteral",
1572
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
1573
+ "Pn!2\"!2#!/$?%"
1574
+ ];
1575
+ function convertFromCapnpObjectLiteral(serializedType) {
1576
+ return {
1577
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
1578
+ typeName: serializedType.typeName || void 0,
1579
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
1580
+ "d",
1581
+ "",
1582
+ "P\"2!\"/\""
1583
+ ])) : void 0,
1584
+ types: serializedType._hasTypes() ? serializedType.types.map(__assignType((t) => t.id, [
1585
+ "t",
1586
+ "",
1587
+ "P\"2!\"/\""
1588
+ ])) : [],
1589
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
1590
+ "t",
1591
+ "",
1592
+ "P\"2!\"/\""
1593
+ ])) : void 0,
1594
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
1595
+ tags: convertFromCapnpTagsReflection(serializedType)
1596
+ };
1597
+ }
1598
+ convertFromCapnpObjectLiteral.__type = [
1599
+ "serializedType",
1600
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeObjectLiteral,
1601
+ "convertFromCapnpObjectLiteral",
1602
+ "P!2!n\"/#"
1603
+ ];
1604
+ /**
1605
+ * Converts a Deepkit serialized type to a Cap'n Proto serialized type.
1606
+ *
1607
+ * @param serializedType - The [Deepkit](https://deepkit.io/) {@link SerializedType | serialized type} to convert
1608
+ * @param result - The {@link capnp.List | list} object defined in a [Cap'n Proto](https://capnproto.org/) schema to write the converted type to
1609
+ */
1610
+ function convertToCapnpParameter(serializedType, result) {
1611
+ result.kind = serializedType.kind;
1612
+ result.typeName = serializedType.typeName || "";
1613
+ result.name = serializedType.name || "";
1614
+ result.optional = serializedType.optional ?? false;
1615
+ result.readonly = serializedType.readonly ?? false;
1616
+ result.visibility = serializedType.visibility === __powerlines_deepkit_vendor_type.ReflectionVisibility.public ? require_reflection.ReflectionVisibility.PUBLIC : serializedType.visibility === __powerlines_deepkit_vendor_type.ReflectionVisibility.protected ? require_reflection.ReflectionVisibility.PROTECTED : require_reflection.ReflectionVisibility.PRIVATE;
1617
+ if (typeof serializedType.default !== "undefined") {
1618
+ const defaultValue = result._initDefault();
1619
+ convertToCapnpDefault(serializedType.default, defaultValue);
1620
+ }
1621
+ const parameterType = result._initType();
1622
+ parameterType.id = serializedType.type;
1623
+ if (serializedType.decorators?.length) {
1624
+ const decorators = result._initDecorators(serializedType.decorators.length);
1625
+ serializedType.decorators.forEach(__assignType((d, index) => {
1626
+ const decorator = decorators.get(index);
1627
+ decorator.id = d;
1628
+ }, [
1629
+ "d",
1630
+ "index",
1631
+ "",
1632
+ "P\"2!\"2\"\"/#"
1633
+ ]));
1634
+ }
1635
+ if (serializedType.typeArguments?.length) {
1636
+ const typeArguments = result._initTypeArguments(serializedType.typeArguments.length);
1637
+ serializedType.typeArguments.forEach(__assignType((t, index) => {
1638
+ const typeArgument = typeArguments.get(index);
1639
+ typeArgument.id = t;
1640
+ }, [
1641
+ "t",
1642
+ "index",
1643
+ "",
1644
+ "P\"2!\"2\"\"/#"
1645
+ ]));
1646
+ }
1647
+ if (serializedType.indexAccessOrigin) convertToCapnpIndexAccessOrigin(result._initIndexAccessOrigin(), serializedType.indexAccessOrigin);
1648
+ if (serializedType.tags) convertToCapnpTagsReflection(result._initTags(), serializedType.tags);
1649
+ return result;
1650
+ }
1651
+ convertToCapnpParameter.__type = [
1652
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeParameter,
1653
+ "serializedType",
1654
+ "result",
1655
+ "convertToCapnpParameter",
1656
+ "Converts a Deepkit serialized type to a Cap'n Proto serialized type.",
1657
+ "Pn!2\"!2#!/$?%"
1658
+ ];
1659
+ function convertFromCapnpParameter(serializedType) {
1660
+ return {
1661
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.parameter,
1662
+ typeName: serializedType.typeName || void 0,
1663
+ name: serializedType.name,
1664
+ default: convertFromCapnpDefault(serializedType.default),
1665
+ optional: serializedType.optional ? true : void 0,
1666
+ readonly: serializedType.readonly ? true : void 0,
1667
+ visibility: serializedType.visibility === require_reflection.ReflectionVisibility.PUBLIC ? __powerlines_deepkit_vendor_type.ReflectionVisibility.public : serializedType.visibility === require_reflection.ReflectionVisibility.PROTECTED ? __powerlines_deepkit_vendor_type.ReflectionVisibility.protected : __powerlines_deepkit_vendor_type.ReflectionVisibility.private,
1668
+ type: serializedType.type.id,
1669
+ decorators: serializedType._hasDecorators() ? serializedType.decorators.map(__assignType((d) => d.id, [
1670
+ "d",
1671
+ "",
1672
+ "P\"2!\"/\""
1673
+ ])) : void 0,
1674
+ typeArguments: serializedType._hasTypeArguments() ? serializedType.typeArguments.map(__assignType((t) => t.id, [
1675
+ "t",
1676
+ "",
1677
+ "P\"2!\"/\""
1678
+ ])) : void 0,
1679
+ indexAccessOrigin: convertFromCapnpIndexAccessOrigin(serializedType),
1680
+ tags: convertFromCapnpTagsReflection(serializedType)
1681
+ };
1682
+ }
1683
+ convertFromCapnpParameter.__type = [
1684
+ "serializedType",
1685
+ () => __powerlines_deepkit_vendor_type.__ΩSerializedTypeParameter,
1686
+ "convertFromCapnpParameter",
1687
+ "P!2!n\"/#"
1688
+ ];
1689
+
1690
+ //#endregion
1691
+ exports.convertFromCapnp = convertFromCapnp;
1692
+ exports.convertToCapnp = convertToCapnp;