@powerlines/plugin-alloy 0.19.32 → 0.19.34
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.
- package/dist/{chunk-CbDLau6x.cjs → _virtual/rolldown_runtime.cjs} +1 -6
- package/dist/core/components/index.cjs +6 -11
- package/dist/core/components/index.d.cts +3 -9
- package/dist/core/components/index.d.mts +3 -9
- package/dist/core/components/index.mjs +3 -8
- package/dist/core/components/output.cjs +39 -6
- package/dist/core/components/output.d.cts +25 -7
- package/dist/core/components/output.d.cts.map +1 -0
- package/dist/core/components/output.d.mts +25 -7
- package/dist/core/components/output.d.mts.map +1 -0
- package/dist/core/components/output.mjs +39 -6
- package/dist/core/components/output.mjs.map +1 -0
- package/dist/core/components/single-line-comment.cjs +21 -2
- package/dist/core/components/single-line-comment.d.cts +23 -3
- package/dist/core/components/single-line-comment.d.cts.map +1 -0
- package/dist/core/components/single-line-comment.d.mts +23 -3
- package/dist/core/components/single-line-comment.d.mts.map +1 -0
- package/dist/core/components/single-line-comment.mjs +21 -2
- package/dist/core/components/single-line-comment.mjs.map +1 -0
- package/dist/core/components/source-file.cjs +62 -3
- package/dist/core/components/source-file.d.cts +33 -3
- package/dist/core/components/source-file.d.cts.map +1 -0
- package/dist/core/components/source-file.d.mts +33 -3
- package/dist/core/components/source-file.d.mts.map +1 -0
- package/dist/core/components/source-file.mjs +61 -3
- package/dist/core/components/source-file.mjs.map +1 -0
- package/dist/core/contexts/context.cjs +39 -5
- package/dist/core/contexts/context.d.cts +30 -2
- package/dist/core/contexts/context.d.cts.map +1 -0
- package/dist/core/contexts/context.d.mts +30 -2
- package/dist/core/contexts/context.d.mts.map +1 -0
- package/dist/core/contexts/context.mjs +36 -2
- package/dist/core/contexts/context.mjs.map +1 -0
- package/dist/core/contexts/index.cjs +19 -20
- package/dist/core/contexts/index.d.cts +3 -5
- package/dist/core/contexts/index.d.mts +3 -5
- package/dist/core/contexts/index.mjs +3 -4
- package/dist/core/contexts/meta.cjs +39 -5
- package/dist/core/contexts/meta.d.cts +48 -2
- package/dist/core/contexts/meta.d.cts.map +1 -0
- package/dist/core/contexts/meta.d.mts +48 -2
- package/dist/core/contexts/meta.d.mts.map +1 -0
- package/dist/core/contexts/meta.mjs +36 -2
- package/dist/core/contexts/meta.mjs.map +1 -0
- package/dist/core/contexts/reflection.cjs +67 -9
- package/dist/core/contexts/reflection.d.cts +53 -3
- package/dist/core/contexts/reflection.d.cts.map +1 -0
- package/dist/core/contexts/reflection.d.mts +53 -3
- package/dist/core/contexts/reflection.d.mts.map +1 -0
- package/dist/core/contexts/reflection.mjs +60 -2
- package/dist/core/contexts/reflection.mjs.map +1 -0
- package/dist/core/index.cjs +27 -27
- package/dist/core/index.d.cts +8 -9
- package/dist/core/index.d.mts +8 -9
- package/dist/core/index.mjs +8 -8
- package/dist/helpers/capnp.cjs +276 -18
- package/dist/helpers/capnp.d.cts +88 -2
- package/dist/helpers/capnp.d.cts.map +1 -0
- package/dist/helpers/capnp.d.mts +88 -2
- package/dist/helpers/capnp.d.mts.map +1 -0
- package/dist/helpers/capnp.mjs +259 -2
- package/dist/helpers/capnp.mjs.map +1 -0
- package/dist/helpers/create-builtin.cjs +18 -2
- package/dist/helpers/create-builtin.d.cts +16 -2
- package/dist/helpers/create-builtin.d.cts.map +1 -0
- package/dist/helpers/create-builtin.d.mts +16 -2
- package/dist/helpers/create-builtin.d.mts.map +1 -0
- package/dist/helpers/create-builtin.mjs +18 -2
- package/dist/helpers/create-builtin.mjs.map +1 -0
- package/dist/helpers/index.cjs +23 -23
- package/dist/helpers/index.d.cts +4 -4
- package/dist/helpers/index.d.mts +4 -4
- package/dist/helpers/index.mjs +4 -4
- package/dist/helpers/refkey.cjs +15 -2
- package/dist/helpers/refkey.d.cts +14 -2
- package/dist/helpers/refkey.d.cts.map +1 -0
- package/dist/helpers/refkey.d.mts +14 -2
- package/dist/helpers/refkey.d.mts.map +1 -0
- package/dist/helpers/refkey.mjs +15 -2
- package/dist/helpers/refkey.mjs.map +1 -0
- package/dist/helpers/typescript.cjs +45 -2
- package/dist/helpers/typescript.d.cts +26 -2
- package/dist/helpers/typescript.d.cts.map +1 -0
- package/dist/helpers/typescript.d.mts +26 -2
- package/dist/helpers/typescript.d.mts.map +1 -0
- package/dist/helpers/typescript.mjs +45 -2
- package/dist/helpers/typescript.mjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/markdown/components/front-matter.cjs +27 -2
- package/dist/markdown/components/front-matter.d.cts +16 -2
- package/dist/markdown/components/front-matter.d.cts.map +1 -0
- package/dist/markdown/components/front-matter.d.mts +16 -2
- package/dist/markdown/components/front-matter.d.mts.map +1 -0
- package/dist/markdown/components/front-matter.mjs +27 -2
- package/dist/markdown/components/front-matter.mjs.map +1 -0
- package/dist/markdown/components/index.cjs +9 -15
- package/dist/markdown/components/index.d.cts +3 -7
- package/dist/markdown/components/index.d.mts +3 -7
- package/dist/markdown/components/index.mjs +3 -9
- package/dist/markdown/components/markdown-file.cjs +130 -8
- package/dist/markdown/components/markdown-file.d.cts +29 -5
- package/dist/markdown/components/markdown-file.d.cts.map +1 -0
- package/dist/markdown/components/markdown-file.d.mts +29 -5
- package/dist/markdown/components/markdown-file.d.mts.map +1 -0
- package/dist/markdown/components/markdown-file.mjs +129 -7
- package/dist/markdown/components/markdown-file.mjs.map +1 -0
- package/dist/markdown/components/markdown-table.cjs +100 -5
- package/dist/markdown/components/markdown-table.d.cts +28 -4
- package/dist/markdown/components/markdown-table.d.cts.map +1 -0
- package/dist/markdown/components/markdown-table.d.mts +28 -4
- package/dist/markdown/components/markdown-table.d.mts.map +1 -0
- package/dist/markdown/components/markdown-table.mjs +98 -3
- package/dist/markdown/components/markdown-table.mjs.map +1 -0
- package/dist/markdown/contexts/index.cjs +5 -6
- package/dist/markdown/contexts/index.d.cts +1 -2
- package/dist/markdown/contexts/index.d.mts +1 -2
- package/dist/markdown/contexts/index.mjs +1 -2
- package/dist/markdown/contexts/markdown-table.cjs +36 -5
- package/dist/markdown/contexts/markdown-table.d.cts +38 -2
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
- package/dist/markdown/contexts/markdown-table.d.mts +38 -2
- package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
- package/dist/markdown/contexts/markdown-table.mjs +33 -2
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
- package/dist/markdown/index.cjs +16 -20
- package/dist/markdown/index.d.cts +6 -8
- package/dist/markdown/index.d.mts +6 -8
- package/dist/markdown/index.mjs +6 -10
- package/dist/render.cjs +60 -0
- package/dist/render.d.cts +23 -0
- package/dist/render.d.cts.map +1 -0
- package/dist/render.d.mts +23 -0
- package/dist/render.d.mts.map +1 -0
- package/dist/render.mjs +60 -0
- package/dist/render.mjs.map +1 -0
- package/dist/types/components.cjs +0 -1
- package/dist/types/components.d.cts +143 -2
- package/dist/types/components.d.cts.map +1 -0
- package/dist/types/components.d.mts +143 -2
- package/dist/types/components.d.mts.map +1 -0
- package/dist/types/components.mjs +0 -2
- package/dist/types/index.cjs +0 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +0 -3
- package/dist/types/plugin.cjs +0 -1
- package/dist/types/plugin.d.cts +39 -2
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +39 -2
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +0 -2
- package/dist/typescript/components/builtin-file.cjs +61 -8
- package/dist/typescript/components/builtin-file.d.cts +35 -6
- package/dist/typescript/components/builtin-file.d.cts.map +1 -0
- package/dist/typescript/components/builtin-file.d.mts +35 -6
- package/dist/typescript/components/builtin-file.d.mts.map +1 -0
- package/dist/typescript/components/builtin-file.mjs +61 -8
- package/dist/typescript/components/builtin-file.mjs.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.cjs +24 -2
- package/dist/typescript/components/dynamic-import-statement.d.cts +33 -2
- package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.d.mts +33 -2
- package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
- package/dist/typescript/components/dynamic-import-statement.mjs +24 -2
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
- package/dist/typescript/components/entry-file.cjs +41 -7
- package/dist/typescript/components/entry-file.d.cts +28 -5
- package/dist/typescript/components/entry-file.d.cts.map +1 -0
- package/dist/typescript/components/entry-file.d.mts +28 -5
- package/dist/typescript/components/entry-file.d.mts.map +1 -0
- package/dist/typescript/components/entry-file.mjs +40 -7
- package/dist/typescript/components/entry-file.mjs.map +1 -0
- package/dist/typescript/components/index.cjs +43 -49
- package/dist/typescript/components/index.d.cts +9 -12
- package/dist/typescript/components/index.d.mts +9 -12
- package/dist/typescript/components/index.mjs +9 -15
- package/dist/typescript/components/record-expression.cjs +11 -2
- package/dist/typescript/components/record-expression.d.cts +13 -2
- package/dist/typescript/components/record-expression.d.cts.map +1 -0
- package/dist/typescript/components/record-expression.d.mts +13 -2
- package/dist/typescript/components/record-expression.d.mts.map +1 -0
- package/dist/typescript/components/record-expression.mjs +11 -2
- package/dist/typescript/components/record-expression.mjs.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.cjs +177 -7
- package/dist/typescript/components/tsdoc-reflection.d.cts +19 -4
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.d.mts +19 -4
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc-reflection.mjs +175 -5
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
- package/dist/typescript/components/tsdoc.cjs +484 -22
- package/dist/typescript/components/tsdoc.d.cts +164 -3
- package/dist/typescript/components/tsdoc.d.cts.map +1 -0
- package/dist/typescript/components/tsdoc.d.mts +164 -3
- package/dist/typescript/components/tsdoc.d.mts.map +1 -0
- package/dist/typescript/components/tsdoc.mjs +465 -3
- package/dist/typescript/components/tsdoc.mjs.map +1 -0
- package/dist/typescript/components/typescript-file.cjs +215 -8
- package/dist/typescript/components/typescript-file.d.cts +50 -4
- package/dist/typescript/components/typescript-file.d.cts.map +1 -0
- package/dist/typescript/components/typescript-file.d.mts +50 -4
- package/dist/typescript/components/typescript-file.d.mts.map +1 -0
- package/dist/typescript/components/typescript-file.mjs +213 -6
- package/dist/typescript/components/typescript-file.mjs.map +1 -0
- package/dist/typescript/components/typescript-interface.cjs +72 -7
- package/dist/typescript/components/typescript-interface.d.cts +26 -3
- package/dist/typescript/components/typescript-interface.d.cts.map +1 -0
- package/dist/typescript/components/typescript-interface.d.mts +26 -3
- package/dist/typescript/components/typescript-interface.d.mts.map +1 -0
- package/dist/typescript/components/typescript-interface.mjs +71 -6
- package/dist/typescript/components/typescript-interface.mjs.map +1 -0
- package/dist/typescript/components/typescript-object.cjs +124 -7
- package/dist/typescript/components/typescript-object.d.cts +30 -3
- package/dist/typescript/components/typescript-object.d.cts.map +1 -0
- package/dist/typescript/components/typescript-object.d.mts +30 -3
- package/dist/typescript/components/typescript-object.d.mts.map +1 -0
- package/dist/typescript/components/typescript-object.mjs +123 -6
- package/dist/typescript/components/typescript-object.mjs.map +1 -0
- package/dist/typescript/index.cjs +44 -49
- package/dist/typescript/index.d.cts +10 -12
- package/dist/typescript/index.d.mts +10 -12
- package/dist/typescript/index.mjs +10 -15
- package/package.json +20 -6
- package/dist/builtin-file-BNp7C-BU.mjs +0 -62
- package/dist/builtin-file-BNp7C-BU.mjs.map +0 -1
- package/dist/builtin-file-C-TpxdCP.d.mts +0 -35
- package/dist/builtin-file-C-TpxdCP.d.mts.map +0 -1
- package/dist/builtin-file-CDLuGDg7.d.cts +0 -35
- package/dist/builtin-file-CDLuGDg7.d.cts.map +0 -1
- package/dist/builtin-file-CQAeHqiO.cjs +0 -67
- package/dist/builtin-file-DWcpFOVB.d.mts +0 -35
- package/dist/builtin-file-DWcpFOVB.d.mts.map +0 -1
- package/dist/builtin-file-I0ejC9w0.d.cts +0 -35
- package/dist/builtin-file-I0ejC9w0.d.cts.map +0 -1
- package/dist/capnp-CLxcoMcG.d.mts +0 -88
- package/dist/capnp-CLxcoMcG.d.mts.map +0 -1
- package/dist/capnp-CPbob9Cm.mjs +0 -260
- package/dist/capnp-CPbob9Cm.mjs.map +0 -1
- package/dist/capnp-ClfqI-5t.cjs +0 -356
- package/dist/capnp-DbPtfpg2.d.cts +0 -88
- package/dist/capnp-DbPtfpg2.d.cts.map +0 -1
- package/dist/components-B0evB5xd.cjs +0 -0
- package/dist/components-BNK9p5AE.cjs +0 -0
- package/dist/components-ByryZacA.mjs +0 -1
- package/dist/components-C3qpgLKV.mjs +0 -1
- package/dist/components-Cr-i-ofB.mjs +0 -1
- package/dist/components-CvqTz7Q9.d.cts +0 -143
- package/dist/components-CvqTz7Q9.d.cts.map +0 -1
- package/dist/components-DPKSrvP-.cjs +0 -0
- package/dist/components-ISRFDWTF.cjs +0 -0
- package/dist/components-NXgsRgB4.mjs +0 -1
- package/dist/components-_4e2YMfT.d.mts +0 -143
- package/dist/components-_4e2YMfT.d.mts.map +0 -1
- package/dist/context-C7gW4eqa.d.cts +0 -30
- package/dist/context-C7gW4eqa.d.cts.map +0 -1
- package/dist/context-CdPajCh6.mjs +0 -37
- package/dist/context-CdPajCh6.mjs.map +0 -1
- package/dist/context-D5pAjVbn.d.mts +0 -30
- package/dist/context-D5pAjVbn.d.mts.map +0 -1
- package/dist/context-DNdlL_gp.cjs +0 -60
- package/dist/contexts-BqTplHQH.mjs +0 -1
- package/dist/contexts-D-vYhGdM.mjs +0 -1
- package/dist/contexts-DWGMeWga.cjs +0 -0
- package/dist/contexts-J643Nrrt.cjs +0 -0
- package/dist/create-builtin-Be3J_vqf.mjs +0 -19
- package/dist/create-builtin-Be3J_vqf.mjs.map +0 -1
- package/dist/create-builtin-BiKyN2s2.cjs +0 -24
- package/dist/create-builtin-Bpswa0ZT.d.cts +0 -16
- package/dist/create-builtin-Bpswa0ZT.d.cts.map +0 -1
- package/dist/create-builtin-CbEjJreB.d.mts +0 -16
- package/dist/create-builtin-CbEjJreB.d.mts.map +0 -1
- package/dist/dynamic-import-statement-B4Ov9C7y.mjs +0 -25
- package/dist/dynamic-import-statement-B4Ov9C7y.mjs.map +0 -1
- package/dist/dynamic-import-statement-CNsIFAva.d.cts +0 -33
- package/dist/dynamic-import-statement-CNsIFAva.d.cts.map +0 -1
- package/dist/dynamic-import-statement-CVIYwXyi.d.mts +0 -33
- package/dist/dynamic-import-statement-CVIYwXyi.d.mts.map +0 -1
- package/dist/dynamic-import-statement-DDEpZVlQ.d.cts +0 -33
- package/dist/dynamic-import-statement-DDEpZVlQ.d.cts.map +0 -1
- package/dist/dynamic-import-statement-DSNDMC9Y.d.mts +0 -33
- package/dist/dynamic-import-statement-DSNDMC9Y.d.mts.map +0 -1
- package/dist/dynamic-import-statement-Dy_MY_Ua.cjs +0 -30
- package/dist/entry-file-CYPWFUfe.cjs +0 -47
- package/dist/entry-file-CrZ-k87r.mjs +0 -41
- package/dist/entry-file-CrZ-k87r.mjs.map +0 -1
- package/dist/entry-file-DOcjyCDG.d.mts +0 -28
- package/dist/entry-file-DOcjyCDG.d.mts.map +0 -1
- package/dist/entry-file-DVf4SGx4.d.cts +0 -28
- package/dist/entry-file-DVf4SGx4.d.cts.map +0 -1
- package/dist/entry-file-DXv3HtYV.d.mts +0 -28
- package/dist/entry-file-DXv3HtYV.d.mts.map +0 -1
- package/dist/entry-file-y0caTLfc.d.cts +0 -28
- package/dist/entry-file-y0caTLfc.d.cts.map +0 -1
- package/dist/front-matter-BeTG0uJA.mjs +0 -28
- package/dist/front-matter-BeTG0uJA.mjs.map +0 -1
- package/dist/front-matter-CXfCT8a8.d.mts +0 -16
- package/dist/front-matter-CXfCT8a8.d.mts.map +0 -1
- package/dist/front-matter-DTorR58b.d.cts +0 -16
- package/dist/front-matter-DTorR58b.d.cts.map +0 -1
- package/dist/front-matter-DZ1tB-Uj.cjs +0 -33
- package/dist/front-matter-DySGMCRE.d.cts +0 -16
- package/dist/front-matter-DySGMCRE.d.cts.map +0 -1
- package/dist/index-BJ8-FA6N.d.cts +0 -1
- package/dist/index-BXpMZvwA.d.cts +0 -1
- package/dist/index-BhY1qu3m.d.cts +0 -1
- package/dist/index-BjgW3E7y.d.mts +0 -1
- package/dist/index-C3usUse7.d.mts +0 -1
- package/dist/index-D13oYj4_.d.mts +0 -1
- package/dist/index-DBGd4WeR.d.mts +0 -1
- package/dist/index-DdxxIAKU.d.cts +0 -1
- package/dist/index-DpEKQcoR.d.cts +0 -1
- package/dist/index-gpCH5158.d.mts +0 -1
- package/dist/markdown-file-BkmvexMF.d.cts +0 -29
- package/dist/markdown-file-BkmvexMF.d.cts.map +0 -1
- package/dist/markdown-file-C7o9bn--.d.mts +0 -29
- package/dist/markdown-file-C7o9bn--.d.mts.map +0 -1
- package/dist/markdown-file-CFt8hI37.cjs +0 -141
- package/dist/markdown-file-CX8auFpl.mjs +0 -130
- package/dist/markdown-file-CX8auFpl.mjs.map +0 -1
- package/dist/markdown-file-CbVNKFje.d.cts +0 -29
- package/dist/markdown-file-CbVNKFje.d.cts.map +0 -1
- package/dist/markdown-file-DMrhFhUU.d.mts +0 -29
- package/dist/markdown-file-DMrhFhUU.d.mts.map +0 -1
- package/dist/markdown-table-B7EUUNbl.d.mts +0 -28
- package/dist/markdown-table-B7EUUNbl.d.mts.map +0 -1
- package/dist/markdown-table-BWPm6GbJ.cjs +0 -57
- package/dist/markdown-table-CGXp5JbS.d.mts +0 -28
- package/dist/markdown-table-CGXp5JbS.d.mts.map +0 -1
- package/dist/markdown-table-CKMEMcyb.d.cts +0 -28
- package/dist/markdown-table-CKMEMcyb.d.cts.map +0 -1
- package/dist/markdown-table-CZMEY6IR.d.cts +0 -38
- package/dist/markdown-table-CZMEY6IR.d.cts.map +0 -1
- package/dist/markdown-table-CnEur72Z.mjs +0 -99
- package/dist/markdown-table-CnEur72Z.mjs.map +0 -1
- package/dist/markdown-table-Cv3P72sN.d.cts +0 -28
- package/dist/markdown-table-Cv3P72sN.d.cts.map +0 -1
- package/dist/markdown-table-PT2TFFY3.mjs +0 -34
- package/dist/markdown-table-PT2TFFY3.mjs.map +0 -1
- package/dist/markdown-table-eTnxxb46.cjs +0 -116
- package/dist/markdown-table-t6Z-cmxX.d.mts +0 -38
- package/dist/markdown-table-t6Z-cmxX.d.mts.map +0 -1
- package/dist/meta-BEeFPjoM.mjs +0 -37
- package/dist/meta-BEeFPjoM.mjs.map +0 -1
- package/dist/meta-BVJcyXVs.cjs +0 -60
- package/dist/meta-D0y5uZo4.d.cts +0 -48
- package/dist/meta-D0y5uZo4.d.cts.map +0 -1
- package/dist/meta-DJqWxY95.d.mts +0 -48
- package/dist/meta-DJqWxY95.d.mts.map +0 -1
- package/dist/output-B5O_qz0i.cjs +0 -44
- package/dist/output-C5BkcdCd.d.cts +0 -24
- package/dist/output-C5BkcdCd.d.cts.map +0 -1
- package/dist/output-C7mlHz0P.d.mts +0 -24
- package/dist/output-C7mlHz0P.d.mts.map +0 -1
- package/dist/output-DcuryjuV.mjs +0 -39
- package/dist/output-DcuryjuV.mjs.map +0 -1
- package/dist/output-XvUhyMSi.d.cts +0 -24
- package/dist/output-XvUhyMSi.d.cts.map +0 -1
- package/dist/plugin-B8wUxSXi.cjs +0 -0
- package/dist/plugin-BzF8Q2v1.mjs +0 -1
- package/dist/plugin-CyBCpZyU.d.mts +0 -39
- package/dist/plugin-CyBCpZyU.d.mts.map +0 -1
- package/dist/plugin-DIlnN1SV.d.cts +0 -39
- package/dist/plugin-DIlnN1SV.d.cts.map +0 -1
- package/dist/record-expression-6ElbFyR0.cjs +0 -17
- package/dist/record-expression-ChoLAsVS.d.mts +0 -13
- package/dist/record-expression-ChoLAsVS.d.mts.map +0 -1
- package/dist/record-expression-D5W72rZN.mjs +0 -12
- package/dist/record-expression-D5W72rZN.mjs.map +0 -1
- package/dist/record-expression-Dwg_PZpg.d.cts +0 -13
- package/dist/record-expression-Dwg_PZpg.d.cts.map +0 -1
- package/dist/refkey-C08kDOQ0.cjs +0 -21
- package/dist/refkey-CP7MJMac.d.cts +0 -14
- package/dist/refkey-CP7MJMac.d.cts.map +0 -1
- package/dist/refkey-CQVHeuAq.mjs +0 -16
- package/dist/refkey-CQVHeuAq.mjs.map +0 -1
- package/dist/refkey-D6OjgKgS.d.mts +0 -14
- package/dist/refkey-D6OjgKgS.d.mts.map +0 -1
- package/dist/reflection-BktS88RM.cjs +0 -108
- package/dist/reflection-CfOmSgDn.d.mts +0 -53
- package/dist/reflection-CfOmSgDn.d.mts.map +0 -1
- package/dist/reflection-Q87E_-w_.d.cts +0 -53
- package/dist/reflection-Q87E_-w_.d.cts.map +0 -1
- package/dist/reflection-TXYxCAwV.mjs +0 -61
- package/dist/reflection-TXYxCAwV.mjs.map +0 -1
- package/dist/single-line-comment-BKFqKn-D.d.mts +0 -23
- package/dist/single-line-comment-BKFqKn-D.d.mts.map +0 -1
- package/dist/single-line-comment-Ct_putR7.d.mts +0 -23
- package/dist/single-line-comment-Ct_putR7.d.mts.map +0 -1
- package/dist/single-line-comment-D2y_A8e1.d.cts +0 -23
- package/dist/single-line-comment-D2y_A8e1.d.cts.map +0 -1
- package/dist/single-line-comment-DW0LUIQ2.mjs +0 -22
- package/dist/single-line-comment-DW0LUIQ2.mjs.map +0 -1
- package/dist/single-line-comment-DWQy5rrk.d.cts +0 -23
- package/dist/single-line-comment-DWQy5rrk.d.cts.map +0 -1
- package/dist/single-line-comment-tAWBgL9v.cjs +0 -27
- package/dist/source-file-B51pGSXX.d.mts +0 -33
- package/dist/source-file-B51pGSXX.d.mts.map +0 -1
- package/dist/source-file-BhqYj8m-.d.mts +0 -33
- package/dist/source-file-BhqYj8m-.d.mts.map +0 -1
- package/dist/source-file-Bl7eV0Li.mjs +0 -62
- package/dist/source-file-Bl7eV0Li.mjs.map +0 -1
- package/dist/source-file-DiisOeS2.d.cts +0 -33
- package/dist/source-file-DiisOeS2.d.cts.map +0 -1
- package/dist/source-file-DnqaQY90.cjs +0 -68
- package/dist/source-file-gMJwiJAw.d.cts +0 -33
- package/dist/source-file-gMJwiJAw.d.cts.map +0 -1
- package/dist/tsdoc-BufL8muf.cjs +0 -585
- package/dist/tsdoc-DB1Qzwsn.mjs +0 -466
- package/dist/tsdoc-DB1Qzwsn.mjs.map +0 -1
- package/dist/tsdoc-DiBR7m1J.d.cts +0 -164
- package/dist/tsdoc-DiBR7m1J.d.cts.map +0 -1
- package/dist/tsdoc-KHfXy9HE.d.mts +0 -164
- package/dist/tsdoc-KHfXy9HE.d.mts.map +0 -1
- package/dist/tsdoc-reflection-B5-J4ia-.cjs +0 -193
- package/dist/tsdoc-reflection-BGPyymTb.mjs +0 -176
- package/dist/tsdoc-reflection-BGPyymTb.mjs.map +0 -1
- package/dist/tsdoc-reflection-CYz5udTh.d.mts +0 -19
- package/dist/tsdoc-reflection-CYz5udTh.d.mts.map +0 -1
- package/dist/tsdoc-reflection-DTYkFxKy.d.cts +0 -19
- package/dist/tsdoc-reflection-DTYkFxKy.d.cts.map +0 -1
- package/dist/tsdoc-reflection-cRd43W18.d.cts +0 -19
- package/dist/tsdoc-reflection-cRd43W18.d.cts.map +0 -1
- package/dist/typescript-BXhP0qIJ.mjs +0 -46
- package/dist/typescript-BXhP0qIJ.mjs.map +0 -1
- package/dist/typescript-BbjCTT04.cjs +0 -51
- package/dist/typescript-CXP7Oa6_.d.cts +0 -26
- package/dist/typescript-CXP7Oa6_.d.cts.map +0 -1
- package/dist/typescript-DvynKONm.d.mts +0 -26
- package/dist/typescript-DvynKONm.d.mts.map +0 -1
- package/dist/typescript-file-4oY1sIRB.cjs +0 -231
- package/dist/typescript-file-C9TPcvPm.d.mts +0 -50
- package/dist/typescript-file-C9TPcvPm.d.mts.map +0 -1
- package/dist/typescript-file-CJxOp_Xl.d.cts +0 -50
- package/dist/typescript-file-CJxOp_Xl.d.cts.map +0 -1
- package/dist/typescript-file-CY0SmW6n.d.mts +0 -50
- package/dist/typescript-file-CY0SmW6n.d.mts.map +0 -1
- package/dist/typescript-file-DWYfy1-C.d.cts +0 -50
- package/dist/typescript-file-DWYfy1-C.d.cts.map +0 -1
- package/dist/typescript-file-iXGdOTZv.mjs +0 -214
- package/dist/typescript-file-iXGdOTZv.mjs.map +0 -1
- package/dist/typescript-interface-4Kxgaglq.d.mts +0 -26
- package/dist/typescript-interface-4Kxgaglq.d.mts.map +0 -1
- package/dist/typescript-interface-B0AoZx3f.cjs +0 -83
- package/dist/typescript-interface-B1mhCCoV.d.cts +0 -26
- package/dist/typescript-interface-B1mhCCoV.d.cts.map +0 -1
- package/dist/typescript-interface-C0mgTtdj.d.cts +0 -26
- package/dist/typescript-interface-C0mgTtdj.d.cts.map +0 -1
- package/dist/typescript-interface-DoEGxV_8.mjs +0 -72
- package/dist/typescript-interface-DoEGxV_8.mjs.map +0 -1
- package/dist/typescript-object-C4d4fThY.cjs +0 -135
- package/dist/typescript-object-C5oh925V.mjs +0 -124
- package/dist/typescript-object-C5oh925V.mjs.map +0 -1
- package/dist/typescript-object-DAepqTrw.d.cts +0 -30
- package/dist/typescript-object-DAepqTrw.d.cts.map +0 -1
- package/dist/typescript-object-DUivJKpz.d.cts +0 -30
- package/dist/typescript-object-DUivJKpz.d.cts.map +0 -1
- package/dist/typescript-object-TlHt1hQc.d.mts +0 -30
- package/dist/typescript-object-TlHt1hQc.d.mts.map +0 -1
|
@@ -1,8 +1,73 @@
|
|
|
1
|
-
require('../../
|
|
2
|
-
require('../../reflection
|
|
3
|
-
require('
|
|
4
|
-
require(
|
|
5
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_core_contexts_reflection = require('../../core/contexts/reflection.cjs');
|
|
3
|
+
const require_typescript_components_tsdoc_reflection = require('./tsdoc-reflection.cjs');
|
|
4
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
6
|
+
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
7
|
+
let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
8
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
9
|
+
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
//#region src/typescript/components/typescript-interface.tsx
|
|
12
|
+
/**
|
|
13
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
14
|
+
*/
|
|
15
|
+
function TypeScriptInterface(props) {
|
|
16
|
+
const [{ name, reflection, doc }, rest] = (0, __alloy_js_core.splitProps)(props, [
|
|
17
|
+
"name",
|
|
18
|
+
"reflection",
|
|
19
|
+
"doc"
|
|
20
|
+
]);
|
|
21
|
+
const interfaceName = (0, __alloy_js_core.computed)(() => (0, __stryke_string_format_pascal_case.pascalCase)(((0, __stryke_type_checks_is_string.isString)(name) ? name : name.toString()) || reflection.getName()));
|
|
22
|
+
const properties = reflection.getProperties().filter((item) => !item.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1);
|
|
23
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_reflection.ReflectionClassContext.Provider, {
|
|
24
|
+
value: { reflection },
|
|
25
|
+
get children() {
|
|
26
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc_reflection.TSDocReflectionClass, { heading: doc }), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, (0, __alloy_js_core_jsx_runtime.mergeProps)({
|
|
27
|
+
"export": true,
|
|
28
|
+
get name() {
|
|
29
|
+
return interfaceName.value;
|
|
30
|
+
}
|
|
31
|
+
}, rest, { get children() {
|
|
32
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
33
|
+
each: properties,
|
|
34
|
+
doubleHardline: true,
|
|
35
|
+
semicolon: true,
|
|
36
|
+
children: (prop) => (0, __alloy_js_core_jsx_runtime.createComponent)(TypescriptInterfaceProperty, { property: prop })
|
|
37
|
+
});
|
|
38
|
+
} }))];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
44
|
+
*/
|
|
45
|
+
function TypescriptInterfaceProperty(props) {
|
|
46
|
+
const [{ property }, rest] = (0, __alloy_js_core.splitProps)(props, ["property"]);
|
|
47
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_reflection.ReflectionPropertyContext.Provider, {
|
|
48
|
+
value: property,
|
|
49
|
+
get children() {
|
|
50
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc_reflection.TSDocReflectionProperty, {}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, (0, __alloy_js_core_jsx_runtime.mergeProps)({
|
|
51
|
+
get name() {
|
|
52
|
+
return property.getNameAsString();
|
|
53
|
+
},
|
|
54
|
+
get readonly() {
|
|
55
|
+
return property.isReadonly();
|
|
56
|
+
},
|
|
57
|
+
get optional() {
|
|
58
|
+
return property.isOptional();
|
|
59
|
+
},
|
|
60
|
+
get nullish() {
|
|
61
|
+
return property.isNullable();
|
|
62
|
+
},
|
|
63
|
+
get type() {
|
|
64
|
+
return (0, __powerlines_deepkit_vendor_type.stringifyType)(property.getType());
|
|
65
|
+
}
|
|
66
|
+
}, rest))];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
exports.TypeScriptInterface = TypeScriptInterface;
|
|
73
|
+
exports.TypescriptInterfaceProperty = TypescriptInterfaceProperty;
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
import "../../components
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
+
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
3
|
+
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { InterfaceDeclarationProps, InterfaceMemberProps } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/typescript-interface.d.ts
|
|
7
|
+
interface TypeScriptInterfaceProps<T extends Record<string, any> = Record<string, any>> extends InterfaceDeclarationProps, ComponentProps {
|
|
8
|
+
reflection: ReflectionClass<T>;
|
|
9
|
+
defaultValue?: Partial<T>;
|
|
10
|
+
}
|
|
11
|
+
interface TypescriptInterfacePropertyProps extends Omit<InterfaceMemberProps, "name">, ComponentProps {
|
|
12
|
+
property: ReflectionProperty;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
16
|
+
*/
|
|
17
|
+
declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>): _alloy_js_core1.Children;
|
|
18
|
+
/**
|
|
19
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
20
|
+
*/
|
|
21
|
+
declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps): _alloy_js_core1.Children;
|
|
22
|
+
declare type __ΩTypeScriptInterfaceProps = any[];
|
|
23
|
+
declare type __ΩTypescriptInterfacePropertyProps = any[];
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TypeScriptInterface, TypeScriptInterfaceProps, TypescriptInterfaceProperty, TypescriptInterfacePropertyProps, __ΩTypeScriptInterfaceProps, __ΩTypescriptInterfacePropertyProps };
|
|
26
|
+
//# sourceMappingURL=typescript-interface.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-interface.d.cts","names":[],"sources":["../../../src/typescript/components/typescript-interface.tsx"],"sourcesContent":[],"mappings":";;;;;;UA0CiB,mCACL,sBAAsB,6BAExB,2BAA2B;cACvB,gBAAgB;iBACb,QAAQ;AALzB;AACY,UAOK,gCAAA,SACP,IARE,CAQG,oBARH,EAAA,MAAA,CAAA,EAQkC,cARlC,CAAA;EAAsB,QAAA,EAStB,kBATsB;;;;;AAExB,iBAaM,mBAbN,CAAA,UAcE,MAdF,CAAA,MAAA,EAAA,GAAA,CAAA,GAcwB,MAdxB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAeD,wBAfC,CAewB,CAfxB,CAAA,CAAA,EAeuB,eAAA,CAAG,QAf1B;;;AAKV;AACe,iBAmDC,2BAAA,CAnDD,KAAA,EAoDN,gCApDM,CAAA,EAoD0B,eAAA,CAAA,QApD1B;AACH,2CAAA,GAAA,EAAA;AADF,mDAAA,GAAA,EAAA"}
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
import "../../components
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
+
import * as _alloy_js_core10 from "@alloy-js/core";
|
|
3
|
+
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { InterfaceDeclarationProps, InterfaceMemberProps } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/typescript-interface.d.ts
|
|
7
|
+
interface TypeScriptInterfaceProps<T extends Record<string, any> = Record<string, any>> extends InterfaceDeclarationProps, ComponentProps {
|
|
8
|
+
reflection: ReflectionClass<T>;
|
|
9
|
+
defaultValue?: Partial<T>;
|
|
10
|
+
}
|
|
11
|
+
interface TypescriptInterfacePropertyProps extends Omit<InterfaceMemberProps, "name">, ComponentProps {
|
|
12
|
+
property: ReflectionProperty;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
16
|
+
*/
|
|
17
|
+
declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>): _alloy_js_core10.Children;
|
|
18
|
+
/**
|
|
19
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
20
|
+
*/
|
|
21
|
+
declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps): _alloy_js_core10.Children;
|
|
22
|
+
declare type __ΩTypeScriptInterfaceProps = any[];
|
|
23
|
+
declare type __ΩTypescriptInterfacePropertyProps = any[];
|
|
24
|
+
//#endregion
|
|
25
|
+
export { TypeScriptInterface, TypeScriptInterfaceProps, TypescriptInterfaceProperty, TypescriptInterfacePropertyProps, __ΩTypeScriptInterfaceProps, __ΩTypescriptInterfacePropertyProps };
|
|
26
|
+
//# sourceMappingURL=typescript-interface.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-interface.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-interface.tsx"],"sourcesContent":[],"mappings":";;;;;;UA0CiB,mCACL,sBAAsB,6BAExB,2BAA2B;cACvB,gBAAgB;iBACb,QAAQ;AALzB;AACY,UAOK,gCAAA,SACP,IARE,CAQG,oBARH,EAAA,MAAA,CAAA,EAQkC,cARlC,CAAA;EAAsB,QAAA,EAStB,kBATsB;;;;;AAExB,iBAaM,mBAbN,CAAA,UAcE,MAdF,CAAA,MAAA,EAAA,GAAA,CAAA,GAcwB,MAdxB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAeD,wBAfC,CAewB,CAfxB,CAAA,CAAA,EAeuB,gBAAA,CAAG,QAf1B;;;AAKV;AACe,iBAmDC,2BAAA,CAnDD,KAAA,EAoDN,gCApDM,CAAA,EAoD0B,gBAAA,CAAA,QApD1B;AACH,2CAAA,GAAA,EAAA;AADF,mDAAA,GAAA,EAAA"}
|
|
@@ -1,7 +1,72 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
1
|
+
import { ReflectionClassContext, ReflectionPropertyContext } from "../../core/contexts/reflection.mjs";
|
|
2
|
+
import { TSDocReflectionClass, TSDocReflectionProperty } from "./tsdoc-reflection.mjs";
|
|
3
|
+
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
|
+
import { For, computed, splitProps } from "@alloy-js/core";
|
|
5
|
+
import { stringifyType } from "@powerlines/deepkit/vendor/type";
|
|
6
|
+
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
7
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
8
|
+
import { InterfaceDeclaration, InterfaceMember } from "@alloy-js/typescript";
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
//#region src/typescript/components/typescript-interface.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
13
|
+
*/
|
|
14
|
+
function TypeScriptInterface(props) {
|
|
15
|
+
const [{ name, reflection, doc }, rest] = splitProps(props, [
|
|
16
|
+
"name",
|
|
17
|
+
"reflection",
|
|
18
|
+
"doc"
|
|
19
|
+
]);
|
|
20
|
+
const interfaceName = computed(() => pascalCase((isString(name) ? name : name.toString()) || reflection.getName()));
|
|
21
|
+
const properties = reflection.getProperties().filter((item) => !item.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1);
|
|
22
|
+
return createComponent(ReflectionClassContext.Provider, {
|
|
23
|
+
value: { reflection },
|
|
24
|
+
get children() {
|
|
25
|
+
return [createComponent(TSDocReflectionClass, { heading: doc }), createComponent(InterfaceDeclaration, mergeProps({
|
|
26
|
+
"export": true,
|
|
27
|
+
get name() {
|
|
28
|
+
return interfaceName.value;
|
|
29
|
+
}
|
|
30
|
+
}, rest, { get children() {
|
|
31
|
+
return createComponent(For, {
|
|
32
|
+
each: properties,
|
|
33
|
+
doubleHardline: true,
|
|
34
|
+
semicolon: true,
|
|
35
|
+
children: (prop) => createComponent(TypescriptInterfaceProperty, { property: prop })
|
|
36
|
+
});
|
|
37
|
+
} }))];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
43
|
+
*/
|
|
44
|
+
function TypescriptInterfaceProperty(props) {
|
|
45
|
+
const [{ property }, rest] = splitProps(props, ["property"]);
|
|
46
|
+
return createComponent(ReflectionPropertyContext.Provider, {
|
|
47
|
+
value: property,
|
|
48
|
+
get children() {
|
|
49
|
+
return [createComponent(TSDocReflectionProperty, {}), createComponent(InterfaceMember, mergeProps({
|
|
50
|
+
get name() {
|
|
51
|
+
return property.getNameAsString();
|
|
52
|
+
},
|
|
53
|
+
get readonly() {
|
|
54
|
+
return property.isReadonly();
|
|
55
|
+
},
|
|
56
|
+
get optional() {
|
|
57
|
+
return property.isOptional();
|
|
58
|
+
},
|
|
59
|
+
get nullish() {
|
|
60
|
+
return property.isNullable();
|
|
61
|
+
},
|
|
62
|
+
get type() {
|
|
63
|
+
return stringifyType(property.getType());
|
|
64
|
+
}
|
|
65
|
+
}, rest))];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
//#endregion
|
|
71
|
+
export { TypeScriptInterface, TypescriptInterfaceProperty };
|
|
72
|
+
//# sourceMappingURL=typescript-interface.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-interface.mjs","names":["computed","For","splitProps","InterfaceDeclaration","InterfaceMember","stringifyType","pascalCase","isString","ReflectionClassContext","ReflectionPropertyContext","TSDocReflectionClass","TSDocReflectionProperty","TypeScriptInterface","props","name","reflection","doc","rest","interfaceName","toString","getName","properties","getProperties","filter","item","isIgnored","sort","a","b","isReadonly","getNameAsString","localeCompare","_$createComponent","Provider","value","children","heading","_$mergeProps","each","doubleHardline","semicolon","prop","TypescriptInterfaceProperty","property","readonly","optional","isOptional","nullish","isNullable","type","getType"],"sources":["../../../src/typescript/components/typescript-interface.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 { computed, For, splitProps } from \"@alloy-js/core\";\nimport {\n InterfaceDeclaration,\n InterfaceDeclarationProps,\n InterfaceMember,\n InterfaceMemberProps\n} from \"@alloy-js/typescript\";\nimport {\n ReflectionClass,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n TSDocReflectionClass,\n TSDocReflectionProperty\n} from \"./tsdoc-reflection\";\n\nexport interface TypeScriptInterfaceProps<\n T extends Record<string, any> = Record<string, any>\n>\n extends InterfaceDeclarationProps, ComponentProps {\n reflection: ReflectionClass<T>;\n defaultValue?: Partial<T>;\n}\n\nexport interface TypescriptInterfacePropertyProps\n extends Omit<InterfaceMemberProps, \"name\">, ComponentProps {\n property: ReflectionProperty;\n}\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function TypeScriptInterface<\n T extends Record<string, any> = Record<string, any>\n>(props: TypeScriptInterfaceProps<T>) {\n const [{ name, reflection, doc }, rest] = splitProps(props, [\n \"name\",\n \"reflection\",\n \"doc\"\n ]);\n\n const interfaceName = computed(() =>\n pascalCase(\n (isString(name) ? name : name.toString()) || reflection.getName()\n )\n );\n\n const properties = 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\n return (\n <ReflectionClassContext.Provider\n value={{\n reflection\n }}>\n <TSDocReflectionClass heading={doc} />\n <InterfaceDeclaration export={true} name={interfaceName.value} {...rest}>\n <For each={properties} doubleHardline={true} semicolon={true}>\n {prop => <TypescriptInterfaceProperty property={prop} />}\n </For>\n </InterfaceDeclaration>\n </ReflectionClassContext.Provider>\n );\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function TypescriptInterfaceProperty(\n props: TypescriptInterfacePropertyProps\n) {\n const [{ property }, rest] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocReflectionProperty />\n <InterfaceMember\n name={property.getNameAsString()}\n readonly={property.isReadonly()}\n optional={property.isOptional()}\n nullish={property.isNullable()}\n type={stringifyType(property.getType())}\n {...rest}\n />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":""}
|
|
@@ -1,8 +1,125 @@
|
|
|
1
|
-
require('../../
|
|
2
|
-
require('../../reflection
|
|
3
|
-
require('
|
|
4
|
-
require(
|
|
5
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_core_contexts_reflection = require('../../core/contexts/reflection.cjs');
|
|
3
|
+
const require_typescript_components_tsdoc_reflection = require('./tsdoc-reflection.cjs');
|
|
4
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
5
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
6
|
+
let __powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
|
|
7
|
+
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
8
|
+
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
9
|
+
let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
10
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
11
|
+
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
//#region src/typescript/components/typescript-object.tsx
|
|
14
|
+
/**
|
|
15
|
+
* Generates a TypeScript object for the given reflection class.
|
|
16
|
+
*/
|
|
17
|
+
function TypescriptObject(props) {
|
|
18
|
+
if (!props.reflection?.value) return null;
|
|
19
|
+
const objectName = (0, __alloy_js_core.computed)(() => (0, __stryke_string_format_camel_case.camelCase)(((0, __stryke_type_checks_is_string.isString)(props.name) ? props.name : props.name.toString()) || props.reflection.value.getName()));
|
|
20
|
+
const objectType = (0, __alloy_js_core.computed)(() => props.type || (0, __stryke_string_format_pascal_case.pascalCase)(props.reflection.value.getName()));
|
|
21
|
+
const properties = (0, __alloy_js_core.computed)(() => props.reflection.value.getProperties().filter((item) => !item.isIgnored() && !(0, __stryke_type_checks_is_undefined.isUndefined)(props.defaultValue?.value?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
|
|
22
|
+
if ((0, __stryke_type_checks_is_undefined.isUndefined)(ret) && !(0, __stryke_type_checks_is_undefined.isUndefined)(props.defaultValue?.value?.[alias])) return props.defaultValue?.value?.[alias];
|
|
23
|
+
return ret;
|
|
24
|
+
}, void 0) ?? item.getDefaultValue())).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1));
|
|
25
|
+
const TypeSymbolSlot = (0, __alloy_js_core.createSymbolSlot)();
|
|
26
|
+
const ValueTypeSymbolSlot = (0, __alloy_js_core.createSymbolSlot)();
|
|
27
|
+
const sym = (0, __alloy_js_typescript.createValueSymbol)(props.name, {
|
|
28
|
+
refkeys: props.refkey,
|
|
29
|
+
default: props.default,
|
|
30
|
+
export: props.export,
|
|
31
|
+
metadata: props.metadata,
|
|
32
|
+
tsFlags: props.nullish ? __alloy_js_typescript.TSSymbolFlags.Nullish : __alloy_js_typescript.TSSymbolFlags.None,
|
|
33
|
+
type: props.type ? TypeSymbolSlot.firstSymbol : void 0,
|
|
34
|
+
namePolicy: (0, __alloy_js_typescript.useTSNamePolicy)().for("variable")
|
|
35
|
+
});
|
|
36
|
+
if (!props.type) ValueTypeSymbolSlot.moveMembersTo(sym);
|
|
37
|
+
const keyword = props.var ? "var" : props.let ? "let" : "const";
|
|
38
|
+
const type = props.type ? (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeRefContext, { get children() {
|
|
39
|
+
return [": ", (0, __alloy_js_core_jsx_runtime.createComponent)(TypeSymbolSlot, { get children() {
|
|
40
|
+
return props.type;
|
|
41
|
+
} })];
|
|
42
|
+
} }) : void 0;
|
|
43
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
44
|
+
get when() {
|
|
45
|
+
return !!props.reflection.value;
|
|
46
|
+
},
|
|
47
|
+
get children() {
|
|
48
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_reflection.ReflectionClassContext.Provider, {
|
|
49
|
+
get value() {
|
|
50
|
+
return {
|
|
51
|
+
reflection: props.reflection.value,
|
|
52
|
+
override: {
|
|
53
|
+
name: objectName.value,
|
|
54
|
+
type: objectType.value,
|
|
55
|
+
defaultValue: props.defaultValue?.value
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
61
|
+
get when() {
|
|
62
|
+
return !!objectName.value && !!objectType.value;
|
|
63
|
+
},
|
|
64
|
+
get children() {
|
|
65
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc_reflection.TSDocReflectionClass, {}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Declaration, {
|
|
66
|
+
symbol: sym,
|
|
67
|
+
get children() {
|
|
68
|
+
return [
|
|
69
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => props.export ? "export " : ""),
|
|
70
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => props.default ? "default " : ""),
|
|
71
|
+
keyword,
|
|
72
|
+
" ",
|
|
73
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Name, {}),
|
|
74
|
+
type,
|
|
75
|
+
" =",
|
|
76
|
+
" ",
|
|
77
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(ValueTypeSymbolSlot, { get children() {
|
|
78
|
+
return props.initializer ?? props.children ?? (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ObjectExpression, { get children() {
|
|
79
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
80
|
+
get each() {
|
|
81
|
+
return properties.value ?? [];
|
|
82
|
+
},
|
|
83
|
+
comma: true,
|
|
84
|
+
doubleHardline: true,
|
|
85
|
+
children: (prop) => (0, __alloy_js_core_jsx_runtime.createComponent)(TypescriptObjectProperty, { property: prop })
|
|
86
|
+
});
|
|
87
|
+
} });
|
|
88
|
+
} })
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
})];
|
|
92
|
+
}
|
|
93
|
+
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Generates a TypeScript object property for the given reflection class.
|
|
101
|
+
*/
|
|
102
|
+
function TypescriptObjectProperty(props) {
|
|
103
|
+
const [{ property }] = (0, __alloy_js_core.splitProps)(props, ["property"]);
|
|
104
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_reflection.ReflectionPropertyContext.Provider, {
|
|
105
|
+
value: property,
|
|
106
|
+
get children() {
|
|
107
|
+
return [
|
|
108
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc_reflection.TSDocReflectionProperty, {}),
|
|
109
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ObjectProperty, {
|
|
110
|
+
get name() {
|
|
111
|
+
return property.getNameAsString();
|
|
112
|
+
},
|
|
113
|
+
get value() {
|
|
114
|
+
return (0, __powerlines_deepkit_utilities.stringifyDefaultValue)(property);
|
|
115
|
+
}
|
|
116
|
+
}),
|
|
117
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//#endregion
|
|
124
|
+
exports.TypescriptObject = TypescriptObject;
|
|
125
|
+
exports.TypescriptObjectProperty = TypescriptObjectProperty;
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
import "../../components
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { ComponentProps } from "../../types/components.cjs";
|
|
2
|
+
import * as _alloy_js_core10 from "@alloy-js/core";
|
|
3
|
+
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/typescript-object.d.ts
|
|
7
|
+
interface ComputedRef<T = any> {
|
|
8
|
+
readonly value: T;
|
|
9
|
+
}
|
|
10
|
+
interface TypescriptObjectProps<T extends Record<string, any> = Record<string, any>> extends VarDeclarationProps {
|
|
11
|
+
reflection?: ComputedRef<ReflectionClass<T>>;
|
|
12
|
+
defaultValue?: ComputedRef<Partial<T> | undefined>;
|
|
13
|
+
}
|
|
14
|
+
interface TypescriptObjectPropertyProps extends ComponentProps {
|
|
15
|
+
property: ReflectionProperty;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Generates a TypeScript object for the given reflection class.
|
|
19
|
+
*/
|
|
20
|
+
declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core10.Children;
|
|
21
|
+
/**
|
|
22
|
+
* Generates a TypeScript object property for the given reflection class.
|
|
23
|
+
*/
|
|
24
|
+
declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core10.Children;
|
|
25
|
+
declare type __ΩComputedRef = any[];
|
|
26
|
+
declare type __ΩTypescriptObjectProps = any[];
|
|
27
|
+
declare type __ΩTypescriptObjectPropertyProps = any[];
|
|
28
|
+
//#endregion
|
|
29
|
+
export { ComputedRef, TypescriptObject, TypescriptObjectProperty, TypescriptObjectPropertyProps, TypescriptObjectProps, __ΩComputedRef, __ΩTypescriptObjectPropertyProps, __ΩTypescriptObjectProps };
|
|
30
|
+
//# sourceMappingURL=typescript-object.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-object.d.cts","names":[],"sources":["../../../src/typescript/components/typescript-object.tsx"],"sourcesContent":[],"mappings":";;;;;;UAuDiB;kBACC;;AADD,UAIA,qBAHE,CAAA,UAIP,MAJO,CAAA,MAAA,EAAA,GAAA,CAAA,GAIe,MAJf,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAKT,mBALS,CAAA;EAGF,UAAA,CAAA,EAGF,WAHuB,CAGX,eAHW,CAGK,CAHL,CAAA,CAAA;EAC1B,YAAA,CAAA,EAGK,WAHL,CAGiB,OAHjB,CAGyB,CAHzB,CAAA,GAAA,SAAA,CAAA;;AAE+B,UAI1B,6BAAA,SAAsC,cAJZ,CAAA;EAAhB,QAAA,EAKf,kBALe;;;;;AADjB,iBAYM,gBAZN,CAAA,UAaE,MAbF,CAAA,MAAA,EAAA,GAAA,CAAA,GAawB,MAbxB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAcD,qBAdC,CAcqB,CAdrB,CAAA,CAAA,EAcoB,gBAAA,CAAG,QAdvB;;AAKV;AAOA;AACY,iBAkHI,wBAAA,CAlHJ,KAAA,EAkHoC,6BAlHpC,CAAA,EAkHiE,gBAAA,CAAA,QAlHjE;AAAsB,8BAAA,GAAA,EAAA;AACH,wCAAA,GAAA,EAAA;AAAtB,gDAAA,GAAA,EAAA"}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
-
import "../../components
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { ComponentProps } from "../../types/components.mjs";
|
|
2
|
+
import * as _alloy_js_core8 from "@alloy-js/core";
|
|
3
|
+
import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
|
+
import { VarDeclarationProps } from "@alloy-js/typescript";
|
|
5
|
+
|
|
6
|
+
//#region src/typescript/components/typescript-object.d.ts
|
|
7
|
+
interface ComputedRef<T = any> {
|
|
8
|
+
readonly value: T;
|
|
9
|
+
}
|
|
10
|
+
interface TypescriptObjectProps<T extends Record<string, any> = Record<string, any>> extends VarDeclarationProps {
|
|
11
|
+
reflection?: ComputedRef<ReflectionClass<T>>;
|
|
12
|
+
defaultValue?: ComputedRef<Partial<T> | undefined>;
|
|
13
|
+
}
|
|
14
|
+
interface TypescriptObjectPropertyProps extends ComponentProps {
|
|
15
|
+
property: ReflectionProperty;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Generates a TypeScript object for the given reflection class.
|
|
19
|
+
*/
|
|
20
|
+
declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core8.Children;
|
|
21
|
+
/**
|
|
22
|
+
* Generates a TypeScript object property for the given reflection class.
|
|
23
|
+
*/
|
|
24
|
+
declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core8.Children;
|
|
25
|
+
declare type __ΩComputedRef = any[];
|
|
26
|
+
declare type __ΩTypescriptObjectProps = any[];
|
|
27
|
+
declare type __ΩTypescriptObjectPropertyProps = any[];
|
|
28
|
+
//#endregion
|
|
29
|
+
export { ComputedRef, TypescriptObject, TypescriptObjectProperty, TypescriptObjectPropertyProps, TypescriptObjectProps, __ΩComputedRef, __ΩTypescriptObjectPropertyProps, __ΩTypescriptObjectProps };
|
|
30
|
+
//# sourceMappingURL=typescript-object.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-object.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-object.tsx"],"sourcesContent":[],"mappings":";;;;;;UAuDiB;kBACC;;AADD,UAIA,qBAHE,CAAA,UAIP,MAJO,CAAA,MAAA,EAAA,GAAA,CAAA,GAIe,MAJf,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAKT,mBALS,CAAA;EAGF,UAAA,CAAA,EAGF,WAHuB,CAGX,eAHW,CAGK,CAHL,CAAA,CAAA;EAC1B,YAAA,CAAA,EAGK,WAHL,CAGiB,OAHjB,CAGyB,CAHzB,CAAA,GAAA,SAAA,CAAA;;AAE+B,UAI1B,6BAAA,SAAsC,cAJZ,CAAA;EAAhB,QAAA,EAKf,kBALe;;;;;AADjB,iBAYM,gBAZN,CAAA,UAaE,MAbF,CAAA,MAAA,EAAA,GAAA,CAAA,GAawB,MAbxB,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAcD,qBAdC,CAcqB,CAdrB,CAAA,CAAA,EAcoB,eAAA,CAAG,QAdvB;;AAKV;AAOA;AACY,iBAkHI,wBAAA,CAlHJ,KAAA,EAkHoC,6BAlHpC,CAAA,EAkHiE,eAAA,CAAA,QAlHjE;AAAsB,8BAAA,GAAA,EAAA;AACH,wCAAA,GAAA,EAAA;AAAtB,gDAAA,GAAA,EAAA"}
|
|
@@ -1,7 +1,124 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
1
|
+
import { ReflectionClassContext, ReflectionPropertyContext } from "../../core/contexts/reflection.mjs";
|
|
2
|
+
import { TSDocReflectionClass, TSDocReflectionProperty } from "./tsdoc-reflection.mjs";
|
|
3
|
+
import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
|
|
4
|
+
import { Declaration, For, Name, Show, computed, createSymbolSlot, splitProps } from "@alloy-js/core";
|
|
5
|
+
import { stringifyDefaultValue } from "@powerlines/deepkit/utilities";
|
|
6
|
+
import { camelCase } from "@stryke/string-format/camel-case";
|
|
7
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
8
|
+
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
9
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
10
|
+
import { ObjectExpression, ObjectProperty, TSSymbolFlags, TypeRefContext, createValueSymbol, useTSNamePolicy } from "@alloy-js/typescript";
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
//#region src/typescript/components/typescript-object.tsx
|
|
13
|
+
/**
|
|
14
|
+
* Generates a TypeScript object for the given reflection class.
|
|
15
|
+
*/
|
|
16
|
+
function TypescriptObject(props) {
|
|
17
|
+
if (!props.reflection?.value) return null;
|
|
18
|
+
const objectName = computed(() => camelCase((isString(props.name) ? props.name : props.name.toString()) || props.reflection.value.getName()));
|
|
19
|
+
const objectType = computed(() => props.type || pascalCase(props.reflection.value.getName()));
|
|
20
|
+
const properties = computed(() => props.reflection.value.getProperties().filter((item) => !item.isIgnored() && !isUndefined(props.defaultValue?.value?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
|
|
21
|
+
if (isUndefined(ret) && !isUndefined(props.defaultValue?.value?.[alias])) return props.defaultValue?.value?.[alias];
|
|
22
|
+
return ret;
|
|
23
|
+
}, void 0) ?? item.getDefaultValue())).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1));
|
|
24
|
+
const TypeSymbolSlot = createSymbolSlot();
|
|
25
|
+
const ValueTypeSymbolSlot = createSymbolSlot();
|
|
26
|
+
const sym = createValueSymbol(props.name, {
|
|
27
|
+
refkeys: props.refkey,
|
|
28
|
+
default: props.default,
|
|
29
|
+
export: props.export,
|
|
30
|
+
metadata: props.metadata,
|
|
31
|
+
tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,
|
|
32
|
+
type: props.type ? TypeSymbolSlot.firstSymbol : void 0,
|
|
33
|
+
namePolicy: useTSNamePolicy().for("variable")
|
|
34
|
+
});
|
|
35
|
+
if (!props.type) ValueTypeSymbolSlot.moveMembersTo(sym);
|
|
36
|
+
const keyword = props.var ? "var" : props.let ? "let" : "const";
|
|
37
|
+
const type = props.type ? createComponent(TypeRefContext, { get children() {
|
|
38
|
+
return [": ", createComponent(TypeSymbolSlot, { get children() {
|
|
39
|
+
return props.type;
|
|
40
|
+
} })];
|
|
41
|
+
} }) : void 0;
|
|
42
|
+
return createComponent(Show, {
|
|
43
|
+
get when() {
|
|
44
|
+
return !!props.reflection.value;
|
|
45
|
+
},
|
|
46
|
+
get children() {
|
|
47
|
+
return createComponent(ReflectionClassContext.Provider, {
|
|
48
|
+
get value() {
|
|
49
|
+
return {
|
|
50
|
+
reflection: props.reflection.value,
|
|
51
|
+
override: {
|
|
52
|
+
name: objectName.value,
|
|
53
|
+
type: objectType.value,
|
|
54
|
+
defaultValue: props.defaultValue?.value
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
get children() {
|
|
59
|
+
return [createComponent(Show, {
|
|
60
|
+
get when() {
|
|
61
|
+
return !!objectName.value && !!objectType.value;
|
|
62
|
+
},
|
|
63
|
+
get children() {
|
|
64
|
+
return [createComponent(TSDocReflectionClass, {}), createComponent(Declaration, {
|
|
65
|
+
symbol: sym,
|
|
66
|
+
get children() {
|
|
67
|
+
return [
|
|
68
|
+
memo(() => props.export ? "export " : ""),
|
|
69
|
+
memo(() => props.default ? "default " : ""),
|
|
70
|
+
keyword,
|
|
71
|
+
" ",
|
|
72
|
+
createComponent(Name, {}),
|
|
73
|
+
type,
|
|
74
|
+
" =",
|
|
75
|
+
" ",
|
|
76
|
+
createComponent(ValueTypeSymbolSlot, { get children() {
|
|
77
|
+
return props.initializer ?? props.children ?? createComponent(ObjectExpression, { get children() {
|
|
78
|
+
return createComponent(For, {
|
|
79
|
+
get each() {
|
|
80
|
+
return properties.value ?? [];
|
|
81
|
+
},
|
|
82
|
+
comma: true,
|
|
83
|
+
doubleHardline: true,
|
|
84
|
+
children: (prop) => createComponent(TypescriptObjectProperty, { property: prop })
|
|
85
|
+
});
|
|
86
|
+
} });
|
|
87
|
+
} })
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
})];
|
|
91
|
+
}
|
|
92
|
+
}), createIntrinsic("hbr", {})];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Generates a TypeScript object property for the given reflection class.
|
|
100
|
+
*/
|
|
101
|
+
function TypescriptObjectProperty(props) {
|
|
102
|
+
const [{ property }] = splitProps(props, ["property"]);
|
|
103
|
+
return createComponent(ReflectionPropertyContext.Provider, {
|
|
104
|
+
value: property,
|
|
105
|
+
get children() {
|
|
106
|
+
return [
|
|
107
|
+
createComponent(TSDocReflectionProperty, {}),
|
|
108
|
+
createComponent(ObjectProperty, {
|
|
109
|
+
get name() {
|
|
110
|
+
return property.getNameAsString();
|
|
111
|
+
},
|
|
112
|
+
get value() {
|
|
113
|
+
return stringifyDefaultValue(property);
|
|
114
|
+
}
|
|
115
|
+
}),
|
|
116
|
+
createIntrinsic("hbr", {})
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
export { TypescriptObject, TypescriptObjectProperty };
|
|
124
|
+
//# sourceMappingURL=typescript-object.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-object.mjs","names":["computed","Declaration","CoreDeclaration","createSymbolSlot","For","Name","Show","splitProps","createValueSymbol","ObjectExpression","ObjectProperty","TSSymbolFlags","TypeRefContext","useTSNamePolicy","stringifyDefaultValue","camelCase","pascalCase","isString","isUndefined","ReflectionClassContext","ReflectionPropertyContext","TSDocReflectionClass","TSDocReflectionProperty","TypescriptObject","props","reflection","value","objectName","name","toString","getName","objectType","type","properties","getProperties","filter","item","isIgnored","defaultValue","getNameAsString","getAlias","reduce","ret","alias","undefined","getDefaultValue","sort","a","b","isReadonly","localeCompare","TypeSymbolSlot","ValueTypeSymbolSlot","sym","refkeys","refkey","default","export","metadata","tsFlags","nullish","Nullish","None","firstSymbol","namePolicy","for","moveMembersTo","keyword","var","let","_$createComponent","children","when","Provider","override","symbol","_$memo","initializer","each","comma","doubleHardline","prop","TypescriptObjectProperty","property","_$createIntrinsic"],"sources":["../../../src/typescript/components/typescript-object.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 {\n computed,\n Declaration as CoreDeclaration,\n createSymbolSlot,\n For,\n Name,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n ObjectExpression,\n ObjectProperty,\n TSSymbolFlags,\n TypeRefContext,\n useTSNamePolicy,\n VarDeclarationProps\n} from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport type {\n ReflectionClass,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport {\n ReflectionClassContext,\n ReflectionPropertyContext\n} from \"../../core/contexts/reflection\";\nimport { ComponentProps } from \"../../types/components\";\nimport {\n TSDocReflectionClass,\n TSDocReflectionProperty\n} from \"./tsdoc-reflection\";\n\nexport interface ComputedRef<T = any> {\n readonly value: T;\n}\n\nexport interface TypescriptObjectProps<\n T extends Record<string, any> = Record<string, any>\n> extends VarDeclarationProps {\n reflection?: ComputedRef<ReflectionClass<T>>;\n defaultValue?: ComputedRef<Partial<T> | undefined>;\n}\n\nexport interface TypescriptObjectPropertyProps extends ComponentProps {\n property: ReflectionProperty;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n */\nexport function TypescriptObject<\n T extends Record<string, any> = Record<string, any>\n>(props: TypescriptObjectProps<T>) {\n if (!props.reflection?.value) {\n return null;\n }\n\n const objectName = computed(() =>\n camelCase(\n (isString(props.name) ? props.name : props.name.toString()) ||\n props.reflection!.value.getName()\n )\n );\n const objectType = computed(\n () => props.type || pascalCase(props.reflection!.value.getName())\n );\n const properties = computed(() =>\n props\n .reflection!.value.getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n props.defaultValue?.value?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (props.defaultValue as Record<string, any>)?.value?.[alias]\n )\n ) {\n return (props.defaultValue as Record<string, any>)?.value?.[\n alias\n ];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) ||\n (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n );\n\n const TypeSymbolSlot = createSymbolSlot();\n const ValueTypeSymbolSlot = createSymbolSlot();\n const sym = createValueSymbol(props.name, {\n refkeys: props.refkey,\n default: props.default,\n export: props.export,\n metadata: props.metadata,\n tsFlags: props.nullish ? TSSymbolFlags.Nullish : TSSymbolFlags.None,\n type: props.type ? TypeSymbolSlot.firstSymbol : undefined,\n namePolicy: useTSNamePolicy().for(\"variable\")\n });\n\n if (!props.type) {\n ValueTypeSymbolSlot.moveMembersTo(sym);\n }\n\n const keyword = props.var ? \"var\" : props.let ? \"let\" : \"const\";\n const type = props.type ? (\n <TypeRefContext>\n : <TypeSymbolSlot>{props.type}</TypeSymbolSlot>\n </TypeRefContext>\n ) : undefined;\n\n return (\n <Show when={!!props.reflection.value}>\n <ReflectionClassContext.Provider\n value={{\n reflection: props.reflection.value as ReflectionClass<any>,\n override: {\n name: objectName.value,\n type: objectType.value,\n defaultValue: props.defaultValue?.value\n }\n }}>\n <Show when={!!objectName.value && !!objectType.value}>\n <TSDocReflectionClass />\n <CoreDeclaration symbol={sym}>\n {props.export ? \"export \" : \"\"}\n {props.default ? \"default \" : \"\"}\n {keyword} <Name />\n {type} ={\" \"}\n <ValueTypeSymbolSlot>\n {props.initializer ?? props.children ?? (\n <ObjectExpression>\n <For\n each={properties.value ?? []}\n comma={true}\n doubleHardline={true}>\n {prop => <TypescriptObjectProperty property={prop} />}\n </For>\n </ObjectExpression>\n )}\n </ValueTypeSymbolSlot>\n </CoreDeclaration>\n </Show>\n <hbr />\n </ReflectionClassContext.Provider>\n </Show>\n );\n}\n\n/**\n * Generates a TypeScript object property for the given reflection class.\n */\nexport function TypescriptObjectProperty(props: TypescriptObjectPropertyProps) {\n const [{ property }] = splitProps(props, [\"property\"]);\n\n return (\n <ReflectionPropertyContext.Provider value={property}>\n <TSDocReflectionProperty />\n <ObjectProperty\n name={property.getNameAsString()}\n value={stringifyDefaultValue(property)}\n />\n <hbr />\n </ReflectionPropertyContext.Provider>\n );\n}\n"],"mappings":""}
|