@powerlines/plugin-alloy 0.16.0 → 0.16.2
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/builtin-file-CXkreb3b.mjs +43 -0
- package/dist/builtin-file-D0xcKRt6.cjs +49 -0
- package/dist/builtin-file-Detj4VKO.d.cts +34 -0
- package/dist/builtin-file-Df3B4vGB.d.mts +34 -0
- package/dist/capnp-6EjloHj4.mjs +265 -0
- package/dist/capnp-BHeTs4Ea.d.mts +86 -0
- package/dist/capnp-CirEkAHB.d.cts +86 -0
- package/dist/capnp-DOzEf2mj.cjs +362 -0
- package/dist/{_virtual/rolldown_runtime.cjs → chunk-BwyOHTjC.cjs} +12 -2
- package/dist/components-BrkXdHq-.d.mts +141 -0
- package/dist/components-CH68f_ve.mjs +1 -0
- package/dist/components-CO0xjM8H.mjs +1 -0
- package/dist/components-CnI3Y57d.mjs +1 -0
- package/dist/components-Cvpo9IEL.cjs +0 -0
- package/dist/components-DTkri-mp.cjs +0 -0
- package/dist/components-DkVeQ5Yn.d.cts +141 -0
- package/dist/components-Gg416Czx.cjs +0 -0
- package/dist/components-ZbItRNLr.cjs +0 -0
- package/dist/components-vTvc6Xgc.mjs +1 -0
- package/dist/context-B1Z2ZRAI.d.cts +32 -0
- package/dist/context-BwQLwanm.d.mts +1680 -0
- package/dist/context-CWt70HA3.d.cts +1680 -0
- package/dist/context-DkLnFNZm.cjs +60 -0
- package/dist/context-eP3fitqj.mjs +36 -0
- package/dist/context-x-0aNytc.d.mts +32 -0
- package/dist/contexts-BtxvYUPj.cjs +0 -0
- package/dist/contexts-Dy4nfIoL.mjs +1 -0
- package/dist/contexts-DzdhIC7G.cjs +0 -0
- package/dist/contexts-Q1YIygoz.mjs +1 -0
- package/dist/core/components/index.cjs +8 -6
- package/dist/core/components/index.d.cts +6 -3
- package/dist/core/components/index.d.mts +6 -3
- package/dist/core/components/index.mjs +5 -3
- package/dist/core/components/output.cjs +3 -39
- package/dist/core/components/output.d.cts +2 -17
- package/dist/core/components/output.d.mts +2 -17
- package/dist/core/components/output.mjs +2 -37
- package/dist/core/components/single-line-comment.cjs +2 -21
- package/dist/core/components/single-line-comment.d.cts +3 -21
- package/dist/core/components/single-line-comment.d.mts +3 -21
- package/dist/core/components/single-line-comment.mjs +1 -19
- package/dist/core/components/source-file.cjs +2 -57
- package/dist/core/components/source-file.d.cts +3 -30
- package/dist/core/components/source-file.d.mts +3 -30
- package/dist/core/components/source-file.mjs +1 -54
- package/dist/core/contexts/context.cjs +5 -39
- package/dist/core/contexts/context.d.cts +2 -31
- package/dist/core/contexts/context.d.mts +2 -31
- package/dist/core/contexts/context.mjs +1 -34
- package/dist/core/contexts/index.cjs +15 -14
- package/dist/core/contexts/index.d.cts +5 -2
- package/dist/core/contexts/index.d.mts +5 -2
- package/dist/core/contexts/index.mjs +3 -2
- package/dist/core/contexts/reflection.cjs +9 -67
- package/dist/core/contexts/reflection.d.cts +3 -50
- package/dist/core/contexts/reflection.d.mts +3 -50
- package/dist/core/contexts/reflection.mjs +1 -58
- package/dist/core/index.cjs +22 -22
- package/dist/core/index.d.cts +9 -7
- package/dist/core/index.d.mts +9 -7
- package/dist/core/index.mjs +7 -7
- package/dist/create-builtin-CtBhQRxS.d.mts +15 -0
- package/dist/create-builtin-DgYGwEYD.cjs +24 -0
- package/dist/create-builtin-Dug1rcMQ.mjs +18 -0
- package/dist/create-builtin-SArMbh0-.d.cts +15 -0
- package/dist/dynamic-import-statement-AUDLZGFa.d.cts +32 -0
- package/dist/dynamic-import-statement-BFl4j9Ex.cjs +30 -0
- package/dist/dynamic-import-statement-BjiwPuJ3.d.mts +32 -0
- package/dist/dynamic-import-statement-DYl1f5Mj.mjs +24 -0
- package/dist/entry-file-CQwIaayx.d.mts +27 -0
- package/dist/entry-file-CTYBU7Lg.mjs +37 -0
- package/dist/entry-file-Cq3bZzix.d.cts +27 -0
- package/dist/entry-file-l3ZhaFTI.cjs +44 -0
- package/dist/helpers/capnp.cjs +19 -274
- package/dist/helpers/capnp.d.cts +2 -85
- package/dist/helpers/capnp.d.mts +2 -85
- package/dist/helpers/capnp.mjs +2 -255
- package/dist/helpers/create-builtin.cjs +2 -18
- package/dist/helpers/create-builtin.d.cts +1 -14
- package/dist/helpers/create-builtin.d.mts +1 -14
- package/dist/helpers/create-builtin.mjs +1 -16
- package/dist/helpers/index.cjs +24 -23
- package/dist/helpers/index.d.cts +5 -4
- package/dist/helpers/index.d.mts +5 -4
- package/dist/helpers/index.mjs +5 -4
- package/dist/helpers/refkey.cjs +2 -15
- package/dist/helpers/refkey.d.cts +1 -12
- package/dist/helpers/refkey.d.mts +1 -12
- package/dist/helpers/refkey.mjs +1 -13
- package/dist/helpers/typescript.cjs +3 -45
- package/dist/helpers/typescript.d.cts +1 -22
- package/dist/helpers/typescript.d.mts +1 -22
- package/dist/helpers/typescript.mjs +2 -43
- package/dist/index-Blaks7l8.d.cts +1 -0
- package/dist/index-CuheJfs-.d.mts +1 -0
- package/dist/index-CwSIy_W-.d.cts +1 -0
- package/dist/index-D7UbuJwP.d.mts +1 -0
- package/dist/index-D9XihFV1.d.mts +1 -0
- package/dist/index-DdxxIAKU.d.cts +1 -0
- package/dist/index-DrK1_jKY.d.mts +1 -0
- package/dist/index-DrZ2Dh-H.d.cts +1 -0
- package/dist/index-DztUdPP_.d.mts +1 -0
- package/dist/index-lQ_hGQ08.d.cts +1 -0
- package/dist/index.cjs +22 -10
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +44 -3
- package/dist/markdown/components/index.cjs +12 -7
- package/dist/markdown/components/index.d.cts +7 -2
- package/dist/markdown/components/index.d.mts +7 -2
- package/dist/markdown/components/index.mjs +7 -2
- package/dist/markdown/components/markdown-file.cjs +6 -117
- package/dist/markdown/components/markdown-file.d.cts +4 -22
- package/dist/markdown/components/markdown-file.d.mts +4 -22
- package/dist/markdown/components/markdown-file.mjs +4 -114
- package/dist/markdown/components/markdown-table.cjs +5 -100
- package/dist/markdown/components/markdown-table.d.cts +4 -26
- package/dist/markdown/components/markdown-table.d.mts +4 -26
- package/dist/markdown/components/markdown-table.mjs +2 -96
- package/dist/markdown/contexts/index.cjs +6 -5
- package/dist/markdown/contexts/index.d.cts +2 -1
- package/dist/markdown/contexts/index.d.mts +2 -1
- package/dist/markdown/contexts/index.mjs +2 -1
- package/dist/markdown/contexts/markdown-table.cjs +5 -36
- package/dist/markdown/contexts/markdown-table.d.cts +1 -36
- package/dist/markdown/contexts/markdown-table.d.mts +1 -36
- package/dist/markdown/contexts/markdown-table.mjs +1 -31
- package/dist/markdown/index.cjs +17 -14
- package/dist/markdown/index.d.cts +8 -5
- package/dist/markdown/index.d.mts +8 -5
- package/dist/markdown/index.mjs +8 -5
- package/dist/markdown-file-CTMTrgdr.mjs +116 -0
- package/dist/markdown-file-CuMvfKbi.d.cts +23 -0
- package/dist/markdown-file-DBpOheYg.d.mts +23 -0
- package/dist/markdown-file-GXj9nWQs.cjs +128 -0
- package/dist/markdown-table-AO9Jtw-o.mjs +98 -0
- package/dist/markdown-table-Biapn9k9.cjs +57 -0
- package/dist/markdown-table-CpnCpTp1.d.cts +27 -0
- package/dist/markdown-table-DFnnh_px.d.cts +37 -0
- package/dist/markdown-table-DKL6g91k.d.mts +37 -0
- package/dist/markdown-table-DaYAMMk6.mjs +33 -0
- package/dist/markdown-table-DcG6ScWX.d.mts +27 -0
- package/dist/markdown-table-d1cy0JP3.cjs +116 -0
- package/dist/output-BC2u6xsn.d.cts +18 -0
- package/dist/output-C_BQEAMU.d.mts +18 -0
- package/dist/output-CiQCsyui.cjs +45 -0
- package/dist/output-eQ8RcTrP.mjs +39 -0
- package/dist/plugin-85Hf9k78.mjs +1 -0
- package/dist/plugin-CofWgH_d.cjs +0 -0
- package/dist/plugin-DcrJBDQ2.d.mts +39 -0
- package/dist/plugin-K4ViA72J.d.cts +39 -0
- package/dist/record-expression-B0NGcmBj.mjs +11 -0
- package/dist/record-expression-P1BTu_7B.d.mts +12 -0
- package/dist/record-expression-j-3eBufn.cjs +17 -0
- package/dist/record-expression-rZuoLQWG.d.cts +12 -0
- package/dist/refkey-BRtVxqGW.d.mts +13 -0
- package/dist/refkey-BUzulmmj.cjs +21 -0
- package/dist/refkey-CSq-Ftvf.mjs +15 -0
- package/dist/refkey-DpAkQ3Cu.d.cts +13 -0
- package/dist/reflection-B9zOZEdi.d.mts +51 -0
- package/dist/reflection-BYeP2t8p.d.cts +51 -0
- package/dist/reflection-CKhynTvI.cjs +108 -0
- package/dist/reflection-srixNcX2.mjs +60 -0
- package/dist/single-line-comment-C9Fz5mkM.mjs +21 -0
- package/dist/single-line-comment-DSAVQ0tl.d.cts +22 -0
- package/dist/single-line-comment-DSz_BbMx.d.mts +22 -0
- package/dist/single-line-comment-_ZglDv1k.cjs +27 -0
- package/dist/source-file-B8OyOWg8.d.mts +31 -0
- package/dist/source-file-DKnFKRGJ.cjs +63 -0
- package/dist/source-file-Db1Wu_yq.mjs +56 -0
- package/dist/source-file-Dr2h8MVw.d.cts +31 -0
- package/dist/tsdoc-BT-2pTD3.d.mts +152 -0
- package/dist/tsdoc-BpykLfnB.cjs +576 -0
- package/dist/tsdoc-CWCdJ1Uj.mjs +456 -0
- package/dist/tsdoc-C_2VzSk_.d.cts +152 -0
- package/dist/tsdoc-reflection-BIWxEkBI.mjs +170 -0
- package/dist/tsdoc-reflection-D4QfeAYE.d.cts +18 -0
- package/dist/tsdoc-reflection-Dr_Nf1ht.cjs +188 -0
- package/dist/tsdoc-reflection-qXh3a1WV.d.mts +18 -0
- package/dist/types/components.cjs +1 -0
- package/dist/types/components.d.cts +2 -141
- package/dist/types/components.d.mts +2 -141
- package/dist/types/components.mjs +2 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +2 -40
- package/dist/types/plugin.d.mts +2 -40
- package/dist/types/plugin.mjs +2 -0
- package/dist/typescript/components/builtin-file.cjs +8 -43
- package/dist/typescript/components/builtin-file.d.cts +6 -33
- package/dist/typescript/components/builtin-file.d.mts +6 -33
- package/dist/typescript/components/builtin-file.mjs +7 -41
- package/dist/typescript/components/dynamic-import-statement.cjs +2 -24
- package/dist/typescript/components/dynamic-import-statement.d.cts +1 -31
- package/dist/typescript/components/dynamic-import-statement.d.mts +1 -31
- package/dist/typescript/components/dynamic-import-statement.mjs +1 -22
- package/dist/typescript/components/entry-file.cjs +6 -38
- package/dist/typescript/components/entry-file.d.cts +5 -26
- package/dist/typescript/components/entry-file.d.mts +5 -26
- package/dist/typescript/components/entry-file.mjs +5 -35
- package/dist/typescript/components/index.cjs +49 -43
- package/dist/typescript/components/index.d.cts +13 -9
- package/dist/typescript/components/index.d.mts +13 -9
- package/dist/typescript/components/index.mjs +15 -9
- package/dist/typescript/components/record-expression.cjs +2 -11
- package/dist/typescript/components/record-expression.d.cts +1 -11
- package/dist/typescript/components/record-expression.d.mts +1 -11
- package/dist/typescript/components/record-expression.mjs +1 -9
- package/dist/typescript/components/tsdoc-reflection.cjs +8 -172
- package/dist/typescript/components/tsdoc-reflection.d.cts +4 -17
- package/dist/typescript/components/tsdoc-reflection.d.mts +4 -17
- package/dist/typescript/components/tsdoc-reflection.mjs +5 -168
- package/dist/typescript/components/tsdoc.cjs +23 -475
- package/dist/typescript/components/tsdoc.d.cts +3 -151
- package/dist/typescript/components/tsdoc.d.mts +3 -151
- package/dist/typescript/components/tsdoc.mjs +3 -454
- package/dist/typescript/components/typescript-file.cjs +7 -192
- package/dist/typescript/components/typescript-file.d.cts +4 -46
- package/dist/typescript/components/typescript-file.d.mts +4 -46
- package/dist/typescript/components/typescript-file.mjs +4 -188
- package/dist/typescript/components/typescript-interface.cjs +8 -67
- package/dist/typescript/components/typescript-interface.d.cts +3 -23
- package/dist/typescript/components/typescript-interface.d.mts +3 -23
- package/dist/typescript/components/typescript-interface.mjs +6 -64
- package/dist/typescript/components/typescript-object.cjs +8 -124
- package/dist/typescript/components/typescript-object.d.cts +3 -24
- package/dist/typescript/components/typescript-object.d.mts +3 -24
- package/dist/typescript/components/typescript-object.mjs +6 -121
- package/dist/typescript/index.cjs +49 -44
- package/dist/typescript/index.d.cts +13 -10
- package/dist/typescript/index.d.mts +13 -10
- package/dist/typescript/index.mjs +15 -10
- package/dist/typescript-BIiCTw8m.d.mts +23 -0
- package/dist/typescript-NNuOlVjo.mjs +45 -0
- package/dist/typescript-VTSR_IQG.cjs +51 -0
- package/dist/typescript-YczHz9BQ.d.cts +23 -0
- package/dist/typescript-file-B2iQamR6.d.cts +47 -0
- package/dist/typescript-file-CCNXO3vl.d.mts +47 -0
- package/dist/typescript-file-DLbLtnFd.cjs +208 -0
- package/dist/typescript-file-hcvsHaDV.mjs +190 -0
- package/dist/typescript-interface-BM02EN5E.mjs +66 -0
- package/dist/typescript-interface-Cu5yH1iH.d.mts +24 -0
- package/dist/typescript-interface-cuXGu4c4.cjs +78 -0
- package/dist/typescript-interface-vmxe6DFQ.d.cts +24 -0
- package/dist/typescript-object-Bk0AnSSQ.mjs +123 -0
- package/dist/typescript-object-Bsfy6ZF0.cjs +135 -0
- package/dist/typescript-object-CYLHqec2.d.cts +25 -0
- package/dist/typescript-object-DlbiBCmI.d.mts +25 -0
- package/dist/{deepkit/src/utilities.mjs → utilities-C6eipB1q.mjs} +1 -1
- package/dist/{deepkit/src/utilities.cjs → utilities-CiKb35hs.cjs} +25 -5
- package/dist/vendor/index.cjs +630 -15
- package/package.json +5 -5
- package/dist/_virtual/rolldown_runtime.mjs +0 -29
- package/dist/powerlines/src/lib/utilities/file-header.cjs +0 -13
- package/dist/powerlines/src/lib/utilities/file-header.mjs +0 -12
- package/dist/powerlines/src/types/babel.d.mts +0 -2
- package/dist/powerlines/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -145
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -369
- package/dist/powerlines/src/types/config.d.mts +0 -369
- package/dist/powerlines/src/types/context.d.cts +0 -362
- package/dist/powerlines/src/types/context.d.mts +0 -364
- package/dist/powerlines/src/types/fs.d.cts +0 -458
- package/dist/powerlines/src/types/fs.d.mts +0 -458
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/plugin.d.cts +0 -231
- package/dist/powerlines/src/types/plugin.d.mts +0 -231
- package/dist/powerlines/src/types/resolved.d.cts +0 -81
- package/dist/powerlines/src/types/resolved.d.mts +0 -81
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/vendor/index.mjs +0 -11
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { n as usePowerlines } from "./context-eP3fitqj.mjs";
|
|
2
|
+
import { r as stringifyDefaultValue } from "./utilities-C6eipB1q.mjs";
|
|
3
|
+
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
5
|
+
import { For, List, Prose, Show, childrenArray, splitProps } from "@powerlines/plugin-alloy/vendor";
|
|
6
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
7
|
+
|
|
8
|
+
//#region 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 [
|
|
15
|
+
"/**",
|
|
16
|
+
createIntrinsic("align", {
|
|
17
|
+
string: " * ",
|
|
18
|
+
get children() {
|
|
19
|
+
return [
|
|
20
|
+
createIntrinsic("hbr", {}),
|
|
21
|
+
createComponent(Show, {
|
|
22
|
+
get when() {
|
|
23
|
+
return !isUndefined(heading);
|
|
24
|
+
},
|
|
25
|
+
get children() {
|
|
26
|
+
return [
|
|
27
|
+
heading,
|
|
28
|
+
createIntrinsic("hbr", {}),
|
|
29
|
+
createComponent(Show, {
|
|
30
|
+
get when() {
|
|
31
|
+
return memo(() => !!!isUndefined(children))() && childrenArray(() => children).length > 0;
|
|
32
|
+
},
|
|
33
|
+
get children() {
|
|
34
|
+
return createIntrinsic("hbr", {});
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
createComponent(Show, {
|
|
41
|
+
get when() {
|
|
42
|
+
return memo(() => !!!isUndefined(children))() && childrenArray(() => children).length > 0;
|
|
43
|
+
},
|
|
44
|
+
get children() {
|
|
45
|
+
return createComponent(List, { get children() {
|
|
46
|
+
return childrenArray(() => children);
|
|
47
|
+
} });
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
createIntrinsic("hbr", {}),
|
|
54
|
+
` */`,
|
|
55
|
+
createIntrinsic("hbr", {})
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a TSDoc `@<props.tag>` tag.
|
|
60
|
+
*/
|
|
61
|
+
function TSDocTag(props) {
|
|
62
|
+
const [{ children, tag }] = splitProps(props, ["children", "tag"]);
|
|
63
|
+
return [
|
|
64
|
+
`@${tag} `,
|
|
65
|
+
createComponent(Show, {
|
|
66
|
+
get when() {
|
|
67
|
+
return Boolean(children);
|
|
68
|
+
},
|
|
69
|
+
get children() {
|
|
70
|
+
return createIntrinsic("align", {
|
|
71
|
+
width: 2,
|
|
72
|
+
get children() {
|
|
73
|
+
return createComponent(Prose, { children });
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}),
|
|
78
|
+
createIntrinsic("hbr", {})
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A component that creates a TSDoc block with `@param` tags for each parameter.
|
|
83
|
+
*/
|
|
84
|
+
function TSDocParams(props) {
|
|
85
|
+
return createComponent(For, {
|
|
86
|
+
each: normalizeParametersForDoc(props.parameters),
|
|
87
|
+
children: (param) => createComponent(TSDocParam, {
|
|
88
|
+
get name() {
|
|
89
|
+
return param.name;
|
|
90
|
+
},
|
|
91
|
+
get optional() {
|
|
92
|
+
return param.optional;
|
|
93
|
+
},
|
|
94
|
+
get children() {
|
|
95
|
+
return param.doc;
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function normalizeParametersForDoc(parameters) {
|
|
101
|
+
if (parameters.some((p) => typeof p === "string")) return [];
|
|
102
|
+
return parameters;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Create a TSDoc `@title` tag.
|
|
106
|
+
*/
|
|
107
|
+
function TSDocTitle(props) {
|
|
108
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
109
|
+
return createComponent(TSDocTag, mergeProps(rest, {
|
|
110
|
+
tag: "title",
|
|
111
|
+
children
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Create a TSDoc `@domain` tag.
|
|
116
|
+
*/
|
|
117
|
+
function TSDocDomain(props) {
|
|
118
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
119
|
+
return createComponent(TSDocTag, mergeProps(rest, {
|
|
120
|
+
tag: "domain",
|
|
121
|
+
children
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Create a TSDoc `@alias` tag.
|
|
126
|
+
*/
|
|
127
|
+
function TSDocAlias(props) {
|
|
128
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
129
|
+
return createComponent(TSDocTag, mergeProps(rest, {
|
|
130
|
+
tag: "alias",
|
|
131
|
+
children
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a TSDoc `@permission` tag.
|
|
136
|
+
*/
|
|
137
|
+
function TSDocPermission(props) {
|
|
138
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
139
|
+
return createComponent(TSDocTag, mergeProps(rest, {
|
|
140
|
+
tag: "permission",
|
|
141
|
+
children
|
|
142
|
+
}));
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Create a TSDoc `@defaultValue` tag.
|
|
146
|
+
*/
|
|
147
|
+
function TSDocDefaultValue(props) {
|
|
148
|
+
return [
|
|
149
|
+
"@defaultValue ",
|
|
150
|
+
createComponent(Show, {
|
|
151
|
+
get when() {
|
|
152
|
+
return !isUndefined(props.value);
|
|
153
|
+
},
|
|
154
|
+
get children() {
|
|
155
|
+
return createIntrinsic("align", {
|
|
156
|
+
width: 2,
|
|
157
|
+
get children() {
|
|
158
|
+
return createComponent(Prose, { get children() {
|
|
159
|
+
return stringifyDefaultValue(props.value);
|
|
160
|
+
} });
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}),
|
|
165
|
+
createIntrinsic("hbr", {})
|
|
166
|
+
];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Create a TSDoc `@remarks` tag.
|
|
170
|
+
*/
|
|
171
|
+
function TSDocRemarks(props) {
|
|
172
|
+
return [
|
|
173
|
+
"@remarks ",
|
|
174
|
+
createIntrinsic("hbr", {}),
|
|
175
|
+
createComponent(List, {
|
|
176
|
+
hardline: true,
|
|
177
|
+
get children() {
|
|
178
|
+
return childrenArray(() => props.children);
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Create a TSDoc `@see` tag.
|
|
185
|
+
*/
|
|
186
|
+
function TSDocLink(props) {
|
|
187
|
+
return createComponent(TSDocTag, mergeProps(props, { tag: "see" }));
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Create a TSDoc `@example` tag.
|
|
191
|
+
*/
|
|
192
|
+
function TSDocExample(props) {
|
|
193
|
+
const [{ tsx, fenced = true, language, children }] = splitProps(props, [
|
|
194
|
+
"tsx",
|
|
195
|
+
"fenced",
|
|
196
|
+
"language",
|
|
197
|
+
"children"
|
|
198
|
+
]);
|
|
199
|
+
return [
|
|
200
|
+
"@example ",
|
|
201
|
+
createIntrinsic("hbr", {}),
|
|
202
|
+
createComponent(Show, {
|
|
203
|
+
when: fenced,
|
|
204
|
+
get children() {
|
|
205
|
+
return [
|
|
206
|
+
"```",
|
|
207
|
+
language || (tsx ? "tsx" : "ts"),
|
|
208
|
+
createIntrinsic("hbr", {})
|
|
209
|
+
];
|
|
210
|
+
}
|
|
211
|
+
}),
|
|
212
|
+
children,
|
|
213
|
+
createComponent(Show, {
|
|
214
|
+
when: fenced,
|
|
215
|
+
get children() {
|
|
216
|
+
return [createIntrinsic("hbr", {}), "```"];
|
|
217
|
+
}
|
|
218
|
+
})
|
|
219
|
+
];
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Create a TSDoc `@readonly` tag.
|
|
223
|
+
*/
|
|
224
|
+
function TSDocReadonly() {
|
|
225
|
+
return createComponent(TSDocTag, { tag: "readonly" });
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Create a TSDoc `@internal` tag.
|
|
229
|
+
*/
|
|
230
|
+
function TSDocInternal() {
|
|
231
|
+
return createComponent(TSDocTag, { tag: "internal" });
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Create a TSDoc `@ignore` tag.
|
|
235
|
+
*/
|
|
236
|
+
function TSDocIgnore() {
|
|
237
|
+
return createComponent(TSDocTag, { tag: "ignore" });
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Create a TSDoc `@hidden` tag.
|
|
241
|
+
*/
|
|
242
|
+
function TSDocHidden() {
|
|
243
|
+
return createComponent(TSDocTag, { tag: "hidden" });
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
247
|
+
*/
|
|
248
|
+
function TSDocAttributesTags(props) {
|
|
249
|
+
const [{ title, alias, permission, domain, readonly, internal, ignore, hidden, defaultValue }] = splitProps(props, [
|
|
250
|
+
"title",
|
|
251
|
+
"alias",
|
|
252
|
+
"permission",
|
|
253
|
+
"domain",
|
|
254
|
+
"readonly",
|
|
255
|
+
"internal",
|
|
256
|
+
"ignore",
|
|
257
|
+
"hidden",
|
|
258
|
+
"defaultValue"
|
|
259
|
+
]);
|
|
260
|
+
return [
|
|
261
|
+
createComponent(Show, {
|
|
262
|
+
get when() {
|
|
263
|
+
return isSetString(title);
|
|
264
|
+
},
|
|
265
|
+
get children() {
|
|
266
|
+
return createComponent(TSDocTitle, { children: title });
|
|
267
|
+
}
|
|
268
|
+
}),
|
|
269
|
+
createComponent(Show, {
|
|
270
|
+
get when() {
|
|
271
|
+
return !isUndefined(alias) && alias.length > 0;
|
|
272
|
+
},
|
|
273
|
+
get children() {
|
|
274
|
+
return createComponent(For, {
|
|
275
|
+
each: alias ?? [],
|
|
276
|
+
children: (alias$1) => createComponent(TSDocAlias, { children: alias$1 })
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}),
|
|
280
|
+
createComponent(Show, {
|
|
281
|
+
get when() {
|
|
282
|
+
return isSetString(domain);
|
|
283
|
+
},
|
|
284
|
+
get children() {
|
|
285
|
+
return createComponent(TSDocDomain, { children: domain });
|
|
286
|
+
}
|
|
287
|
+
}),
|
|
288
|
+
createComponent(Show, {
|
|
289
|
+
get when() {
|
|
290
|
+
return !isUndefined(permission) && permission.length > 0;
|
|
291
|
+
},
|
|
292
|
+
get children() {
|
|
293
|
+
return createComponent(For, {
|
|
294
|
+
each: permission ?? [],
|
|
295
|
+
children: (permission$1) => createComponent(TSDocPermission, { children: permission$1 })
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}),
|
|
299
|
+
createComponent(Show, {
|
|
300
|
+
when: readonly === true,
|
|
301
|
+
get children() {
|
|
302
|
+
return createComponent(TSDocReadonly, {});
|
|
303
|
+
}
|
|
304
|
+
}),
|
|
305
|
+
createComponent(Show, {
|
|
306
|
+
when: internal === true,
|
|
307
|
+
get children() {
|
|
308
|
+
return createComponent(TSDocInternal, {});
|
|
309
|
+
}
|
|
310
|
+
}),
|
|
311
|
+
createComponent(Show, {
|
|
312
|
+
when: ignore === true,
|
|
313
|
+
get children() {
|
|
314
|
+
return createComponent(TSDocIgnore, {});
|
|
315
|
+
}
|
|
316
|
+
}),
|
|
317
|
+
createComponent(Show, {
|
|
318
|
+
when: hidden === true,
|
|
319
|
+
get children() {
|
|
320
|
+
return createComponent(TSDocHidden, {});
|
|
321
|
+
}
|
|
322
|
+
}),
|
|
323
|
+
createComponent(Show, {
|
|
324
|
+
get when() {
|
|
325
|
+
return !isUndefined(defaultValue);
|
|
326
|
+
},
|
|
327
|
+
get children() {
|
|
328
|
+
return createComponent(TSDocDefaultValue, { value: defaultValue });
|
|
329
|
+
}
|
|
330
|
+
})
|
|
331
|
+
];
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Create a TSDoc parameter set off with `@param`.
|
|
335
|
+
*/
|
|
336
|
+
function TSDocParam(props) {
|
|
337
|
+
return [
|
|
338
|
+
"@param ",
|
|
339
|
+
createComponent(TSDocParamName, {
|
|
340
|
+
get name() {
|
|
341
|
+
return props.name;
|
|
342
|
+
},
|
|
343
|
+
get optional() {
|
|
344
|
+
return props.optional;
|
|
345
|
+
},
|
|
346
|
+
get defaultValue() {
|
|
347
|
+
return props.defaultValue;
|
|
348
|
+
}
|
|
349
|
+
}),
|
|
350
|
+
createComponent(TSDocParamDescription, { get children() {
|
|
351
|
+
return props.children;
|
|
352
|
+
} })
|
|
353
|
+
];
|
|
354
|
+
}
|
|
355
|
+
function TSDocParamName(props) {
|
|
356
|
+
return [
|
|
357
|
+
createComponent(Show, {
|
|
358
|
+
get when() {
|
|
359
|
+
return props.optional;
|
|
360
|
+
},
|
|
361
|
+
children: "["
|
|
362
|
+
}),
|
|
363
|
+
memo(() => props.name),
|
|
364
|
+
createComponent(Show, {
|
|
365
|
+
get when() {
|
|
366
|
+
return Boolean(props.defaultValue);
|
|
367
|
+
},
|
|
368
|
+
get children() {
|
|
369
|
+
return ["=", memo(() => props.defaultValue)];
|
|
370
|
+
}
|
|
371
|
+
}),
|
|
372
|
+
createComponent(Show, {
|
|
373
|
+
get when() {
|
|
374
|
+
return props.optional;
|
|
375
|
+
},
|
|
376
|
+
children: "]"
|
|
377
|
+
})
|
|
378
|
+
];
|
|
379
|
+
}
|
|
380
|
+
function TSDocParamDescription(props) {
|
|
381
|
+
return createComponent(Show, {
|
|
382
|
+
get when() {
|
|
383
|
+
return Boolean(props.children);
|
|
384
|
+
},
|
|
385
|
+
get children() {
|
|
386
|
+
return [" - ", createIntrinsic("align", {
|
|
387
|
+
width: 2,
|
|
388
|
+
get children() {
|
|
389
|
+
return createComponent(Prose, { get children() {
|
|
390
|
+
return props.children;
|
|
391
|
+
} });
|
|
392
|
+
}
|
|
393
|
+
})];
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Create a TSDoc `@returns` tag.
|
|
399
|
+
*/
|
|
400
|
+
function TSDocReturns(props) {
|
|
401
|
+
return createComponent(TSDocTag, mergeProps(props, { tag: "returns" }));
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Create a TSDoc `@throws` tag.
|
|
405
|
+
*/
|
|
406
|
+
function TSDocThrows(props) {
|
|
407
|
+
return createComponent(TSDocTag, mergeProps(props, { tag: "throws" }));
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Generates a TSDoc `@module` tag for the given module name.
|
|
411
|
+
*/
|
|
412
|
+
function TSDocModule(props) {
|
|
413
|
+
const [{ children, name, prefix }] = splitProps(props, [
|
|
414
|
+
"children",
|
|
415
|
+
"name",
|
|
416
|
+
"prefix"
|
|
417
|
+
]);
|
|
418
|
+
const context = usePowerlines();
|
|
419
|
+
return [
|
|
420
|
+
"/**",
|
|
421
|
+
createIntrinsic("align", {
|
|
422
|
+
string: " * ",
|
|
423
|
+
get children() {
|
|
424
|
+
return [
|
|
425
|
+
createIntrinsic("hbr", {}),
|
|
426
|
+
createComponent(Show, {
|
|
427
|
+
get when() {
|
|
428
|
+
return Boolean(children);
|
|
429
|
+
},
|
|
430
|
+
get children() {
|
|
431
|
+
return [
|
|
432
|
+
createComponent(List, {
|
|
433
|
+
hardline: true,
|
|
434
|
+
get children() {
|
|
435
|
+
return childrenArray(() => children);
|
|
436
|
+
}
|
|
437
|
+
}),
|
|
438
|
+
createIntrinsic("hbr", {}),
|
|
439
|
+
createIntrinsic("hbr", {})
|
|
440
|
+
];
|
|
441
|
+
}
|
|
442
|
+
}),
|
|
443
|
+
"@module ",
|
|
444
|
+
memo(() => prefix || context?.config.output.builtinPrefix),
|
|
445
|
+
":",
|
|
446
|
+
name
|
|
447
|
+
];
|
|
448
|
+
}
|
|
449
|
+
}),
|
|
450
|
+
createIntrinsic("hbr", {}),
|
|
451
|
+
` */`
|
|
452
|
+
];
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
//#endregion
|
|
456
|
+
export { TSDocReturns as _, TSDocDomain as a, TSDocTitle as b, TSDocIgnore as c, TSDocModule as d, TSDocParam as f, TSDocRemarks as g, TSDocReadonly as h, TSDocDefaultValue as i, TSDocInternal as l, TSDocPermission as m, TSDocAlias as n, TSDocExample as o, TSDocParams as p, TSDocAttributesTags as r, TSDocHidden as s, TSDoc as t, TSDocLink as u, TSDocTag as v, TSDocThrows as y };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { n as ComponentProps } from "./components-DkVeQ5Yn.cjs";
|
|
2
|
+
import { Children } from "@powerlines/plugin-alloy/vendor";
|
|
3
|
+
import { JSDocExampleProps, ParameterDescriptor } from "@alloy-js/typescript";
|
|
4
|
+
|
|
5
|
+
//#region src/typescript/components/tsdoc.d.ts
|
|
6
|
+
interface TSDocProps extends ComponentProps {
|
|
7
|
+
heading?: Children;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Generates a TypeScript interface for the given reflection class.
|
|
11
|
+
*/
|
|
12
|
+
declare function TSDoc(props: TSDocProps): Children;
|
|
13
|
+
interface TSDocTagProps extends ComponentProps {
|
|
14
|
+
tag: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a TSDoc `@<props.tag>` tag.
|
|
18
|
+
*/
|
|
19
|
+
declare function TSDocTag(props: TSDocTagProps): Children;
|
|
20
|
+
interface TSDocParamsProps {
|
|
21
|
+
parameters: ParameterDescriptor[] | string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A component that creates a TSDoc block with `@param` tags for each parameter.
|
|
25
|
+
*/
|
|
26
|
+
declare function TSDocParams(props: TSDocParamsProps): Children;
|
|
27
|
+
/**
|
|
28
|
+
* Create a TSDoc `@title` tag.
|
|
29
|
+
*/
|
|
30
|
+
declare function TSDocTitle(props: ComponentProps): Children;
|
|
31
|
+
/**
|
|
32
|
+
* Create a TSDoc `@domain` tag.
|
|
33
|
+
*/
|
|
34
|
+
declare function TSDocDomain(props: ComponentProps): Children;
|
|
35
|
+
/**
|
|
36
|
+
* Create a TSDoc `@alias` tag.
|
|
37
|
+
*/
|
|
38
|
+
declare function TSDocAlias(props: ComponentProps): Children;
|
|
39
|
+
/**
|
|
40
|
+
* Create a TSDoc `@permission` tag.
|
|
41
|
+
*/
|
|
42
|
+
declare function TSDocPermission(props: ComponentProps): Children;
|
|
43
|
+
interface TSDocDefaultValueProps extends ComponentProps {
|
|
44
|
+
value: any;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create a TSDoc `@defaultValue` tag.
|
|
48
|
+
*/
|
|
49
|
+
declare function TSDocDefaultValue(props: TSDocDefaultValueProps): Children;
|
|
50
|
+
/**
|
|
51
|
+
* Create a TSDoc `@remarks` tag.
|
|
52
|
+
*/
|
|
53
|
+
declare function TSDocRemarks(props: ComponentProps): Children;
|
|
54
|
+
/**
|
|
55
|
+
* Create a TSDoc `@see` tag.
|
|
56
|
+
*/
|
|
57
|
+
declare function TSDocLink(props: ComponentProps): Children;
|
|
58
|
+
interface TSDocExampleProps extends JSDocExampleProps {
|
|
59
|
+
/**
|
|
60
|
+
* Whether the file is a TSX file.
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue false
|
|
63
|
+
*/
|
|
64
|
+
tsx?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Create a TSDoc `@example` tag.
|
|
68
|
+
*/
|
|
69
|
+
declare function TSDocExample(props: TSDocExampleProps): Children;
|
|
70
|
+
/**
|
|
71
|
+
* Create a TSDoc `@readonly` tag.
|
|
72
|
+
*/
|
|
73
|
+
declare function TSDocReadonly(): Children;
|
|
74
|
+
/**
|
|
75
|
+
* Create a TSDoc `@internal` tag.
|
|
76
|
+
*/
|
|
77
|
+
declare function TSDocInternal(): Children;
|
|
78
|
+
/**
|
|
79
|
+
* Create a TSDoc `@ignore` tag.
|
|
80
|
+
*/
|
|
81
|
+
declare function TSDocIgnore(): Children;
|
|
82
|
+
/**
|
|
83
|
+
* Create a TSDoc `@hidden` tag.
|
|
84
|
+
*/
|
|
85
|
+
declare function TSDocHidden(): Children;
|
|
86
|
+
interface TSDocAttributesTagsProps {
|
|
87
|
+
title?: string;
|
|
88
|
+
alias?: string[];
|
|
89
|
+
permission?: string[];
|
|
90
|
+
domain?: string;
|
|
91
|
+
readonly?: boolean;
|
|
92
|
+
internal?: boolean;
|
|
93
|
+
ignore?: boolean;
|
|
94
|
+
hidden?: boolean;
|
|
95
|
+
defaultValue?: any;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
99
|
+
*/
|
|
100
|
+
declare function TSDocAttributesTags(props: TSDocAttributesTagsProps): Children;
|
|
101
|
+
interface TSDocParamProps {
|
|
102
|
+
name: Children;
|
|
103
|
+
children?: Children;
|
|
104
|
+
optional?: boolean;
|
|
105
|
+
defaultValue?: Children;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Create a TSDoc parameter set off with `@param`.
|
|
109
|
+
*/
|
|
110
|
+
declare function TSDocParam(props: TSDocParamProps): Children;
|
|
111
|
+
/**
|
|
112
|
+
* Create a TSDoc `@returns` tag.
|
|
113
|
+
*/
|
|
114
|
+
declare function TSDocReturns(props: ComponentProps): Children;
|
|
115
|
+
/**
|
|
116
|
+
* Create a TSDoc `@throws` tag.
|
|
117
|
+
*/
|
|
118
|
+
declare function TSDocThrows(props: ComponentProps): Children;
|
|
119
|
+
interface TSDocModuleProps extends ComponentProps {
|
|
120
|
+
/**
|
|
121
|
+
* the prefix for the builtin module name
|
|
122
|
+
*
|
|
123
|
+
* @defaultValue "storm"
|
|
124
|
+
*/
|
|
125
|
+
prefix?: string;
|
|
126
|
+
/**
|
|
127
|
+
* The name of the module
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* import { MyModule } from "storm:my-module";
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
name: Children;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Generates a TSDoc `@module` tag for the given module name.
|
|
141
|
+
*/
|
|
142
|
+
declare function TSDocModule(props: TSDocModuleProps): Children;
|
|
143
|
+
declare type __ΩTSDocProps = any[];
|
|
144
|
+
declare type __ΩTSDocTagProps = any[];
|
|
145
|
+
declare type __ΩTSDocParamsProps = any[];
|
|
146
|
+
declare type __ΩTSDocDefaultValueProps = any[];
|
|
147
|
+
declare type __ΩTSDocExampleProps = any[];
|
|
148
|
+
declare type __ΩTSDocAttributesTagsProps = any[];
|
|
149
|
+
declare type __ΩTSDocParamProps = any[];
|
|
150
|
+
declare type __ΩTSDocModuleProps = any[];
|
|
151
|
+
//#endregion
|
|
152
|
+
export { __ΩTSDocDefaultValueProps as A, TSDocRemarks as C, TSDocThrows as D, TSDocTagProps as E, __ΩTSDocProps as F, __ΩTSDocTagProps as I, __ΩTSDocModuleProps as M, __ΩTSDocParamProps as N, TSDocTitle as O, __ΩTSDocParamsProps as P, TSDocReadonly as S, TSDocTag as T, TSDocParamProps as _, TSDocDefaultValue as a, TSDocPermission as b, TSDocExample as c, TSDocIgnore as d, TSDocInternal as f, TSDocParam as g, TSDocModuleProps as h, TSDocAttributesTagsProps as i, __ΩTSDocExampleProps as j, __ΩTSDocAttributesTagsProps as k, TSDocExampleProps as l, TSDocModule as m, TSDocAlias as n, TSDocDefaultValueProps as o, TSDocLink as p, TSDocAttributesTags as r, TSDocDomain as s, TSDoc as t, TSDocHidden as u, TSDocParams as v, TSDocReturns as w, TSDocProps as x, TSDocParamsProps as y };
|