@powerlines/plugin-date 0.12.142 → 0.12.144

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 (198) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  2. package/dist/components/date-fns.cjs +527 -0
  3. package/dist/components/date-fns.d.cts +13 -0
  4. package/dist/components/date-fns.d.mts +13 -0
  5. package/dist/components/date-fns.mjs +527 -0
  6. package/dist/components/dayjs.cjs +472 -0
  7. package/dist/components/dayjs.d.cts +13 -0
  8. package/dist/components/dayjs.d.mts +13 -0
  9. package/dist/components/dayjs.mjs +472 -0
  10. package/dist/components/index.cjs +4 -0
  11. package/dist/components/index.d.cts +4 -0
  12. package/dist/components/index.d.mts +4 -0
  13. package/dist/components/index.mjs +6 -0
  14. package/dist/components/luxon.cjs +476 -0
  15. package/dist/components/luxon.d.cts +13 -0
  16. package/dist/components/luxon.d.mts +13 -0
  17. package/dist/components/luxon.mjs +476 -0
  18. package/dist/components/moment.cjs +462 -0
  19. package/dist/components/moment.d.cts +13 -0
  20. package/dist/components/moment.d.mts +13 -0
  21. package/dist/components/moment.mjs +462 -0
  22. package/dist/deepkit/schemas/reflection.cjs +3998 -0
  23. package/dist/deepkit/schemas/reflection.d.cts +1560 -0
  24. package/dist/deepkit/schemas/reflection.d.mts +1560 -0
  25. package/dist/deepkit/schemas/reflection.mjs +3996 -0
  26. package/dist/deepkit/schemas/reflection2.cjs +4112 -0
  27. package/dist/deepkit/schemas/reflection2.mjs +4110 -0
  28. package/dist/deepkit/src/capnp.cjs +913 -0
  29. package/dist/deepkit/src/capnp.mjs +911 -0
  30. package/dist/deepkit/src/esbuild-plugin.cjs +47 -0
  31. package/dist/deepkit/src/esbuild-plugin.mjs +46 -0
  32. package/dist/deepkit/src/reflect-type.cjs +22 -0
  33. package/dist/deepkit/src/reflect-type.mjs +20 -0
  34. package/dist/deepkit/src/resolve-reflections.cjs +16 -0
  35. package/dist/deepkit/src/resolve-reflections.mjs +15 -0
  36. package/dist/deepkit/src/transformer.cjs +52 -0
  37. package/dist/deepkit/src/transformer.mjs +49 -0
  38. package/dist/deepkit/src/transpile.cjs +29 -0
  39. package/dist/deepkit/src/transpile.mjs +27 -0
  40. package/dist/deepkit/src/types.d.cts +10 -0
  41. package/dist/deepkit/src/types.d.mts +10 -0
  42. package/dist/deepkit/src/utilities.cjs +66 -0
  43. package/dist/deepkit/src/utilities.mjs +65 -0
  44. package/dist/index.cjs +17 -13844
  45. package/dist/index.d.cts +9 -40
  46. package/dist/index.d.mts +9 -40
  47. package/dist/index.mjs +6 -13800
  48. package/dist/plugin-alloy/src/core/components/output.cjs +38 -0
  49. package/dist/plugin-alloy/src/core/components/output.mjs +37 -0
  50. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +20 -0
  51. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +19 -0
  52. package/dist/plugin-alloy/src/core/components/source-file.cjs +60 -0
  53. package/dist/plugin-alloy/src/core/components/source-file.mjs +58 -0
  54. package/dist/plugin-alloy/src/core/contexts/context.cjs +60 -0
  55. package/dist/plugin-alloy/src/core/contexts/context.mjs +54 -0
  56. package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
  57. package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
  58. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
  59. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
  60. package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
  61. package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
  62. package/dist/plugin-alloy/src/index.cjs +90 -0
  63. package/dist/plugin-alloy/src/index.mjs +88 -0
  64. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +7 -0
  65. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +9 -0
  66. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +5 -0
  67. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +7 -0
  68. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +17 -0
  69. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
  70. package/dist/plugin-alloy/src/types/components.d.mts +3 -0
  71. package/dist/plugin-alloy/src/types/index.d.mts +2 -0
  72. package/dist/plugin-alloy/src/types/plugin.d.cts +37 -0
  73. package/dist/plugin-alloy/src/types/plugin.d.mts +37 -0
  74. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +47 -0
  75. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +46 -0
  76. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +75 -0
  77. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +73 -0
  78. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +359 -0
  79. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +350 -0
  80. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +143 -0
  81. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +140 -0
  82. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +53 -0
  83. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +52 -0
  84. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +94 -0
  85. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +93 -0
  86. package/dist/plugin-automd/src/index.cjs +101 -0
  87. package/dist/plugin-automd/src/index.mjs +98 -0
  88. package/dist/plugin-automd/src/types/plugin.d.cts +38 -0
  89. package/dist/plugin-automd/src/types/plugin.d.mts +40 -0
  90. package/dist/plugin-automd/src/types/toc.d.cts +33 -0
  91. package/dist/plugin-automd/src/types/toc.d.mts +33 -0
  92. package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
  93. package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
  94. package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -0
  95. package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -0
  96. package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
  97. package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
  98. package/dist/plugin-babel/src/helpers/index.cjs +5 -0
  99. package/dist/plugin-babel/src/helpers/index.mjs +7 -0
  100. package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -0
  101. package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -0
  102. package/dist/plugin-babel/src/helpers/options.cjs +50 -0
  103. package/dist/plugin-babel/src/helpers/options.mjs +47 -0
  104. package/dist/plugin-babel/src/index.cjs +91 -0
  105. package/dist/plugin-babel/src/index.mjs +89 -0
  106. package/dist/plugin-babel/src/types/index.d.mts +1 -0
  107. package/dist/plugin-babel/src/types/plugin.d.cts +15 -0
  108. package/dist/plugin-babel/src/types/plugin.d.mts +15 -0
  109. package/dist/plugin-env/src/babel/index.cjs +1 -0
  110. package/dist/plugin-env/src/babel/index.mjs +3 -0
  111. package/dist/plugin-env/src/babel/plugin.cjs +121 -0
  112. package/dist/plugin-env/src/babel/plugin.mjs +119 -0
  113. package/dist/plugin-env/src/components/docs.cjs +9 -0
  114. package/dist/plugin-env/src/components/docs.mjs +11 -0
  115. package/dist/plugin-env/src/components/env.cjs +487 -0
  116. package/dist/plugin-env/src/components/env.mjs +484 -0
  117. package/dist/plugin-env/src/components/index.cjs +2 -0
  118. package/dist/plugin-env/src/components/index.mjs +4 -0
  119. package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -0
  120. package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -0
  121. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -0
  122. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -0
  123. package/dist/plugin-env/src/helpers/index.cjs +6 -0
  124. package/dist/plugin-env/src/helpers/index.mjs +8 -0
  125. package/dist/plugin-env/src/helpers/load.cjs +83 -0
  126. package/dist/plugin-env/src/helpers/load.mjs +80 -0
  127. package/dist/plugin-env/src/helpers/persistence.cjs +199 -0
  128. package/dist/plugin-env/src/helpers/persistence.mjs +188 -0
  129. package/dist/plugin-env/src/helpers/reflect.cjs +125 -0
  130. package/dist/plugin-env/src/helpers/reflect.mjs +117 -0
  131. package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -0
  132. package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -0
  133. package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -0
  134. package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -0
  135. package/dist/plugin-env/src/index.cjs +172 -0
  136. package/dist/plugin-env/src/index.mjs +170 -0
  137. package/dist/plugin-env/src/types/plugin.d.cts +151 -0
  138. package/dist/plugin-env/src/types/plugin.d.mts +153 -0
  139. package/dist/plugin-env/src/types/runtime.d.cts +792 -0
  140. package/dist/plugin-env/src/types/runtime.d.mts +792 -0
  141. package/dist/powerlines/src/lib/build/esbuild.cjs +102 -0
  142. package/dist/powerlines/src/lib/build/esbuild.mjs +100 -0
  143. package/dist/powerlines/src/lib/entry.cjs +12 -0
  144. package/dist/powerlines/src/lib/entry.mjs +14 -0
  145. package/dist/powerlines/src/lib/logger.cjs +41 -0
  146. package/dist/powerlines/src/lib/logger.mjs +39 -0
  147. package/dist/powerlines/src/lib/utilities/bundle.cjs +35 -0
  148. package/dist/powerlines/src/lib/utilities/bundle.mjs +34 -0
  149. package/dist/powerlines/src/lib/utilities/file-header.cjs +22 -0
  150. package/dist/powerlines/src/lib/utilities/file-header.mjs +21 -0
  151. package/dist/powerlines/src/lib/utilities/resolve.cjs +30 -0
  152. package/dist/powerlines/src/lib/utilities/resolve.mjs +29 -0
  153. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
  154. package/dist/powerlines/src/plugin-utils/paths.mjs +3 -0
  155. package/dist/powerlines/src/types/babel.d.cts +22 -0
  156. package/dist/powerlines/src/types/babel.d.mts +22 -0
  157. package/dist/powerlines/src/types/build.d.cts +145 -0
  158. package/dist/powerlines/src/types/build.d.mts +145 -0
  159. package/dist/powerlines/src/types/commands.d.cts +8 -0
  160. package/dist/powerlines/src/types/commands.d.mts +9 -0
  161. package/dist/powerlines/src/types/config.d.cts +387 -0
  162. package/dist/powerlines/src/types/config.d.mts +388 -0
  163. package/dist/powerlines/src/types/context.d.cts +414 -0
  164. package/dist/powerlines/src/types/context.d.mts +416 -0
  165. package/dist/powerlines/src/types/fs.d.cts +486 -0
  166. package/dist/powerlines/src/types/fs.d.mts +486 -0
  167. package/dist/powerlines/src/types/hooks.d.mts +2 -0
  168. package/dist/powerlines/src/types/plugin.d.cts +231 -0
  169. package/dist/powerlines/src/types/plugin.d.mts +231 -0
  170. package/dist/powerlines/src/types/resolved.d.cts +82 -0
  171. package/dist/powerlines/src/types/resolved.d.mts +82 -0
  172. package/dist/powerlines/src/types/tsconfig.d.cts +69 -0
  173. package/dist/powerlines/src/types/tsconfig.d.mts +69 -0
  174. package/dist/types/index.cjs +0 -3
  175. package/dist/types/index.d.cts +2 -3
  176. package/dist/types/index.d.mts +2 -3
  177. package/dist/types/index.mjs +0 -4
  178. package/dist/types/plugin.cjs +0 -1
  179. package/dist/types/plugin.d.cts +42 -1
  180. package/dist/types/plugin.d.mts +42 -1
  181. package/dist/types/plugin.mjs +0 -2
  182. package/dist/types/runtime.cjs +0 -1
  183. package/dist/types/runtime.d.cts +710 -1
  184. package/dist/types/runtime.d.mts +710 -1
  185. package/dist/types/runtime.mjs +0 -2
  186. package/package.json +5 -5
  187. package/dist/index-CA4VvAY_.d.mts +0 -1
  188. package/dist/index-CmCelmEL.d.cts +0 -1
  189. package/dist/plugin-BUfZ6cT1.d.cts +0 -4432
  190. package/dist/plugin-CuNMs4r-.d.mts +0 -4434
  191. package/dist/plugin-DHXHjv16.cjs +0 -0
  192. package/dist/plugin-ufqFO5xS.mjs +0 -1
  193. package/dist/runtime-B7WoCmC4.mjs +0 -1
  194. package/dist/runtime-B8LVkjWB.d.cts +0 -711
  195. package/dist/runtime-CiYq8JJ6.d.mts +0 -711
  196. package/dist/runtime-D4zTdSwv.cjs +0 -0
  197. package/dist/types-BReKsBV6.mjs +0 -1
  198. package/dist/types-CBTc19th.cjs +0 -0
@@ -0,0 +1,359 @@
1
+ const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
2
+ const require_context = require('../../core/contexts/context.cjs');
3
+ const require_utilities = require('../../../../deepkit/src/utilities.cjs');
4
+ let __alloy_js_core = require("@alloy-js/core");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
7
+ let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
8
+
9
+ //#region ../plugin-alloy/src/typescript/components/tsdoc.tsx
10
+ /**
11
+ * Generates a TypeScript interface for the given reflection class.
12
+ */
13
+ function TSDoc(props) {
14
+ const [{ children, heading }] = (0, __alloy_js_core.splitProps)(props, ["children", "heading"]);
15
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
16
+ "/**",
17
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("align", {
18
+ string: " * ",
19
+ children: [
20
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
21
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
22
+ when: !(0, __stryke_type_checks_is_undefined.isUndefined)(heading),
23
+ children: [
24
+ heading,
25
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
26
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
27
+ when: !(0, __stryke_type_checks_is_undefined.isUndefined)(children) && (0, __alloy_js_core.childrenArray)(() => children).length > 0,
28
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
29
+ })
30
+ ]
31
+ }),
32
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
33
+ when: !(0, __stryke_type_checks_is_undefined.isUndefined)(children) && (0, __alloy_js_core.childrenArray)(() => children).length > 0,
34
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.List, { children: (0, __alloy_js_core.childrenArray)(() => children) })
35
+ })
36
+ ]
37
+ }),
38
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
39
+ ` */`,
40
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
41
+ ] });
42
+ }
43
+ /**
44
+ * Create a TSDoc `@<props.tag>` tag.
45
+ */
46
+ function TSDocTag(props) {
47
+ const [{ children, tag }] = (0, __alloy_js_core.splitProps)(props, ["children", "tag"]);
48
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
49
+ `@${tag} `,
50
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
51
+ when: Boolean(children),
52
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("align", {
53
+ width: 2,
54
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Prose, { children })
55
+ })
56
+ }),
57
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
58
+ ] });
59
+ }
60
+ /**
61
+ * Create a TSDoc `@title` tag.
62
+ */
63
+ function TSDocTitle(props) {
64
+ const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
65
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
66
+ ...rest,
67
+ tag: "title",
68
+ children
69
+ });
70
+ }
71
+ /**
72
+ * Create a TSDoc `@domain` tag.
73
+ */
74
+ function TSDocDomain(props) {
75
+ const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
76
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
77
+ ...rest,
78
+ tag: "domain",
79
+ children
80
+ });
81
+ }
82
+ /**
83
+ * Create a TSDoc `@alias` tag.
84
+ */
85
+ function TSDocAlias(props) {
86
+ const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
87
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
88
+ ...rest,
89
+ tag: "alias",
90
+ children
91
+ });
92
+ }
93
+ /**
94
+ * Create a TSDoc `@permission` tag.
95
+ */
96
+ function TSDocPermission(props) {
97
+ const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
98
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
99
+ ...rest,
100
+ tag: "permission",
101
+ children
102
+ });
103
+ }
104
+ /**
105
+ * Create a TSDoc `@defaultValue` tag.
106
+ */
107
+ function TSDocDefaultValue(props) {
108
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
109
+ "@defaultValue ",
110
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
111
+ when: !(0, __stryke_type_checks_is_undefined.isUndefined)(props.value),
112
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("align", {
113
+ width: 2,
114
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Prose, { children: require_utilities.stringifyDefaultValue(props.value) })
115
+ })
116
+ }),
117
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
118
+ ] });
119
+ }
120
+ /**
121
+ * Create a TSDoc `@remarks` tag.
122
+ */
123
+ function TSDocRemarks(props) {
124
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
125
+ "@remarks ",
126
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
127
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.List, {
128
+ hardline: true,
129
+ children: (0, __alloy_js_core.childrenArray)(() => props.children)
130
+ })
131
+ ] });
132
+ }
133
+ /**
134
+ * Create a TSDoc `@see` tag.
135
+ */
136
+ function TSDocLink(props) {
137
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
138
+ ...props,
139
+ tag: "see"
140
+ });
141
+ }
142
+ /**
143
+ * Create a TSDoc `@example` tag.
144
+ */
145
+ function TSDocExample(props) {
146
+ const [{ tsx, fenced = true, language, children }] = (0, __alloy_js_core.splitProps)(props, [
147
+ "tsx",
148
+ "fenced",
149
+ "language",
150
+ "children"
151
+ ]);
152
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
153
+ "@example ",
154
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
155
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
156
+ when: fenced,
157
+ children: [
158
+ "```",
159
+ language || (tsx ? "tsx" : "ts"),
160
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
161
+ ]
162
+ }),
163
+ children,
164
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
165
+ when: fenced,
166
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}), "```"]
167
+ })
168
+ ] });
169
+ }
170
+ /**
171
+ * Create a TSDoc `@readonly` tag.
172
+ */
173
+ function TSDocReadonly() {
174
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, { tag: "readonly" });
175
+ }
176
+ /**
177
+ * Create a TSDoc `@internal` tag.
178
+ */
179
+ function TSDocInternal() {
180
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, { tag: "internal" });
181
+ }
182
+ /**
183
+ * Create a TSDoc `@ignore` tag.
184
+ */
185
+ function TSDocIgnore() {
186
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, { tag: "ignore" });
187
+ }
188
+ /**
189
+ * Create a TSDoc `@hidden` tag.
190
+ */
191
+ function TSDocHidden() {
192
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, { tag: "hidden" });
193
+ }
194
+ /**
195
+ * Generates a TypeScript interface property for the given reflection class.
196
+ */
197
+ function TSDocAttributesTags(props) {
198
+ const [{ title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = (0, __alloy_js_core.splitProps)(props, [
199
+ "title",
200
+ "alias",
201
+ "permission",
202
+ "domain",
203
+ "readonly",
204
+ "internal",
205
+ "ignore",
206
+ "hidden",
207
+ "defaultValue"
208
+ ]);
209
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
210
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
211
+ when: (0, __stryke_type_checks_is_set_string.isSetString)(title),
212
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTitle, { children: title })
213
+ }),
214
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
215
+ when: !(0, __stryke_type_checks_is_undefined.isUndefined)(alias) && alias.length > 0,
216
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
217
+ each: alias ?? [],
218
+ children: (alias$1) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocAlias, { children: alias$1 })
219
+ })
220
+ }),
221
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
222
+ when: (0, __stryke_type_checks_is_set_string.isSetString)(domain),
223
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocDomain, { children: domain })
224
+ }),
225
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
226
+ when: !(0, __stryke_type_checks_is_undefined.isUndefined)(permission) && permission.length > 0,
227
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.For, {
228
+ each: permission ?? [],
229
+ children: (permission$1) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocPermission, { children: permission$1 })
230
+ })
231
+ }),
232
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
233
+ when: readonly === true,
234
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocReadonly, {})
235
+ }),
236
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
237
+ when: internal === true,
238
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocInternal, {})
239
+ }),
240
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
241
+ when: ignore === true,
242
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocIgnore, {})
243
+ }),
244
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
245
+ when: hidden === true,
246
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocHidden, {})
247
+ }),
248
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
249
+ when: !(0, __stryke_type_checks_is_undefined.isUndefined)(defaultValue),
250
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocDefaultValue, { value: defaultValue })
251
+ })
252
+ ] });
253
+ }
254
+ /**
255
+ * Create a TSDoc parameter set off with `@param`.
256
+ */
257
+ function TSDocParam(props) {
258
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
259
+ "@param ",
260
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocParamName, {
261
+ name: props.name,
262
+ optional: props.optional,
263
+ defaultValue: props.defaultValue
264
+ }),
265
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocParamDescription, { children: props.children })
266
+ ] });
267
+ }
268
+ function TSDocParamName(props) {
269
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
270
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
271
+ when: props.optional,
272
+ children: "["
273
+ }),
274
+ props.name,
275
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
276
+ when: Boolean(props.defaultValue),
277
+ children: ["=", props.defaultValue]
278
+ }),
279
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
280
+ when: props.optional,
281
+ children: "]"
282
+ })
283
+ ] });
284
+ }
285
+ function TSDocParamDescription(props) {
286
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
287
+ when: Boolean(props.children),
288
+ children: [" - ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("align", {
289
+ width: 2,
290
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Prose, { children: props.children })
291
+ })]
292
+ });
293
+ }
294
+ /**
295
+ * Create a TSDoc `@returns` tag.
296
+ */
297
+ function TSDocReturns(props) {
298
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
299
+ ...props,
300
+ tag: "returns"
301
+ });
302
+ }
303
+ /**
304
+ * Create a TSDoc `@throws` tag.
305
+ */
306
+ function TSDocThrows(props) {
307
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TSDocTag, {
308
+ ...props,
309
+ tag: "throws"
310
+ });
311
+ }
312
+ /**
313
+ * Generates a TSDoc `@module` tag for the given module name.
314
+ */
315
+ function TSDocModule(props) {
316
+ const [{ children, name, prefix }] = (0, __alloy_js_core.splitProps)(props, [
317
+ "children",
318
+ "name",
319
+ "prefix"
320
+ ]);
321
+ const context = require_context.usePowerlines();
322
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
323
+ "/**",
324
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("align", {
325
+ string: " * ",
326
+ children: [
327
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
328
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__alloy_js_core.Show, {
329
+ when: Boolean(children),
330
+ children: [
331
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.List, {
332
+ hardline: true,
333
+ children: (0, __alloy_js_core.childrenArray)(() => children)
334
+ }),
335
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
336
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {})
337
+ ]
338
+ }),
339
+ "@module ",
340
+ prefix || context?.config.output.builtinPrefix,
341
+ ":",
342
+ name
343
+ ]
344
+ }),
345
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hbr", {}),
346
+ ` */`
347
+ ] });
348
+ }
349
+
350
+ //#endregion
351
+ exports.TSDoc = TSDoc;
352
+ exports.TSDocAttributesTags = TSDocAttributesTags;
353
+ exports.TSDocExample = TSDocExample;
354
+ exports.TSDocLink = TSDocLink;
355
+ exports.TSDocModule = TSDocModule;
356
+ exports.TSDocParam = TSDocParam;
357
+ exports.TSDocRemarks = TSDocRemarks;
358
+ exports.TSDocReturns = TSDocReturns;
359
+ exports.TSDocThrows = TSDocThrows;
@@ -0,0 +1,350 @@
1
+ import { usePowerlines } from "../../core/contexts/context.mjs";
2
+ import { stringifyDefaultValue } from "../../../../deepkit/src/utilities.mjs";
3
+ import { For, List, Prose, Show, childrenArray, splitProps } from "@alloy-js/core";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { isSetString } from "@stryke/type-checks/is-set-string";
6
+ import { isUndefined } from "@stryke/type-checks/is-undefined";
7
+
8
+ //#region ../plugin-alloy/src/typescript/components/tsdoc.tsx
9
+ /**
10
+ * Generates a TypeScript interface for the given reflection class.
11
+ */
12
+ function TSDoc(props) {
13
+ const [{ children, heading }] = splitProps(props, ["children", "heading"]);
14
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
15
+ "/**",
16
+ /* @__PURE__ */ jsxs("align", {
17
+ string: " * ",
18
+ children: [
19
+ /* @__PURE__ */ jsx("hbr", {}),
20
+ /* @__PURE__ */ jsxs(Show, {
21
+ when: !isUndefined(heading),
22
+ children: [
23
+ heading,
24
+ /* @__PURE__ */ jsx("hbr", {}),
25
+ /* @__PURE__ */ jsx(Show, {
26
+ when: !isUndefined(children) && childrenArray(() => children).length > 0,
27
+ children: /* @__PURE__ */ jsx("hbr", {})
28
+ })
29
+ ]
30
+ }),
31
+ /* @__PURE__ */ jsx(Show, {
32
+ when: !isUndefined(children) && childrenArray(() => children).length > 0,
33
+ children: /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })
34
+ })
35
+ ]
36
+ }),
37
+ /* @__PURE__ */ jsx("hbr", {}),
38
+ ` */`,
39
+ /* @__PURE__ */ jsx("hbr", {})
40
+ ] });
41
+ }
42
+ /**
43
+ * Create a TSDoc `@<props.tag>` tag.
44
+ */
45
+ function TSDocTag(props) {
46
+ const [{ children, tag }] = splitProps(props, ["children", "tag"]);
47
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
48
+ `@${tag} `,
49
+ /* @__PURE__ */ jsx(Show, {
50
+ when: Boolean(children),
51
+ children: /* @__PURE__ */ jsx("align", {
52
+ width: 2,
53
+ children: /* @__PURE__ */ jsx(Prose, { children })
54
+ })
55
+ }),
56
+ /* @__PURE__ */ jsx("hbr", {})
57
+ ] });
58
+ }
59
+ /**
60
+ * Create a TSDoc `@title` tag.
61
+ */
62
+ function TSDocTitle(props) {
63
+ const [{ children }, rest] = splitProps(props, ["children"]);
64
+ return /* @__PURE__ */ jsx(TSDocTag, {
65
+ ...rest,
66
+ tag: "title",
67
+ children
68
+ });
69
+ }
70
+ /**
71
+ * Create a TSDoc `@domain` tag.
72
+ */
73
+ function TSDocDomain(props) {
74
+ const [{ children }, rest] = splitProps(props, ["children"]);
75
+ return /* @__PURE__ */ jsx(TSDocTag, {
76
+ ...rest,
77
+ tag: "domain",
78
+ children
79
+ });
80
+ }
81
+ /**
82
+ * Create a TSDoc `@alias` tag.
83
+ */
84
+ function TSDocAlias(props) {
85
+ const [{ children }, rest] = splitProps(props, ["children"]);
86
+ return /* @__PURE__ */ jsx(TSDocTag, {
87
+ ...rest,
88
+ tag: "alias",
89
+ children
90
+ });
91
+ }
92
+ /**
93
+ * Create a TSDoc `@permission` tag.
94
+ */
95
+ function TSDocPermission(props) {
96
+ const [{ children }, rest] = splitProps(props, ["children"]);
97
+ return /* @__PURE__ */ jsx(TSDocTag, {
98
+ ...rest,
99
+ tag: "permission",
100
+ children
101
+ });
102
+ }
103
+ /**
104
+ * Create a TSDoc `@defaultValue` tag.
105
+ */
106
+ function TSDocDefaultValue(props) {
107
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
108
+ "@defaultValue ",
109
+ /* @__PURE__ */ jsx(Show, {
110
+ when: !isUndefined(props.value),
111
+ children: /* @__PURE__ */ jsx("align", {
112
+ width: 2,
113
+ children: /* @__PURE__ */ jsx(Prose, { children: stringifyDefaultValue(props.value) })
114
+ })
115
+ }),
116
+ /* @__PURE__ */ jsx("hbr", {})
117
+ ] });
118
+ }
119
+ /**
120
+ * Create a TSDoc `@remarks` tag.
121
+ */
122
+ function TSDocRemarks(props) {
123
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
124
+ "@remarks ",
125
+ /* @__PURE__ */ jsx("hbr", {}),
126
+ /* @__PURE__ */ jsx(List, {
127
+ hardline: true,
128
+ children: childrenArray(() => props.children)
129
+ })
130
+ ] });
131
+ }
132
+ /**
133
+ * Create a TSDoc `@see` tag.
134
+ */
135
+ function TSDocLink(props) {
136
+ return /* @__PURE__ */ jsx(TSDocTag, {
137
+ ...props,
138
+ tag: "see"
139
+ });
140
+ }
141
+ /**
142
+ * Create a TSDoc `@example` tag.
143
+ */
144
+ function TSDocExample(props) {
145
+ const [{ tsx, fenced = true, language, children }] = splitProps(props, [
146
+ "tsx",
147
+ "fenced",
148
+ "language",
149
+ "children"
150
+ ]);
151
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
152
+ "@example ",
153
+ /* @__PURE__ */ jsx("hbr", {}),
154
+ /* @__PURE__ */ jsxs(Show, {
155
+ when: fenced,
156
+ children: [
157
+ "```",
158
+ language || (tsx ? "tsx" : "ts"),
159
+ /* @__PURE__ */ jsx("hbr", {})
160
+ ]
161
+ }),
162
+ children,
163
+ /* @__PURE__ */ jsxs(Show, {
164
+ when: fenced,
165
+ children: [/* @__PURE__ */ jsx("hbr", {}), "```"]
166
+ })
167
+ ] });
168
+ }
169
+ /**
170
+ * Create a TSDoc `@readonly` tag.
171
+ */
172
+ function TSDocReadonly() {
173
+ return /* @__PURE__ */ jsx(TSDocTag, { tag: "readonly" });
174
+ }
175
+ /**
176
+ * Create a TSDoc `@internal` tag.
177
+ */
178
+ function TSDocInternal() {
179
+ return /* @__PURE__ */ jsx(TSDocTag, { tag: "internal" });
180
+ }
181
+ /**
182
+ * Create a TSDoc `@ignore` tag.
183
+ */
184
+ function TSDocIgnore() {
185
+ return /* @__PURE__ */ jsx(TSDocTag, { tag: "ignore" });
186
+ }
187
+ /**
188
+ * Create a TSDoc `@hidden` tag.
189
+ */
190
+ function TSDocHidden() {
191
+ return /* @__PURE__ */ jsx(TSDocTag, { tag: "hidden" });
192
+ }
193
+ /**
194
+ * Generates a TypeScript interface property for the given reflection class.
195
+ */
196
+ function TSDocAttributesTags(props) {
197
+ const [{ title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = splitProps(props, [
198
+ "title",
199
+ "alias",
200
+ "permission",
201
+ "domain",
202
+ "readonly",
203
+ "internal",
204
+ "ignore",
205
+ "hidden",
206
+ "defaultValue"
207
+ ]);
208
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
209
+ /* @__PURE__ */ jsx(Show, {
210
+ when: isSetString(title),
211
+ children: /* @__PURE__ */ jsx(TSDocTitle, { children: title })
212
+ }),
213
+ /* @__PURE__ */ jsx(Show, {
214
+ when: !isUndefined(alias) && alias.length > 0,
215
+ children: /* @__PURE__ */ jsx(For, {
216
+ each: alias ?? [],
217
+ children: (alias$1) => /* @__PURE__ */ jsx(TSDocAlias, { children: alias$1 })
218
+ })
219
+ }),
220
+ /* @__PURE__ */ jsx(Show, {
221
+ when: isSetString(domain),
222
+ children: /* @__PURE__ */ jsx(TSDocDomain, { children: domain })
223
+ }),
224
+ /* @__PURE__ */ jsx(Show, {
225
+ when: !isUndefined(permission) && permission.length > 0,
226
+ children: /* @__PURE__ */ jsx(For, {
227
+ each: permission ?? [],
228
+ children: (permission$1) => /* @__PURE__ */ jsx(TSDocPermission, { children: permission$1 })
229
+ })
230
+ }),
231
+ /* @__PURE__ */ jsx(Show, {
232
+ when: readonly === true,
233
+ children: /* @__PURE__ */ jsx(TSDocReadonly, {})
234
+ }),
235
+ /* @__PURE__ */ jsx(Show, {
236
+ when: internal === true,
237
+ children: /* @__PURE__ */ jsx(TSDocInternal, {})
238
+ }),
239
+ /* @__PURE__ */ jsx(Show, {
240
+ when: ignore === true,
241
+ children: /* @__PURE__ */ jsx(TSDocIgnore, {})
242
+ }),
243
+ /* @__PURE__ */ jsx(Show, {
244
+ when: hidden === true,
245
+ children: /* @__PURE__ */ jsx(TSDocHidden, {})
246
+ }),
247
+ /* @__PURE__ */ jsx(Show, {
248
+ when: !isUndefined(defaultValue),
249
+ children: /* @__PURE__ */ jsx(TSDocDefaultValue, { value: defaultValue })
250
+ })
251
+ ] });
252
+ }
253
+ /**
254
+ * Create a TSDoc parameter set off with `@param`.
255
+ */
256
+ function TSDocParam(props) {
257
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
258
+ "@param ",
259
+ /* @__PURE__ */ jsx(TSDocParamName, {
260
+ name: props.name,
261
+ optional: props.optional,
262
+ defaultValue: props.defaultValue
263
+ }),
264
+ /* @__PURE__ */ jsx(TSDocParamDescription, { children: props.children })
265
+ ] });
266
+ }
267
+ function TSDocParamName(props) {
268
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
269
+ /* @__PURE__ */ jsx(Show, {
270
+ when: props.optional,
271
+ children: "["
272
+ }),
273
+ props.name,
274
+ /* @__PURE__ */ jsxs(Show, {
275
+ when: Boolean(props.defaultValue),
276
+ children: ["=", props.defaultValue]
277
+ }),
278
+ /* @__PURE__ */ jsx(Show, {
279
+ when: props.optional,
280
+ children: "]"
281
+ })
282
+ ] });
283
+ }
284
+ function TSDocParamDescription(props) {
285
+ return /* @__PURE__ */ jsxs(Show, {
286
+ when: Boolean(props.children),
287
+ children: [" - ", /* @__PURE__ */ jsx("align", {
288
+ width: 2,
289
+ children: /* @__PURE__ */ jsx(Prose, { children: props.children })
290
+ })]
291
+ });
292
+ }
293
+ /**
294
+ * Create a TSDoc `@returns` tag.
295
+ */
296
+ function TSDocReturns(props) {
297
+ return /* @__PURE__ */ jsx(TSDocTag, {
298
+ ...props,
299
+ tag: "returns"
300
+ });
301
+ }
302
+ /**
303
+ * Create a TSDoc `@throws` tag.
304
+ */
305
+ function TSDocThrows(props) {
306
+ return /* @__PURE__ */ jsx(TSDocTag, {
307
+ ...props,
308
+ tag: "throws"
309
+ });
310
+ }
311
+ /**
312
+ * Generates a TSDoc `@module` tag for the given module name.
313
+ */
314
+ function TSDocModule(props) {
315
+ const [{ children, name, prefix }] = splitProps(props, [
316
+ "children",
317
+ "name",
318
+ "prefix"
319
+ ]);
320
+ const context = usePowerlines();
321
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
322
+ "/**",
323
+ /* @__PURE__ */ jsxs("align", {
324
+ string: " * ",
325
+ children: [
326
+ /* @__PURE__ */ jsx("hbr", {}),
327
+ /* @__PURE__ */ jsxs(Show, {
328
+ when: Boolean(children),
329
+ children: [
330
+ /* @__PURE__ */ jsx(List, {
331
+ hardline: true,
332
+ children: childrenArray(() => children)
333
+ }),
334
+ /* @__PURE__ */ jsx("hbr", {}),
335
+ /* @__PURE__ */ jsx("hbr", {})
336
+ ]
337
+ }),
338
+ "@module ",
339
+ prefix || context?.config.output.builtinPrefix,
340
+ ":",
341
+ name
342
+ ]
343
+ }),
344
+ /* @__PURE__ */ jsx("hbr", {}),
345
+ ` */`
346
+ ] });
347
+ }
348
+
349
+ //#endregion
350
+ export { TSDoc, TSDocAttributesTags, TSDocExample, TSDocLink, TSDocModule, TSDocParam, TSDocRemarks, TSDocReturns, TSDocThrows };