@powerlines/plugin-alloy 0.25.21 → 0.25.23

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 (261) 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 +25 -0
  4. package/dist/core/components/output.d.cts.map +1 -0
  5. package/dist/core/components/output.d.mts +25 -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 +30 -0
  28. package/dist/core/contexts/context.d.cts.map +1 -0
  29. package/dist/core/contexts/context.d.mts +30 -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 +30 -0
  48. package/dist/core/helpers/code.d.cts.map +1 -0
  49. package/dist/core/helpers/code.d.mts +30 -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 +12 -0
  56. package/dist/core/index.d.mts +12 -0
  57. package/dist/helpers/capnp.d.cts +88 -0
  58. package/dist/helpers/capnp.d.cts.map +1 -0
  59. package/dist/helpers/capnp.d.mts +88 -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 +14 -0
  72. package/dist/helpers/refkey.d.cts.map +1 -0
  73. package/dist/helpers/refkey.d.mts +14 -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.d.cts +19 -0
  84. package/dist/index.d.cts.map +1 -0
  85. package/dist/index.d.mts +19 -0
  86. package/dist/index.d.mts.map +1 -0
  87. package/dist/index.mjs +2 -1
  88. package/dist/index.mjs.map +1 -0
  89. package/dist/markdown/components/front-matter.d.cts +16 -0
  90. package/dist/markdown/components/front-matter.d.cts.map +1 -0
  91. package/dist/markdown/components/front-matter.d.mts +16 -0
  92. package/dist/markdown/components/front-matter.d.mts.map +1 -0
  93. package/dist/markdown/components/front-matter.mjs +2 -1
  94. package/dist/markdown/components/front-matter.mjs.map +1 -0
  95. package/dist/markdown/components/index.d.cts +4 -0
  96. package/dist/markdown/components/index.d.mts +4 -0
  97. package/dist/markdown/components/markdown-file.d.cts +29 -0
  98. package/dist/markdown/components/markdown-file.d.cts.map +1 -0
  99. package/dist/markdown/components/markdown-file.d.mts +29 -0
  100. package/dist/markdown/components/markdown-file.d.mts.map +1 -0
  101. package/dist/markdown/components/markdown-file.mjs +2 -1
  102. package/dist/markdown/components/markdown-file.mjs.map +1 -0
  103. package/dist/markdown/components/markdown-table.d.cts +28 -0
  104. package/dist/markdown/components/markdown-table.d.cts.map +1 -0
  105. package/dist/markdown/components/markdown-table.d.mts +28 -0
  106. package/dist/markdown/components/markdown-table.d.mts.map +1 -0
  107. package/dist/markdown/components/markdown-table.mjs +2 -1
  108. package/dist/markdown/components/markdown-table.mjs.map +1 -0
  109. package/dist/markdown/contexts/index.d.cts +2 -0
  110. package/dist/markdown/contexts/index.d.mts +2 -0
  111. package/dist/markdown/contexts/markdown-table.d.cts +38 -0
  112. package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
  113. package/dist/markdown/contexts/markdown-table.d.mts +38 -0
  114. package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
  115. package/dist/markdown/contexts/markdown-table.mjs +2 -1
  116. package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
  117. package/dist/markdown/index.d.cts +7 -0
  118. package/dist/markdown/index.d.mts +7 -0
  119. package/dist/render.d.cts +39 -0
  120. package/dist/render.d.cts.map +1 -0
  121. package/dist/render.d.mts +39 -0
  122. package/dist/render.d.mts.map +1 -0
  123. package/dist/render.mjs +2 -1
  124. package/dist/render.mjs.map +1 -0
  125. package/dist/types/components.d.cts +142 -0
  126. package/dist/types/components.d.cts.map +1 -0
  127. package/dist/types/components.d.mts +142 -0
  128. package/dist/types/components.d.mts.map +1 -0
  129. package/dist/types/index.d.cts +3 -0
  130. package/dist/types/index.d.mts +3 -0
  131. package/dist/types/plugin.d.cts +39 -0
  132. package/dist/types/plugin.d.cts.map +1 -0
  133. package/dist/types/plugin.d.mts +39 -0
  134. package/dist/types/plugin.d.mts.map +1 -0
  135. package/dist/typescript/components/builtin-file.d.cts +35 -0
  136. package/dist/typescript/components/builtin-file.d.cts.map +1 -0
  137. package/dist/typescript/components/builtin-file.d.mts +35 -0
  138. package/dist/typescript/components/builtin-file.d.mts.map +1 -0
  139. package/dist/typescript/components/builtin-file.mjs +2 -1
  140. package/dist/typescript/components/builtin-file.mjs.map +1 -0
  141. package/dist/typescript/components/class-declaration.d.cts +145 -0
  142. package/dist/typescript/components/class-declaration.d.cts.map +1 -0
  143. package/dist/typescript/components/class-declaration.d.mts +145 -0
  144. package/dist/typescript/components/class-declaration.d.mts.map +1 -0
  145. package/dist/typescript/components/class-declaration.mjs +2 -1
  146. package/dist/typescript/components/class-declaration.mjs.map +1 -0
  147. package/dist/typescript/components/dynamic-import-statement.d.cts +33 -0
  148. package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
  149. package/dist/typescript/components/dynamic-import-statement.d.mts +33 -0
  150. package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
  151. package/dist/typescript/components/dynamic-import-statement.mjs +2 -1
  152. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
  153. package/dist/typescript/components/entry-file.d.cts +28 -0
  154. package/dist/typescript/components/entry-file.d.cts.map +1 -0
  155. package/dist/typescript/components/entry-file.d.mts +28 -0
  156. package/dist/typescript/components/entry-file.d.mts.map +1 -0
  157. package/dist/typescript/components/entry-file.mjs +2 -1
  158. package/dist/typescript/components/entry-file.mjs.map +1 -0
  159. package/dist/typescript/components/index.d.cts +15 -0
  160. package/dist/typescript/components/index.d.mts +15 -0
  161. package/dist/typescript/components/infrastructure-file.d.cts +21 -0
  162. package/dist/typescript/components/infrastructure-file.d.cts.map +1 -0
  163. package/dist/typescript/components/infrastructure-file.d.mts +21 -0
  164. package/dist/typescript/components/infrastructure-file.d.mts.map +1 -0
  165. package/dist/typescript/components/infrastructure-file.mjs +2 -1
  166. package/dist/typescript/components/infrastructure-file.mjs.map +1 -0
  167. package/dist/typescript/components/interface-declaration.d.cts +86 -0
  168. package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
  169. package/dist/typescript/components/interface-declaration.d.mts +86 -0
  170. package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
  171. package/dist/typescript/components/interface-declaration.mjs +2 -1
  172. package/dist/typescript/components/interface-declaration.mjs.map +1 -0
  173. package/dist/typescript/components/object-declaration.d.cts +30 -0
  174. package/dist/typescript/components/object-declaration.d.cts.map +1 -0
  175. package/dist/typescript/components/object-declaration.d.mts +30 -0
  176. package/dist/typescript/components/object-declaration.d.mts.map +1 -0
  177. package/dist/typescript/components/object-declaration.mjs +2 -1
  178. package/dist/typescript/components/object-declaration.mjs.map +1 -0
  179. package/dist/typescript/components/property-name.d.cts +24 -0
  180. package/dist/typescript/components/property-name.d.cts.map +1 -0
  181. package/dist/typescript/components/property-name.d.mts +24 -0
  182. package/dist/typescript/components/property-name.d.mts.map +1 -0
  183. package/dist/typescript/components/property-name.mjs +2 -1
  184. package/dist/typescript/components/property-name.mjs.map +1 -0
  185. package/dist/typescript/components/record-expression.d.cts +13 -0
  186. package/dist/typescript/components/record-expression.d.cts.map +1 -0
  187. package/dist/typescript/components/record-expression.d.mts +13 -0
  188. package/dist/typescript/components/record-expression.d.mts.map +1 -0
  189. package/dist/typescript/components/record-expression.mjs +2 -1
  190. package/dist/typescript/components/record-expression.mjs.map +1 -0
  191. package/dist/typescript/components/tsdoc-reflection.d.cts +44 -0
  192. package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
  193. package/dist/typescript/components/tsdoc-reflection.d.mts +44 -0
  194. package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
  195. package/dist/typescript/components/tsdoc-reflection.mjs +2 -1
  196. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
  197. package/dist/typescript/components/tsdoc.d.cts +164 -0
  198. package/dist/typescript/components/tsdoc.d.cts.map +1 -0
  199. package/dist/typescript/components/tsdoc.d.mts +164 -0
  200. package/dist/typescript/components/tsdoc.d.mts.map +1 -0
  201. package/dist/typescript/components/tsdoc.mjs +2 -1
  202. package/dist/typescript/components/tsdoc.mjs.map +1 -0
  203. package/dist/typescript/components/type-declaration.d.cts +18 -0
  204. package/dist/typescript/components/type-declaration.d.cts.map +1 -0
  205. package/dist/typescript/components/type-declaration.d.mts +18 -0
  206. package/dist/typescript/components/type-declaration.d.mts.map +1 -0
  207. package/dist/typescript/components/type-declaration.mjs +2 -1
  208. package/dist/typescript/components/type-declaration.mjs.map +1 -0
  209. package/dist/typescript/components/type-parameters.d.cts +24 -0
  210. package/dist/typescript/components/type-parameters.d.cts.map +1 -0
  211. package/dist/typescript/components/type-parameters.d.mts +24 -0
  212. package/dist/typescript/components/type-parameters.d.mts.map +1 -0
  213. package/dist/typescript/components/type-parameters.mjs +2 -1
  214. package/dist/typescript/components/type-parameters.mjs.map +1 -0
  215. package/dist/typescript/components/typescript-file.d.cts +50 -0
  216. package/dist/typescript/components/typescript-file.d.cts.map +1 -0
  217. package/dist/typescript/components/typescript-file.d.mts +50 -0
  218. package/dist/typescript/components/typescript-file.d.mts.map +1 -0
  219. package/dist/typescript/components/typescript-file.mjs +2 -1
  220. package/dist/typescript/components/typescript-file.mjs.map +1 -0
  221. package/dist/typescript/contexts/index.d.cts +2 -0
  222. package/dist/typescript/contexts/index.d.mts +2 -0
  223. package/dist/typescript/contexts/lexical-scope.d.cts +17 -0
  224. package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
  225. package/dist/typescript/contexts/lexical-scope.d.mts +17 -0
  226. package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
  227. package/dist/typescript/contexts/lexical-scope.mjs +2 -1
  228. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
  229. package/dist/typescript/contexts/member-scope.d.cts +20 -0
  230. package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
  231. package/dist/typescript/contexts/member-scope.d.mts +20 -0
  232. package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
  233. package/dist/typescript/contexts/member-scope.mjs +2 -1
  234. package/dist/typescript/contexts/member-scope.mjs.map +1 -0
  235. package/dist/typescript/helpers/get-call-signature-props.d.cts +15 -0
  236. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
  237. package/dist/typescript/helpers/get-call-signature-props.d.mts +15 -0
  238. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
  239. package/dist/typescript/helpers/get-call-signature-props.mjs +2 -1
  240. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
  241. package/dist/typescript/helpers/index.d.cts +3 -0
  242. package/dist/typescript/helpers/index.d.mts +3 -0
  243. package/dist/typescript/helpers/utilities.d.cts +11 -0
  244. package/dist/typescript/helpers/utilities.d.cts.map +1 -0
  245. package/dist/typescript/helpers/utilities.d.mts +11 -0
  246. package/dist/typescript/helpers/utilities.d.mts.map +1 -0
  247. package/dist/typescript/helpers/utilities.mjs +2 -1
  248. package/dist/typescript/helpers/utilities.mjs.map +1 -0
  249. package/dist/typescript/index.d.cts +21 -0
  250. package/dist/typescript/index.d.mts +21 -0
  251. package/dist/yaml/components/index.d.cts +2 -0
  252. package/dist/yaml/components/index.d.mts +2 -0
  253. package/dist/yaml/components/yaml-file.d.cts +34 -0
  254. package/dist/yaml/components/yaml-file.d.cts.map +1 -0
  255. package/dist/yaml/components/yaml-file.d.mts +34 -0
  256. package/dist/yaml/components/yaml-file.d.mts.map +1 -0
  257. package/dist/yaml/components/yaml-file.mjs +2 -1
  258. package/dist/yaml/components/yaml-file.mjs.map +1 -0
  259. package/dist/yaml/index.d.cts +3 -0
  260. package/dist/yaml/index.d.mts +3 -0
  261. package/package.json +6 -6
@@ -0,0 +1,26 @@
1
+ import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
2
+
3
+ //#region src/helpers/typescript.d.ts
4
+ interface GenerateInterfaceDeclarationOptions<T> {
5
+ overrideName?: string;
6
+ overrideExtends?: string | false;
7
+ defaultValues?: Partial<T>;
8
+ }
9
+ interface GenerateObjectDeclarationOptions<T> {
10
+ overrideName?: string;
11
+ overrideExtends?: string | false;
12
+ defaultValues?: Partial<T>;
13
+ }
14
+ /**
15
+ * Generates a TypeScript object for the given reflection class.
16
+ *
17
+ * @param reflection - The reflection class to generate the object for.
18
+ * @param options - Options for generating the object.
19
+ * @returns A string containing the TypeScript object definition.
20
+ */
21
+ declare function generateObjectDeclaration<T extends Record<string, any>>(reflection: ReflectionClass<T>, options?: GenerateObjectDeclarationOptions<T>): string;
22
+ declare type __ΩGenerateInterfaceDeclarationOptions = any[];
23
+ declare type __ΩGenerateObjectDeclarationOptions = any[];
24
+ //#endregion
25
+ export { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration };
26
+ //# sourceMappingURL=typescript.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.d.cts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;AAAoD,UAbnC,gCAamC,CAAA,CAAA,CAAA,CAAA;EACtB,YAAA,CAAA,EAAA,MAAA;EAAhB,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAC8B,aAAA,CAAA,EAZ1B,OAY0B,CAZlB,CAYkB,CAAA;;;;;;;;;iBAF5B,oCAAoC,iCACtC,gBAAgB,cACnB,iCAAiC"}
@@ -0,0 +1,26 @@
1
+ import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
2
+
3
+ //#region src/helpers/typescript.d.ts
4
+ interface GenerateInterfaceDeclarationOptions<T> {
5
+ overrideName?: string;
6
+ overrideExtends?: string | false;
7
+ defaultValues?: Partial<T>;
8
+ }
9
+ interface GenerateObjectDeclarationOptions<T> {
10
+ overrideName?: string;
11
+ overrideExtends?: string | false;
12
+ defaultValues?: Partial<T>;
13
+ }
14
+ /**
15
+ * Generates a TypeScript object for the given reflection class.
16
+ *
17
+ * @param reflection - The reflection class to generate the object for.
18
+ * @param options - Options for generating the object.
19
+ * @returns A string containing the TypeScript object definition.
20
+ */
21
+ declare function generateObjectDeclaration<T extends Record<string, any>>(reflection: ReflectionClass<T>, options?: GenerateObjectDeclarationOptions<T>): string;
22
+ declare type __ΩGenerateInterfaceDeclarationOptions = any[];
23
+ declare type __ΩGenerateObjectDeclarationOptions = any[];
24
+ //#endregion
25
+ export { GenerateInterfaceDeclarationOptions, GenerateObjectDeclarationOptions, __ΩGenerateInterfaceDeclarationOptions, __ΩGenerateObjectDeclarationOptions, generateObjectDeclaration };
26
+ //# sourceMappingURL=typescript.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.d.mts","names":[],"sources":["../../src/helpers/typescript.ts"],"sourcesContent":[],"mappings":";;;UAwBiB;;EAAA,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAwJA,aAAA,CAAA,EArJC,OAqJD,CArJS,CAqJT,CAAA;AAajB;AAAoD,UAbnC,gCAamC,CAAA,CAAA,CAAA,CAAA;EACtB,YAAA,CAAA,EAAA,MAAA;EAAhB,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EAC8B,aAAA,CAAA,EAZ1B,OAY0B,CAZlB,CAYkB,CAAA;;;;;;;;;iBAF5B,oCAAoC,iCACtC,gBAAgB,cACnB,iCAAiC"}
@@ -42,4 +42,5 @@ export const ${camelCase(options.overrideName || reflection.getName())}${options
42
42
  }
43
43
 
44
44
  //#endregion
45
- export { generateObjectDeclaration };
45
+ export { generateObjectDeclaration };
46
+ //# sourceMappingURL=typescript.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.mjs","names":["stringifyValue","camelCase","titleCase","isUndefined","generateObjectDeclaration","reflection","options","getDescription","overrideName","getClassName","getName","overrideExtends","getSuperReflectionClass","getProperties","filter","item","isIgnored","defaultValues","getNameAsString","getAlias","reduce","ret","alias","undefined","getDefaultValue","sort","a","b","isReadonly","localeCompare","map","getTitle","length","join","getDomain","getPermission","permission","isInternal","isHidden","getType"],"sources":["../../src/helpers/typescript.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 { stringifyValue } from \"@powerlines/deepkit/utilities\";\nimport type { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport interface GenerateInterfaceDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n// /**\n// * Generates a TypeScript interface for the given reflection class.\n// *\n// * @param reflection - The reflection class to generate the interface for.\n// * @returns A string containing the TypeScript interface definition.\n// */\n// export function InterfaceDeclaration<T>(\n// reflection: ReflectionClass<T>,\n// options: GenerateInterfaceDeclarationOptions<T> = {}\n// ): string {\n// if (!reflection) {\n// return \"\";\n// }\n\n// return `\n// /**\n// * Interface for ${reflection.getTitle() || titleCase(options.overrideName || reflection.getName())}.\n// *\n// * @title ${reflection.getTitle() || titleCase(reflection.getName())}${\n// reflection.getAlias().length\n// ? ` ${reflection\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${reflection.getDomain() ? ` * @domain ${reflection.getDomain()}` : \"\"}${\n// reflection.getPermission().length\n// ? `\n// ${reflection\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// reflection.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// reflection.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// reflection.isIgnored()\n// ? `\n// * @ignored`\n// : \"\"\n// }${\n// reflection.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// export interface ${pascalCase(options.overrideName || reflection.getName())}${\n// options.overrideExtends !== false &&\n// (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n// ? ` extends ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n// : \"\"\n// } {\n// ${reflection\n// .getProperties()\n// .filter(item => !item.isIgnored())\n// .sort((a, b) =>\n// (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n// ? a.getNameAsString().localeCompare(b.getNameAsString())\n// : a.isReadonly()\n// ? 1\n// : -1\n// )\n// .map(\n// item =>\n// ` /**\n// * ${\n// item.getDescription() ||\n// item.getTitle() ||\n// titleCase(item.getNameAsString())\n// }\n// *\n// * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n// item.getAlias().length\n// ? `\n// ${item\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// item.getDomain()\n// ? `\n// * @domain ${item.getDomain()}`\n// : \"\"\n// }${\n// item.getPermission().length\n// ? `\n// ${item\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// !isUndefined(item.getDefaultValue()) && item.getDefaultValue() !== \"\"\n// ? `\n// * @defaultValue ${item.getDefaultValue()}`\n// : \"\"\n// }${\n// item.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// item.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// item.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// ${item.isReadonly() ? \"readonly \" : \"\"}${item.getNameAsString()}${\n// isUndefined(\n// (options.defaultValues as Record<string, any>)?.[item.getNameAsString()]\n// ) &&\n// isUndefined(item.getDefaultValue()) &&\n// !item\n// .getAlias()\n// .some(\n// alias =>\n// !isUndefined(\n// (options.defaultValues as Record<string, any>)?.[alias]\n// )\n// ) &&\n// item.isOptional()\n// ? \"?\"\n// : \"\"\n// }: ${stringifyType(item.getType())}`\n// )\n// .join(\", \\n\")}\n// }\n// `;\n// }\n\nexport interface GenerateObjectDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n *\n * @param reflection - The reflection class to generate the object for.\n * @param options - Options for generating the object.\n * @returns A string containing the TypeScript object definition.\n */\nexport function generateObjectDeclaration<T extends Record<string, any>>(\n reflection: ReflectionClass<T>,\n options: GenerateObjectDeclarationOptions<T> = {}\n) {\n if (!reflection) {\n return \"\";\n }\n\n return `\n/**\n * ${\n reflection.getDescription() ||\n `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`\n }.\n */\nexport const ${camelCase(options.overrideName || reflection.getName())}${\n options.overrideExtends !== false &&\n (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n : \"\"\n } = {\n ${reflection\n .getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (options.defaultValues as Record<string, any>)?.[alias]\n )\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(\n item =>\n ` /**\n * ${\n item.getDescription() ||\n item.getTitle() ||\n titleCase(item.getNameAsString())\n }\n *\n * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n item.getAlias().length\n ? `\n ${item\n .getAlias()\n .map(alias => ` * @alias ${alias}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.getDomain()\n ? `\n * @domain ${item.getDomain()}`\n : \"\"\n }${\n item.getPermission().length\n ? `\n ${item\n .getPermission()\n .map(permission => ` * @permission ${permission}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.isInternal()\n ? `\n * @internal`\n : \"\"\n }${\n item.isReadonly()\n ? `\n * @readonly`\n : \"\"\n }${\n item.isIgnored()\n ? `\n * @ignored`\n : \"\"\n }${\n item.isHidden()\n ? `\n * @hidden`\n : \"\"\n }\n */\n ${item.getNameAsString()}: ${stringifyValue(\n item.getType(),\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined((options.defaultValues as Record<string, any>)?.[alias])\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )}`\n )\n .join(\", \\n\")}\n};\n`;\n}\n"],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { AlloyPluginContext, AlloyPluginOptions } from "./types/plugin.cjs";
2
+ import { Plugin } from "powerlines";
3
+
4
+ //#region src/index.d.ts
5
+ declare module "powerlines" {
6
+ interface Config {
7
+ alloy?: AlloyPluginOptions;
8
+ }
9
+ }
10
+ /**
11
+ * Alloy-js plugin for Powerlines.
12
+ *
13
+ * @param options - The Alloy-js plugin user configuration options.
14
+ * @returns A Powerlines plugin that integrates Alloy-js transformations.
15
+ */
16
+ declare const plugin: <TContext extends AlloyPluginContext = AlloyPluginContext>(options?: AlloyPluginOptions) => Plugin<TContext>[];
17
+ //#endregion
18
+ export { plugin as default, plugin };
19
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;IAqB6E,KAAA,CAAA,EAIjE,kBAJiE;EAAA;;;;AAc7E;;;;AA2Dc,cA3DD,MA2DC,EAAA,CAAA,iBA1DK,kBA0DL,GA1D0B,kBA0D1B,CAAA,CAAA,OAAA,CAAA,EAxDH,kBAwDG,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA,EAAA"}
@@ -0,0 +1,19 @@
1
+ import { AlloyPluginContext, AlloyPluginOptions } from "./types/plugin.mjs";
2
+ import { Plugin } from "powerlines";
3
+
4
+ //#region src/index.d.ts
5
+ declare module "powerlines" {
6
+ interface Config {
7
+ alloy?: AlloyPluginOptions;
8
+ }
9
+ }
10
+ /**
11
+ * Alloy-js plugin for Powerlines.
12
+ *
13
+ * @param options - The Alloy-js plugin user configuration options.
14
+ * @returns A Powerlines plugin that integrates Alloy-js transformations.
15
+ */
16
+ declare const plugin: <TContext extends AlloyPluginContext = AlloyPluginContext>(options?: AlloyPluginOptions) => Plugin<TContext>[];
17
+ //#endregion
18
+ export { plugin as default, plugin };
19
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;IAqB6E,KAAA,CAAA,EAIjE,kBAJiE;EAAA;;;;AAc7E;;;;AA2Dc,cA3DD,MA2DC,EAAA,CAAA,iBA1DK,kBA0DL,GA1D0B,kBA0D1B,CAAA,CAAA,OAAA,CAAA,EAxDH,kBAwDG,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA,EAAA"}
package/dist/index.mjs CHANGED
@@ -39,4 +39,5 @@ const plugin = (options = {}) => {
39
39
  var src_default = plugin;
40
40
 
41
41
  //#endregion
42
- export { src_default as default, plugin };
42
+ export { src_default as default, plugin };
43
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["rollupPlugin","StormJSON","plugin","options","name","config","debug","alloy","typescript","resolve","external","tsdown","inputOptions","transform","jsx","plugins","configResolved","tsconfig","tsconfigJson","compilerOptions","jsxImportSource","fs","write","tsconfigFilePath","stringify"],"sources":["../src/index.tsx"],"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 rollupPlugin from \"@alloy-js/rollup-plugin\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport type { Plugin } from \"powerlines\";\nimport type { AlloyPluginContext, AlloyPluginOptions } from \"./types/plugin\";\n\ndeclare module \"powerlines\" {\n interface Config {\n alloy?: AlloyPluginOptions;\n }\n}\n\n/**\n * Alloy-js plugin for Powerlines.\n *\n * @param options - The Alloy-js plugin user configuration options.\n * @returns A Powerlines plugin that integrates Alloy-js transformations.\n */\nexport const plugin = <\n TContext extends AlloyPluginContext = AlloyPluginContext\n>(\n options: AlloyPluginOptions = {}\n) => {\n return [\n {\n name: \"alloy\",\n config() {\n this.debug(\n \"Updating configuration options to support Alloy-js builds.\"\n );\n\n return {\n alloy: {\n typescript: true,\n ...options\n },\n resolve: {\n external: [/^@alloy-js\\//]\n },\n tsdown: {\n inputOptions: {\n transform: {\n jsx: \"preserve\"\n }\n },\n plugins: [rollupPlugin()]\n }\n };\n },\n async configResolved() {\n this.debug(\"Ensuring TypeScript configuration is set up for Alloy-js.\");\n if (\n this.tsconfig.tsconfigJson.compilerOptions?.jsx !== \"preserve\" ||\n this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n\n if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== \"preserve\") {\n this.tsconfig.tsconfigJson.compilerOptions.jsx = \"preserve\";\n }\n\n if (\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !==\n \"@alloy-js/core\"\n ) {\n this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource =\n \"@alloy-js/core\";\n }\n\n await this.fs.write(\n this.tsconfig.tsconfigFilePath,\n StormJSON.stringify(this.tsconfig.tsconfigJson)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import * as _alloy_js_core0 from "@alloy-js/core";
2
+
3
+ //#region src/markdown/components/front-matter.d.ts
4
+ interface FrontMatterProps {
5
+ data: Record<string, any>;
6
+ }
7
+ /**
8
+ * Renders YAML front matter for a markdown file.
9
+ *
10
+ * @see https://jekyllrb.com/docs/front-matter/
11
+ */
12
+ declare function FrontMatter(props: FrontMatterProps): _alloy_js_core0.Children;
13
+ declare type __ΩFrontMatterProps = any[];
14
+ //#endregion
15
+ export { FrontMatter, FrontMatterProps, __ΩFrontMatterProps };
16
+ //# sourceMappingURL=front-matter.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-matter.d.cts","names":[],"sources":["../../../src/markdown/components/front-matter.tsx"],"sourcesContent":[],"mappings":";;;UAoBiB,gBAAA;QACT;;AADR;AASA;;;;iBAAgB,WAAA,QAAmB,mBAAgB,eAAA,CAAA"}
@@ -0,0 +1,16 @@
1
+ import * as _alloy_js_core10 from "@alloy-js/core";
2
+
3
+ //#region src/markdown/components/front-matter.d.ts
4
+ interface FrontMatterProps {
5
+ data: Record<string, any>;
6
+ }
7
+ /**
8
+ * Renders YAML front matter for a markdown file.
9
+ *
10
+ * @see https://jekyllrb.com/docs/front-matter/
11
+ */
12
+ declare function FrontMatter(props: FrontMatterProps): _alloy_js_core10.Children;
13
+ declare type __ΩFrontMatterProps = any[];
14
+ //#endregion
15
+ export { FrontMatter, FrontMatterProps, __ΩFrontMatterProps };
16
+ //# sourceMappingURL=front-matter.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-matter.d.mts","names":[],"sources":["../../../src/markdown/components/front-matter.tsx"],"sourcesContent":[],"mappings":";;;UAoBiB,gBAAA;QACT;;AADR;AASA;;;;iBAAgB,WAAA,QAAmB,mBAAgB,gBAAA,CAAA"}
@@ -24,4 +24,5 @@ function FrontMatter(props) {
24
24
  }
25
25
 
26
26
  //#endregion
27
- export { FrontMatter };
27
+ export { FrontMatter };
28
+ //# sourceMappingURL=front-matter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front-matter.mjs","names":["code","For","FrontMatter","props","_$createIntrinsic","_$createComponent","each","Object","entries","data","hardline","children","key","value","JSON","stringify"],"sources":["../../../src/markdown/components/front-matter.tsx"],"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, For } from \"@alloy-js/core\";\n\nexport interface FrontMatterProps {\n data: Record<string, any>;\n}\n\n/**\n * Renders YAML front matter for a markdown file.\n *\n * @see https://jekyllrb.com/docs/front-matter/\n */\nexport function FrontMatter(props: FrontMatterProps) {\n return (\n <>\n {\"---\"}\n <hbr />\n <For each={Object.entries(props.data)} hardline>\n {([key, value]) => code`${key}: ${JSON.stringify(value)}`}\n </For>\n {\"---\"}\n <hbr />\n </>\n );\n}\n"],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { FrontMatter, FrontMatterProps, __ΩFrontMatterProps } from "./front-matter.cjs";
2
+ import { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps } from "./markdown-file.cjs";
3
+ import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./markdown-table.cjs";
4
+ export { FrontMatter, FrontMatterProps, MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩFrontMatterProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps };
@@ -0,0 +1,4 @@
1
+ import { FrontMatter, FrontMatterProps, __ΩFrontMatterProps } from "./front-matter.mjs";
2
+ import { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps } from "./markdown-file.mjs";
3
+ import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./markdown-table.mjs";
4
+ export { FrontMatter, FrontMatterProps, MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩFrontMatterProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps };
@@ -0,0 +1,29 @@
1
+ import { ComponentProps, SourceFileHeaderProps } from "../../types/components.cjs";
2
+ import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.cjs";
3
+ import { FrontMatterProps } from "./front-matter.cjs";
4
+ import * as _alloy_js_core7 from "@alloy-js/core";
5
+
6
+ //#region src/markdown/components/markdown-file.d.ts
7
+ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & MarkdownFileHeaderProps;
8
+ /**
9
+ * A base component representing a Powerlines generated markdown source file.
10
+ *
11
+ * @param props - The properties for the source file.
12
+ * @returns The rendered source file component.
13
+ */
14
+ declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core7.Children;
15
+ type MarkdownFileHeaderProps = SourceFileHeaderProps & {
16
+ frontMatter?: FrontMatterProps["data"];
17
+ };
18
+ /**
19
+ * Renders the header for a Powerlines Typescript source file.
20
+ *
21
+ * @param props - The properties for the source file header.
22
+ * @returns The rendered source file header.
23
+ */
24
+ declare function MarkdownFileHeader(props: MarkdownFileHeaderProps): _alloy_js_core7.Children;
25
+ declare type __ΩMarkdownFileProps = any[];
26
+ declare type __ΩMarkdownFileHeaderProps = any[];
27
+ //#endregion
28
+ export { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps };
29
+ //# sourceMappingURL=markdown-file.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-file.d.cts","names":[],"sources":["../../../src/markdown/components/markdown-file.tsx"],"sourcesContent":[],"mappings":";;;;;;KA6BY,iBAAA,GAAoB,KAAK,iCACnC,iBACA;;;AAFF;;;;AAEE,iBAQc,YAAA,CARd,KAAA,EAQkC,iBARlC,CAAA,EAQmD,eAAA,CAAA,QARnD;AAAuB,KA2Bb,uBAAA,GAA0B,qBA3Bb,GAAA;EAQT,WAAA,CAAA,EAoBA,gBApBoB,CAAA,MAAA,CAAA;AAmBpC,CAAA;AAUA;;;;;;iBAAgB,kBAAA,QAA0B,0BAAuB,eAAA,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { ComponentProps, SourceFileHeaderProps } from "../../types/components.mjs";
2
+ import { SourceFileProps as SourceFileProps$1 } from "../../core/components/source-file.mjs";
3
+ import { FrontMatterProps } from "./front-matter.mjs";
4
+ import * as _alloy_js_core22 from "@alloy-js/core";
5
+
6
+ //#region src/markdown/components/markdown-file.d.ts
7
+ type MarkdownFileProps = Omit<SourceFileProps$1, "filetype"> & ComponentProps & MarkdownFileHeaderProps;
8
+ /**
9
+ * A base component representing a Powerlines generated markdown source file.
10
+ *
11
+ * @param props - The properties for the source file.
12
+ * @returns The rendered source file component.
13
+ */
14
+ declare function MarkdownFile(props: MarkdownFileProps): _alloy_js_core22.Children;
15
+ type MarkdownFileHeaderProps = SourceFileHeaderProps & {
16
+ frontMatter?: FrontMatterProps["data"];
17
+ };
18
+ /**
19
+ * Renders the header for a Powerlines Typescript source file.
20
+ *
21
+ * @param props - The properties for the source file header.
22
+ * @returns The rendered source file header.
23
+ */
24
+ declare function MarkdownFileHeader(props: MarkdownFileHeaderProps): _alloy_js_core22.Children;
25
+ declare type __ΩMarkdownFileProps = any[];
26
+ declare type __ΩMarkdownFileHeaderProps = any[];
27
+ //#endregion
28
+ export { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps };
29
+ //# sourceMappingURL=markdown-file.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-file.d.mts","names":[],"sources":["../../../src/markdown/components/markdown-file.tsx"],"sourcesContent":[],"mappings":";;;;;;KA6BY,iBAAA,GAAoB,KAAK,iCACnC,iBACA;;;AAFF;;;;AAEE,iBAQc,YAAA,CARd,KAAA,EAQkC,iBARlC,CAAA,EAQmD,gBAAA,CAAA,QARnD;AAAuB,KA2Bb,uBAAA,GAA0B,qBA3Bb,GAAA;EAQT,WAAA,CAAA,EAoBA,gBApBoB,CAAA,MAAA,CAAA;AAmBpC,CAAA;AAUA;;;;;;iBAAgB,kBAAA,QAA0B,0BAAuB,gBAAA,CAAA"}
@@ -129,4 +129,5 @@ function MarkdownFileHeader(props) {
129
129
  }
130
130
 
131
131
  //#endregion
132
- export { MarkdownFile, MarkdownFileHeader };
132
+ export { MarkdownFile, MarkdownFileHeader };
133
+ //# sourceMappingURL=markdown-file.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-file.mjs","names":["Show","splitProps","Link","titleCase","isSetObject","getFileHeaderWarning","SingleLineComment","SourceFile","usePowerlinesSafe","FrontMatter","MarkdownFile","props","children","storage","frontMatter","rest","_$createComponent","_$mergeProps","header","MarkdownFileHeader","filetype","reference","when","Boolean","disableEslint","disableBiome","disablePrettier","context","_$memo","Object","keys","length","data","variant","_$createIntrinsic","config","framework"],"sources":["../../../src/markdown/components/markdown-file.tsx"],"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 { Show, splitProps } from \"@alloy-js/core\";\nimport { Link } from \"@alloy-js/markdown\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\nimport { FrontMatter, FrontMatterProps } from \"./front-matter\";\n\nexport type MarkdownFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps &\n MarkdownFileHeaderProps;\n\n/**\n * A base component representing a Powerlines generated markdown source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function MarkdownFile(props: MarkdownFileProps) {\n const [{ children, storage, frontMatter }, rest] = splitProps(props, [\n \"children\",\n \"storage\",\n \"frontMatter\"\n ]);\n\n return (\n <SourceFile\n header={<MarkdownFileHeader frontMatter={frontMatter} />}\n {...rest}\n filetype=\"md\"\n reference={Link}\n storage={storage}>\n <Show when={Boolean(children)}>{children}</Show>\n </SourceFile>\n );\n}\n\nexport type MarkdownFileHeaderProps = SourceFileHeaderProps & {\n frontMatter?: FrontMatterProps[\"data\"];\n};\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function MarkdownFileHeader(props: MarkdownFileHeaderProps) {\n const [\n {\n children,\n disableEslint = true,\n disableBiome = true,\n disablePrettier = false,\n frontMatter\n }\n ] = splitProps(props, [\n \"children\",\n \"disableEslint\",\n \"disableBiome\",\n \"disablePrettier\",\n \"frontMatter\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show\n when={isSetObject(frontMatter) && Object.keys(frontMatter).length > 0}>\n <FrontMatter data={frontMatter!} />\n </Show>\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"markdown\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disablePrettier)}>\n <SingleLineComment variant=\"markdown\">\n {\"prettier-ignore\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment variant=\"markdown\">\n {\"biome-ignore lint: disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show\n when={\n Boolean(disableEslint) ||\n Boolean(disablePrettier) ||\n Boolean(disableBiome)\n }>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"markdown\">{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"markdown\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;SAqDgB,aAAA;CAAA,MAAA,CAAA,EAAA,UAAA,SAAA,eAAA,QAAA,WAAA,OAAA;EAAA;;;;AAAA,QAAA,gBAAA,YAAA,WAAA,EAAA,IAAA,SAAA;AAAA,SAAA,gBAAA,oBAAA,EAAA,aAAA,CAAA;IAAA,QAAA;EAAA,UAAA;EAAA,WAAA;EAAA;EAAA,IAAA,WAAA;AAAA,UAAA,sBAAA;IAAA,IAAA,OAAA;AAAA,YAAEuB,QAAQX,SAAS;;IAAA;IAAA,CAAA;;EAAA,CAAA,CAAA;;;;;;;;;yDA8CO,wBAAAI,wBACjCV,WAAAA,OAAAA;EAAAA;EAAAA;;;;GAAAA;OAAAA,UAAAA,mBAAAA;;kBAAAA,MAAAA;GAAAA,IAAkB2B,OAAAA;AAAAA,WAAAA,WAAAA,CAAAA,CAAAA,YAAAA,YAAAA,CAAAA,EAAAA,IAAAA,OAAAA,KAAAA,YAAAA,CAAAA,SAAAA;;GAAAA,IAAAA,WAAAA;AAAAA,WAAAA,gBAAAA,aAAAA,EAAAA,MAAAA,aAAAA,CAAAA;;GAAAA,CAAAA;EAAAA,gBAAAA,MAAAA;GAAAA,IAAAA,OAAAA;AAAAA,WAAAA,QAAAA,cAAAA;;GAAAA,IAAAA,WAAAA;AAAAA,WAAAA,CAAAA,gBAAAA,mBAAO;KAAA,SAAA;KAAA,UAAA;KAAA,CAAA,EAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;GAAA,CAAA;EAAA,gBAAA,MAAA;GAAA,IAAA,OAAA;AAAA,WAAA,QAAA,gBAAA;;GAAA,IAAA,WAAA;AAAA,WAAA,CAAA,gBAAA,mBAAA;KAAA,SAAA;KAAA,UAAA;KAAA,CAAA,EAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;GAAA,CAAA;EAAA,gBAKlB,MAAA;GAAA,IAAA,OAAA;AAAA,WAAA,QAAA,aAAA;;GAAA,IAAA,WAAA;AAAA,WAAA,CAAA,gBAAA,mBAAA;KAAA,SAAA;KAAA,UAAA;KAAA,CAAA,EAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;GAAA,CAAA;EAAA,sBAAA;GAAA,IAAA,OAAA;AAAA,WAAA,QAAA,cAAA,IAAA,QAAA,gBAAA,IAAA,QAAA,aAAA;;GAAA,IAAA,WAAA;AAAA,WAAA,gBAAA,OAAA,EAAA,CAAA;;GAAA,CAAA;EAAA,gBAAA,MAAA;GAAA,IAAA,OAAA;AAAA,WAAA,QAAA,SAAA;;GAAA,IAAA,WAAA;AAAA,WAAA,CAAA,UAAA,gBAAA,OAAA,EAAA,CAAA,CAAA;;GAAA,CAAA;EAAA,gBAAuB,mBAAA;GAAA,SAAA;GAAA,IAAA,WAAA;AAAA,WAAA,gBAAA,UAAA,SAAA,QAAA,UAAA,IAAA;;GAAA,CAAA;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA,gBAEAC,mBAAAA;GAAAA,SAAAA;GAAAA,IAAAA,WAAAA;AAAAA,WAAAA,qBAAAA,QAAAA;;GAAAA,CAAAA;EAAAA,gBAAAA,OAAAA,EAAAA,CAAAA;EAAAA"}
@@ -0,0 +1,28 @@
1
+ import { ComponentProps } from "../../types/components.cjs";
2
+ import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.cjs";
3
+ import * as _alloy_js_core4 from "@alloy-js/core";
4
+
5
+ //#region src/markdown/components/markdown-table.d.ts
6
+ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
7
+ data: T[];
8
+ }
9
+ /**
10
+ * Component that provides a context for rendering markdown tables.
11
+ */
12
+ declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core4.Children;
13
+ type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
14
+ width?: number;
15
+ };
16
+ /**
17
+ * Component that provides a context for rendering markdown tables.
18
+ */
19
+ declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core4.Children;
20
+ /**
21
+ * Component that provides a context for rendering markdown tables.
22
+ */
23
+ declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core4.Children;
24
+ declare type __ΩMarkdownTableProps = any[];
25
+ declare type __ΩMarkdownTableColumnProps = any[];
26
+ //#endregion
27
+ export { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps };
28
+ //# sourceMappingURL=markdown-table.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.d.cts","names":[],"sources":["../../../src/markdown/components/markdown-table.tsx"],"sourcesContent":[],"mappings":";;;;;UA4BiB,6BACL,sBAAsB,6BACxB;QACF;;AAHR;;;AAGQ,iBAMQ,aANR,CAAA,UAOI,MAPJ,CAAA,MAAA,EAAA,GAAA,CAAA,GAO0B,MAP1B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAQC,kBARD,CAQoB,CARpB,CAAA,CAAA,EAQmB,eAAA,CAAG,QARtB;AADE,KA4BE,wBAAA,GAA2B,cA5B7B,GA6BR,OA7BQ,CA6BA,IA7BA,CA6BK,mCA7BL,EAAA,OAAA,CAAA,CAAA,GA8BR,QA9BQ,CA8BC,IA9BD,CA8BM,mCA9BN,EAAA,MAAA,CAAA,CAAA,GAAA;EAAc,KAAA,CAAA,EAAA,MAAA;AAOxB,CAAA;;;;AAES,iBA4BO,mBAAA,CA5BP,KAAA,EA4BkC,wBA5BlC,CAAA,EA4B0D,eAAA,CAAA,QA5B1D;;;AAmBT;AAAuC,iBAsDvB,yBAAA,CAtDuB,KAAA,EAsDU,wBAtDV,CAAA,EAsDkC,eAAA,CAAA,QAtDlC;AACxB,qCAAA,GAAA,EAAA;AAAL,2CAAA,GAAA,EAAA"}
@@ -0,0 +1,28 @@
1
+ import { ComponentProps } from "../../types/components.mjs";
2
+ import { MarkdownTableColumnContextInterface } from "../contexts/markdown-table.mjs";
3
+ import * as _alloy_js_core19 from "@alloy-js/core";
4
+
5
+ //#region src/markdown/components/markdown-table.d.ts
6
+ interface MarkdownTableProps<T extends Record<string, any> = Record<string, any>> extends ComponentProps {
7
+ data: T[];
8
+ }
9
+ /**
10
+ * Component that provides a context for rendering markdown tables.
11
+ */
12
+ declare function MarkdownTable<T extends Record<string, any> = Record<string, any>>(props: MarkdownTableProps<T>): _alloy_js_core19.Children;
13
+ type MarkdownTableColumnProps = ComponentProps & Partial<Pick<MarkdownTableColumnContextInterface, "align">> & Required<Pick<MarkdownTableColumnContextInterface, "name">> & {
14
+ width?: number;
15
+ };
16
+ /**
17
+ * Component that provides a context for rendering markdown tables.
18
+ */
19
+ declare function MarkdownTableColumn(props: MarkdownTableColumnProps): _alloy_js_core19.Children;
20
+ /**
21
+ * Component that provides a context for rendering markdown tables.
22
+ */
23
+ declare function MarkdownTableColumnHeader(props: MarkdownTableColumnProps): _alloy_js_core19.Children;
24
+ declare type __ΩMarkdownTableProps = any[];
25
+ declare type __ΩMarkdownTableColumnProps = any[];
26
+ //#endregion
27
+ export { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps };
28
+ //# sourceMappingURL=markdown-table.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.d.mts","names":[],"sources":["../../../src/markdown/components/markdown-table.tsx"],"sourcesContent":[],"mappings":";;;;;UA4BiB,6BACL,sBAAsB,6BACxB;QACF;;AAHR;;;AAGQ,iBAMQ,aANR,CAAA,UAOI,MAPJ,CAAA,MAAA,EAAA,GAAA,CAAA,GAO0B,MAP1B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAQC,kBARD,CAQoB,CARpB,CAAA,CAAA,EAQmB,gBAAA,CAAG,QARtB;AADE,KA4BE,wBAAA,GAA2B,cA5B7B,GA6BR,OA7BQ,CA6BA,IA7BA,CA6BK,mCA7BL,EAAA,OAAA,CAAA,CAAA,GA8BR,QA9BQ,CA8BC,IA9BD,CA8BM,mCA9BN,EAAA,MAAA,CAAA,CAAA,GAAA;EAAc,KAAA,CAAA,EAAA,MAAA;AAOxB,CAAA;;;;AAES,iBA4BO,mBAAA,CA5BP,KAAA,EA4BkC,wBA5BlC,CAAA,EA4B0D,gBAAA,CAAA,QA5B1D;;;AAmBT;AAAuC,iBAsDvB,yBAAA,CAtDuB,KAAA,EAsDU,wBAtDV,CAAA,EAsDkC,gBAAA,CAAA,QAtDlC;AACxB,qCAAA,GAAA,EAAA;AAAL,2CAAA,GAAA,EAAA"}
@@ -95,4 +95,5 @@ function MarkdownTableColumnHeader(props) {
95
95
  }
96
96
 
97
97
  //#endregion
98
- export { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader };
98
+ export { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader };
99
+ //# sourceMappingURL=markdown-table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.mjs","names":["code","computed","Prose","Show","splitProps","titleCase","isUndefined","MarkdownTableContext","useMarkdownTable","MarkdownTable","props","children","data","columns","Object","keys","map","name","index","align","width","_$createComponent","Provider","value","when","Boolean","MarkdownTableColumn","tableContext","columnRef","find","c","indexRef","alignRef","widthRef","textLength","content","toString","length","repeat","MarkdownTableColumnHeader","rest","_$mergeProps","fallback","useDescriptions"],"sources":["../../../src/markdown/components/markdown-table.tsx"],"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, computed, Prose, Show, splitProps } from \"@alloy-js/core\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n MarkdownTableColumnContextInterface,\n MarkdownTableContext,\n useMarkdownTable\n} from \"../contexts/markdown-table\";\n\nexport interface MarkdownTableProps<\n T extends Record<string, any> = Record<string, any>\n> extends ComponentProps {\n data: T[];\n}\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTable<\n T extends Record<string, any> = Record<string, any>\n>(props: MarkdownTableProps<T>) {\n const [{ children, data }] = splitProps(props, [\"children\", \"data\"]);\n\n const columns = computed(() =>\n Object.keys(data).map((name: string, index: number) => ({\n index,\n name,\n align: \"left\" as const,\n width: 20\n }))\n );\n\n return (\n <MarkdownTableContext.Provider value={{ columns: columns.value, data }}>\n <Show when={Boolean(children)}>{children}</Show>\n </MarkdownTableContext.Provider>\n );\n}\n\nexport type MarkdownTableColumnProps = ComponentProps &\n Partial<Pick<MarkdownTableColumnContextInterface, \"align\">> &\n Required<Pick<MarkdownTableColumnContextInterface, \"name\">> & {\n width?: number;\n };\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTableColumn(props: MarkdownTableColumnProps) {\n const [{ children, width, align, name }] = splitProps(props, [\n \"children\",\n \"width\",\n \"align\",\n \"name\"\n ]);\n\n const tableContext = useMarkdownTable();\n const columnRef = computed(() =>\n tableContext?.columns.find(c => c.name === name)\n );\n\n const indexRef = computed(() => columnRef.value?.index ?? 0);\n const alignRef = computed(() => columnRef.value?.align ?? align ?? \"left\");\n const widthRef = computed(() => columnRef.value?.width ?? width ?? 20);\n\n const textLength = computed(() => {\n const content = children ? children.toString() : \"\";\n\n return content.length;\n });\n\n return (\n <Prose>\n <Show when={indexRef.value === 0}>{\"|\"}</Show>\n <Show when={Boolean(children)}>\n <Prose>{code`${\n alignRef.value === \"left\"\n ? \" \".repeat(widthRef.value - textLength.value - 1)\n : \" \"\n }${children}${\n alignRef.value === \"right\"\n ? \" \".repeat(widthRef.value - textLength.value - 1)\n : \" \"\n }`}</Prose>\n </Show>\n {\"|\"}\n </Prose>\n );\n}\n\n/**\n * Component that provides a context for rendering markdown tables.\n */\nexport function MarkdownTableColumnHeader(props: MarkdownTableColumnProps) {\n const [{ children, name }, rest] = splitProps(props, [\"children\", \"name\"]);\n\n return (\n <>\n <MarkdownTableColumn {...rest} name={name}>\n <Show\n fallback={titleCase(name, {\n useDescriptions: false\n })}\n when={!isUndefined(children)}>\n {children}\n </Show>\n </MarkdownTableColumn>\n </>\n );\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn } from "./markdown-table.cjs";
2
+ export { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn };
@@ -0,0 +1,2 @@
1
+ import { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn } from "./markdown-table.mjs";
2
+ export { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn };
@@ -0,0 +1,38 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+
3
+ //#region src/markdown/contexts/markdown-table.d.ts
4
+ interface MarkdownTableColumnContextInterface<T extends Record<string, any> = Record<string, any>> {
5
+ index: number;
6
+ name: keyof T;
7
+ align: "left" | "right" | "center";
8
+ width: number;
9
+ }
10
+ /**
11
+ * The Powerlines context used in template rendering.
12
+ */
13
+ declare const MarkdownTableColumnContext: ComponentContext<MarkdownTableColumnContextInterface>;
14
+ /**
15
+ * Hook to access the Powerlines Context.
16
+ *
17
+ * @returns The Context.
18
+ */
19
+ declare function useMarkdownTableColumn(): MarkdownTableColumnContextInterface<Record<string, any>> | undefined;
20
+ interface MarkdownTableContextInterface<T extends Record<string, any> = Record<string, any>> {
21
+ columns: MarkdownTableColumnContextInterface<T>[];
22
+ data: T[];
23
+ }
24
+ /**
25
+ * The Powerlines context used in template rendering.
26
+ */
27
+ declare const MarkdownTableContext: ComponentContext<MarkdownTableContextInterface>;
28
+ /**
29
+ * Hook to access the Powerlines Context.
30
+ *
31
+ * @returns The Context.
32
+ */
33
+ declare function useMarkdownTable(): MarkdownTableContextInterface<Record<string, any>> | undefined;
34
+ declare type __ΩMarkdownTableColumnContextInterface = any[];
35
+ declare type __ΩMarkdownTableContextInterface = any[];
36
+ //#endregion
37
+ export { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn };
38
+ //# sourceMappingURL=markdown-table.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.d.cts","names":[],"sources":["../../../src/markdown/contexts/markdown-table.ts"],"sourcesContent":[],"mappings":";;;UAqBiB,8CACL,sBAAsB;;EADjB,IAAA,EAAA,MAIH,CAJG;EACL,KAAA,EAAA,MAAA,GAAA,OAAA,GAAA,QAAA;EAAsB,KAAA,EAAA,MAAA;;;AAWlC;AAWA;AAMiB,cAjBJ,0BAiBiC,EAjBL,gBAiBK,CAjBY,mCAiBZ,CAAA;;;;;;AAIrC,iBAVO,sBAAA,CAAA,CAUP,EAV6B,mCAU7B,CAV6B,MAU7B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAMI,UAVI,6BAUmC,CAAA,UATxC,MASwC,CAAA,MAAjB,EAAA,GAAA,CAAA,GATD,MASC,CAAA,MAAgB,EAAA,GAAA,CAAA,CAAA,CAAA;EAWnC,OAAA,EAlBL,mCAkBqB,CAlBe,CAkBf,CAAA,EAAA;QAjBxB;;;;;cAMK,sBAAsB,iBAAiB;;;;;;iBAWpC,gBAAA,CAAA,GAAgB,8BAAA"}
@@ -0,0 +1,38 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+
3
+ //#region src/markdown/contexts/markdown-table.d.ts
4
+ interface MarkdownTableColumnContextInterface<T extends Record<string, any> = Record<string, any>> {
5
+ index: number;
6
+ name: keyof T;
7
+ align: "left" | "right" | "center";
8
+ width: number;
9
+ }
10
+ /**
11
+ * The Powerlines context used in template rendering.
12
+ */
13
+ declare const MarkdownTableColumnContext: ComponentContext<MarkdownTableColumnContextInterface>;
14
+ /**
15
+ * Hook to access the Powerlines Context.
16
+ *
17
+ * @returns The Context.
18
+ */
19
+ declare function useMarkdownTableColumn(): MarkdownTableColumnContextInterface<Record<string, any>> | undefined;
20
+ interface MarkdownTableContextInterface<T extends Record<string, any> = Record<string, any>> {
21
+ columns: MarkdownTableColumnContextInterface<T>[];
22
+ data: T[];
23
+ }
24
+ /**
25
+ * The Powerlines context used in template rendering.
26
+ */
27
+ declare const MarkdownTableContext: ComponentContext<MarkdownTableContextInterface>;
28
+ /**
29
+ * Hook to access the Powerlines Context.
30
+ *
31
+ * @returns The Context.
32
+ */
33
+ declare function useMarkdownTable(): MarkdownTableContextInterface<Record<string, any>> | undefined;
34
+ declare type __ΩMarkdownTableColumnContextInterface = any[];
35
+ declare type __ΩMarkdownTableContextInterface = any[];
36
+ //#endregion
37
+ export { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn };
38
+ //# sourceMappingURL=markdown-table.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.d.mts","names":[],"sources":["../../../src/markdown/contexts/markdown-table.ts"],"sourcesContent":[],"mappings":";;;UAqBiB,8CACL,sBAAsB;;EADjB,IAAA,EAAA,MAIH,CAJG;EACL,KAAA,EAAA,MAAA,GAAA,OAAA,GAAA,QAAA;EAAsB,KAAA,EAAA,MAAA;;;AAWlC;AAWA;AAMiB,cAjBJ,0BAiBiC,EAjBL,gBAiBK,CAjBY,mCAiBZ,CAAA;;;;;;AAIrC,iBAVO,sBAAA,CAAA,CAUP,EAV6B,mCAU7B,CAV6B,MAU7B,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAMI,UAVI,6BAUmC,CAAA,UATxC,MASwC,CAAA,MAAA,EAAjB,GAAA,CAAA,GATD,MASC,CAAA,MAAgB,EAAA,GAAA,CAAA,CAAA,CAAA;EAWnC,OAAA,EAlBL,mCAkBqB,CAlBe,CAkBf,CAAA,EAAA;QAjBxB;;;;;cAMK,sBAAsB,iBAAiB;;;;;;iBAWpC,gBAAA,CAAA,GAAgB,8BAAA"}
@@ -30,4 +30,5 @@ function useMarkdownTable() {
30
30
  }
31
31
 
32
32
  //#endregion
33
- export { MarkdownTableColumnContext, MarkdownTableContext, useMarkdownTable, useMarkdownTableColumn };
33
+ export { MarkdownTableColumnContext, MarkdownTableContext, useMarkdownTable, useMarkdownTableColumn };
34
+ //# sourceMappingURL=markdown-table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.mjs","names":["createContext","createNamedContext","useContext","MarkdownTableColumnContext","useMarkdownTableColumn","MarkdownTableContext","columns","data","useMarkdownTable"],"sources":["../../../src/markdown/contexts/markdown-table.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\";\n\nexport interface MarkdownTableColumnContextInterface<\n T extends Record<string, any> = Record<string, any>\n> {\n index: number;\n name: keyof T;\n align: \"left\" | \"right\" | \"center\";\n width: number;\n}\n\n/**\n * The Powerlines context used in template rendering.\n */\nexport const MarkdownTableColumnContext: ComponentContext<MarkdownTableColumnContextInterface> =\n createNamedContext<MarkdownTableColumnContextInterface>(\n \"MarkdownTableColumn\",\n {} as MarkdownTableColumnContextInterface\n );\n\n/**\n * Hook to access the Powerlines Context.\n *\n * @returns The Context.\n */\nexport function useMarkdownTableColumn() {\n return useContext<MarkdownTableColumnContextInterface>(\n MarkdownTableColumnContext\n );\n}\n\nexport interface MarkdownTableContextInterface<\n T extends Record<string, any> = Record<string, any>\n> {\n columns: MarkdownTableColumnContextInterface<T>[];\n data: T[];\n}\n\n/**\n * The Powerlines context used in template rendering.\n */\nexport const MarkdownTableContext: ComponentContext<MarkdownTableContextInterface> =\n createContext<MarkdownTableContextInterface>({\n columns: [],\n data: []\n } as MarkdownTableContextInterface);\n\n/**\n * Hook to access the Powerlines Context.\n *\n * @returns The Context.\n */\nexport function useMarkdownTable() {\n return useContext<MarkdownTableContextInterface>(MarkdownTableContext);\n}\n"],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { FrontMatter, FrontMatterProps, __ΩFrontMatterProps } from "./components/front-matter.cjs";
2
+ import { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps } from "./components/markdown-file.cjs";
3
+ import { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn } from "./contexts/markdown-table.cjs";
4
+ import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./components/markdown-table.cjs";
5
+ import "./components/index.cjs";
6
+ import "./contexts/index.cjs";
7
+ export { FrontMatter, FrontMatterProps, MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableContext, MarkdownTableContextInterface, MarkdownTableProps, __ΩFrontMatterProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableColumnProps, __ΩMarkdownTableContextInterface, __ΩMarkdownTableProps, useMarkdownTable, useMarkdownTableColumn };
@@ -0,0 +1,7 @@
1
+ import { FrontMatter, FrontMatterProps, __ΩFrontMatterProps } from "./components/front-matter.mjs";
2
+ import { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps } from "./components/markdown-file.mjs";
3
+ import { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn } from "./contexts/markdown-table.mjs";
4
+ import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./components/markdown-table.mjs";
5
+ import "./components/index.mjs";
6
+ import "./contexts/index.mjs";
7
+ export { FrontMatter, FrontMatterProps, MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableContext, MarkdownTableContextInterface, MarkdownTableProps, __ΩFrontMatterProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableColumnProps, __ΩMarkdownTableContextInterface, __ΩMarkdownTableProps, useMarkdownTable, useMarkdownTableColumn };
@@ -0,0 +1,39 @@
1
+ import { Children, PrintTreeOptions } from "@alloy-js/core";
2
+ import { PluginContext } from "powerlines";
3
+
4
+ //#region src/render.d.ts
5
+
6
+ /**
7
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { render } from "@powerlines/plugin-alloy/render";
12
+ *
13
+ * await render(context, <> ... </>);
14
+ * ```
15
+ *
16
+ * @param context - The Powerlines plugin context.
17
+ * @param children - The children components to render.
18
+ * @returns A promise that resolves when rendering is complete.
19
+ */
20
+ declare function render<TContext extends PluginContext>(context: TContext, children: Children): Promise<void>;
21
+ /**
22
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * import { renderString } from "@powerlines/plugin-alloy/render";
27
+ *
28
+ * const output = await renderString(context, <> ... </>);
29
+ * ```
30
+ *
31
+ * @param context - The Powerlines plugin context.
32
+ * @param children - The children components to render.
33
+ * @param options - Optional print tree options.
34
+ * @returns The rendered output as a string.
35
+ */
36
+ declare function renderString<TContext extends PluginContext>(context: TContext, children: Children, options?: PrintTreeOptions): string;
37
+ //#endregion
38
+ export { render, renderString };
39
+ //# sourceMappingURL=render.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"sourcesContent":[],"mappings":";;;;;;;AA4CA;;;;;;AA6FA;;;;;;iBA7FsB,wBAAwB,wBACnC,oBACC,WAAQ;;;;;;;;;;;;;;;;iBA2FJ,8BAA8B,wBACnC,oBACC,oBACA"}