@powerlines/plugin-alloy 0.15.3 → 0.15.5

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 (307) hide show
  1. package/dist/{chunk-CbDLau6x.cjs → _virtual/rolldown_runtime.cjs} +9 -6
  2. package/dist/_virtual/rolldown_runtime.mjs +29 -0
  3. package/dist/core/components/index.cjs +6 -8
  4. package/dist/core/components/index.d.cts +3 -6
  5. package/dist/core/components/index.d.mts +3 -6
  6. package/dist/core/components/index.mjs +3 -5
  7. package/dist/core/components/output.cjs +39 -3
  8. package/dist/core/components/output.d.cts +17 -2
  9. package/dist/core/components/output.d.mts +17 -2
  10. package/dist/core/components/output.mjs +37 -2
  11. package/dist/core/components/single-line-comment.cjs +21 -2
  12. package/dist/core/components/single-line-comment.d.cts +21 -3
  13. package/dist/core/components/single-line-comment.d.mts +21 -3
  14. package/dist/core/components/single-line-comment.mjs +19 -1
  15. package/dist/core/components/source-file.cjs +57 -2
  16. package/dist/core/components/source-file.d.cts +30 -3
  17. package/dist/core/components/source-file.d.mts +30 -3
  18. package/dist/core/components/source-file.mjs +54 -1
  19. package/dist/core/contexts/context.cjs +28 -4
  20. package/dist/core/contexts/context.d.cts +25 -2
  21. package/dist/core/contexts/context.d.mts +25 -2
  22. package/dist/core/contexts/context.mjs +24 -1
  23. package/dist/core/contexts/index.cjs +13 -14
  24. package/dist/core/contexts/index.d.cts +2 -5
  25. package/dist/core/contexts/index.d.mts +2 -5
  26. package/dist/core/contexts/index.mjs +2 -3
  27. package/dist/core/contexts/reflection.cjs +67 -9
  28. package/dist/core/contexts/reflection.d.cts +51 -3
  29. package/dist/core/contexts/reflection.d.mts +51 -3
  30. package/dist/core/contexts/reflection.mjs +58 -1
  31. package/dist/core/index.cjs +21 -22
  32. package/dist/core/index.d.cts +5 -10
  33. package/dist/core/index.d.mts +7 -10
  34. package/dist/core/index.mjs +7 -8
  35. package/dist/deepkit/src/utilities.cjs +113 -0
  36. package/dist/deepkit/src/utilities.mjs +109 -0
  37. package/dist/deepkit/src/vendor/core.cjs +20 -0
  38. package/dist/deepkit/src/vendor/core.mjs +11 -0
  39. package/dist/deepkit/src/vendor/type.cjs +20 -0
  40. package/dist/deepkit/src/vendor/type.d.cts +7 -0
  41. package/dist/deepkit/src/vendor/type.d.mts +7 -0
  42. package/dist/deepkit/src/vendor/type.mjs +11 -0
  43. package/dist/helpers/capnp.cjs +276 -19
  44. package/dist/helpers/capnp.d.cts +86 -2
  45. package/dist/helpers/capnp.d.mts +86 -2
  46. package/dist/helpers/capnp.mjs +257 -2
  47. package/dist/helpers/create-builtin.cjs +18 -2
  48. package/dist/helpers/create-builtin.d.cts +14 -1
  49. package/dist/helpers/create-builtin.d.mts +14 -1
  50. package/dist/helpers/create-builtin.mjs +16 -1
  51. package/dist/helpers/index.cjs +23 -25
  52. package/dist/helpers/index.d.cts +4 -6
  53. package/dist/helpers/index.d.mts +4 -6
  54. package/dist/helpers/index.mjs +4 -6
  55. package/dist/helpers/refkey.cjs +15 -2
  56. package/dist/helpers/refkey.d.cts +12 -1
  57. package/dist/helpers/refkey.d.mts +12 -1
  58. package/dist/helpers/refkey.mjs +13 -1
  59. package/dist/helpers/typescript.cjs +45 -3
  60. package/dist/helpers/typescript.d.cts +24 -1
  61. package/dist/helpers/typescript.d.mts +24 -1
  62. package/dist/helpers/typescript.mjs +43 -2
  63. package/dist/index.cjs +114 -123
  64. package/dist/index.d.cts +24 -34
  65. package/dist/index.d.mts +29 -34
  66. package/dist/index.mjs +35 -44
  67. package/dist/markdown/components/index.cjs +7 -12
  68. package/dist/markdown/components/index.d.cts +2 -7
  69. package/dist/markdown/components/index.d.mts +2 -7
  70. package/dist/markdown/components/index.mjs +2 -7
  71. package/dist/markdown/components/markdown-file.cjs +117 -6
  72. package/dist/markdown/components/markdown-file.d.cts +22 -4
  73. package/dist/markdown/components/markdown-file.d.mts +22 -4
  74. package/dist/markdown/components/markdown-file.mjs +114 -4
  75. package/dist/markdown/components/markdown-table.cjs +100 -5
  76. package/dist/markdown/components/markdown-table.d.cts +26 -4
  77. package/dist/markdown/components/markdown-table.d.mts +26 -4
  78. package/dist/markdown/components/markdown-table.mjs +96 -2
  79. package/dist/markdown/contexts/index.cjs +5 -6
  80. package/dist/markdown/contexts/index.d.cts +1 -2
  81. package/dist/markdown/contexts/index.d.mts +1 -2
  82. package/dist/markdown/contexts/index.mjs +1 -2
  83. package/dist/markdown/contexts/markdown-table.cjs +36 -5
  84. package/dist/markdown/contexts/markdown-table.d.cts +36 -1
  85. package/dist/markdown/contexts/markdown-table.d.mts +36 -1
  86. package/dist/markdown/contexts/markdown-table.mjs +31 -1
  87. package/dist/markdown/index.cjs +14 -18
  88. package/dist/markdown/index.d.cts +3 -9
  89. package/dist/markdown/index.d.mts +5 -9
  90. package/dist/markdown/index.mjs +5 -9
  91. package/dist/powerlines/src/lib/utilities/file-header.cjs +13 -0
  92. package/dist/powerlines/src/lib/utilities/file-header.mjs +12 -0
  93. package/dist/powerlines/src/types/babel.d.mts +2 -0
  94. package/dist/powerlines/src/types/build.d.cts +145 -0
  95. package/dist/powerlines/src/types/build.d.mts +145 -0
  96. package/dist/powerlines/src/types/commands.d.cts +8 -0
  97. package/dist/powerlines/src/types/commands.d.mts +9 -0
  98. package/dist/powerlines/src/types/config.d.cts +369 -0
  99. package/dist/powerlines/src/types/config.d.mts +369 -0
  100. package/dist/powerlines/src/types/context.d.cts +362 -0
  101. package/dist/powerlines/src/types/context.d.mts +364 -0
  102. package/dist/powerlines/src/types/fs.d.cts +458 -0
  103. package/dist/powerlines/src/types/fs.d.mts +458 -0
  104. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  105. package/dist/powerlines/src/types/plugin.d.cts +231 -0
  106. package/dist/powerlines/src/types/plugin.d.mts +231 -0
  107. package/dist/powerlines/src/types/resolved.d.cts +81 -0
  108. package/dist/powerlines/src/types/resolved.d.mts +81 -0
  109. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  110. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  111. package/dist/types/components.cjs +0 -1
  112. package/dist/types/components.d.cts +142 -2
  113. package/dist/types/components.d.mts +142 -2
  114. package/dist/types/components.mjs +0 -2
  115. package/dist/types/index.cjs +0 -3
  116. package/dist/types/index.d.cts +2 -4
  117. package/dist/types/index.d.mts +2 -4
  118. package/dist/types/index.mjs +0 -4
  119. package/dist/types/plugin.cjs +0 -1
  120. package/dist/types/plugin.d.cts +41 -2
  121. package/dist/types/plugin.d.mts +41 -2
  122. package/dist/types/plugin.mjs +0 -2
  123. package/dist/typescript/components/builtin-file.cjs +43 -8
  124. package/dist/typescript/components/builtin-file.d.cts +33 -6
  125. package/dist/typescript/components/builtin-file.d.mts +33 -6
  126. package/dist/typescript/components/builtin-file.mjs +41 -7
  127. package/dist/typescript/components/dynamic-import-statement.cjs +24 -2
  128. package/dist/typescript/components/dynamic-import-statement.d.cts +31 -1
  129. package/dist/typescript/components/dynamic-import-statement.d.mts +31 -1
  130. package/dist/typescript/components/dynamic-import-statement.mjs +22 -1
  131. package/dist/typescript/components/entry-file.cjs +38 -6
  132. package/dist/typescript/components/entry-file.d.cts +26 -5
  133. package/dist/typescript/components/entry-file.d.mts +26 -5
  134. package/dist/typescript/components/entry-file.mjs +35 -5
  135. package/dist/typescript/components/index.cjs +43 -49
  136. package/dist/typescript/components/index.d.cts +9 -13
  137. package/dist/typescript/components/index.d.mts +9 -13
  138. package/dist/typescript/components/index.mjs +9 -15
  139. package/dist/typescript/components/record-expression.cjs +11 -2
  140. package/dist/typescript/components/record-expression.d.cts +11 -1
  141. package/dist/typescript/components/record-expression.d.mts +11 -1
  142. package/dist/typescript/components/record-expression.mjs +9 -1
  143. package/dist/typescript/components/tsdoc-reflection.cjs +172 -8
  144. package/dist/typescript/components/tsdoc-reflection.d.cts +17 -4
  145. package/dist/typescript/components/tsdoc-reflection.d.mts +17 -4
  146. package/dist/typescript/components/tsdoc-reflection.mjs +168 -5
  147. package/dist/typescript/components/tsdoc.cjs +475 -23
  148. package/dist/typescript/components/tsdoc.d.cts +151 -3
  149. package/dist/typescript/components/tsdoc.d.mts +151 -3
  150. package/dist/typescript/components/tsdoc.mjs +454 -3
  151. package/dist/typescript/components/typescript-file.cjs +192 -7
  152. package/dist/typescript/components/typescript-file.d.cts +46 -4
  153. package/dist/typescript/components/typescript-file.d.mts +46 -4
  154. package/dist/typescript/components/typescript-file.mjs +188 -4
  155. package/dist/typescript/components/typescript-interface.cjs +68 -8
  156. package/dist/typescript/components/typescript-interface.d.cts +24 -3
  157. package/dist/typescript/components/typescript-interface.d.mts +24 -3
  158. package/dist/typescript/components/typescript-interface.mjs +65 -6
  159. package/dist/typescript/components/typescript-object.cjs +124 -8
  160. package/dist/typescript/components/typescript-object.d.cts +25 -3
  161. package/dist/typescript/components/typescript-object.d.mts +25 -3
  162. package/dist/typescript/components/typescript-object.mjs +121 -6
  163. package/dist/typescript/index.cjs +44 -50
  164. package/dist/typescript/index.d.cts +9 -14
  165. package/dist/typescript/index.d.mts +10 -14
  166. package/dist/typescript/index.mjs +10 -16
  167. package/dist/vendor.cjs +12594 -0
  168. package/dist/vendor.d.cts +1 -0
  169. package/dist/vendor.d.ts +1 -0
  170. package/dist/vendor.js +12424 -0
  171. package/package.json +23 -9
  172. package/dist/builtin-file-BDc5-4_L.mjs +0 -43
  173. package/dist/builtin-file-BxePApb0.d.mts +0 -34
  174. package/dist/builtin-file-Cey2cJy9.cjs +0 -49
  175. package/dist/builtin-file-Cq1ooVDk.d.cts +0 -34
  176. package/dist/capnp-8yVLwAox.cjs +0 -364
  177. package/dist/capnp-C5d2Z3gP.d.cts +0 -87
  178. package/dist/capnp-CNythuSw.mjs +0 -267
  179. package/dist/capnp-DkidugOV.d.mts +0 -87
  180. package/dist/components-BOkkDhM9.cjs +0 -0
  181. package/dist/components-BXrpeD8J.cjs +0 -0
  182. package/dist/components-C3qpgLKV.mjs +0 -1
  183. package/dist/components-C8Qs2PB0.d.cts +0 -142
  184. package/dist/components-CBtEhH9k.mjs +0 -1
  185. package/dist/components-Cj5gaIV0.cjs +0 -0
  186. package/dist/components-HMVhsFQl.mjs +0 -1
  187. package/dist/components-I0ydtjfW.cjs +0 -0
  188. package/dist/components-ajocJcib.mjs +0 -1
  189. package/dist/components-ixU_ICbr.d.mts +0 -142
  190. package/dist/context-BApo1nhP.d.mts +0 -26
  191. package/dist/context-BDGjT3c-.d.cts +0 -26
  192. package/dist/context-BIduC1bB.cjs +0 -44
  193. package/dist/context-BsDdxy5g.d.cts +0 -1668
  194. package/dist/context-Cx38_mgI.mjs +0 -26
  195. package/dist/context-DXy7MPku.d.mts +0 -1668
  196. package/dist/contexts-BSRk0whx.cjs +0 -0
  197. package/dist/contexts-X44bRyOp.mjs +0 -1
  198. package/dist/contexts-XuEdvZdE.mjs +0 -1
  199. package/dist/contexts-uXFW3CIa.cjs +0 -0
  200. package/dist/core-B57eQAue.mjs +0 -1
  201. package/dist/core-DzEmU6tL.cjs +0 -0
  202. package/dist/create-builtin-Bpswa0ZT.d.cts +0 -15
  203. package/dist/create-builtin-CP9mN5P-.mjs +0 -18
  204. package/dist/create-builtin-_3GNADDt.cjs +0 -24
  205. package/dist/create-builtin-wEbNOWNw.d.mts +0 -15
  206. package/dist/dynamic-import-statement-CWK5I_yt.mjs +0 -24
  207. package/dist/dynamic-import-statement-D6f1SnIf.d.mts +0 -32
  208. package/dist/dynamic-import-statement-DVGp5Cvq.cjs +0 -30
  209. package/dist/dynamic-import-statement-Dk3bSR8x.d.cts +0 -32
  210. package/dist/entry-file-B5YXZbGV.d.cts +0 -27
  211. package/dist/entry-file-DijEelFv.cjs +0 -44
  212. package/dist/entry-file-DtjJPVZY.mjs +0 -37
  213. package/dist/entry-file-HWtqk30Z.d.mts +0 -27
  214. package/dist/helpers-BrA1Dy07.mjs +0 -1
  215. package/dist/helpers-Cten3PJk.cjs +0 -0
  216. package/dist/index-BINnViIh.d.mts +0 -1
  217. package/dist/index-BJ8-FA6N.d.cts +0 -1
  218. package/dist/index-BRJ_6A42.d.mts +0 -1
  219. package/dist/index-BXpMZvwA.d.cts +0 -1
  220. package/dist/index-Bi0Yc4v2.d.cts +0 -1
  221. package/dist/index-BrGZHEgX.d.mts +0 -1
  222. package/dist/index-BwFl_eS0.d.mts +0 -1
  223. package/dist/index-C1ihAKnV.d.cts +0 -1
  224. package/dist/index-CLTQPxoD.d.mts +0 -1
  225. package/dist/index-CoUVmp_Q.d.mts +0 -1
  226. package/dist/index-D1aKd2tO.d.cts +0 -1
  227. package/dist/index-D4d_pZLu.d.cts +0 -1
  228. package/dist/index-DBGd4WeR.d.mts +0 -1
  229. package/dist/index-DdxxIAKU.d.cts +0 -1
  230. package/dist/index-Deol7ZWO.d.mts +0 -1
  231. package/dist/index-DpEKQcoR.d.cts +0 -1
  232. package/dist/index-DrZ2Dh-H.d.cts +0 -1
  233. package/dist/index-MEuojd-r.d.cts +0 -1
  234. package/dist/index-bHnO4ZKt.d.mts +0 -1
  235. package/dist/index-lIMqGGJz.d.mts +0 -1
  236. package/dist/markdown-BTQE0AI9.cjs +0 -0
  237. package/dist/markdown-DMddlO1y.mjs +0 -1
  238. package/dist/markdown-file-BVSRcpXO.cjs +0 -128
  239. package/dist/markdown-file-CKkjaqpP.d.mts +0 -23
  240. package/dist/markdown-file-Clh5iU1_.mjs +0 -116
  241. package/dist/markdown-file-EKqcnqeE.d.cts +0 -23
  242. package/dist/markdown-table-2qP_4eLk.mjs +0 -33
  243. package/dist/markdown-table-83GdY7ag.d.mts +0 -27
  244. package/dist/markdown-table-B40X-Kp1.cjs +0 -116
  245. package/dist/markdown-table-BIRzgtYb.d.cts +0 -27
  246. package/dist/markdown-table-BOWM26Kb.cjs +0 -57
  247. package/dist/markdown-table-CZMEY6IR.d.cts +0 -37
  248. package/dist/markdown-table-D-YnljE7.mjs +0 -98
  249. package/dist/markdown-table-kFQoqKQt.d.mts +0 -37
  250. package/dist/output-BlHZS50Y.cjs +0 -45
  251. package/dist/output-C2C9L6Ho.d.cts +0 -18
  252. package/dist/output-CNnPjQlW.mjs +0 -39
  253. package/dist/output-Di6Elv89.d.mts +0 -18
  254. package/dist/plugin-DU0K2-Om.mjs +0 -1
  255. package/dist/plugin-DfBq0RfU.d.cts +0 -40
  256. package/dist/plugin-Fx-uJ4It.cjs +0 -0
  257. package/dist/plugin-LknisCLa.d.mts +0 -40
  258. package/dist/record-expression-BOCZ9iqR.d.mts +0 -12
  259. package/dist/record-expression-DM_zSqE_.d.cts +0 -12
  260. package/dist/record-expression-DNVzCKgo.cjs +0 -17
  261. package/dist/record-expression-DxS_DiPc.mjs +0 -11
  262. package/dist/refkey-B0XSqdGY.d.mts +0 -13
  263. package/dist/refkey-B6A9kh_u.cjs +0 -21
  264. package/dist/refkey-CP7MJMac.d.cts +0 -13
  265. package/dist/refkey-CV0mIj0Y.mjs +0 -15
  266. package/dist/reflection-BSbFFYZO.cjs +0 -108
  267. package/dist/reflection-CBMQ1FQo.mjs +0 -60
  268. package/dist/reflection-CL_Lrq2o.d.cts +0 -52
  269. package/dist/reflection-DLJST1Z7.d.mts +0 -52
  270. package/dist/single-line-comment-BhEed2Bl.d.cts +0 -22
  271. package/dist/single-line-comment-Biwa95Py.mjs +0 -21
  272. package/dist/single-line-comment-CH3Apcm8.d.mts +0 -22
  273. package/dist/single-line-comment-DvU69OGj.cjs +0 -27
  274. package/dist/source-file-BNEo0iAE.d.mts +0 -31
  275. package/dist/source-file-BOgnPw2P.d.cts +0 -31
  276. package/dist/source-file-DK_nFwAK.cjs +0 -63
  277. package/dist/source-file-Dna2E0ro.mjs +0 -56
  278. package/dist/tsdoc-B0TNs3dK.cjs +0 -576
  279. package/dist/tsdoc-CK6J_ap5.d.cts +0 -152
  280. package/dist/tsdoc-QH5nHvck.d.mts +0 -152
  281. package/dist/tsdoc-XXdq_9iS.mjs +0 -456
  282. package/dist/tsdoc-reflection-BizVi_gn.cjs +0 -188
  283. package/dist/tsdoc-reflection-DllAx-qb.d.cts +0 -18
  284. package/dist/tsdoc-reflection-DtWdO7Hk.d.mts +0 -18
  285. package/dist/tsdoc-reflection-IWtPMJjw.mjs +0 -170
  286. package/dist/types-BBEDEYnP.cjs +0 -0
  287. package/dist/types-BWlfXHs2.mjs +0 -1
  288. package/dist/typescript-45caIUPa.mjs +0 -1
  289. package/dist/typescript-BrZsJqvc.mjs +0 -45
  290. package/dist/typescript-CXP7Oa6_.d.cts +0 -25
  291. package/dist/typescript-DG1-qdBQ.d.mts +0 -25
  292. package/dist/typescript-DV5akLQO.cjs +0 -0
  293. package/dist/typescript-DcqKlMoH.cjs +0 -51
  294. package/dist/typescript-file-BDXTfhtE.d.cts +0 -47
  295. package/dist/typescript-file-BljeGTrz.d.mts +0 -47
  296. package/dist/typescript-file-CLL-ELi0.mjs +0 -190
  297. package/dist/typescript-file-HsAUWnQY.cjs +0 -208
  298. package/dist/typescript-interface-CTt8ULTa.d.mts +0 -25
  299. package/dist/typescript-interface-DwHJ9in_.cjs +0 -79
  300. package/dist/typescript-interface-FVDsEsu0.mjs +0 -67
  301. package/dist/typescript-interface-raVgIJpX.d.cts +0 -25
  302. package/dist/typescript-object-D8MHeFId.cjs +0 -135
  303. package/dist/typescript-object-Db0fqsDb.d.cts +0 -26
  304. package/dist/typescript-object-Ju07nQg9.mjs +0 -123
  305. package/dist/typescript-object-USS-Xx2b.d.mts +0 -26
  306. package/dist/utilities-CnaPrauh.mjs +0 -109
  307. package/dist/utilities-llRqOC4l.cjs +0 -133
@@ -1,87 +0,0 @@
1
- import { n as PluginContext, t as Context } from "./context-BsDdxy5g.cjs";
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
- /**
8
- * Compiles a Cap'n Proto schema into TypeScript definitions.
9
- *
10
- * @param context - The context containing the project and workspace information.
11
- * @param options - The options for compiling the schema.
12
- * @returns A promise that resolves to the compiled schema.
13
- */
14
- declare function compile(context: Context, options?: Partial<CapnpcOptions>): Promise<CapnpcResult>;
15
- /**
16
- * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
17
- *
18
- * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
19
- * @param value - The value to stringify.
20
- * @returns A string representation of the value.
21
- */
22
- declare function stringifyCapnpDefaultValue(property: ReflectionProperty | ReflectionParameter, value?: any): string;
23
- /**
24
- * Converts any {@link Type}'s actual value to string representation.
25
- *
26
- * @param type - The {@link Type} of the value to stringify.
27
- * @param value - The value to stringify.
28
- * @returns A string representation of the value.
29
- */
30
- declare function stringifyCapnpValue(type: Type, value: any): string;
31
- /**
32
- * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.
33
- *
34
- * @param type - The TypeEnum to evaluate.
35
- * @returns A string representation of the property.
36
- */
37
- declare function getCapnpEnumTypes(type: Type): "Text" | "Float32" | null;
38
- /**
39
- * Determines if a Type is a `Void` type in a Cap'n Proto schema.
40
- *
41
- * @param type - The Type to check.
42
- * @returns True if the Type is a `Void` type, false otherwise.
43
- */
44
- declare function isVoidType(type: Type): boolean;
45
- /**
46
- * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
47
- *
48
- * @param type - The {@link TypeUnion} to convert.
49
- * @returns A string representation of the Cap'n Proto primitive type.
50
- */
51
- declare function getCapnpUnionTypes(type: Type): Type[];
52
- /**
53
- * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
54
- *
55
- * @param type - The {@link TypeUnion} to convert.
56
- * @returns An array of Cap'n Proto primitive types.
57
- */
58
- declare function isCapnpStringUnion(type: Type): boolean;
59
- declare const LARGE_BUFFER: number;
60
- type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
61
- type StdioOptions = IOType | Array<IOType | "ipc" | number | null | undefined>;
62
- declare function generateCapnpId(): Promise<string>;
63
- interface GenerateCapnpOptions {
64
- name?: string;
65
- }
66
- declare function generateCapnp(context: PluginContext, reflection: ReflectionClass<any>, options: GenerateCapnpOptions): Promise<string>;
67
- interface GenerateCapnpStructOptions extends GenerateCapnpOptions {
68
- indexCounter?: () => number;
69
- }
70
- declare function generateCapnpStruct(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
71
- declare function generateCapnpInterface(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
72
- declare function generateCapnpSchema(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
73
- declare function generateCapnpMethodSchema(reflection: ReflectionMethod, indexCounter: () => number): string;
74
- declare function generateCapnpEnumSchema(type: TypeEnum | TypeUnion, name: string): string;
75
- /**
76
- * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.
77
- *
78
- * @param type - The Deepkit Type to convert.
79
- * @returns A string representation of the Cap'n Proto primitive type.
80
- */
81
- declare function generateCapnpPrimitive(type: Type): string;
82
- declare type __ΩIOType = any[];
83
- declare type __ΩStdioOptions = any[];
84
- declare type __ΩGenerateCapnpOptions = any[];
85
- declare type __ΩGenerateCapnpStructOptions = any[];
86
- //#endregion
87
- export { stringifyCapnpDefaultValue as C, isVoidType as S, generateCapnpSchema as _, StdioOptions as a, getCapnpUnionTypes as b, __ΩIOType as c, generateCapnp as d, generateCapnpEnumSchema as f, generateCapnpPrimitive as g, generateCapnpMethodSchema as h, LARGE_BUFFER as i, __ΩStdioOptions as l, generateCapnpInterface as m, GenerateCapnpStructOptions as n, __ΩGenerateCapnpOptions as o, generateCapnpId as p, IOType as r, __ΩGenerateCapnpStructOptions as s, GenerateCapnpOptions as t, compile as u, generateCapnpStruct as v, stringifyCapnpValue as w, isCapnpStringUnion as x, getCapnpEnumTypes as y };
@@ -1,267 +0,0 @@
1
- import { n as kindToName, t as getUnionTypes } from "./utilities-CnaPrauh.mjs";
2
- import { ReflectionKind, memberNameToString } from "@powerlines/deepkit/vendor/type";
3
- import { getUniqueBy } from "@stryke/helpers/get-unique";
4
- import { isNull } from "@stryke/type-checks/is-null";
5
- import { isString } from "@stryke/type-checks/is-string";
6
- import { isUndefined } from "@stryke/type-checks/is-undefined";
7
- import { titleCase } from "@stryke/string-format/title-case";
8
- import defu from "defu";
9
- import { pascalCase } from "@stryke/string-format/pascal-case";
10
- import { camelCase } from "@stryke/string-format/camel-case";
11
- import { getClassName } from "@powerlines/deepkit/vendor/core";
12
- import { capnpc } from "@stryke/capnp/compile";
13
- import { resolveOptions } from "@stryke/capnp/helpers";
14
- import { toArray } from "@stryke/convert/to-array";
15
- import { StormJSON } from "@stryke/json";
16
- import { joinPaths } from "@stryke/path/join";
17
- import { getWords } from "@stryke/string-format/get-words";
18
- import { isBigInt } from "@stryke/type-checks/is-bigint";
19
- import { isNumber } from "@stryke/type-checks/is-number";
20
- import { Buffer } from "node:buffer";
21
- import { exec } from "node:child_process";
22
- import { promisify } from "node:util";
23
-
24
- //#region ../powerlines/src/lib/utilities/file-header.ts
25
- function getBaseFileHeader(context) {
26
- return `
27
- // Generated with ${titleCase(context.config.framework)}
28
- // Note: Do not edit this file manually - it will be overwritten automatically
29
- `;
30
- }
31
-
32
- //#endregion
33
- //#region src/helpers/capnp.ts
34
- /**
35
- * Compiles a Cap'n Proto schema into TypeScript definitions.
36
- *
37
- * @param context - The context containing the project and workspace information.
38
- * @param options - The options for compiling the schema.
39
- * @returns A promise that resolves to the compiled schema.
40
- */
41
- async function compile(context, options = {}) {
42
- const opts = defu(options, {
43
- ts: true,
44
- js: false,
45
- dts: false,
46
- schemas: joinPaths(context.artifactsPath, "schemas"),
47
- tsconfig: context.tsconfig,
48
- projectRoot: context.config.projectRoot,
49
- workspaceRoot: context.workspaceConfig.workspaceRoot,
50
- tty: true
51
- });
52
- const resolvedOptions = await resolveOptions(opts);
53
- if (!resolvedOptions) throw new Error(`✖ No Cap'n Proto schema files found in the specified source paths: ${toArray(opts.schemas).join(", ")}.`);
54
- return capnpc(resolvedOptions);
55
- }
56
- /**
57
- * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
58
- *
59
- * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
60
- * @param value - The value to stringify.
61
- * @returns A string representation of the value.
62
- */
63
- function stringifyCapnpDefaultValue(property, value) {
64
- return stringifyCapnpValue(property.type, value ?? property.getDefaultValue());
65
- }
66
- /**
67
- * Converts any {@link Type}'s actual value to string representation.
68
- *
69
- * @param type - The {@link Type} of the value to stringify.
70
- * @param value - The value to stringify.
71
- * @returns A string representation of the value.
72
- */
73
- function stringifyCapnpValue(type, value) {
74
- return type.kind === ReflectionKind.string || type.kind === ReflectionKind.literal && isString(type.literal) ? `"${String(value)}"` : type.kind === ReflectionKind.enum ? `${camelCase(String(value))}` : type.kind === ReflectionKind.array ? StormJSON.stringify(value) : type.kind === ReflectionKind.object || type.kind === ReflectionKind.objectLiteral ? StormJSON.stringify(value).replaceAll("{", "(").replaceAll("}", ")") : String(value);
75
- }
76
- /**
77
- * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.
78
- *
79
- * @param type - The TypeEnum to evaluate.
80
- * @returns A string representation of the property.
81
- */
82
- function getCapnpEnumTypes(type) {
83
- if (type.kind !== ReflectionKind.enum) return null;
84
- const unique = getUniqueBy(type.values.filter((value) => !isUndefined(value) && !isNull(value)), (enumMember) => isString(enumMember) ? "Text" : "Float32");
85
- if (unique.length === 0) return null;
86
- return unique[0] && isString(unique[0]) ? "Text" : "Float32";
87
- }
88
- /**
89
- * Determines if a Type is a `Void` type in a Cap'n Proto schema.
90
- *
91
- * @param type - The Type to check.
92
- * @returns True if the Type is a `Void` type, false otherwise.
93
- */
94
- function isVoidType(type) {
95
- return type.kind === ReflectionKind.void || type.kind === ReflectionKind.never || type.kind === ReflectionKind.null || type.kind === ReflectionKind.undefined || type.kind === ReflectionKind.symbol;
96
- }
97
- /**
98
- * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
99
- *
100
- * @param type - The {@link TypeUnion} to convert.
101
- * @returns A string representation of the Cap'n Proto primitive type.
102
- */
103
- function getCapnpUnionTypes(type) {
104
- return getUnionTypes(type);
105
- }
106
- /**
107
- * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
108
- *
109
- * @param type - The {@link TypeUnion} to convert.
110
- * @returns An array of Cap'n Proto primitive types.
111
- */
112
- function isCapnpStringUnion(type) {
113
- return getCapnpUnionTypes(type).some((member) => member.kind === ReflectionKind.string);
114
- }
115
- const LARGE_BUFFER = 1024 * 1e6;
116
- const execAsync = promisify(exec);
117
- async function generateCapnpId() {
118
- const { stdout } = await execAsync("capnp id", {
119
- windowsHide: true,
120
- maxBuffer: LARGE_BUFFER,
121
- killSignal: "SIGTERM"
122
- });
123
- return stdout;
124
- }
125
- async function generateCapnp(context, reflection, options) {
126
- return `${(await generateCapnpId()).trim()};
127
- ${getBaseFileHeader(context).replace(/^\r*\n*/g, "").replaceAll("//", "#")}
128
- ${reflection.getMethods().length === 0 ? generateCapnpStruct(reflection, options) : generateCapnpInterface(reflection, options)}
129
- `.trim();
130
- }
131
- function generateCapnpStruct(reflection, options = {}) {
132
- const structName = options?.name || reflection.getTitle() || reflection.getClassName() || reflection.getName();
133
- return `${generateCapnpEnums(reflection)}struct ${pascalCase(structName)} {
134
- # Struct definition for ${titleCase(structName)}.
135
-
136
- ${generateCapnpSchema(reflection, options)}
137
- }
138
- `;
139
- }
140
- function generateCapnpInterface(reflection, options = {}) {
141
- const interfaceName = options?.name || reflection.getTitle() || reflection.getClassName() || reflection.getName();
142
- return `${generateCapnpEnums(reflection)}interface ${pascalCase(interfaceName)} {
143
- # Interface definition for ${titleCase(interfaceName)}.
144
-
145
- ${generateCapnpSchema(reflection, options)}
146
- }
147
- `;
148
- }
149
- function formatEnumName(name) {
150
- return pascalCase(`${name}_Type`);
151
- }
152
- function generateCapnpEnums(reflection) {
153
- const enums = reflection.getProperties().filter((prop) => !prop.isIgnored() && (prop.type.kind === ReflectionKind.enum || prop.type.kind === ReflectionKind.union && getCapnpUnionTypes(prop.type).filter((type) => type.kind === ReflectionKind.literal && (isString(type.literal) || isNumber(type.literal))).length === 1)).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? b.getNameAsString().localeCompare(a.getNameAsString()) : a.isReadonly() ? 1 : -1);
154
- if (enums.length === 0) return "";
155
- return `${enums.map((enumeration) => generateCapnpEnumSchema(enumeration.type, formatEnumName(enumeration.getNameAsString()))).join("\n\n")}
156
-
157
- `;
158
- }
159
- function generateCapnpSchema(reflection, options = {}) {
160
- let index = 0;
161
- const indexCounter = options?.indexCounter ?? (() => index++);
162
- return `${reflection.getProperties().filter((prop) => !prop.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? b.getNameAsString().localeCompare(a.getNameAsString()) : a.isReadonly() ? 1 : -1).map((prop) => generateCapnpPropertySchema(prop, indexCounter)).join(" \n\n ")}${reflection.getMethods().filter((methods) => !methods.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? String(b.getName()).localeCompare(String(a.getName())) : a.isReadonly() ? 1 : -1).map((methods) => generateCapnpMethodSchema(methods, indexCounter)).join(" \n\n ")}${reflection.getProperties().some((prop) => prop.type.kind === ReflectionKind.class && prop.type.classType === Map) ? `
163
- struct Map(Key, Value) {
164
- entries @0 :List(Entry);
165
-
166
- struct Entry {
167
- key @0 :Key;
168
- value @1 :Value;
169
- }
170
- }` : ""}${reflection.getProperties().some((prop) => prop.type.kind === ReflectionKind.class && prop.type.classType === Date) ? `
171
- struct Date {
172
- # A standard Gregorian calendar date.
173
-
174
- year @0 :Int16;
175
- # The year - Must include the century.
176
- # Negative value indicates BC.
177
-
178
- month @1 :UInt8; # The month, 1-12
179
-
180
- day @2 :UInt8; # The day of the month, 1-30
181
-
182
- hour @3 :UInt8; # The hour of the day, 0-23
183
-
184
- minute @4 :UInt8; # The minute of the hour, 0-59
185
-
186
- second @5 :UInt8; # The second of the minute, 0-59
187
-
188
- millisecond @6 :UInt16; # Milliseconds of the second, 0-999
189
- }` : ""}`;
190
- }
191
- function generateCapnpMethodSchema(reflection, indexCounter) {
192
- const methodName = reflection.getTitle() || typeof reflection.getName() === "string" ? String(reflection.getName()) : "";
193
- if (!methodName) throw new Error(`Cannot generate Cap'n Proto schema for method without a name - Parent interface: ${reflection.reflectionClass.getName()}`);
194
- return `${camelCase(methodName)} @${indexCounter()} (${reflection.getParameters().map((param) => {
195
- return `${camelCase(param.getName())} :${generateCapnpPrimitive(param.getType())}${param.hasDefault() ? ` = ${stringifyCapnpDefaultValue(param)}` : ""}`;
196
- }).join(", ")})${isVoidType(reflection.getReturnType()) ? "" : ` -> (${kindToName(reflection.getReturnType().kind)}: ${generateCapnpPrimitive(reflection.getReturnType())})`}; # ${(reflection.getDescription() || `The ${titleCase(reflection.reflectionClass.getTitle() || reflection.reflectionClass.getName())} interface ${titleCase(methodName)} method.`).replaceAll("\n", ". ")}`;
197
- }
198
- function generateCapnpPropertyComment(reflection) {
199
- const result = getWords(reflection.getDescription() || `A schema property for ${titleCase(reflection.getTitle() || reflection.getNameAsString())} field.`, { relaxed: true }).reduce((ret, word) => {
200
- let length = ret.length;
201
- if (ret.includes("\n")) length = ret.substring(ret.lastIndexOf("\n") + 1).length;
202
- const current = word.trim();
203
- if (length + current.length > 60) ret += `\n\t# ${current}`;
204
- else ret += ` ${current}`;
205
- return ret;
206
- }, "").trim();
207
- if (result.length > 0) return `\t# ${result}`;
208
- return "";
209
- }
210
- function generateCapnpPropertySchema(reflection, indexCounter) {
211
- if (reflection.type.kind === ReflectionKind.union) if (getCapnpUnionTypes(reflection.type).length === 0) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Void;
212
- ${generateCapnpPropertyComment(reflection)}`;
213
- else if (getCapnpUnionTypes(reflection.type).filter((type) => type.kind === ReflectionKind.literal && (isString(type.literal) || isNumber(type.literal))).length === 1) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${formatEnumName(reflection.getNameAsString())}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
214
- ${generateCapnpPropertyComment(reflection)}`;
215
- else return `${camelCase(reflection.getNameAsString())} :union {
216
- ${getCapnpUnionTypes(reflection.type).map((type) => ` ${kindToName(type.kind)} @${indexCounter()} :${generateCapnpPrimitive(type)};`).join("\n")}
217
- }
218
- ${generateCapnpPropertyComment(reflection)}`;
219
- else if (reflection.type.kind === ReflectionKind.array) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :List(${generateCapnpPrimitive(reflection.getSubType())})${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
220
- ${generateCapnpPropertyComment(reflection)}`;
221
- else if (reflection.type.kind === ReflectionKind.class) if (reflection.type.classType === Map) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Map(${!reflection.type.typeArguments || reflection.type.typeArguments.length === 0 || !reflection.type.typeArguments[0] ? "Data" : generateCapnpPrimitive(reflection.type.typeArguments[0])}, ${!reflection.type.typeArguments || reflection.type.typeArguments.length < 2 || !reflection.type.typeArguments[1] ? "Data" : generateCapnpPrimitive(reflection.type.typeArguments[1])})${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
222
- ${generateCapnpPropertyComment(reflection)}`;
223
- else if (reflection.type.classType === Date) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
224
- ${generateCapnpPropertyComment(reflection)}`;
225
- else if (reflection.type.classType === Buffer) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
226
- ${generateCapnpPropertyComment(reflection)}`;
227
- else if (reflection.type.classType === ArrayBuffer) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
228
- ${generateCapnpPropertyComment(reflection)}`;
229
- else return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(reflection.type.typeName || getClassName(reflection.type.classType))}${generateCapnpStruct(reflection.reflectionClass, { name: pascalCase(reflection.type.typeName || getClassName(reflection.type.classType)) })}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
230
- ${generateCapnpPropertyComment(reflection)}`;
231
- else if (reflection.type.kind === ReflectionKind.objectLiteral) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(reflection.type.typeName || memberNameToString(reflection.getNameAsString()))}${generateCapnpStruct(reflection.reflectionClass, { name: pascalCase(reflection.type.typeName || memberNameToString(reflection.getNameAsString())) })}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
232
- ${generateCapnpPropertyComment(reflection)}`;
233
- else if (reflection.type.kind === ReflectionKind.enum) return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(reflection.getNameAsString())}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
234
- ${generateCapnpPropertyComment(reflection)}`;
235
- return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${generateCapnpPrimitive(reflection.getType())}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
236
- ${generateCapnpPropertyComment(reflection)}`;
237
- }
238
- function generateCapnpEnumSchema(type, name) {
239
- if (type.kind === ReflectionKind.union) return generateCapnpEnumSchema({
240
- kind: ReflectionKind.enum,
241
- indexType: type,
242
- enum: type.types.reduce((ret, type$1) => {
243
- if (isString(type$1.literal) || isNumber(type$1.literal)) ret[camelCase(String(type$1.literal))] = type$1.literal;
244
- return ret;
245
- }, {}),
246
- values: getCapnpUnionTypes(type).filter((type$1) => type$1.kind === ReflectionKind.literal && (isString(type$1.literal) || isNumber(type$1.literal))).map((type$1) => type$1.literal)
247
- }, name);
248
- let index = 0;
249
- const indexCounter = () => index++;
250
- const enumType = getCapnpEnumTypes(type);
251
- if (!enumType) return "";
252
- return `enum ${pascalCase(name)} {
253
- ${type.enum && Object.entries(type.enum).length > 0 ? Object.entries(type.enum).filter(([, value]) => value !== null && value !== void 0).map(([key]) => ` ${camelCase(key)} @${indexCounter()};`).join("\n") : type.values.filter((value) => value !== null && value !== void 0).map((value) => `${enumType === "Text" && value ? camelCase(String(value)) : `${type.typeName ? `${camelCase(type.typeName)}_` : ""}${value || ""}`} @${indexCounter()};`).join("\n")}
254
- }`;
255
- }
256
- /**
257
- * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.
258
- *
259
- * @param type - The Deepkit Type to convert.
260
- * @returns A string representation of the Cap'n Proto primitive type.
261
- */
262
- function generateCapnpPrimitive(type) {
263
- return type.kind === ReflectionKind.never || type.kind === ReflectionKind.void || type.kind === ReflectionKind.null || type.kind === ReflectionKind.undefined || type.kind === ReflectionKind.symbol ? "Void" : type.kind === ReflectionKind.class && type.classType === Date ? "Date" : type.kind === ReflectionKind.class && type.classType === Set ? `List(${type.typeArguments && type.typeArguments[0] ? generateCapnpPrimitive(type.typeArguments[0]) : "Data"})` : type.kind === ReflectionKind.bigint ? "UInt64" : type.kind === ReflectionKind.number ? "Float64" : type.kind === ReflectionKind.string || type.kind === ReflectionKind.regexp ? "Text" : type.kind === ReflectionKind.boolean ? "Bool" : type.kind === ReflectionKind.literal ? isNumber(type.literal) ? "Float64" : isBigInt(type.literal) ? "UInt64" : isString(type.literal) ? "Text" : typeof type.literal === "boolean" ? "Bool" : "Data" : "Data";
264
- }
265
-
266
- //#endregion
267
- export { generateCapnpId as a, generateCapnpPrimitive as c, getCapnpEnumTypes as d, getCapnpUnionTypes as f, stringifyCapnpValue as g, stringifyCapnpDefaultValue as h, generateCapnpEnumSchema as i, generateCapnpSchema as l, isVoidType as m, compile as n, generateCapnpInterface as o, isCapnpStringUnion as p, generateCapnp as r, generateCapnpMethodSchema as s, LARGE_BUFFER as t, generateCapnpStruct as u };
@@ -1,87 +0,0 @@
1
- import { n as PluginContext, t as Context } from "./context-DXy7MPku.mjs";
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
- /**
8
- * Compiles a Cap'n Proto schema into TypeScript definitions.
9
- *
10
- * @param context - The context containing the project and workspace information.
11
- * @param options - The options for compiling the schema.
12
- * @returns A promise that resolves to the compiled schema.
13
- */
14
- declare function compile(context: Context, options?: Partial<CapnpcOptions>): Promise<CapnpcResult>;
15
- /**
16
- * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
17
- *
18
- * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
19
- * @param value - The value to stringify.
20
- * @returns A string representation of the value.
21
- */
22
- declare function stringifyCapnpDefaultValue(property: ReflectionProperty | ReflectionParameter, value?: any): string;
23
- /**
24
- * Converts any {@link Type}'s actual value to string representation.
25
- *
26
- * @param type - The {@link Type} of the value to stringify.
27
- * @param value - The value to stringify.
28
- * @returns A string representation of the value.
29
- */
30
- declare function stringifyCapnpValue(type: Type, value: any): string;
31
- /**
32
- * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.
33
- *
34
- * @param type - The TypeEnum to evaluate.
35
- * @returns A string representation of the property.
36
- */
37
- declare function getCapnpEnumTypes(type: Type): "Text" | "Float32" | null;
38
- /**
39
- * Determines if a Type is a `Void` type in a Cap'n Proto schema.
40
- *
41
- * @param type - The Type to check.
42
- * @returns True if the Type is a `Void` type, false otherwise.
43
- */
44
- declare function isVoidType(type: Type): boolean;
45
- /**
46
- * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
47
- *
48
- * @param type - The {@link TypeUnion} to convert.
49
- * @returns A string representation of the Cap'n Proto primitive type.
50
- */
51
- declare function getCapnpUnionTypes(type: Type): Type[];
52
- /**
53
- * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
54
- *
55
- * @param type - The {@link TypeUnion} to convert.
56
- * @returns An array of Cap'n Proto primitive types.
57
- */
58
- declare function isCapnpStringUnion(type: Type): boolean;
59
- declare const LARGE_BUFFER: number;
60
- type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
61
- type StdioOptions = IOType | Array<IOType | "ipc" | number | null | undefined>;
62
- declare function generateCapnpId(): Promise<string>;
63
- interface GenerateCapnpOptions {
64
- name?: string;
65
- }
66
- declare function generateCapnp(context: PluginContext, reflection: ReflectionClass<any>, options: GenerateCapnpOptions): Promise<string>;
67
- interface GenerateCapnpStructOptions extends GenerateCapnpOptions {
68
- indexCounter?: () => number;
69
- }
70
- declare function generateCapnpStruct(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
71
- declare function generateCapnpInterface(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
72
- declare function generateCapnpSchema(reflection: ReflectionClass<any>, options?: GenerateCapnpStructOptions): string;
73
- declare function generateCapnpMethodSchema(reflection: ReflectionMethod, indexCounter: () => number): string;
74
- declare function generateCapnpEnumSchema(type: TypeEnum | TypeUnion, name: string): string;
75
- /**
76
- * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.
77
- *
78
- * @param type - The Deepkit Type to convert.
79
- * @returns A string representation of the Cap'n Proto primitive type.
80
- */
81
- declare function generateCapnpPrimitive(type: Type): string;
82
- declare type __ΩIOType = any[];
83
- declare type __ΩStdioOptions = any[];
84
- declare type __ΩGenerateCapnpOptions = any[];
85
- declare type __ΩGenerateCapnpStructOptions = any[];
86
- //#endregion
87
- export { stringifyCapnpDefaultValue as C, isVoidType as S, generateCapnpSchema as _, StdioOptions as a, getCapnpUnionTypes as b, __ΩIOType as c, generateCapnp as d, generateCapnpEnumSchema as f, generateCapnpPrimitive as g, generateCapnpMethodSchema as h, LARGE_BUFFER as i, __ΩStdioOptions as l, generateCapnpInterface as m, GenerateCapnpStructOptions as n, __ΩGenerateCapnpOptions as o, generateCapnpId as p, IOType as r, __ΩGenerateCapnpStructOptions as s, GenerateCapnpOptions as t, compile as u, generateCapnpStruct as v, stringifyCapnpValue as w, isCapnpStringUnion as x, getCapnpEnumTypes as y };
File without changes
File without changes
@@ -1 +0,0 @@
1
- export { };
@@ -1,142 +0,0 @@
1
- import { o as ResolvedEntryTypeDefinition, s as StoragePreset } from "./context-BsDdxy5g.cjs";
2
- import { Context } from "@alloy-js/core";
3
- import { Children as Children$1 } from "@alloy-js/core/jsx-runtime";
4
- import { SourceFileContext } from "@alloy-js/typescript";
5
-
6
- //#region src/types/components.d.ts
7
- interface CopyOutputFile {
8
- kind: "file";
9
- path: string;
10
- sourcePath: string;
11
- /**
12
- * The format of the output files
13
- *
14
- * @remarks
15
- * If not specified, the output mode will be determined by the provided \`output.mode\` value.
16
- */
17
- preset?: StoragePreset;
18
- }
19
- interface WriteOutputFile {
20
- kind: "file" | "entry" | "builtin";
21
- path: string;
22
- contents: string;
23
- filetype: string;
24
- /**
25
- * The format of the output files
26
- *
27
- * @remarks
28
- * If not specified, the output mode will be determined by the provided \`output.mode\` value.
29
- */
30
- preset?: StoragePreset;
31
- }
32
- type OutputFile = (WriteOutputFile & {
33
- kind: "file";
34
- }) | (WriteOutputFile & {
35
- kind: "entry";
36
- typeDefinition?: ResolvedEntryTypeDefinition;
37
- }) | (WriteOutputFile & {
38
- kind: "builtin";
39
- id: string;
40
- }) | CopyOutputFile;
41
- interface OutputDirectory {
42
- kind: "directory";
43
- path: string;
44
- contents: (OutputDirectory | OutputFile)[];
45
- }
46
- interface RenderEntryContext {
47
- typeDefinition: ResolvedEntryTypeDefinition;
48
- }
49
- interface RenderBuiltinContext {
50
- id: string;
51
- }
52
- interface RenderOutputContext {
53
- mode?: StoragePreset;
54
- }
55
- interface CopyFileOutputContext {
56
- path?: string;
57
- sourcePath?: string;
58
- }
59
- interface RenderContext extends Context {
60
- meta?: {
61
- copyFile?: CopyFileOutputContext;
62
- /**
63
- * The current context for the built-in module.
64
- */
65
- builtin?: RenderBuiltinContext;
66
- /**
67
- * The current context for the application entrypoint file being rendered.
68
- */
69
- entry?: RenderEntryContext;
70
- /**
71
- * The current context for output rendering.
72
- */
73
- output?: RenderOutputContext;
74
- } & Record<string, any>;
75
- }
76
- /**
77
- * A type that represents the props of a component that can have children.
78
- */
79
- interface ComponentProps {
80
- children?: Children$1;
81
- }
82
- /**
83
- * A type that requires the `children` prop in a component.
84
- */
85
- type ComponentPropsWithChildren = Omit<ComponentProps, "children"> & Required<Pick<ComponentProps, "children">>;
86
- interface BuiltinSourceFileContext extends SourceFileContext {
87
- /**
88
- * The runtime module identifier.
89
- */
90
- id: string;
91
- }
92
- interface ReflectionOverrideInterface<T> {
93
- name?: string | Children$1;
94
- type?: string | Children$1;
95
- extends?: string | false;
96
- defaultValue?: Partial<T>;
97
- }
98
- interface TypescriptFileImportItem {
99
- name: string;
100
- default?: boolean;
101
- alias?: string;
102
- type?: boolean;
103
- }
104
- type TypescriptFileImports = Record<string, null | Array<TypescriptFileImportItem | string>>;
105
- interface SourceFileHeaderProps extends ComponentProps {
106
- /**
107
- * If true, disables the ESLint directive at the top of the file.
108
- *
109
- * @defaultValue true
110
- */
111
- disableEslint?: boolean;
112
- /**
113
- * If true, disables the Biome directive at the top of the file.
114
- *
115
- * @defaultValue true
116
- */
117
- disableBiome?: boolean;
118
- /**
119
- * If true, disables the Prettier directive at the top of the file.
120
- *
121
- * @defaultValue false
122
- */
123
- disablePrettier?: boolean;
124
- }
125
- declare type __ΩCopyOutputFile = any[];
126
- declare type __ΩWriteOutputFile = any[];
127
- declare type __ΩOutputFile = any[];
128
- declare type __ΩOutputDirectory = any[];
129
- declare type __ΩRenderEntryContext = any[];
130
- declare type __ΩRenderBuiltinContext = any[];
131
- declare type __ΩRenderOutputContext = any[];
132
- declare type __ΩCopyFileOutputContext = any[];
133
- declare type __ΩRenderContext = any[];
134
- declare type __ΩComponentProps = any[];
135
- declare type __ΩComponentPropsWithChildren = any[];
136
- declare type __ΩBuiltinSourceFileContext = any[];
137
- declare type __ΩReflectionOverrideInterface = any[];
138
- declare type __ΩTypescriptFileImportItem = any[];
139
- declare type __ΩTypescriptFileImports = any[];
140
- declare type __ΩSourceFileHeaderProps = any[];
141
- //#endregion
142
- export { __ΩTypescriptFileImportItem as A, __ΩOutputFile as C, __ΩRenderEntryContext as D, __ΩRenderContext as E, __ΩWriteOutputFile as M, __ΩRenderOutputContext as O, __ΩOutputDirectory as S, __ΩRenderBuiltinContext as T, __ΩBuiltinSourceFileContext as _, CopyOutputFile as a, __ΩCopyFileOutputContext as b, ReflectionOverrideInterface as c, RenderEntryContext as d, RenderOutputContext as f, WriteOutputFile as g, TypescriptFileImports as h, CopyFileOutputContext as i, __ΩTypescriptFileImports as j, __ΩSourceFileHeaderProps as k, RenderBuiltinContext as l, TypescriptFileImportItem as m, ComponentProps as n, OutputDirectory as o, SourceFileHeaderProps as p, ComponentPropsWithChildren as r, OutputFile as s, BuiltinSourceFileContext as t, RenderContext as u, __ΩComponentProps as v, __ΩReflectionOverrideInterface as w, __ΩCopyOutputFile as x, __ΩComponentPropsWithChildren as y };
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1 +0,0 @@
1
- export { };