@powerlines/plugin-alloy 0.18.45 → 0.18.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/core/components/output.cjs +2 -2
  2. package/dist/core/components/output.mjs +4 -4
  3. package/dist/core/contexts/context.cjs +1 -50
  4. package/dist/core/contexts/context.mjs +2 -46
  5. package/dist/index.cjs +2 -5
  6. package/dist/index.mjs +0 -3
  7. package/dist/powerlines/src/types/api.d.cts +3 -3
  8. package/dist/powerlines/src/types/api.d.mts +3 -3
  9. package/dist/powerlines/src/types/build.d.cts +10 -10
  10. package/dist/powerlines/src/types/build.d.mts +10 -10
  11. package/dist/powerlines/src/types/commands.d.cts +1 -1
  12. package/dist/powerlines/src/types/commands.d.mts +1 -1
  13. package/dist/powerlines/src/types/config.d.cts +5 -5
  14. package/dist/powerlines/src/types/config.d.mts +5 -5
  15. package/dist/powerlines/src/types/context.d.cts +5 -5
  16. package/dist/powerlines/src/types/context.d.mts +5 -5
  17. package/dist/powerlines/src/types/hooks.d.cts +1 -1
  18. package/dist/powerlines/src/types/hooks.d.mts +1 -1
  19. package/dist/powerlines/src/types/plugin.d.cts +5 -5
  20. package/dist/powerlines/src/types/plugin.d.mts +5 -5
  21. package/dist/powerlines/src/types/resolved.d.cts +1 -1
  22. package/dist/powerlines/src/types/resolved.d.mts +1 -1
  23. package/dist/powerlines/src/types/unplugin.d.cts +1 -1
  24. package/dist/powerlines/src/types/unplugin.d.mts +1 -1
  25. package/dist/types/plugin.d.cts +1 -9
  26. package/dist/types/plugin.d.mts +1 -9
  27. package/package.json +15 -15
  28. package/dist/core/components/index.cjs +0 -7
  29. package/dist/core/components/index.d.cts +0 -4
  30. package/dist/core/components/index.d.mts +0 -4
  31. package/dist/core/components/index.mjs +0 -5
  32. package/dist/core/components/output.d.cts +0 -23
  33. package/dist/core/components/output.d.mts +0 -23
  34. package/dist/core/components/single-line-comment.cjs +0 -22
  35. package/dist/core/components/single-line-comment.d.cts +0 -22
  36. package/dist/core/components/single-line-comment.d.mts +0 -22
  37. package/dist/core/components/single-line-comment.mjs +0 -21
  38. package/dist/core/components/source-file.cjs +0 -64
  39. package/dist/core/components/source-file.d.cts +0 -32
  40. package/dist/core/components/source-file.d.mts +0 -32
  41. package/dist/core/components/source-file.mjs +0 -62
  42. package/dist/core/contexts/context.d.cts +0 -71
  43. package/dist/core/contexts/context.d.mts +0 -71
  44. package/dist/core/contexts/index.cjs +0 -17
  45. package/dist/core/contexts/index.d.cts +0 -3
  46. package/dist/core/contexts/index.d.mts +0 -3
  47. package/dist/core/contexts/index.mjs +0 -4
  48. package/dist/core/contexts/reflection.cjs +0 -68
  49. package/dist/core/contexts/reflection.d.cts +0 -52
  50. package/dist/core/contexts/reflection.d.mts +0 -52
  51. package/dist/core/contexts/reflection.mjs +0 -60
  52. package/dist/core/index.cjs +0 -25
  53. package/dist/core/index.d.cts +0 -7
  54. package/dist/core/index.d.mts +0 -8
  55. package/dist/core/index.mjs +0 -9
  56. package/dist/helpers/capnp.cjs +0 -276
  57. package/dist/helpers/capnp.d.cts +0 -87
  58. package/dist/helpers/capnp.d.mts +0 -87
  59. package/dist/helpers/capnp.mjs +0 -259
  60. package/dist/helpers/create-builtin.cjs +0 -19
  61. package/dist/helpers/create-builtin.d.cts +0 -15
  62. package/dist/helpers/create-builtin.d.mts +0 -15
  63. package/dist/helpers/create-builtin.mjs +0 -18
  64. package/dist/helpers/index.cjs +0 -24
  65. package/dist/helpers/index.d.cts +0 -5
  66. package/dist/helpers/index.d.mts +0 -5
  67. package/dist/helpers/index.mjs +0 -6
  68. package/dist/helpers/refkey.cjs +0 -16
  69. package/dist/helpers/refkey.d.cts +0 -13
  70. package/dist/helpers/refkey.d.mts +0 -13
  71. package/dist/helpers/refkey.mjs +0 -15
  72. package/dist/helpers/typescript.cjs +0 -46
  73. package/dist/helpers/typescript.d.cts +0 -25
  74. package/dist/helpers/typescript.d.mts +0 -25
  75. package/dist/helpers/typescript.mjs +0 -45
  76. package/dist/markdown/components/index.cjs +0 -8
  77. package/dist/markdown/components/index.d.cts +0 -3
  78. package/dist/markdown/components/index.d.mts +0 -3
  79. package/dist/markdown/components/index.mjs +0 -4
  80. package/dist/markdown/components/markdown-file.cjs +0 -116
  81. package/dist/markdown/components/markdown-file.d.cts +0 -23
  82. package/dist/markdown/components/markdown-file.d.mts +0 -23
  83. package/dist/markdown/components/markdown-file.mjs +0 -114
  84. package/dist/markdown/components/markdown-table.cjs +0 -101
  85. package/dist/markdown/components/markdown-table.d.cts +0 -27
  86. package/dist/markdown/components/markdown-table.d.mts +0 -27
  87. package/dist/markdown/components/markdown-table.mjs +0 -98
  88. package/dist/markdown/contexts/index.cjs +0 -6
  89. package/dist/markdown/contexts/index.d.cts +0 -2
  90. package/dist/markdown/contexts/index.d.mts +0 -2
  91. package/dist/markdown/contexts/index.mjs +0 -3
  92. package/dist/markdown/contexts/markdown-table.cjs +0 -37
  93. package/dist/markdown/contexts/markdown-table.d.cts +0 -37
  94. package/dist/markdown/contexts/markdown-table.d.mts +0 -37
  95. package/dist/markdown/contexts/markdown-table.mjs +0 -33
  96. package/dist/markdown/index.cjs +0 -15
  97. package/dist/markdown/index.d.cts +0 -4
  98. package/dist/markdown/index.d.mts +0 -6
  99. package/dist/markdown/index.mjs +0 -7
  100. package/dist/types/components.cjs +0 -0
  101. package/dist/types/components.d.cts +0 -142
  102. package/dist/types/components.d.mts +0 -142
  103. package/dist/types/components.mjs +0 -1
  104. package/dist/types/index.cjs +0 -0
  105. package/dist/types/index.d.cts +0 -3
  106. package/dist/types/index.d.mts +0 -3
  107. package/dist/types/index.mjs +0 -1
  108. package/dist/types/plugin.cjs +0 -0
  109. package/dist/types/plugin.mjs +0 -1
  110. package/dist/typescript/components/builtin-file.cjs +0 -62
  111. package/dist/typescript/components/builtin-file.d.cts +0 -34
  112. package/dist/typescript/components/builtin-file.d.mts +0 -34
  113. package/dist/typescript/components/builtin-file.mjs +0 -61
  114. package/dist/typescript/components/dynamic-import-statement.cjs +0 -25
  115. package/dist/typescript/components/dynamic-import-statement.d.cts +0 -32
  116. package/dist/typescript/components/dynamic-import-statement.d.mts +0 -32
  117. package/dist/typescript/components/dynamic-import-statement.mjs +0 -24
  118. package/dist/typescript/components/entry-file.cjs +0 -41
  119. package/dist/typescript/components/entry-file.d.cts +0 -27
  120. package/dist/typescript/components/entry-file.d.mts +0 -27
  121. package/dist/typescript/components/entry-file.mjs +0 -39
  122. package/dist/typescript/components/index.cjs +0 -44
  123. package/dist/typescript/components/index.d.cts +0 -10
  124. package/dist/typescript/components/index.d.mts +0 -10
  125. package/dist/typescript/components/index.mjs +0 -11
  126. package/dist/typescript/components/record-expression.cjs +0 -12
  127. package/dist/typescript/components/record-expression.d.cts +0 -12
  128. package/dist/typescript/components/record-expression.d.mts +0 -12
  129. package/dist/typescript/components/record-expression.mjs +0 -11
  130. package/dist/typescript/components/tsdoc-reflection.cjs +0 -177
  131. package/dist/typescript/components/tsdoc-reflection.d.cts +0 -18
  132. package/dist/typescript/components/tsdoc-reflection.d.mts +0 -18
  133. package/dist/typescript/components/tsdoc-reflection.mjs +0 -174
  134. package/dist/typescript/components/tsdoc.cjs +0 -481
  135. package/dist/typescript/components/tsdoc.d.cts +0 -163
  136. package/dist/typescript/components/tsdoc.d.mts +0 -163
  137. package/dist/typescript/components/tsdoc.mjs +0 -461
  138. package/dist/typescript/components/typescript-file.cjs +0 -216
  139. package/dist/typescript/components/typescript-file.d.cts +0 -49
  140. package/dist/typescript/components/typescript-file.d.mts +0 -49
  141. package/dist/typescript/components/typescript-file.mjs +0 -213
  142. package/dist/typescript/components/typescript-interface.cjs +0 -69
  143. package/dist/typescript/components/typescript-interface.d.cts +0 -25
  144. package/dist/typescript/components/typescript-interface.d.mts +0 -25
  145. package/dist/typescript/components/typescript-interface.mjs +0 -67
  146. package/dist/typescript/components/typescript-object.cjs +0 -125
  147. package/dist/typescript/components/typescript-object.d.cts +0 -26
  148. package/dist/typescript/components/typescript-object.d.mts +0 -26
  149. package/dist/typescript/components/typescript-object.mjs +0 -123
  150. package/dist/typescript/index.cjs +0 -45
  151. package/dist/typescript/index.d.cts +0 -11
  152. package/dist/typescript/index.d.mts +0 -11
  153. package/dist/typescript/index.mjs +0 -12
@@ -1,68 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- let __alloy_js_core = require("@alloy-js/core");
3
-
4
- //#region src/core/contexts/reflection.ts
5
- /**
6
- * The reflection class context used in template rendering.
7
- */
8
- const ReflectionClassContext = (0, __alloy_js_core.createContext)();
9
- /**
10
- * Hook to access the Reflection context.
11
- *
12
- * @returns A reactive version of the current reflection.
13
- */
14
- function useReflectionClass() {
15
- const context = (0, __alloy_js_core.useContext)(ReflectionClassContext);
16
- if (!context) throw new Error("Powerlines - ReflectionClass Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
17
- return context;
18
- }
19
- /**
20
- * The reflection property context used in template rendering.
21
- */
22
- const ReflectionPropertyContext = (0, __alloy_js_core.createNamedContext)("reflection-property");
23
- /**
24
- * Hook to access the Reflection Property context.
25
- *
26
- * @returns A reactive version of the current reflection.
27
- */
28
- function useReflectionProperty() {
29
- const context = (0, __alloy_js_core.useContext)(ReflectionPropertyContext);
30
- if (!context) throw new Error("Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
31
- return context;
32
- }
33
- /**
34
- * The reflection method context used in template rendering.
35
- */
36
- const ReflectionMethodContext = (0, __alloy_js_core.createNamedContext)("reflection-method");
37
- /**
38
- * Hook to access the Reflection Method context.
39
- *
40
- * @returns A reactive version of the current reflection.
41
- */
42
- function useReflectionMethod() {
43
- const context = (0, __alloy_js_core.useContext)(ReflectionMethodContext);
44
- if (!context) throw new Error("Powerlines - Reflection Method Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
45
- return context;
46
- }
47
- /**
48
- * The reflection parameter context used in template rendering.
49
- */
50
- const ReflectionParameterContext = (0, __alloy_js_core.createNamedContext)("reflection-parameter");
51
- /**
52
- * Hook to access the Reflection Parameter context.
53
- *
54
- * @returns A reactive version of the current reflection.
55
- */
56
- function useReflectionParameter() {
57
- return (0, __alloy_js_core.useContext)(ReflectionParameterContext);
58
- }
59
-
60
- //#endregion
61
- exports.ReflectionClassContext = ReflectionClassContext;
62
- exports.ReflectionMethodContext = ReflectionMethodContext;
63
- exports.ReflectionParameterContext = ReflectionParameterContext;
64
- exports.ReflectionPropertyContext = ReflectionPropertyContext;
65
- exports.useReflectionClass = useReflectionClass;
66
- exports.useReflectionMethod = useReflectionMethod;
67
- exports.useReflectionParameter = useReflectionParameter;
68
- exports.useReflectionProperty = useReflectionProperty;
@@ -1,52 +0,0 @@
1
- import { ReflectionOverrideInterface } from "../../types/components.cjs";
2
- import { ComponentContext } from "@alloy-js/core";
3
- import { ReflectionClass, ReflectionMethod, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
-
5
- //#region src/core/contexts/reflection.d.ts
6
- interface ReflectionClassContextInterface<T extends Record<string, any> = Record<string, any>> {
7
- reflection: ReflectionClass<T>;
8
- override?: ReflectionOverrideInterface<T>;
9
- }
10
- /**
11
- * The reflection class context used in template rendering.
12
- */
13
- declare const ReflectionClassContext: ComponentContext<ReflectionClassContextInterface<any>>;
14
- /**
15
- * Hook to access the Reflection context.
16
- *
17
- * @returns A reactive version of the current reflection.
18
- */
19
- declare function useReflectionClass<T extends Record<string, any> = Record<string, any>>(): ReflectionClassContextInterface<T>;
20
- /**
21
- * The reflection property context used in template rendering.
22
- */
23
- declare const ReflectionPropertyContext: ComponentContext<ReflectionProperty>;
24
- /**
25
- * Hook to access the Reflection Property context.
26
- *
27
- * @returns A reactive version of the current reflection.
28
- */
29
- declare function useReflectionProperty(): ReflectionProperty;
30
- /**
31
- * The reflection method context used in template rendering.
32
- */
33
- declare const ReflectionMethodContext: ComponentContext<ReflectionMethod>;
34
- /**
35
- * Hook to access the Reflection Method context.
36
- *
37
- * @returns A reactive version of the current reflection.
38
- */
39
- declare function useReflectionMethod(): ReflectionMethod;
40
- /**
41
- * The reflection parameter context used in template rendering.
42
- */
43
- declare const ReflectionParameterContext: ComponentContext<ReflectionParameter>;
44
- /**
45
- * Hook to access the Reflection Parameter context.
46
- *
47
- * @returns A reactive version of the current reflection.
48
- */
49
- declare function useReflectionParameter(): ReflectionParameter;
50
- declare type __ΩReflectionClassContextInterface = any[];
51
- //#endregion
52
- export { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,52 +0,0 @@
1
- import { ReflectionOverrideInterface } from "../../types/components.mjs";
2
- import { ComponentContext } from "@alloy-js/core";
3
- import { ReflectionClass, ReflectionMethod, ReflectionParameter, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
-
5
- //#region src/core/contexts/reflection.d.ts
6
- interface ReflectionClassContextInterface<T extends Record<string, any> = Record<string, any>> {
7
- reflection: ReflectionClass<T>;
8
- override?: ReflectionOverrideInterface<T>;
9
- }
10
- /**
11
- * The reflection class context used in template rendering.
12
- */
13
- declare const ReflectionClassContext: ComponentContext<ReflectionClassContextInterface<any>>;
14
- /**
15
- * Hook to access the Reflection context.
16
- *
17
- * @returns A reactive version of the current reflection.
18
- */
19
- declare function useReflectionClass<T extends Record<string, any> = Record<string, any>>(): ReflectionClassContextInterface<T>;
20
- /**
21
- * The reflection property context used in template rendering.
22
- */
23
- declare const ReflectionPropertyContext: ComponentContext<ReflectionProperty>;
24
- /**
25
- * Hook to access the Reflection Property context.
26
- *
27
- * @returns A reactive version of the current reflection.
28
- */
29
- declare function useReflectionProperty(): ReflectionProperty;
30
- /**
31
- * The reflection method context used in template rendering.
32
- */
33
- declare const ReflectionMethodContext: ComponentContext<ReflectionMethod>;
34
- /**
35
- * Hook to access the Reflection Method context.
36
- *
37
- * @returns A reactive version of the current reflection.
38
- */
39
- declare function useReflectionMethod(): ReflectionMethod;
40
- /**
41
- * The reflection parameter context used in template rendering.
42
- */
43
- declare const ReflectionParameterContext: ComponentContext<ReflectionParameter>;
44
- /**
45
- * Hook to access the Reflection Parameter context.
46
- *
47
- * @returns A reactive version of the current reflection.
48
- */
49
- declare function useReflectionParameter(): ReflectionParameter;
50
- declare type __ΩReflectionClassContextInterface = any[];
51
- //#endregion
52
- export { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,60 +0,0 @@
1
- import { createContext, createNamedContext, useContext } from "@alloy-js/core";
2
-
3
- //#region src/core/contexts/reflection.ts
4
- /**
5
- * The reflection class context used in template rendering.
6
- */
7
- const ReflectionClassContext = createContext();
8
- /**
9
- * Hook to access the Reflection context.
10
- *
11
- * @returns A reactive version of the current reflection.
12
- */
13
- function useReflectionClass() {
14
- const context = useContext(ReflectionClassContext);
15
- if (!context) throw new Error("Powerlines - ReflectionClass Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
16
- return context;
17
- }
18
- /**
19
- * The reflection property context used in template rendering.
20
- */
21
- const ReflectionPropertyContext = createNamedContext("reflection-property");
22
- /**
23
- * Hook to access the Reflection Property context.
24
- *
25
- * @returns A reactive version of the current reflection.
26
- */
27
- function useReflectionProperty() {
28
- const context = useContext(ReflectionPropertyContext);
29
- if (!context) throw new Error("Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
30
- return context;
31
- }
32
- /**
33
- * The reflection method context used in template rendering.
34
- */
35
- const ReflectionMethodContext = createNamedContext("reflection-method");
36
- /**
37
- * Hook to access the Reflection Method context.
38
- *
39
- * @returns A reactive version of the current reflection.
40
- */
41
- function useReflectionMethod() {
42
- const context = useContext(ReflectionMethodContext);
43
- if (!context) throw new Error("Powerlines - Reflection Method Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
44
- return context;
45
- }
46
- /**
47
- * The reflection parameter context used in template rendering.
48
- */
49
- const ReflectionParameterContext = createNamedContext("reflection-parameter");
50
- /**
51
- * Hook to access the Reflection Parameter context.
52
- *
53
- * @returns A reactive version of the current reflection.
54
- */
55
- function useReflectionParameter() {
56
- return useContext(ReflectionParameterContext);
57
- }
58
-
59
- //#endregion
60
- export { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,25 +0,0 @@
1
- const require_core_contexts_context = require('./contexts/context.cjs');
2
- const require_core_components_output = require('./components/output.cjs');
3
- const require_core_components_single_line_comment = require('./components/single-line-comment.cjs');
4
- const require_core_contexts_reflection = require('./contexts/reflection.cjs');
5
- require('./contexts/index.cjs');
6
- const require_core_components_source_file = require('./components/source-file.cjs');
7
- require('./components/index.cjs');
8
-
9
- exports.Output = require_core_components_output.Output;
10
- exports.PowerlinesContext = require_core_contexts_context.PowerlinesContext;
11
- exports.ReflectionClassContext = require_core_contexts_reflection.ReflectionClassContext;
12
- exports.ReflectionMethodContext = require_core_contexts_reflection.ReflectionMethodContext;
13
- exports.ReflectionParameterContext = require_core_contexts_reflection.ReflectionParameterContext;
14
- exports.ReflectionPropertyContext = require_core_contexts_reflection.ReflectionPropertyContext;
15
- exports.SingleLineComment = require_core_components_single_line_comment.SingleLineComment;
16
- exports.SourceFile = require_core_components_source_file.SourceFile;
17
- exports.useMeta = require_core_contexts_context.useMeta;
18
- exports.useMetaSafe = require_core_contexts_context.useMetaSafe;
19
- exports.usePowerlines = require_core_contexts_context.usePowerlines;
20
- exports.usePowerlinesContext = require_core_contexts_context.usePowerlinesContext;
21
- exports.usePowerlinesSafe = require_core_contexts_context.usePowerlinesSafe;
22
- exports.useReflectionClass = require_core_contexts_reflection.useReflectionClass;
23
- exports.useReflectionMethod = require_core_contexts_reflection.useReflectionMethod;
24
- exports.useReflectionParameter = require_core_contexts_reflection.useReflectionParameter;
25
- exports.useReflectionProperty = require_core_contexts_reflection.useReflectionProperty;
@@ -1,7 +0,0 @@
1
- import { MetaItem, PowerlinesContext, PowerlinesContextInterface, __ΩMetaItem, __ΩPowerlinesContextInterface, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./contexts/context.cjs";
2
- import { Output, OutputProps, __ΩOutputProps } from "./components/output.cjs";
3
- import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./components/single-line-comment.cjs";
4
- import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./components/source-file.cjs";
5
- import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./contexts/reflection.cjs";
6
- import "./contexts/index.cjs";
7
- export { MetaItem, Output, OutputProps, PowerlinesContext, PowerlinesContextInterface, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, __ΩMetaItem, __ΩOutputProps, __ΩPowerlinesContextInterface, __ΩReflectionClassContextInterface, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,8 +0,0 @@
1
- import { MetaItem, PowerlinesContext, PowerlinesContextInterface, __ΩMetaItem, __ΩPowerlinesContextInterface, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./contexts/context.mjs";
2
- import { Output, OutputProps, __ΩOutputProps } from "./components/output.mjs";
3
- import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./components/single-line-comment.mjs";
4
- import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./components/source-file.mjs";
5
- import "./components/index.mjs";
6
- import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./contexts/reflection.mjs";
7
- import "./contexts/index.mjs";
8
- export { MetaItem, Output, OutputProps, PowerlinesContext, PowerlinesContextInterface, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, __ΩMetaItem, __ΩOutputProps, __ΩPowerlinesContextInterface, __ΩReflectionClassContextInterface, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,9 +0,0 @@
1
- import { PowerlinesContext, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./contexts/context.mjs";
2
- import { Output } from "./components/output.mjs";
3
- import { SingleLineComment } from "./components/single-line-comment.mjs";
4
- import { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./contexts/reflection.mjs";
5
- import "./contexts/index.mjs";
6
- import { SourceFile } from "./components/source-file.mjs";
7
- import "./components/index.mjs";
8
-
9
- export { Output, PowerlinesContext, ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SourceFile, useMeta, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,276 +0,0 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- let defu = require("defu");
3
- defu = require_rolldown_runtime.__toESM(defu);
4
- let __powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
5
- let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
6
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
7
- let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
8
- let __powerlines_deepkit_vendor_core = require("@powerlines/deepkit/vendor/core");
9
- let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
10
- let __stryke_capnp_compile = require("@stryke/capnp/compile");
11
- let __stryke_capnp_helpers = require("@stryke/capnp/helpers");
12
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
13
- let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
14
- let __stryke_json = require("@stryke/json");
15
- let __stryke_path_join = require("@stryke/path/join");
16
- let __stryke_string_format_get_words = require("@stryke/string-format/get-words");
17
- let __stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
18
- let __stryke_type_checks_is_bigint = require("@stryke/type-checks/is-bigint");
19
- let __stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
20
- let __stryke_type_checks_is_number = require("@stryke/type-checks/is-number");
21
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
22
- let node_buffer = require("node:buffer");
23
- let node_child_process = require("node:child_process");
24
- let node_util = require("node:util");
25
- let powerlines_lib_utilities_file_header = require("powerlines/lib/utilities/file-header");
26
-
27
- //#region src/helpers/capnp.ts
28
- /**
29
- * Compiles a Cap'n Proto schema into TypeScript definitions.
30
- *
31
- * @param context - The context containing the project and workspace information.
32
- * @param options - The options for compiling the schema.
33
- * @returns A promise that resolves to the compiled schema.
34
- */
35
- async function compile(context, options = {}) {
36
- const opts = (0, defu.default)(options, {
37
- ts: true,
38
- js: false,
39
- dts: false,
40
- schemas: (0, __stryke_path_join.joinPaths)(context.artifactsPath, "schemas"),
41
- tsconfig: context.tsconfig,
42
- projectRoot: context.config.projectRoot,
43
- workspaceRoot: context.workspaceConfig.workspaceRoot,
44
- tty: true
45
- });
46
- const resolvedOptions = await (0, __stryke_capnp_helpers.resolveOptions)(opts);
47
- if (!resolvedOptions) throw new Error(`✖ No Cap'n Proto schema files found in the specified source paths: ${(0, __stryke_convert_to_array.toArray)(opts.schemas).join(", ")}.`);
48
- return (0, __stryke_capnp_compile.capnpc)(resolvedOptions);
49
- }
50
- /**
51
- * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.
52
- *
53
- * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.
54
- * @param value - The value to stringify.
55
- * @returns A string representation of the value.
56
- */
57
- function stringifyCapnpDefaultValue(property, value) {
58
- return stringifyCapnpValue(property.type, value ?? property.getDefaultValue());
59
- }
60
- /**
61
- * Converts any {@link Type}'s actual value to string representation.
62
- *
63
- * @param type - The {@link Type} of the value to stringify.
64
- * @param value - The value to stringify.
65
- * @returns A string representation of the value.
66
- */
67
- function stringifyCapnpValue(type, value) {
68
- return type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && (0, __stryke_type_checks_is_string.isString)(type.literal) ? `"${String(value)}"` : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.enum ? `${(0, __stryke_string_format_camel_case.camelCase)(String(value))}` : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array ? __stryke_json.StormJSON.stringify(value) : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.object || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral ? __stryke_json.StormJSON.stringify(value).replaceAll("{", "(").replaceAll("}", ")") : String(value);
69
- }
70
- /**
71
- * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.
72
- *
73
- * @param type - The TypeEnum to evaluate.
74
- * @returns A string representation of the property.
75
- */
76
- function getCapnpEnumTypes(type) {
77
- if (type.kind !== __powerlines_deepkit_vendor_type.ReflectionKind.enum) return null;
78
- const unique = (0, __stryke_helpers_get_unique.getUniqueBy)(type.values.filter((value) => !(0, __stryke_type_checks_is_undefined.isUndefined)(value) && !(0, __stryke_type_checks_is_null.isNull)(value)), (enumMember) => (0, __stryke_type_checks_is_string.isString)(enumMember) ? "Text" : "Float32");
79
- if (unique.length === 0) return null;
80
- return unique[0] && (0, __stryke_type_checks_is_string.isString)(unique[0]) ? "Text" : "Float32";
81
- }
82
- /**
83
- * Determines if a Type is a `Void` type in a Cap'n Proto schema.
84
- *
85
- * @param type - The Type to check.
86
- * @returns True if the Type is a `Void` type, false otherwise.
87
- */
88
- function isVoidType(type) {
89
- return type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.void || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.never || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.null || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.undefined || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.symbol;
90
- }
91
- /**
92
- * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
93
- *
94
- * @param type - The {@link TypeUnion} to convert.
95
- * @returns A string representation of the Cap'n Proto primitive type.
96
- */
97
- function getCapnpUnionTypes(type) {
98
- return (0, __powerlines_deepkit_utilities.getUnionTypes)(type);
99
- }
100
- /**
101
- * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.
102
- *
103
- * @param type - The {@link TypeUnion} to convert.
104
- * @returns An array of Cap'n Proto primitive types.
105
- */
106
- function isCapnpStringUnion(type) {
107
- return getCapnpUnionTypes(type).some((member) => member.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string);
108
- }
109
- const LARGE_BUFFER = 1024 * 1e6;
110
- const execAsync = (0, node_util.promisify)(node_child_process.exec);
111
- async function generateCapnpId() {
112
- const { stdout } = await execAsync("capnp id", {
113
- windowsHide: true,
114
- maxBuffer: LARGE_BUFFER,
115
- killSignal: "SIGTERM"
116
- });
117
- return stdout;
118
- }
119
- async function generateCapnp(context, reflection, options) {
120
- return `${(await generateCapnpId()).trim()};
121
- ${(0, powerlines_lib_utilities_file_header.getBaseFileHeader)(context).replace(/^\r*\n*/g, "").replaceAll("//", "#")}
122
- ${reflection.getMethods().length === 0 ? generateCapnpStruct(reflection, options) : generateCapnpInterface(reflection, options)}
123
- `.trim();
124
- }
125
- function generateCapnpStruct(reflection, options = {}) {
126
- const structName = options?.name || reflection.getTitle() || reflection.getClassName() || reflection.getName();
127
- return `${generateCapnpEnums(reflection)}struct ${(0, __stryke_string_format_pascal_case.pascalCase)(structName)} {
128
- # Struct definition for ${(0, __stryke_string_format_title_case.titleCase)(structName)}.
129
-
130
- ${generateCapnpSchema(reflection, options)}
131
- }
132
- `;
133
- }
134
- function generateCapnpInterface(reflection, options = {}) {
135
- const interfaceName = options?.name || reflection.getTitle() || reflection.getClassName() || reflection.getName();
136
- return `${generateCapnpEnums(reflection)}interface ${(0, __stryke_string_format_pascal_case.pascalCase)(interfaceName)} {
137
- # Interface definition for ${(0, __stryke_string_format_title_case.titleCase)(interfaceName)}.
138
-
139
- ${generateCapnpSchema(reflection, options)}
140
- }
141
- `;
142
- }
143
- function formatEnumName(name) {
144
- return (0, __stryke_string_format_pascal_case.pascalCase)(`${name}_Type`);
145
- }
146
- function generateCapnpEnums(reflection) {
147
- const enums = reflection.getProperties().filter((prop) => !prop.isIgnored() && (prop.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.enum || prop.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.union && getCapnpUnionTypes(prop.type).filter((type) => type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && ((0, __stryke_type_checks_is_string.isString)(type.literal) || (0, __stryke_type_checks_is_number.isNumber)(type.literal))).length === 1)).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? b.getNameAsString().localeCompare(a.getNameAsString()) : a.isReadonly() ? 1 : -1);
148
- if (enums.length === 0) return "";
149
- return `${enums.map((enumeration) => generateCapnpEnumSchema(enumeration.type, formatEnumName(enumeration.getNameAsString()))).join("\n\n")}
150
-
151
- `;
152
- }
153
- function generateCapnpSchema(reflection, options = {}) {
154
- let index = 0;
155
- const indexCounter = options?.indexCounter ?? (() => index++);
156
- return `${reflection.getProperties().filter((prop) => !prop.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? b.getNameAsString().localeCompare(a.getNameAsString()) : a.isReadonly() ? 1 : -1).map((prop) => generateCapnpPropertySchema(prop, indexCounter)).join(" \n\n ")}${reflection.getMethods().filter((methods) => !methods.isIgnored()).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? String(b.getName()).localeCompare(String(a.getName())) : a.isReadonly() ? 1 : -1).map((methods) => generateCapnpMethodSchema(methods, indexCounter)).join(" \n\n ")}${reflection.getProperties().some((prop) => prop.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.class && prop.type.classType === Map) ? `
157
- struct Map(Key, Value) {
158
- entries @0 :List(Entry);
159
-
160
- struct Entry {
161
- key @0 :Key;
162
- value @1 :Value;
163
- }
164
- }` : ""}${reflection.getProperties().some((prop) => prop.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.class && prop.type.classType === Date) ? `
165
- struct Date {
166
- # A standard Gregorian calendar date.
167
-
168
- year @0 :Int16;
169
- # The year - Must include the century.
170
- # Negative value indicates BC.
171
-
172
- month @1 :UInt8; # The month, 1-12
173
-
174
- day @2 :UInt8; # The day of the month, 1-30
175
-
176
- hour @3 :UInt8; # The hour of the day, 0-23
177
-
178
- minute @4 :UInt8; # The minute of the hour, 0-59
179
-
180
- second @5 :UInt8; # The second of the minute, 0-59
181
-
182
- millisecond @6 :UInt16; # Milliseconds of the second, 0-999
183
- }` : ""}`;
184
- }
185
- function generateCapnpMethodSchema(reflection, indexCounter) {
186
- const methodName = reflection.getTitle() || typeof reflection.getName() === "string" ? String(reflection.getName()) : "";
187
- if (!methodName) throw new Error(`Cannot generate Cap'n Proto schema for method without a name - Parent interface: ${reflection.reflectionClass.getName()}`);
188
- return `${(0, __stryke_string_format_camel_case.camelCase)(methodName)} @${indexCounter()} (${reflection.getParameters().map((param) => {
189
- return `${(0, __stryke_string_format_camel_case.camelCase)(param.getName())} :${generateCapnpPrimitive(param.getType())}${param.hasDefault() ? ` = ${stringifyCapnpDefaultValue(param)}` : ""}`;
190
- }).join(", ")})${isVoidType(reflection.getReturnType()) ? "" : ` -> (${(0, __powerlines_deepkit_utilities.kindToName)(reflection.getReturnType().kind)}: ${generateCapnpPrimitive(reflection.getReturnType())})`}; # ${(reflection.getDescription() || `The ${(0, __stryke_string_format_title_case.titleCase)(reflection.reflectionClass.getTitle() || reflection.reflectionClass.getName())} interface ${(0, __stryke_string_format_title_case.titleCase)(methodName)} method.`).replaceAll("\n", ". ")}`;
191
- }
192
- function generateCapnpPropertyComment(reflection) {
193
- const result = (0, __stryke_string_format_get_words.getWords)(reflection.getDescription() || `A schema property for ${(0, __stryke_string_format_title_case.titleCase)(reflection.getTitle() || reflection.getNameAsString())} field.`, { relaxed: true }).reduce((ret, word) => {
194
- let length = ret.length;
195
- if (ret.includes("\n")) length = ret.substring(ret.lastIndexOf("\n") + 1).length;
196
- const current = word.trim();
197
- if (length + current.length > 60) ret += `\n\t# ${current}`;
198
- else ret += ` ${current}`;
199
- return ret;
200
- }, "").trim();
201
- if (result.length > 0) return `\t# ${result}`;
202
- return "";
203
- }
204
- function generateCapnpPropertySchema(reflection, indexCounter) {
205
- if (reflection.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.union) if (getCapnpUnionTypes(reflection.type).length === 0) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :Void;
206
- ${generateCapnpPropertyComment(reflection)}`;
207
- else if (getCapnpUnionTypes(reflection.type).filter((type) => type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && ((0, __stryke_type_checks_is_string.isString)(type.literal) || (0, __stryke_type_checks_is_number.isNumber)(type.literal))).length === 1) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :${formatEnumName(reflection.getNameAsString())}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
208
- ${generateCapnpPropertyComment(reflection)}`;
209
- else return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} :union {
210
- ${getCapnpUnionTypes(reflection.type).map((type) => ` ${(0, __powerlines_deepkit_utilities.kindToName)(type.kind)} @${indexCounter()} :${generateCapnpPrimitive(type)};`).join("\n")}
211
- }
212
- ${generateCapnpPropertyComment(reflection)}`;
213
- else if (reflection.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.array) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :List(${generateCapnpPrimitive(reflection.getSubType())})${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
214
- ${generateCapnpPropertyComment(reflection)}`;
215
- else if (reflection.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.class) if (reflection.type.classType === Map) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :Map(${!reflection.type.typeArguments || reflection.type.typeArguments.length === 0 || !reflection.type.typeArguments[0] ? "Data" : generateCapnpPrimitive(reflection.type.typeArguments[0])}, ${!reflection.type.typeArguments || reflection.type.typeArguments.length < 2 || !reflection.type.typeArguments[1] ? "Data" : generateCapnpPrimitive(reflection.type.typeArguments[1])})${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
216
- ${generateCapnpPropertyComment(reflection)}`;
217
- else if (reflection.type.classType === Date) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :Data${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
218
- ${generateCapnpPropertyComment(reflection)}`;
219
- else if (reflection.type.classType === node_buffer.Buffer) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :Data${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
220
- ${generateCapnpPropertyComment(reflection)}`;
221
- else if (reflection.type.classType === ArrayBuffer) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :Data${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
222
- ${generateCapnpPropertyComment(reflection)}`;
223
- else return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :${(0, __stryke_string_format_pascal_case.pascalCase)(reflection.type.typeName || (0, __powerlines_deepkit_vendor_core.getClassName)(reflection.type.classType))}${generateCapnpStruct(reflection.reflectionClass, { name: (0, __stryke_string_format_pascal_case.pascalCase)(reflection.type.typeName || (0, __powerlines_deepkit_vendor_core.getClassName)(reflection.type.classType)) })}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
224
- ${generateCapnpPropertyComment(reflection)}`;
225
- else if (reflection.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :${(0, __stryke_string_format_pascal_case.pascalCase)(reflection.type.typeName || (0, __powerlines_deepkit_vendor_type.memberNameToString)(reflection.getNameAsString()))}${generateCapnpStruct(reflection.reflectionClass, { name: (0, __stryke_string_format_pascal_case.pascalCase)(reflection.type.typeName || (0, __powerlines_deepkit_vendor_type.memberNameToString)(reflection.getNameAsString())) })}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
226
- ${generateCapnpPropertyComment(reflection)}`;
227
- else if (reflection.type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.enum) return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :${(0, __stryke_string_format_pascal_case.pascalCase)(reflection.getNameAsString())}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
228
- ${generateCapnpPropertyComment(reflection)}`;
229
- return `${(0, __stryke_string_format_camel_case.camelCase)(reflection.getNameAsString())} @${indexCounter()} :${generateCapnpPrimitive(reflection.getType())}${reflection.hasDefault() ? ` = ${stringifyCapnpDefaultValue(reflection)}` : ""};
230
- ${generateCapnpPropertyComment(reflection)}`;
231
- }
232
- function generateCapnpEnumSchema(type, name) {
233
- if (type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.union) return generateCapnpEnumSchema({
234
- kind: __powerlines_deepkit_vendor_type.ReflectionKind.enum,
235
- indexType: type,
236
- enum: type.types.reduce((ret, type$1) => {
237
- if ((0, __stryke_type_checks_is_string.isString)(type$1.literal) || (0, __stryke_type_checks_is_number.isNumber)(type$1.literal)) ret[(0, __stryke_string_format_camel_case.camelCase)(String(type$1.literal))] = type$1.literal;
238
- return ret;
239
- }, {}),
240
- values: getCapnpUnionTypes(type).filter((type$1) => type$1.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal && ((0, __stryke_type_checks_is_string.isString)(type$1.literal) || (0, __stryke_type_checks_is_number.isNumber)(type$1.literal))).map((type$1) => type$1.literal)
241
- }, name);
242
- let index = 0;
243
- const indexCounter = () => index++;
244
- const enumType = getCapnpEnumTypes(type);
245
- if (!enumType) return "";
246
- return `enum ${(0, __stryke_string_format_pascal_case.pascalCase)(name)} {
247
- ${type.enum && Object.entries(type.enum).length > 0 ? Object.entries(type.enum).filter(([, value]) => value !== null && value !== void 0).map(([key]) => ` ${(0, __stryke_string_format_camel_case.camelCase)(key)} @${indexCounter()};`).join("\n") : type.values.filter((value) => value !== null && value !== void 0).map((value) => `${enumType === "Text" && value ? (0, __stryke_string_format_camel_case.camelCase)(String(value)) : `${type.typeName ? `${(0, __stryke_string_format_camel_case.camelCase)(type.typeName)}_` : ""}${value || ""}`} @${indexCounter()};`).join("\n")}
248
- }`;
249
- }
250
- /**
251
- * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.
252
- *
253
- * @param type - The Deepkit Type to convert.
254
- * @returns A string representation of the Cap'n Proto primitive type.
255
- */
256
- function generateCapnpPrimitive(type) {
257
- return type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.never || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.void || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.null || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.undefined || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.symbol ? "Void" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.class && type.classType === Date ? "Date" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.class && type.classType === Set ? `List(${type.typeArguments && type.typeArguments[0] ? generateCapnpPrimitive(type.typeArguments[0]) : "Data"})` : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.bigint ? "UInt64" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.number ? "Float64" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.string || type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.regexp ? "Text" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.boolean ? "Bool" : type.kind === __powerlines_deepkit_vendor_type.ReflectionKind.literal ? (0, __stryke_type_checks_is_number.isNumber)(type.literal) ? "Float64" : (0, __stryke_type_checks_is_bigint.isBigInt)(type.literal) ? "UInt64" : (0, __stryke_type_checks_is_string.isString)(type.literal) ? "Text" : typeof type.literal === "boolean" ? "Bool" : "Data" : "Data";
258
- }
259
-
260
- //#endregion
261
- exports.LARGE_BUFFER = LARGE_BUFFER;
262
- exports.compile = compile;
263
- exports.generateCapnp = generateCapnp;
264
- exports.generateCapnpEnumSchema = generateCapnpEnumSchema;
265
- exports.generateCapnpId = generateCapnpId;
266
- exports.generateCapnpInterface = generateCapnpInterface;
267
- exports.generateCapnpMethodSchema = generateCapnpMethodSchema;
268
- exports.generateCapnpPrimitive = generateCapnpPrimitive;
269
- exports.generateCapnpSchema = generateCapnpSchema;
270
- exports.generateCapnpStruct = generateCapnpStruct;
271
- exports.getCapnpEnumTypes = getCapnpEnumTypes;
272
- exports.getCapnpUnionTypes = getCapnpUnionTypes;
273
- exports.isCapnpStringUnion = isCapnpStringUnion;
274
- exports.isVoidType = isVoidType;
275
- exports.stringifyCapnpDefaultValue = stringifyCapnpDefaultValue;
276
- exports.stringifyCapnpValue = stringifyCapnpValue;