@powerlines/plugin-alloy 0.25.34 → 0.25.36

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 (267) hide show
  1. package/dist/core/components/index.d.cts +5 -0
  2. package/dist/core/components/index.d.mts +5 -0
  3. package/dist/core/components/output.d.cts +24 -0
  4. package/dist/core/components/output.d.cts.map +1 -0
  5. package/dist/core/components/output.d.mts +24 -0
  6. package/dist/core/components/output.d.mts.map +1 -0
  7. package/dist/core/components/output.mjs +2 -1
  8. package/dist/core/components/output.mjs.map +1 -0
  9. package/dist/core/components/single-line-comment.d.cts +23 -0
  10. package/dist/core/components/single-line-comment.d.cts.map +1 -0
  11. package/dist/core/components/single-line-comment.d.mts +23 -0
  12. package/dist/core/components/single-line-comment.d.mts.map +1 -0
  13. package/dist/core/components/single-line-comment.mjs +2 -1
  14. package/dist/core/components/single-line-comment.mjs.map +1 -0
  15. package/dist/core/components/source-file.d.cts +33 -0
  16. package/dist/core/components/source-file.d.cts.map +1 -0
  17. package/dist/core/components/source-file.d.mts +33 -0
  18. package/dist/core/components/source-file.d.mts.map +1 -0
  19. package/dist/core/components/source-file.mjs +2 -1
  20. package/dist/core/components/source-file.mjs.map +1 -0
  21. package/dist/core/components/spacing.d.cts +24 -0
  22. package/dist/core/components/spacing.d.cts.map +1 -0
  23. package/dist/core/components/spacing.d.mts +24 -0
  24. package/dist/core/components/spacing.d.mts.map +1 -0
  25. package/dist/core/components/spacing.mjs +2 -1
  26. package/dist/core/components/spacing.mjs.map +1 -0
  27. package/dist/core/contexts/context.d.cts +29 -0
  28. package/dist/core/contexts/context.d.cts.map +1 -0
  29. package/dist/core/contexts/context.d.mts +29 -0
  30. package/dist/core/contexts/context.d.mts.map +1 -0
  31. package/dist/core/contexts/context.mjs +2 -1
  32. package/dist/core/contexts/context.mjs.map +1 -0
  33. package/dist/core/contexts/index.d.cts +4 -0
  34. package/dist/core/contexts/index.d.mts +4 -0
  35. package/dist/core/contexts/meta.d.cts +48 -0
  36. package/dist/core/contexts/meta.d.cts.map +1 -0
  37. package/dist/core/contexts/meta.d.mts +48 -0
  38. package/dist/core/contexts/meta.d.mts.map +1 -0
  39. package/dist/core/contexts/meta.mjs +2 -1
  40. package/dist/core/contexts/meta.mjs.map +1 -0
  41. package/dist/core/contexts/reflection.d.cts +53 -0
  42. package/dist/core/contexts/reflection.d.cts.map +1 -0
  43. package/dist/core/contexts/reflection.d.mts +53 -0
  44. package/dist/core/contexts/reflection.d.mts.map +1 -0
  45. package/dist/core/contexts/reflection.mjs +2 -1
  46. package/dist/core/contexts/reflection.mjs.map +1 -0
  47. package/dist/core/helpers/code.d.cts +29 -0
  48. package/dist/core/helpers/code.d.cts.map +1 -0
  49. package/dist/core/helpers/code.d.mts +29 -0
  50. package/dist/core/helpers/code.d.mts.map +1 -0
  51. package/dist/core/helpers/code.mjs +2 -1
  52. package/dist/core/helpers/code.mjs.map +1 -0
  53. package/dist/core/helpers/index.d.cts +2 -0
  54. package/dist/core/helpers/index.d.mts +2 -0
  55. package/dist/core/index.d.cts +9 -0
  56. package/dist/core/index.d.mts +9 -0
  57. package/dist/helpers/capnp.d.cts +87 -0
  58. package/dist/helpers/capnp.d.cts.map +1 -0
  59. package/dist/helpers/capnp.d.mts +87 -0
  60. package/dist/helpers/capnp.d.mts.map +1 -0
  61. package/dist/helpers/capnp.mjs +2 -1
  62. package/dist/helpers/capnp.mjs.map +1 -0
  63. package/dist/helpers/create-builtin.d.cts +16 -0
  64. package/dist/helpers/create-builtin.d.cts.map +1 -0
  65. package/dist/helpers/create-builtin.d.mts +16 -0
  66. package/dist/helpers/create-builtin.d.mts.map +1 -0
  67. package/dist/helpers/create-builtin.mjs +2 -1
  68. package/dist/helpers/create-builtin.mjs.map +1 -0
  69. package/dist/helpers/index.d.cts +5 -0
  70. package/dist/helpers/index.d.mts +5 -0
  71. package/dist/helpers/refkey.d.cts +13 -0
  72. package/dist/helpers/refkey.d.cts.map +1 -0
  73. package/dist/helpers/refkey.d.mts +13 -0
  74. package/dist/helpers/refkey.d.mts.map +1 -0
  75. package/dist/helpers/refkey.mjs +2 -1
  76. package/dist/helpers/refkey.mjs.map +1 -0
  77. package/dist/helpers/typescript.d.cts +26 -0
  78. package/dist/helpers/typescript.d.cts.map +1 -0
  79. package/dist/helpers/typescript.d.mts +26 -0
  80. package/dist/helpers/typescript.d.mts.map +1 -0
  81. package/dist/helpers/typescript.mjs +2 -1
  82. package/dist/helpers/typescript.mjs.map +1 -0
  83. package/dist/index.cjs +6 -1
  84. package/dist/index.d.cts +19 -0
  85. package/dist/index.d.cts.map +1 -0
  86. package/dist/index.d.mts +19 -0
  87. package/dist/index.d.mts.map +1 -0
  88. package/dist/index.mjs +8 -2
  89. package/dist/index.mjs.map +1 -0
  90. package/dist/markdown/components/front-matter.d.cts +16 -0
  91. package/dist/markdown/components/front-matter.d.cts.map +1 -0
  92. package/dist/markdown/components/front-matter.d.mts +16 -0
  93. package/dist/markdown/components/front-matter.d.mts.map +1 -0
  94. package/dist/markdown/components/front-matter.mjs +2 -1
  95. package/dist/markdown/components/front-matter.mjs.map +1 -0
  96. package/dist/markdown/components/index.d.cts +4 -0
  97. package/dist/markdown/components/index.d.mts +4 -0
  98. package/dist/markdown/components/markdown-file.d.cts +29 -0
  99. package/dist/markdown/components/markdown-file.d.cts.map +1 -0
  100. package/dist/markdown/components/markdown-file.d.mts +29 -0
  101. package/dist/markdown/components/markdown-file.d.mts.map +1 -0
  102. package/dist/markdown/components/markdown-file.mjs +2 -1
  103. package/dist/markdown/components/markdown-file.mjs.map +1 -0
  104. package/dist/markdown/components/markdown-table.d.cts +28 -0
  105. package/dist/markdown/components/markdown-table.d.cts.map +1 -0
  106. package/dist/markdown/components/markdown-table.d.mts +28 -0
  107. package/dist/markdown/components/markdown-table.d.mts.map +1 -0
  108. package/dist/markdown/components/markdown-table.mjs +2 -1
  109. package/dist/markdown/components/markdown-table.mjs.map +1 -0
  110. package/dist/markdown/contexts/index.d.cts +2 -0
  111. package/dist/markdown/contexts/index.d.mts +2 -0
  112. package/dist/markdown/contexts/markdown-table.d.cts +38 -0
  113. package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
  114. package/dist/markdown/contexts/markdown-table.d.mts +38 -0
  115. package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
  116. package/dist/markdown/contexts/markdown-table.mjs +2 -1
  117. package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
  118. package/dist/markdown/index.d.cts +5 -0
  119. package/dist/markdown/index.d.mts +5 -0
  120. package/dist/render.cjs +1 -1
  121. package/dist/render.d.cts +38 -0
  122. package/dist/render.d.cts.map +1 -0
  123. package/dist/render.d.mts +38 -0
  124. package/dist/render.d.mts.map +1 -0
  125. package/dist/render.mjs +3 -2
  126. package/dist/render.mjs.map +1 -0
  127. package/dist/types/components.d.cts +142 -0
  128. package/dist/types/components.d.cts.map +1 -0
  129. package/dist/types/components.d.mts +142 -0
  130. package/dist/types/components.d.mts.map +1 -0
  131. package/dist/types/index.d.cts +3 -0
  132. package/dist/types/index.d.mts +3 -0
  133. package/dist/types/plugin.d.cts +39 -0
  134. package/dist/types/plugin.d.cts.map +1 -0
  135. package/dist/types/plugin.d.mts +39 -0
  136. package/dist/types/plugin.d.mts.map +1 -0
  137. package/dist/typescript/components/builtin-file.cjs +1 -1
  138. package/dist/typescript/components/builtin-file.d.cts +35 -0
  139. package/dist/typescript/components/builtin-file.d.cts.map +1 -0
  140. package/dist/typescript/components/builtin-file.d.mts +35 -0
  141. package/dist/typescript/components/builtin-file.d.mts.map +1 -0
  142. package/dist/typescript/components/builtin-file.mjs +3 -2
  143. package/dist/typescript/components/builtin-file.mjs.map +1 -0
  144. package/dist/typescript/components/class-declaration.d.cts +145 -0
  145. package/dist/typescript/components/class-declaration.d.cts.map +1 -0
  146. package/dist/typescript/components/class-declaration.d.mts +145 -0
  147. package/dist/typescript/components/class-declaration.d.mts.map +1 -0
  148. package/dist/typescript/components/class-declaration.mjs +2 -1
  149. package/dist/typescript/components/class-declaration.mjs.map +1 -0
  150. package/dist/typescript/components/dynamic-import-statement.d.cts +33 -0
  151. package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
  152. package/dist/typescript/components/dynamic-import-statement.d.mts +33 -0
  153. package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
  154. package/dist/typescript/components/dynamic-import-statement.mjs +2 -1
  155. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
  156. package/dist/typescript/components/entry-file.cjs +1 -1
  157. package/dist/typescript/components/entry-file.d.cts +28 -0
  158. package/dist/typescript/components/entry-file.d.cts.map +1 -0
  159. package/dist/typescript/components/entry-file.d.mts +28 -0
  160. package/dist/typescript/components/entry-file.d.mts.map +1 -0
  161. package/dist/typescript/components/entry-file.mjs +3 -2
  162. package/dist/typescript/components/entry-file.mjs.map +1 -0
  163. package/dist/typescript/components/index.d.cts +15 -0
  164. package/dist/typescript/components/index.d.mts +15 -0
  165. package/dist/typescript/components/infrastructure-file.cjs +1 -1
  166. package/dist/typescript/components/infrastructure-file.d.cts +21 -0
  167. package/dist/typescript/components/infrastructure-file.d.cts.map +1 -0
  168. package/dist/typescript/components/infrastructure-file.d.mts +21 -0
  169. package/dist/typescript/components/infrastructure-file.d.mts.map +1 -0
  170. package/dist/typescript/components/infrastructure-file.mjs +3 -2
  171. package/dist/typescript/components/infrastructure-file.mjs.map +1 -0
  172. package/dist/typescript/components/interface-declaration.d.cts +86 -0
  173. package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
  174. package/dist/typescript/components/interface-declaration.d.mts +86 -0
  175. package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
  176. package/dist/typescript/components/interface-declaration.mjs +2 -1
  177. package/dist/typescript/components/interface-declaration.mjs.map +1 -0
  178. package/dist/typescript/components/object-declaration.d.cts +30 -0
  179. package/dist/typescript/components/object-declaration.d.cts.map +1 -0
  180. package/dist/typescript/components/object-declaration.d.mts +30 -0
  181. package/dist/typescript/components/object-declaration.d.mts.map +1 -0
  182. package/dist/typescript/components/object-declaration.mjs +2 -1
  183. package/dist/typescript/components/object-declaration.mjs.map +1 -0
  184. package/dist/typescript/components/property-name.d.cts +24 -0
  185. package/dist/typescript/components/property-name.d.cts.map +1 -0
  186. package/dist/typescript/components/property-name.d.mts +24 -0
  187. package/dist/typescript/components/property-name.d.mts.map +1 -0
  188. package/dist/typescript/components/property-name.mjs +2 -1
  189. package/dist/typescript/components/property-name.mjs.map +1 -0
  190. package/dist/typescript/components/record-expression.d.cts +13 -0
  191. package/dist/typescript/components/record-expression.d.cts.map +1 -0
  192. package/dist/typescript/components/record-expression.d.mts +13 -0
  193. package/dist/typescript/components/record-expression.d.mts.map +1 -0
  194. package/dist/typescript/components/record-expression.mjs +2 -1
  195. package/dist/typescript/components/record-expression.mjs.map +1 -0
  196. package/dist/typescript/components/tsdoc-reflection.d.cts +44 -0
  197. package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
  198. package/dist/typescript/components/tsdoc-reflection.d.mts +44 -0
  199. package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
  200. package/dist/typescript/components/tsdoc-reflection.mjs +2 -1
  201. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
  202. package/dist/typescript/components/tsdoc.d.cts +164 -0
  203. package/dist/typescript/components/tsdoc.d.cts.map +1 -0
  204. package/dist/typescript/components/tsdoc.d.mts +164 -0
  205. package/dist/typescript/components/tsdoc.d.mts.map +1 -0
  206. package/dist/typescript/components/tsdoc.mjs +2 -1
  207. package/dist/typescript/components/tsdoc.mjs.map +1 -0
  208. package/dist/typescript/components/type-declaration.d.cts +18 -0
  209. package/dist/typescript/components/type-declaration.d.cts.map +1 -0
  210. package/dist/typescript/components/type-declaration.d.mts +18 -0
  211. package/dist/typescript/components/type-declaration.d.mts.map +1 -0
  212. package/dist/typescript/components/type-declaration.mjs +2 -1
  213. package/dist/typescript/components/type-declaration.mjs.map +1 -0
  214. package/dist/typescript/components/type-parameters.d.cts +24 -0
  215. package/dist/typescript/components/type-parameters.d.cts.map +1 -0
  216. package/dist/typescript/components/type-parameters.d.mts +24 -0
  217. package/dist/typescript/components/type-parameters.d.mts.map +1 -0
  218. package/dist/typescript/components/type-parameters.mjs +2 -1
  219. package/dist/typescript/components/type-parameters.mjs.map +1 -0
  220. package/dist/typescript/components/typescript-file.cjs +4 -15
  221. package/dist/typescript/components/typescript-file.d.cts +50 -0
  222. package/dist/typescript/components/typescript-file.d.cts.map +1 -0
  223. package/dist/typescript/components/typescript-file.d.mts +50 -0
  224. package/dist/typescript/components/typescript-file.d.mts.map +1 -0
  225. package/dist/typescript/components/typescript-file.mjs +6 -16
  226. package/dist/typescript/components/typescript-file.mjs.map +1 -0
  227. package/dist/typescript/contexts/index.d.cts +2 -0
  228. package/dist/typescript/contexts/index.d.mts +2 -0
  229. package/dist/typescript/contexts/lexical-scope.d.cts +17 -0
  230. package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
  231. package/dist/typescript/contexts/lexical-scope.d.mts +17 -0
  232. package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
  233. package/dist/typescript/contexts/lexical-scope.mjs +2 -1
  234. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
  235. package/dist/typescript/contexts/member-scope.d.cts +20 -0
  236. package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
  237. package/dist/typescript/contexts/member-scope.d.mts +20 -0
  238. package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
  239. package/dist/typescript/contexts/member-scope.mjs +2 -1
  240. package/dist/typescript/contexts/member-scope.mjs.map +1 -0
  241. package/dist/typescript/helpers/get-call-signature-props.d.cts +14 -0
  242. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
  243. package/dist/typescript/helpers/get-call-signature-props.d.mts +14 -0
  244. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
  245. package/dist/typescript/helpers/get-call-signature-props.mjs +2 -1
  246. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
  247. package/dist/typescript/helpers/index.d.cts +3 -0
  248. package/dist/typescript/helpers/index.d.mts +3 -0
  249. package/dist/typescript/helpers/utilities.d.cts +11 -0
  250. package/dist/typescript/helpers/utilities.d.cts.map +1 -0
  251. package/dist/typescript/helpers/utilities.d.mts +11 -0
  252. package/dist/typescript/helpers/utilities.d.mts.map +1 -0
  253. package/dist/typescript/helpers/utilities.mjs +2 -1
  254. package/dist/typescript/helpers/utilities.mjs.map +1 -0
  255. package/dist/typescript/index.d.cts +18 -0
  256. package/dist/typescript/index.d.mts +18 -0
  257. package/dist/yaml/components/index.d.cts +2 -0
  258. package/dist/yaml/components/index.d.mts +2 -0
  259. package/dist/yaml/components/yaml-file.d.cts +34 -0
  260. package/dist/yaml/components/yaml-file.d.cts.map +1 -0
  261. package/dist/yaml/components/yaml-file.d.mts +34 -0
  262. package/dist/yaml/components/yaml-file.d.mts.map +1 -0
  263. package/dist/yaml/components/yaml-file.mjs +2 -1
  264. package/dist/yaml/components/yaml-file.mjs.map +1 -0
  265. package/dist/yaml/index.d.cts +2 -0
  266. package/dist/yaml/index.d.mts +2 -0
  267. package/package.json +5 -5
@@ -0,0 +1,53 @@
1
+ import { ReflectionOverrideInterface } from "../../types/components.mjs";
2
+ import { ComponentContext } from "@alloy-js/core";
3
+ import { ReflectionClass, ReflectionMethod, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
+
5
+ //#region src/core/contexts/reflection.d.ts
6
+ interface ReflectionClassContextInterface<T extends Record<string, any> = Record<string, any>> {
7
+ reflection: ReflectionClass<T>;
8
+ override?: ReflectionOverrideInterface<T>;
9
+ }
10
+ /**
11
+ * The reflection class context used in template rendering.
12
+ */
13
+ declare const ReflectionClassContext: ComponentContext<ReflectionClassContextInterface<any>>;
14
+ /**
15
+ * Hook to access the Reflection context.
16
+ *
17
+ * @returns A reactive version of the current reflection.
18
+ */
19
+ declare function useReflectionClass<T extends Record<string, any> = Record<string, any>>(): ReflectionClassContextInterface<T>;
20
+ /**
21
+ * The reflection property context used in template rendering.
22
+ */
23
+ declare const ReflectionPropertyContext: ComponentContext<ReflectionProperty>;
24
+ /**
25
+ * Hook to access the Reflection Property context.
26
+ *
27
+ * @returns A reactive version of the current reflection.
28
+ */
29
+ declare function useReflectionProperty(): ReflectionProperty;
30
+ /**
31
+ * The reflection method context used in template rendering.
32
+ */
33
+ declare const ReflectionMethodContext: ComponentContext<ReflectionMethod>;
34
+ /**
35
+ * Hook to access the Reflection Method context.
36
+ *
37
+ * @returns A reactive version of the current reflection.
38
+ */
39
+ declare function useReflectionMethod(): ReflectionMethod;
40
+ /**
41
+ * The reflection parameter context used in template rendering.
42
+ */
43
+ declare const ReflectionParameterContext: ComponentContext<ReflectionParameter>;
44
+ /**
45
+ * Hook to access the Reflection Parameter context.
46
+ *
47
+ * @returns A reactive version of the current reflection.
48
+ */
49
+ declare function useReflectionParameter(): ReflectionParameter;
50
+ declare type __ΩReflectionClassContextInterface = any[];
51
+ //#endregion
52
+ export { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
53
+ //# sourceMappingURL=reflection.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflection.d.mts","names":[],"sources":["../../../src/core/contexts/reflection.ts"],"mappings":";;;;;UA4BiB,+BAAA,WACL,MAAA,gBAAsB,MAAA;EAEhC,UAAA,EAAY,eAAA,CAAgB,CAAA;EAC5B,QAAA,GAAW,2BAAA,CAA4B,CAAA;AAAA;;;;cAM5B,sBAAA,EAAwB,gBAAA,CACnC,+BAAA;;;;;;iBAQc,kBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAAA,GAAmB,+BAAA,CAAA,CAAA;;;;cAkBxC,yBAAA,EAA2B,gBAAA,CAAiB,kBAAA;;;;;;iBAQzC,qBAAA,CAAA,GAAqB,kBAAA;AApCrC;;;AAAA,cAmDa,uBAAA,EAAyB,gBAAA,CAAiB,gBAAA;;AA1CvD;;;;iBAkDgB,mBAAA,CAAA,GAAmB,gBAAA;;;;cAetB,0BAAA,EAA4B,gBAAA,CAAiB,mBAAA;;;;;;iBAQ1C,sBAAA,CAAA,GAAsB,mBAAA;AAAA"}
@@ -57,4 +57,5 @@ function useReflectionParameter() {
57
57
  }
58
58
 
59
59
  //#endregion
60
- export { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
60
+ export { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
61
+ //# sourceMappingURL=reflection.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflection.mjs","names":[],"sources":["../../../src/core/contexts/reflection.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ComponentContext } from \"@alloy-js/core\";\nimport { createContext, createNamedContext, useContext } from \"@alloy-js/core\";\nimport type {\n ReflectionClass,\n ReflectionMethod,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { ReflectionOverrideInterface } from \"../../types/components\";\n\nexport interface ReflectionClassContextInterface<\n T extends Record<string, any> = Record<string, any>\n> {\n reflection: ReflectionClass<T>;\n override?: ReflectionOverrideInterface<T>;\n}\n\n/**\n * The reflection class context used in template rendering.\n */\nexport const ReflectionClassContext: ComponentContext<\n ReflectionClassContextInterface<any>\n> = createContext<ReflectionClassContextInterface<any>>();\n\n/**\n * Hook to access the Reflection context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>() {\n const context = useContext<ReflectionClassContextInterface<T>>(\n ReflectionClassContext\n )!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - ReflectionClass Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * The reflection property context used in template rendering.\n */\nexport const ReflectionPropertyContext: ComponentContext<ReflectionProperty> =\n createNamedContext<ReflectionProperty>(\"ReflectionProperty\");\n\n/**\n * Hook to access the Reflection Property context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionProperty() {\n const context = useContext<ReflectionProperty>(ReflectionPropertyContext)!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * The reflection method context used in template rendering.\n */\nexport const ReflectionMethodContext: ComponentContext<ReflectionMethod> =\n createNamedContext<ReflectionMethod>(\"ReflectionMethod\");\n\n/**\n * Hook to access the Reflection Method context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionMethod() {\n const context = useContext<ReflectionMethod>(ReflectionMethodContext)!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - Reflection Method Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const ReflectionParameterContext: ComponentContext<ReflectionParameter> =\n createNamedContext<ReflectionParameter>(\"ReflectionParameter\");\n\n/**\n * Hook to access the Reflection Parameter context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionParameter() {\n return useContext<ReflectionParameter>(ReflectionParameterContext)!;\n}\n"],"mappings":";;;;;;AAsCA,MAAa,yBAET,eAAqD;;;;;;AAOzD,SAAgB,qBAEZ;CACF,MAAM,UAAU,WACd,uBACD;AAED,KAAI,CAAC,QACH,OAAM,IAAI,MACR,sMACD;AAGH,QAAO;;;;;AAMT,MAAa,4BACX,mBAAuC,qBAAqB;;;;;;AAO9D,SAAgB,wBAAwB;CACtC,MAAM,UAAU,WAA+B,0BAA0B;AAEzE,KAAI,CAAC,QACH,OAAM,IAAI,MACR,0MACD;AAGH,QAAO;;;;;AAMT,MAAa,0BACX,mBAAqC,mBAAmB;;;;;;AAO1D,SAAgB,sBAAsB;CACpC,MAAM,UAAU,WAA6B,wBAAwB;AAErE,KAAI,CAAC,QACH,OAAM,IAAI,MACR,wMACD;AAGH,QAAO;;;;;AAMT,MAAa,6BACX,mBAAwC,sBAAsB;;;;;;AAOhE,SAAgB,yBAAyB;AACvC,QAAO,WAAgC,2BAA2B"}
@@ -0,0 +1,29 @@
1
+ import { Children } from "@alloy-js/core";
2
+
3
+ //#region src/core/helpers/code.d.ts
4
+ /**
5
+ * Turn the provided string template into Children by replacing literal line
6
+ * breaks with hardlines and automatically indenting indented content. Similar
7
+ * in spirit to the `<code>` element in HTML.
8
+ *
9
+ * @see {@link text} for a similar function which treats whitespace similar to
10
+ * JSX template bodies.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * code`
15
+ * function greet(name: string) {
16
+ * console.log("Hello, " + name + "!");
17
+ * }
18
+ * `
19
+ * ```
20
+ *
21
+ * @param template - The template string to be processed into Children.
22
+ * @param substitutions - Any interpolated values within the template, which will be treated as Children and properly indented.
23
+ * @returns A Children representation of the provided template string, with proper handling of line breaks and indentation.
24
+ * @throws Will throw an error if the provided template contains only whitespace, as this is likely a mistake and would cause a less recognizable "Cannot read properties of undefined" exception later in the processing.
25
+ */
26
+ declare function code(template: TemplateStringsArray, ...substitutions: Children[]): Children;
27
+ //#endregion
28
+ export { code };
29
+ //# sourceMappingURL=code.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.d.cts","names":[],"sources":["../../../src/core/helpers/code.ts"],"mappings":";;;;;AA0CA;;;;;;;;;;;;;;;;;;;;iBAAgB,IAAA,CACd,QAAA,EAAU,oBAAA,KACP,aAAA,EAAe,QAAA,KACjB,QAAA"}
@@ -0,0 +1,29 @@
1
+ import { Children } from "@alloy-js/core";
2
+
3
+ //#region src/core/helpers/code.d.ts
4
+ /**
5
+ * Turn the provided string template into Children by replacing literal line
6
+ * breaks with hardlines and automatically indenting indented content. Similar
7
+ * in spirit to the `<code>` element in HTML.
8
+ *
9
+ * @see {@link text} for a similar function which treats whitespace similar to
10
+ * JSX template bodies.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * code`
15
+ * function greet(name: string) {
16
+ * console.log("Hello, " + name + "!");
17
+ * }
18
+ * `
19
+ * ```
20
+ *
21
+ * @param template - The template string to be processed into Children.
22
+ * @param substitutions - Any interpolated values within the template, which will be treated as Children and properly indented.
23
+ * @returns A Children representation of the provided template string, with proper handling of line breaks and indentation.
24
+ * @throws Will throw an error if the provided template contains only whitespace, as this is likely a mistake and would cause a less recognizable "Cannot read properties of undefined" exception later in the processing.
25
+ */
26
+ declare function code(template: TemplateStringsArray, ...substitutions: Children[]): Children;
27
+ //#endregion
28
+ export { code };
29
+ //# sourceMappingURL=code.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.d.mts","names":[],"sources":["../../../src/core/helpers/code.ts"],"mappings":";;;;;AA0CA;;;;;;;;;;;;;;;;;;;;iBAAgB,IAAA,CACd,QAAA,EAAU,oBAAA,KACP,aAAA,EAAe,QAAA,KACjB,QAAA"}
@@ -29,4 +29,5 @@ function code(template, ...substitutions) {
29
29
  }
30
30
 
31
31
  //#endregion
32
- export { code };
32
+ export { code };
33
+ //# sourceMappingURL=code.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code.mjs","names":["baseCode"],"sources":["../../../src/core/helpers/code.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code as baseCode, Children } from \"@alloy-js/core\";\n\n/**\n * Turn the provided string template into Children by replacing literal line\n * breaks with hardlines and automatically indenting indented content. Similar\n * in spirit to the `<code>` element in HTML.\n *\n * @see {@link text} for a similar function which treats whitespace similar to\n * JSX template bodies.\n *\n * @example\n * ```ts\n * code`\n * function greet(name: string) {\n * console.log(\"Hello, \" + name + \"!\");\n * }\n * `\n * ```\n *\n * @param template - The template string to be processed into Children.\n * @param substitutions - Any interpolated values within the template, which will be treated as Children and properly indented.\n * @returns A Children representation of the provided template string, with proper handling of line breaks and indentation.\n * @throws Will throw an error if the provided template contains only whitespace, as this is likely a mistake and would cause a less recognizable \"Cannot read properties of undefined\" exception later in the processing.\n */\nexport function code(\n template: TemplateStringsArray,\n ...substitutions: Children[]\n): Children {\n if (\n template.filter(seg => seg.trim()).length === 0 &&\n substitutions.length === 0\n ) {\n throw new Error(\n \"The `code` function cannot be used with a template that contains only whitespace. Please provide a non-empty template.\"\n );\n }\n\n return baseCode(template, ...substitutions);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,KACd,UACA,GAAG,eACO;AACV,KACE,SAAS,QAAO,QAAO,IAAI,MAAM,CAAC,CAAC,WAAW,KAC9C,cAAc,WAAW,EAEzB,OAAM,IAAI,MACR,yHACD;AAGH,QAAOA,OAAS,UAAU,GAAG,cAAc"}
@@ -0,0 +1,2 @@
1
+ import { code } from "./code.cjs";
2
+ export { code };
@@ -0,0 +1,2 @@
1
+ import { code } from "./code.mjs";
2
+ export { code };
@@ -0,0 +1,9 @@
1
+ import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./contexts/context.cjs";
2
+ import { MetaContext, MetaItem, __ΩMetaItem, useMeta, useMetaContext, useMetaSafe } from "./contexts/meta.cjs";
3
+ import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./contexts/reflection.cjs";
4
+ import { Output, OutputProps, __ΩOutputProps } from "./components/output.cjs";
5
+ import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./components/single-line-comment.cjs";
6
+ import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./components/source-file.cjs";
7
+ import { Spacing, SpacingProps, __ΩSpacingProps } from "./components/spacing.cjs";
8
+ import { code } from "./helpers/code.cjs";
9
+ export { MetaContext, MetaItem, Output, OutputProps, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩMetaItem, __ΩOutputProps, __ΩReflectionClassContextInterface, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps, code, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -0,0 +1,9 @@
1
+ import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./contexts/context.mjs";
2
+ import { MetaContext, MetaItem, __ΩMetaItem, useMeta, useMetaContext, useMetaSafe } from "./contexts/meta.mjs";
3
+ import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./contexts/reflection.mjs";
4
+ import { Output, OutputProps, __ΩOutputProps } from "./components/output.mjs";
5
+ import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./components/single-line-comment.mjs";
6
+ import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./components/source-file.mjs";
7
+ import { Spacing, SpacingProps, __ΩSpacingProps } from "./components/spacing.mjs";
8
+ import { code } from "./helpers/code.mjs";
9
+ export { MetaContext, MetaItem, Output, OutputProps, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩMetaItem, __ΩOutputProps, __ΩReflectionClassContextInterface, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps, code, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -0,0 +1,87 @@
1
+ import { Context, PluginContext } from "powerlines";
2
+ import { ReflectionClass, ReflectionMethod, ReflectionParameter, ReflectionProperty, Type, TypeEnum, TypeUnion } from "@powerlines/deepkit/vendor/type";
3
+ import { CapnpcOptions, CapnpcResult } from "@stryke/capnp/types";
4
+
5
+ //#region src/helpers/capnp.d.ts
6
+ /**
7
+ * Compiles a Cap'n Proto schema into TypeScript definitions.
8
+ *
9
+ * @param context - The context containing the project and workspace information.
10
+ * @param options - The options for compiling the schema.
11
+ * @returns A promise that resolves to the compiled schema.
12
+ */
13
+ declare function compile(context: Context, options?: Partial<CapnpcOptions>): Promise<CapnpcResult>;
14
+ /**
15
+ * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
16
+ *
17
+ * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
18
+ * @param value - The value to stringify.
19
+ * @returns A string representation of the value.
20
+ */
21
+ declare function stringifyCapnpDefaultValue(property: ReflectionProperty | ReflectionParameter, value?: any): string;
22
+ /**
23
+ * Converts any {@link Type}'s actual value to string representation.
24
+ *
25
+ * @param type - The {@link Type} of the value to stringify.
26
+ * @param value - The value to stringify.
27
+ * @returns A string representation of the value.
28
+ */
29
+ declare function stringifyCapnpValue(type: Type, value: any): string;
30
+ /**
31
+ * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.
32
+ *
33
+ * @param type - The TypeEnum to evaluate.
34
+ * @returns A string representation of the property.
35
+ */
36
+ declare function getCapnpEnumTypes(type: Type): "Text" | "Float32" | null;
37
+ /**
38
+ * Determines if a Type is a `Void` type in a Cap'n Proto schema.
39
+ *
40
+ * @param type - The Type to check.
41
+ * @returns True if the Type is a `Void` type, false otherwise.
42
+ */
43
+ declare function isVoidType(type: Type): boolean;
44
+ /**
45
+ * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
46
+ *
47
+ * @param type - The {@link TypeUnion} to convert.
48
+ * @returns A string representation of the Cap'n Proto primitive type.
49
+ */
50
+ declare function getCapnpUnionTypes(type: Type): Type[];
51
+ /**
52
+ * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
53
+ *
54
+ * @param type - The {@link TypeUnion} to convert.
55
+ * @returns An array of Cap'n Proto primitive types.
56
+ */
57
+ declare function isCapnpStringUnion(type: Type): boolean;
58
+ declare const LARGE_BUFFER: number;
59
+ type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
60
+ type StdioOptions = IOType | Array<IOType | "ipc" | number | null | undefined>;
61
+ declare function generateCapnpId(): Promise<string>;
62
+ interface GenerateCapnpOptions {
63
+ name?: string;
64
+ }
65
+ declare function generateCapnp(context: PluginContext, reflection: ReflectionClass<any>, options: GenerateCapnpOptions): Promise<string>;
66
+ interface GenerateCapnpStructOptions extends GenerateCapnpOptions {
67
+ indexCounter?: () => number;
68
+ }
69
+ declare function generateCapnpStruct(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
70
+ declare function generateCapnpInterface(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
71
+ declare function generateCapnpSchema(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
72
+ declare function generateCapnpMethodSchema(reflection: ReflectionMethod, indexCounter: () => number): string;
73
+ declare function generateCapnpEnumSchema(type: TypeEnum | TypeUnion, name: string): string;
74
+ /**
75
+ * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.
76
+ *
77
+ * @param type - The Deepkit Type to convert.
78
+ * @returns A string representation of the Cap'n Proto primitive type.
79
+ */
80
+ declare function generateCapnpPrimitive(type: Type): string;
81
+ declare type __ΩIOType = any[];
82
+ declare type __ΩStdioOptions = any[];
83
+ declare type __ΩGenerateCapnpOptions = any[];
84
+ declare type __ΩGenerateCapnpStructOptions = any[];
85
+ //#endregion
86
+ export { GenerateCapnpOptions, GenerateCapnpStructOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩIOType, __ΩStdioOptions, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue };
87
+ //# sourceMappingURL=capnp.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capnp.d.cts","names":[],"sources":["../../src/helpers/capnp.ts"],"mappings":";;;;;;;AA8DA;;;;;iBAAsB,OAAA,CACpB,OAAA,EAAS,OAAA,EACT,OAAA,GAAS,OAAA,CAAQ,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erlines/deepkit/vendor/type";
2
+ import { Context, PluginContext } from "powerlines";
3
+ import { CapnpcOptions, CapnpcResult } from "@stryke/capnp/types";
4
+
5
+ //#region src/helpers/capnp.d.ts
6
+ /**
7
+ * Compiles a Cap'n Proto schema into TypeScript definitions.
8
+ *
9
+ * @param context - The context containing the project and workspace information.
10
+ * @param options - The options for compiling the schema.
11
+ * @returns A promise that resolves to the compiled schema.
12
+ */
13
+ declare function compile(context: Context, options?: Partial<CapnpcOptions>): Promise<CapnpcResult>;
14
+ /**
15
+ * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
16
+ *
17
+ * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
18
+ * @param value - The value to stringify.
19
+ * @returns A string representation of the value.
20
+ */
21
+ declare function stringifyCapnpDefaultValue(property: ReflectionProperty | ReflectionParameter, value?: any): string;
22
+ /**
23
+ * Converts any {@link Type}'s actual value to string representation.
24
+ *
25
+ * @param type - The {@link Type} of the value to stringify.
26
+ * @param value - The value to stringify.
27
+ * @returns A string representation of the value.
28
+ */
29
+ declare function stringifyCapnpValue(type: Type, value: any): string;
30
+ /**
31
+ * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.
32
+ *
33
+ * @param type - The TypeEnum to evaluate.
34
+ * @returns A string representation of the property.
35
+ */
36
+ declare function getCapnpEnumTypes(type: Type): "Text" | "Float32" | null;
37
+ /**
38
+ * Determines if a Type is a `Void` type in a Cap'n Proto schema.
39
+ *
40
+ * @param type - The Type to check.
41
+ * @returns True if the Type is a `Void` type, false otherwise.
42
+ */
43
+ declare function isVoidType(type: Type): boolean;
44
+ /**
45
+ * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
46
+ *
47
+ * @param type - The {@link TypeUnion} to convert.
48
+ * @returns A string representation of the Cap'n Proto primitive type.
49
+ */
50
+ declare function getCapnpUnionTypes(type: Type): Type[];
51
+ /**
52
+ * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
53
+ *
54
+ * @param type - The {@link TypeUnion} to convert.
55
+ * @returns An array of Cap'n Proto primitive types.
56
+ */
57
+ declare function isCapnpStringUnion(type: Type): boolean;
58
+ declare const LARGE_BUFFER: number;
59
+ type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
60
+ type StdioOptions = IOType | Array<IOType | "ipc" | number | null | undefined>;
61
+ declare function generateCapnpId(): Promise<string>;
62
+ interface GenerateCapnpOptions {
63
+ name?: string;
64
+ }
65
+ declare function generateCapnp(context: PluginContext, reflection: ReflectionClass<any>, options: GenerateCapnpOptions): Promise<string>;
66
+ interface GenerateCapnpStructOptions extends GenerateCapnpOptions {
67
+ indexCounter?: () => number;
68
+ }
69
+ declare function generateCapnpStruct(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
70
+ declare function generateCapnpInterface(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
71
+ declare function generateCapnpSchema(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
72
+ declare function generateCapnpMethodSchema(reflection: ReflectionMethod, indexCounter: () => number): string;
73
+ declare function generateCapnpEnumSchema(type: TypeEnum | TypeUnion, name: string): string;
74
+ /**
75
+ * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.
76
+ *
77
+ * @param type - The Deepkit Type to convert.
78
+ * @returns A string representation of the Cap'n Proto primitive type.
79
+ */
80
+ declare function generateCapnpPrimitive(type: Type): string;
81
+ declare type __ΩIOType = any[];
82
+ declare type __ΩStdioOptions = any[];
83
+ declare type __ΩGenerateCapnpOptions = any[];
84
+ declare type __ΩGenerateCapnpStructOptions = any[];
85
+ //#endregion
86
+ export { GenerateCapnpOptions, GenerateCapnpStructOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩIOType, __ΩStdioOptions, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue };
87
+ //# sourceMappingURL=capnp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capnp.d.mts","names":[],"sources":["../../src/helpers/capnp.ts"],"mappings":";;;;;;;AA8DA;;;;;iBAAsB,OAAA,CACpB,OAAA,EAAS,OAAA,EACT,OAAA,GAAS,OAAA,CAAQ,aAAA,IAChB,OAAA,CAAQ,YAAA;;;;;;;;iBA+BK,0BAAA,CACd,QAAA,EAAU,kBAAA,GAAqB,mBAAA,EAC/B,KAAA;;;;;;AAFF;;iBAiBgB,mBAAA,CAAoB,IAAA,EAAM,IAAA,EAAM,KAAA;;;;;;;iBAoBhC,iBAAA,CAAkB,IAAA,EAAM,IAAA;AApBxC;;;;;;AAAA,iBA0CgB,UAAA,CAAW,IAAA,EAAM,IAAA;;;AAtBjC;;;;iBAsCgB,kBAAA,CAAmB,IAAA,EAAM,IAAA,GAAO,IAAA;AAhBhD;;;;;AAgBA;AAhBA,iBA0BgB,kBAAA,CAAmB,IAAA,EAAM,IAAA;AAAA,cAM5B,YAAA;AAAA,KACD,MAAA;AAAA,KACA,YAAA,GACR,MAAA,GACA,KAAA,CAAM,MAAA;AAAA,iBAIY,eAAA,CAAA,GAAe,OAAA;AAAA,UAUpB,oBAAA;EACf,IAAA;AAAA;AAAA,iBAGoB,aAAA,CACpB,OAAA,EAAS,aAAA,EACT,UAAA,EAAY,eAAA,OACZ,OAAA,EAAS,oBAAA,GAAoB,OAAA;AAAA,UAgBd,0BAAA,SAAmC,oBAAA;EAClD,YAAA;AAAA;AAAA,iBAGc,mBAAA,CACd,UAAA,EAAY,eAAA,OACZ,OAAA,GAAS,0BAAA;AAAA,iBAgBK,sBAAA,CACd,UAAA,EAAY,eAAA,OACZ,OAAA,GAAS,0BAAA;AAAA,iBAyDK,mBAAA,CACd,UAAA,EAAY,eAAA,OACZ,OAAA,GAAS,0BAAA;AAAA,iBA4EK,yBAAA,CACd,UAAA,EAAY,gBAAA,EACZ,YAAA;AAAA,iBA0Mc,uBAAA,CACd,IAAA,EAAM,QAAA,GAAW,SAAA,EACjB,IAAA;;AArZF;;;;;iBAudgB,sBAAA,CAAuB,IAAA,EAAM,IAAA;AAAA"}
@@ -256,4 +256,5 @@ function generateCapnpPrimitive(type) {
256
256
  }
257
257
 
258
258
  //#endregion
259
- export { LARGE_BUFFER, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue };
259
+ export { LARGE_BUFFER, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue };
260
+ //# sourceMappingURL=capnp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capnp.mjs","names":[],"sources":["../../src/helpers/capnp.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { getUnionTypes, kindToName } from \"@powerlines/deepkit/utilities\";\nimport { getClassName } from \"@powerlines/deepkit/vendor/core\";\nimport {\n memberNameToString,\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionParameter,\n ReflectionProperty,\n Type,\n TypeEnum,\n TypeLiteral,\n TypeUnion\n} from \"@powerlines/deepkit/vendor/type\";\nimport { capnpc } from \"@stryke/capnp/compile\";\nimport { resolveOptions } from \"@stryke/capnp/helpers\";\nimport type { CapnpcOptions, CapnpcResult } from \"@stryke/capnp/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { StormJSON } from \"@stryke/json\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { getWords } from \"@stryke/string-format/get-words\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBigInt } from \"@stryke/type-checks/is-bigint\";\nimport { isNull } from \"@stryke/type-checks/is-null\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport defu from \"defu\";\nimport { Buffer } from \"node:buffer\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { Context, PluginContext } from \"powerlines\";\nimport { getFileHeader } from \"powerlines/utils\";\n\n/**\n * Compiles a Cap'n Proto schema into TypeScript definitions.\n *\n * @param context - The context containing the project and workspace information.\n * @param options - The options for compiling the schema.\n * @returns A promise that resolves to the compiled schema.\n */\nexport async function compile(\n context: Context,\n options: Partial<CapnpcOptions> = {}\n): Promise<CapnpcResult> {\n const opts = defu(options, {\n ts: true,\n js: false,\n dts: false,\n schemas: joinPaths(context.artifactsPath, \"schemas\"),\n tsconfig: context.tsconfig,\n projectRoot: context.config.root,\n workspaceRoot: context.workspaceConfig.workspaceRoot,\n tty: true\n }) as Parameters<typeof resolveOptions>[0];\n\n const resolvedOptions = await resolveOptions(opts);\n if (!resolvedOptions) {\n throw new Error(\n `✖ No Cap'n Proto schema files found in the specified source paths: ${toArray(\n opts.schemas\n ).join(\", \")}.`\n );\n }\n\n return capnpc(resolvedOptions);\n}\n\n/**\n * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.\n *\n * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyCapnpDefaultValue(\n property: ReflectionProperty | ReflectionParameter,\n value?: any\n): string {\n return stringifyCapnpValue(\n property.type,\n value ?? property.getDefaultValue()\n );\n}\n\n/**\n * Converts any {@link Type}'s actual value to string representation.\n *\n * @param type - The {@link Type} of the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyCapnpValue(type: Type, value: any): string {\n return type.kind === ReflectionKind.string ||\n (type.kind === ReflectionKind.literal && isString(type.literal))\n ? `\"${String(value)}\"`\n : type.kind === ReflectionKind.enum\n ? `${camelCase(String(value))}`\n : type.kind === ReflectionKind.array\n ? StormJSON.stringify(value)\n : type.kind === ReflectionKind.object ||\n type.kind === ReflectionKind.objectLiteral\n ? StormJSON.stringify(value).replaceAll(\"{\", \"(\").replaceAll(\"}\", \")\")\n : String(value);\n}\n\n/**\n * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.\n *\n * @param type - The TypeEnum to evaluate.\n * @returns A string representation of the property.\n */\nexport function getCapnpEnumTypes(type: Type): \"Text\" | \"Float32\" | null {\n if (type.kind !== ReflectionKind.enum) {\n return null;\n }\n\n const unique = getUniqueBy(\n type.values.filter(value => !isUndefined(value) && !isNull(value)),\n enumMember => (isString(enumMember) ? \"Text\" : \"Float32\")\n );\n if (unique.length === 0) {\n return null;\n }\n\n return unique[0] && isString(unique[0]) ? \"Text\" : \"Float32\";\n}\n\n/**\n * Determines if a Type is a `Void` type in a Cap'n Proto schema.\n *\n * @param type - The Type to check.\n * @returns True if the Type is a `Void` type, false otherwise.\n */\nexport function isVoidType(type: Type): boolean {\n return (\n type.kind === ReflectionKind.void ||\n type.kind === ReflectionKind.never ||\n type.kind === ReflectionKind.null ||\n type.kind === ReflectionKind.undefined ||\n type.kind === ReflectionKind.symbol\n );\n}\n\n/**\n * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.\n *\n * @param type - The {@link TypeUnion} to convert.\n * @returns A string representation of the Cap'n Proto primitive type.\n */\nexport function getCapnpUnionTypes(type: Type): Type[] {\n return getUnionTypes(type);\n}\n\n/**\n * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.\n *\n * @param type - The {@link TypeUnion} to convert.\n * @returns An array of Cap'n Proto primitive types.\n */\nexport function isCapnpStringUnion(type: Type): boolean {\n return getCapnpUnionTypes(type).some(\n member => member.kind === ReflectionKind.string\n );\n}\n\nexport const LARGE_BUFFER = 1024 * 1000000;\nexport type IOType = \"overlapped\" | \"pipe\" | \"ignore\" | \"inherit\";\nexport type StdioOptions =\n | IOType\n | Array<IOType | \"ipc\" | number | null | undefined>;\n\nconst execAsync = promisify(exec);\n\nexport async function generateCapnpId() {\n const { stdout } = await execAsync(\"capnp id\", {\n windowsHide: true,\n maxBuffer: LARGE_BUFFER,\n killSignal: \"SIGTERM\"\n });\n\n return stdout;\n}\n\nexport interface GenerateCapnpOptions {\n name?: string;\n}\n\nexport async function generateCapnp(\n context: PluginContext,\n reflection: ReflectionClass<any>,\n options: GenerateCapnpOptions\n) {\n const capnpId = await generateCapnpId();\n\n return `${capnpId.trim()};\n${getFileHeader(context)\n .replace(/^\\r*\\n*/g, \"\")\n .replaceAll(\"//\", \"#\")}\n${\n reflection.getMethods().length === 0\n ? generateCapnpStruct(reflection, options)\n : generateCapnpInterface(reflection, options)\n}\n`.trim();\n}\n\nexport interface GenerateCapnpStructOptions extends GenerateCapnpOptions {\n indexCounter?: () => number;\n}\n\nexport function generateCapnpStruct(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n const structName =\n options?.name ||\n reflection.getTitle() ||\n reflection.getClassName() ||\n reflection.getName();\n\n return `${generateCapnpEnums(reflection)}struct ${pascalCase(structName)} {\n # Struct definition for ${titleCase(structName)}.\n\n ${generateCapnpSchema(reflection, options)}\n}\n`;\n}\n\nexport function generateCapnpInterface(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n const interfaceName =\n options?.name ||\n reflection.getTitle() ||\n reflection.getClassName() ||\n reflection.getName();\n\n return `${generateCapnpEnums(reflection)}interface ${pascalCase(interfaceName)} {\n # Interface definition for ${titleCase(interfaceName)}.\n\n ${generateCapnpSchema(reflection, options)}\n}\n`;\n}\n\nfunction formatEnumName(name: string) {\n return pascalCase(`${name}_Type`);\n}\n\nfunction generateCapnpEnums(reflection: ReflectionClass<any>): string {\n const enums = reflection\n .getProperties()\n .filter(\n prop =>\n !prop.isIgnored() &&\n (prop.type.kind === ReflectionKind.enum ||\n (prop.type.kind === ReflectionKind.union &&\n getCapnpUnionTypes(prop.type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ).length === 1))\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? b.getNameAsString().localeCompare(a.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n );\n if (enums.length === 0) {\n return \"\";\n }\n\n return `${enums\n .map(enumeration =>\n generateCapnpEnumSchema(\n enumeration.type as TypeEnum | TypeUnion,\n formatEnumName(enumeration.getNameAsString())\n )\n )\n .join(\"\\n\\n\")}\n\n`;\n}\n\nexport function generateCapnpSchema(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n let index = 0;\n const indexCounter: () => number = options?.indexCounter ?? (() => index++);\n\n return `${reflection\n .getProperties()\n .filter(prop => !prop.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? b.getNameAsString().localeCompare(a.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(prop => generateCapnpPropertySchema(prop, indexCounter))\n .join(\" \\n\\n\\t\")}${reflection\n .getMethods()\n .filter(methods => !methods.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? String(b.getName()).localeCompare(String(a.getName()))\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(methods => generateCapnpMethodSchema(methods, indexCounter))\n .join(\" \\n\\n\\t\")}${\n reflection\n .getProperties()\n .some(\n prop =>\n prop.type.kind === ReflectionKind.class && prop.type.classType === Map\n )\n ? `\n struct Map(Key, Value) {\n entries @0 :List(Entry);\n\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n }`\n : \"\"\n }${\n reflection\n .getProperties()\n .some(\n prop =>\n prop.type.kind === ReflectionKind.class &&\n prop.type.classType === Date\n )\n ? `\n struct Date {\n # A standard Gregorian calendar date.\n\n year @0 :Int16;\n # The year - Must include the century.\n # Negative value indicates BC.\n\n month @1 :UInt8; # The month, 1-12\n\n day @2 :UInt8; # The day of the month, 1-30\n\n hour @3 :UInt8; # The hour of the day, 0-23\n\n minute @4 :UInt8; # The minute of the hour, 0-59\n\n second @5 :UInt8; # The second of the minute, 0-59\n\n millisecond @6 :UInt16; # Milliseconds of the second, 0-999\n }`\n : \"\"\n }`;\n}\n\nexport function generateCapnpMethodSchema(\n reflection: ReflectionMethod,\n indexCounter: () => number\n): string {\n const methodName =\n reflection.getTitle() || typeof reflection.getName() === \"string\"\n ? String(reflection.getName())\n : \"\";\n if (!methodName) {\n throw new Error(\n `Cannot generate Cap'n Proto schema for method without a name - Parent interface: ${reflection.reflectionClass.getName()}`\n );\n }\n\n return `${camelCase(methodName)} @${indexCounter()} (${reflection\n .getParameters()\n .map(param => {\n return `${camelCase(\n param.getName()\n )} :${generateCapnpPrimitive(param.getType())}${\n param.hasDefault() ? ` = ${stringifyCapnpDefaultValue(param)}` : \"\"\n }`;\n })\n .join(\", \")})${\n isVoidType(reflection.getReturnType())\n ? \"\"\n : ` -> (${kindToName(\n reflection.getReturnType().kind\n )}: ${generateCapnpPrimitive(reflection.getReturnType())})`\n }; # ${(\n reflection.getDescription() ||\n `The ${titleCase(\n reflection.reflectionClass.getTitle() ||\n reflection.reflectionClass.getName()\n )} interface ${titleCase(methodName)} method.`\n ).replaceAll(\"\\n\", \". \")}`;\n}\n\nfunction generateCapnpPropertyComment(reflection: ReflectionProperty) {\n const result = getWords(\n reflection.getDescription() ||\n `A schema property for ${titleCase(\n reflection.getTitle() || reflection.getNameAsString()\n )} field.`,\n {\n relaxed: true\n }\n )\n .reduce((ret, word) => {\n let length = ret.length;\n if (ret.includes(\"\\n\")) {\n length = ret.substring(ret.lastIndexOf(\"\\n\") + 1).length;\n }\n\n const current = word.trim();\n if (length + current.length > 60) {\n ret += `\\n\\t# ${current}`;\n } else {\n ret += ` ${current}`;\n }\n return ret;\n }, \"\")\n .trim();\n if (result.length > 0) {\n return `\\t# ${result}`;\n }\n\n return \"\";\n}\n\nfunction generateCapnpPropertySchema(\n reflection: ReflectionProperty,\n indexCounter: () => number\n): string {\n if (reflection.type.kind === ReflectionKind.union) {\n if (getCapnpUnionTypes(reflection.type).length === 0) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Void;\n${generateCapnpPropertyComment(reflection)}`;\n } else if (\n getCapnpUnionTypes(reflection.type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ).length === 1\n ) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${formatEnumName(\n reflection.getNameAsString()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else {\n return `${camelCase(reflection.getNameAsString())} :union {\n${getCapnpUnionTypes(reflection.type)\n .map(\n type =>\n ` ${kindToName(type.kind)} @${indexCounter()} :${generateCapnpPrimitive(\n type\n )};`\n )\n .join(\"\\n\")}\n }\n${generateCapnpPropertyComment(reflection)}`;\n }\n } else if (reflection.type.kind === ReflectionKind.array) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :List(${generateCapnpPrimitive(reflection.getSubType())})${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.kind === ReflectionKind.class) {\n if (reflection.type.classType === Map) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Map(${\n !reflection.type.typeArguments ||\n reflection.type.typeArguments.length === 0 ||\n !reflection.type.typeArguments[0]\n ? \"Data\"\n : generateCapnpPrimitive(reflection.type.typeArguments[0])\n }, ${\n !reflection.type.typeArguments ||\n reflection.type.typeArguments.length < 2 ||\n !reflection.type.typeArguments[1]\n ? \"Data\"\n : generateCapnpPrimitive(reflection.type.typeArguments[1])\n })${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === Date) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === Buffer) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === ArrayBuffer) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.type.typeName || getClassName(reflection.type.classType)\n )}${generateCapnpStruct(reflection.reflectionClass, {\n name: pascalCase(\n reflection.type.typeName || getClassName(reflection.type.classType)\n )\n })}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n }\n } else if (reflection.type.kind === ReflectionKind.objectLiteral) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.type.typeName ||\n memberNameToString(reflection.getNameAsString())\n )}${generateCapnpStruct(reflection.reflectionClass, {\n name: pascalCase(\n reflection.type.typeName ||\n memberNameToString(reflection.getNameAsString())\n )\n })}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.kind === ReflectionKind.enum) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.getNameAsString()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n }\n\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${generateCapnpPrimitive(\n reflection.getType()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n}\n\nexport function generateCapnpEnumSchema(\n type: TypeEnum | TypeUnion,\n name: string\n): string {\n if (type.kind === ReflectionKind.union) {\n return generateCapnpEnumSchema(\n {\n kind: ReflectionKind.enum,\n indexType: type,\n enum: (type.types as TypeLiteral[]).reduce<\n Record<string, string | number>\n >((ret, type) => {\n if (isString(type.literal) || isNumber(type.literal)) {\n ret[camelCase(String(type.literal))] = type.literal;\n }\n\n return ret;\n }, {}),\n values: (\n getCapnpUnionTypes(type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ) as TypeLiteral[]\n ).map(type => type.literal as string | number)\n },\n name\n );\n }\n\n let index = 0;\n const indexCounter: () => number = () => index++;\n\n const enumType = getCapnpEnumTypes(type);\n if (!enumType) {\n return \"\";\n }\n\n return `enum ${pascalCase(name)} {\n${\n type.enum && Object.entries(type.enum).length > 0\n ? Object.entries(type.enum)\n .filter(([, value]) => value !== null && value !== undefined)\n .map(([key]) => ` ${camelCase(key)} @${indexCounter()};`)\n .join(\"\\n\")\n : type.values\n .filter(value => value !== null && value !== undefined)\n .map(\n value =>\n `${\n enumType === \"Text\" && value\n ? camelCase(String(value))\n : `${\n type.typeName ? `${camelCase(type.typeName)}_` : \"\"\n }${value || \"\"}`\n } @${indexCounter()};`\n )\n .join(\"\\n\")\n}\n }`;\n}\n\n/**\n * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.\n *\n * @param type - The Deepkit Type to convert.\n * @returns A string representation of the Cap'n Proto primitive type.\n */\nexport function generateCapnpPrimitive(type: Type): string {\n return type.kind === ReflectionKind.never ||\n type.kind === ReflectionKind.void ||\n type.kind === ReflectionKind.null ||\n type.kind === ReflectionKind.undefined ||\n type.kind === ReflectionKind.symbol\n ? \"Void\"\n : type.kind === ReflectionKind.class && type.classType === Date\n ? \"Date\"\n : type.kind === ReflectionKind.class && type.classType === Set\n ? `List(${\n type.typeArguments && type.typeArguments[0]\n ? generateCapnpPrimitive(type.typeArguments[0])\n : \"Data\"\n })`\n : type.kind === ReflectionKind.bigint\n ? \"UInt64\"\n : type.kind === ReflectionKind.number\n ? \"Float64\"\n : type.kind === ReflectionKind.string ||\n type.kind === ReflectionKind.regexp\n ? \"Text\"\n : type.kind === ReflectionKind.boolean\n ? \"Bool\"\n : type.kind === ReflectionKind.literal\n ? isNumber(type.literal)\n ? \"Float64\"\n : isBigInt(type.literal)\n ? \"UInt64\"\n : isString(type.literal)\n ? \"Text\"\n : typeof type.literal === \"boolean\"\n ? \"Bool\"\n : \"Data\"\n : \"Data\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,eAAs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,SAC7B,SACA,KAAK,SAAS,eAAe,UAC3B,SACA,KAAK,SAAS,eAAe,UAC3B,SAAS,KAAK,QAAQ,GACpB,YACA,SAAS,KAAK,QAAQ,GACpB,WACA,SAAS,KAAK,QAAQ,GACpB,SACA,OAAO,KAAK,YAAY,YACtB,SACA,SACR"}
@@ -0,0 +1,16 @@
1
+ import { SymbolCreator } from "@alloy-js/core";
2
+ import { CreatePackageProps, PackageDescriptor, PackageRefkeys } from "@alloy-js/typescript";
3
+
4
+ //#region src/helpers/create-builtin.d.ts
5
+ type CreateBuiltinOptions<T extends PackageDescriptor> = Omit<CreatePackageProps<T>, "builtin">;
6
+ /**
7
+ * Creates a built-in representation of a package based on the provided descriptor.
8
+ *
9
+ * @param options - Properties to define the package, excluding the 'builtin' flag which is set to true.
10
+ * @returns An object containing reference keys for the package and a symbol creator function.
11
+ */
12
+ declare function createBuiltin<const T extends PackageDescriptor>(options: CreateBuiltinOptions<T>): PackageRefkeys<T> & SymbolCreator;
13
+ declare type __ΩCreateBuiltinOptions = any[];
14
+ //#endregion
15
+ export { CreateBuiltinOptions, __ΩCreateBuiltinOptions, createBuiltin };
16
+ //# sourceMappingURL=create-builtin.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-builtin.d.cts","names":[],"sources":["../../src/helpers/create-builtin.ts"],"mappings":";;;;KA0BY,oBAAA,WAA+B,iBAAA,IAAqB,IAAA,CAC9D,kBAAA,CAAmB,CAAA;;AADrB;;;;;iBAWgB,aAAA,iBAA8B,iBAAA,CAAA,CAC5C,OAAA,EAAS,oBAAA,CAAqB,CAAA,IAC7B,cAAA,CAAe,CAAA,IAAK,aAAA;AAAA"}
@@ -0,0 +1,16 @@
1
+ import { SymbolCreator } from "@alloy-js/core";
2
+ import { CreatePackageProps, PackageDescriptor, PackageRefkeys } from "@alloy-js/typescript";
3
+
4
+ //#region src/helpers/create-builtin.d.ts
5
+ type CreateBuiltinOptions<T extends PackageDescriptor> = Omit<CreatePackageProps<T>, "builtin">;
6
+ /**
7
+ * Creates a built-in representation of a package based on the provided descriptor.
8
+ *
9
+ * @param options - Properties to define the package, excluding the 'builtin' flag which is set to true.
10
+ * @returns An object containing reference keys for the package and a symbol creator function.
11
+ */
12
+ declare function createBuiltin<const T extends PackageDescriptor>(options: CreateBuiltinOptions<T>): PackageRefkeys<T> & SymbolCreator;
13
+ declare type __ΩCreateBuiltinOptions = any[];
14
+ //#endregion
15
+ export { CreateBuiltinOptions, __ΩCreateBuiltinOptions, createBuiltin };
16
+ //# sourceMappingURL=create-builtin.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-builtin.d.mts","names":[],"sources":["../../src/helpers/create-builtin.ts"],"mappings":";;;;KA0BY,oBAAA,WAA+B,iBAAA,IAAqB,IAAA,CAC9D,kBAAA,CAAmB,CAAA;;AADrB;;;;;iBAWgB,aAAA,iBAA8B,iBAAA,CAAA,CAC5C,OAAA,EAAS,oBAAA,CAAqB,CAAA,IAC7B,cAAA,CAAe,CAAA,IAAK,aAAA;AAAA"}
@@ -15,4 +15,5 @@ function createBuiltin(options) {
15
15
  }
16
16
 
17
17
  //#endregion
18
- export { createBuiltin };
18
+ export { createBuiltin };
19
+ //# sourceMappingURL=create-builtin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-builtin.mjs","names":[],"sources":["../../src/helpers/create-builtin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { SymbolCreator } from \"@alloy-js/core\";\nimport {\n createPackage,\n CreatePackageProps,\n PackageDescriptor,\n PackageRefkeys\n} from \"@alloy-js/typescript\";\n\nexport type CreateBuiltinOptions<T extends PackageDescriptor> = Omit<\n CreatePackageProps<T>,\n \"builtin\"\n>;\n\n/**\n * Creates a built-in representation of a package based on the provided descriptor.\n *\n * @param options - Properties to define the package, excluding the 'builtin' flag which is set to true.\n * @returns An object containing reference keys for the package and a symbol creator function.\n */\nexport function createBuiltin<const T extends PackageDescriptor>(\n options: CreateBuiltinOptions<T>\n): PackageRefkeys<T> & SymbolCreator {\n // const refkeys: any = {\n // [getSymbolCreatorSymbol()](binder: Binder) {\n // createSymbols(binder, props, refkeys);\n // }\n // };\n\n // for (const [path, symbols] of Object.entries(props.descriptor)) {\n // const keys = path === \".\" ? refkeys : (refkeys[path] = {});\n\n // if (symbols.default) {\n // keys.default = refkey(props.descriptor, path, \"default\");\n // }\n\n // for (const named of symbols.named ?? []) {\n // const namedObj = typeof named === \"string\" ? { name: named } : named;\n // keys[namedObj.name] = refkey();\n\n // if (namedObj.staticMembers?.length) {\n // createRefkeysForMembers(\n // namedObj.staticMembers,\n // keys[namedObj.name],\n // \"static\"\n // );\n // }\n\n // if (namedObj.instanceMembers?.length) {\n // createRefkeysForMembers(\n // namedObj.instanceMembers,\n // keys[namedObj.name],\n // \"instance\"\n // );\n // }\n\n // keys[namedObj.name][getSymbolCreatorSymbol()] = (\n // binder: Binder,\n // parentSym: TSOutputSymbol\n // ) => {\n // if (namedObj.staticMembers?.length) {\n // assignMembers(\n // binder,\n // parentSym,\n // namedObj.staticMembers,\n // keys[namedObj.name],\n // true\n // );\n // }\n // if (namedObj.instanceMembers?.length) {\n // assignMembers(\n // binder,\n // parentSym,\n // namedObj.instanceMembers,\n // keys[namedObj.name],\n // false\n // );\n // }\n // };\n // }\n // }\n\n // return refkeys;\n\n return createPackage({ ...options, builtin: true });\n}\n"],"mappings":";;;;;;;;;AAqCA,SAAgB,cACd,SACmC;AA8DnC,QAAO,cAAc;EAAE,GAAG;EAAS,SAAS;EAAM,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { GenerateCapnpOptions, GenerateCapnpStructOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩIOType, __ΩStdioOptions, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue } from "./capnp.cjs";
2
+ import { CreateBuiltinOptions, __ΩCreateBuiltinOptions, createBuiltin } from "./create-builtin.cjs";
3
+ import { refkey } from "./refkey.cjs";
4
+ import { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration } from "./typescript.cjs";
5
+ export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions, GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩCreateBuiltinOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, __ΩIOType, __ΩStdioOptions, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateObjectDeclaration, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
@@ -0,0 +1,5 @@
1
+ import { GenerateCapnpOptions, GenerateCapnpStructOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩIOType, __ΩStdioOptions, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue } from "./capnp.mjs";
2
+ import { CreateBuiltinOptions, __ΩCreateBuiltinOptions, createBuiltin } from "./create-builtin.mjs";
3
+ import { refkey } from "./refkey.mjs";
4
+ import { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration } from "./typescript.mjs";
5
+ export { CreateBuiltinOptions, GenerateCapnpOptions, GenerateCapnpStructOptions, GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, IOType, LARGE_BUFFER, StdioOptions, __ΩCreateBuiltinOptions, __ΩGenerateCapnpOptions, __ΩGenerateCapnpStructOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, __ΩIOType, __ΩStdioOptions, compile, createBuiltin, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, generateObjectDeclaration, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, refkey, stringifyCapnpDefaultValue, stringifyCapnpValue };
@@ -0,0 +1,13 @@
1
+ import { Refkey } from "@alloy-js/core";
2
+
3
+ //#region src/helpers/refkey.d.ts
4
+ /**
5
+ * Create a refkey for the provided arguments. Passing no arguments returns a fresh refkey that is guaranteed to be unique. Otherwise, the arguments passed will be used to create a refkey for those values. Providing the same arguments will always return the same refkey.
6
+ *
7
+ * @remarks
8
+ * Values are compared using the SameValueZero algorithm, which considers objects the same if they are reference identical, and primitives the same if they are the same value, with the exception of `NaN`, which is always considered equal to other `NaN` values, and `-0`, which is considered identical to `+0`
9
+ */
10
+ declare function refkey(...args: unknown[]): Refkey;
11
+ //#endregion
12
+ export { refkey };
13
+ //# sourceMappingURL=refkey.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refkey.d.cts","names":[],"sources":["../../src/helpers/refkey.ts"],"mappings":";;;;;AA0BA;;;;iBAAgB,MAAA,CAAA,GAAU,IAAA,cAAkB,MAAA"}
@@ -0,0 +1,13 @@
1
+ import { Refkey } from "@alloy-js/core";
2
+
3
+ //#region src/helpers/refkey.d.ts
4
+ /**
5
+ * Create a refkey for the provided arguments. Passing no arguments returns a fresh refkey that is guaranteed to be unique. Otherwise, the arguments passed will be used to create a refkey for those values. Providing the same arguments will always return the same refkey.
6
+ *
7
+ * @remarks
8
+ * Values are compared using the SameValueZero algorithm, which considers objects the same if they are reference identical, and primitives the same if they are the same value, with the exception of `NaN`, which is always considered equal to other `NaN` values, and `-0`, which is considered identical to `+0`
9
+ */
10
+ declare function refkey(...args: unknown[]): Refkey;
11
+ //#endregion
12
+ export { refkey };
13
+ //# sourceMappingURL=refkey.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refkey.d.mts","names":[],"sources":["../../src/helpers/refkey.ts"],"mappings":";;;;;AA0BA;;;;iBAAgB,MAAA,CAAA,GAAU,IAAA,cAAkB,MAAA"}
@@ -12,4 +12,5 @@ function refkey(...args) {
12
12
  }
13
13
 
14
14
  //#endregion
15
- export { refkey };
15
+ export { refkey };
16
+ //# sourceMappingURL=refkey.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refkey.mjs","names":["refkeyExternal"],"sources":["../../src/helpers/refkey.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Refkey, refkey as refkeyExternal } from \"@alloy-js/core\";\n\n/**\n * Create a refkey for the provided arguments. Passing no arguments returns a fresh refkey that is guaranteed to be unique. Otherwise, the arguments passed will be used to create a refkey for those values. Providing the same arguments will always return the same refkey.\n *\n * @remarks\n * Values are compared using the SameValueZero algorithm, which considers objects the same if they are reference identical, and primitives the same if they are the same value, with the exception of `NaN`, which is always considered equal to other `NaN` values, and `-0`, which is considered identical to `+0`\n */\nexport function refkey(...args: unknown[]): Refkey {\n return refkeyExternal(\"powerlines\", ...args);\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgB,OAAO,GAAG,MAAyB;AACjD,QAAOA,SAAe,cAAc,GAAG,KAAK"}