@powerlines/plugin-alloy 0.20.15 → 0.21.1

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 (92) hide show
  1. package/dist/core/components/output.d.cts +2 -2
  2. package/dist/core/components/output.d.cts.map +1 -1
  3. package/dist/core/components/single-line-comment.d.cts +2 -2
  4. package/dist/core/components/source-file.d.cts +2 -2
  5. package/dist/core/components/source-file.d.cts.map +1 -1
  6. package/dist/core/contexts/reflection.d.cts.map +1 -1
  7. package/dist/markdown/components/front-matter.d.cts +2 -2
  8. package/dist/markdown/components/front-matter.d.mts +2 -2
  9. package/dist/markdown/components/markdown-file.d.cts +3 -3
  10. package/dist/markdown/components/markdown-file.d.cts.map +1 -1
  11. package/dist/markdown/components/markdown-table.d.cts +4 -4
  12. package/dist/markdown/components/markdown-table.d.cts.map +1 -1
  13. package/dist/typescript/components/builtin-file.d.mts +2 -2
  14. package/dist/typescript/components/class-declaration.cjs +196 -0
  15. package/dist/typescript/components/class-declaration.d.cts +89 -0
  16. package/dist/typescript/components/class-declaration.d.cts.map +1 -0
  17. package/dist/typescript/components/class-declaration.d.mts +89 -0
  18. package/dist/typescript/components/class-declaration.d.mts.map +1 -0
  19. package/dist/typescript/components/class-declaration.mjs +193 -0
  20. package/dist/typescript/components/class-declaration.mjs.map +1 -0
  21. package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
  22. package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -1
  23. package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
  24. package/dist/typescript/components/entry-file.d.cts +2 -2
  25. package/dist/typescript/components/entry-file.d.cts.map +1 -1
  26. package/dist/typescript/components/entry-file.d.mts +2 -2
  27. package/dist/typescript/components/index.cjs +10 -1
  28. package/dist/typescript/components/index.d.cts +4 -1
  29. package/dist/typescript/components/index.d.mts +4 -1
  30. package/dist/typescript/components/index.mjs +4 -1
  31. package/dist/typescript/components/tsdoc-reflection.d.cts +4 -4
  32. package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -1
  33. package/dist/typescript/components/tsdoc-reflection.d.mts +4 -4
  34. package/dist/typescript/components/type-parameters.cjs +107 -0
  35. package/dist/typescript/components/type-parameters.d.cts +25 -0
  36. package/dist/typescript/components/type-parameters.d.cts.map +1 -0
  37. package/dist/typescript/components/type-parameters.d.mts +25 -0
  38. package/dist/typescript/components/type-parameters.d.mts.map +1 -0
  39. package/dist/typescript/components/type-parameters.mjs +107 -0
  40. package/dist/typescript/components/type-parameters.mjs.map +1 -0
  41. package/dist/typescript/components/typescript-file.cjs +2 -2
  42. package/dist/typescript/components/typescript-file.mjs +2 -2
  43. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  44. package/dist/typescript/components/typescript-interface.d.cts +3 -3
  45. package/dist/typescript/components/typescript-interface.d.cts.map +1 -1
  46. package/dist/typescript/components/typescript-interface.d.mts +3 -3
  47. package/dist/typescript/components/typescript-interface.d.mts.map +1 -1
  48. package/dist/typescript/components/typescript-object.d.cts +3 -3
  49. package/dist/typescript/components/typescript-object.d.cts.map +1 -1
  50. package/dist/typescript/components/typescript-object.d.mts +3 -3
  51. package/dist/typescript/components/typescript-object.d.mts.map +1 -1
  52. package/dist/typescript/components/typescript-property-name.cjs +31 -0
  53. package/dist/typescript/components/typescript-property-name.d.cts +24 -0
  54. package/dist/typescript/components/typescript-property-name.d.cts.map +1 -0
  55. package/dist/typescript/components/typescript-property-name.d.mts +24 -0
  56. package/dist/typescript/components/typescript-property-name.d.mts.map +1 -0
  57. package/dist/typescript/components/typescript-property-name.mjs +31 -0
  58. package/dist/typescript/components/typescript-property-name.mjs.map +1 -0
  59. package/dist/typescript/contexts/index.cjs +3 -0
  60. package/dist/typescript/contexts/index.d.cts +2 -0
  61. package/dist/typescript/contexts/index.d.mts +2 -0
  62. package/dist/typescript/contexts/index.mjs +3 -0
  63. package/dist/typescript/contexts/lexical-scope.cjs +25 -0
  64. package/dist/typescript/contexts/lexical-scope.d.cts +17 -0
  65. package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
  66. package/dist/typescript/contexts/lexical-scope.d.mts +17 -0
  67. package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
  68. package/dist/typescript/contexts/lexical-scope.mjs +25 -0
  69. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
  70. package/dist/typescript/helpers/get-call-signature-props.cjs +25 -0
  71. package/dist/typescript/helpers/get-call-signature-props.d.cts +15 -0
  72. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
  73. package/dist/typescript/helpers/get-call-signature-props.d.mts +15 -0
  74. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
  75. package/dist/typescript/helpers/get-call-signature-props.mjs +25 -0
  76. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
  77. package/dist/typescript/helpers/index.cjs +5 -0
  78. package/dist/typescript/helpers/index.d.cts +3 -0
  79. package/dist/typescript/helpers/index.d.mts +3 -0
  80. package/dist/typescript/helpers/index.mjs +4 -0
  81. package/dist/typescript/helpers/utilities.cjs +14 -0
  82. package/dist/typescript/helpers/utilities.d.cts +11 -0
  83. package/dist/typescript/helpers/utilities.d.cts.map +1 -0
  84. package/dist/typescript/helpers/utilities.d.mts +11 -0
  85. package/dist/typescript/helpers/utilities.d.mts.map +1 -0
  86. package/dist/typescript/helpers/utilities.mjs +14 -0
  87. package/dist/typescript/helpers/utilities.mjs.map +1 -0
  88. package/dist/typescript/index.cjs +18 -1
  89. package/dist/typescript/index.d.cts +9 -1
  90. package/dist/typescript/index.d.mts +9 -1
  91. package/dist/typescript/index.mjs +9 -1
  92. package/package.json +128 -16
@@ -0,0 +1,107 @@
1
+ import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
2
+ import { For, Indent, Show, createSymbolSlot, onCleanup, taggedComponent } from "@alloy-js/core";
3
+ import { TSSymbolFlags, TypeRefContext, createValueSymbol, useTSNamePolicy } from "@alloy-js/typescript";
4
+
5
+ //#region src/typescript/components/type-parameters.tsx
6
+ /** Props for type parameters */
7
+ const typeParametersTag = Symbol("type-parameters");
8
+ function typeParameter(param) {
9
+ return createIntrinsic("group", { get children() {
10
+ return [
11
+ memo(() => param.symbol.name),
12
+ createComponent(Show, {
13
+ get when() {
14
+ return !!param.extends;
15
+ },
16
+ get children() {
17
+ return [
18
+ " ",
19
+ "extends",
20
+ createIntrinsic("indent", { get children() {
21
+ return [" ", createComponent(TypeRefContext, { get children() {
22
+ return param.extends;
23
+ } })];
24
+ } })
25
+ ];
26
+ }
27
+ }),
28
+ createComponent(Show, {
29
+ get when() {
30
+ return !!param.default;
31
+ },
32
+ get children() {
33
+ return [" = ", createComponent(TypeRefContext, { get children() {
34
+ return param.default;
35
+ } })];
36
+ }
37
+ })
38
+ ];
39
+ } });
40
+ }
41
+ /**
42
+ * Represent type parameters
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * <A, B extends string>
47
+ * ```
48
+ */
49
+ const TypeParameters = taggedComponent(typeParametersTag, function TypeParameters$1(props) {
50
+ if (props.children) return props.children;
51
+ if (!props.parameters) return;
52
+ const typeParameters = normalizeAndDeclareParameters(props.parameters);
53
+ onCleanup(() => {
54
+ for (const param of typeParameters) param.symbol.delete();
55
+ });
56
+ return [
57
+ "<",
58
+ createIntrinsic("group", { get children() {
59
+ return createComponent(Indent, {
60
+ softline: true,
61
+ get children() {
62
+ return [createComponent(For, {
63
+ each: typeParameters,
64
+ comma: true,
65
+ line: true,
66
+ children: (param) => typeParameter(param)
67
+ }), createIntrinsic("ifBreak", { children: "," })];
68
+ }
69
+ });
70
+ } }),
71
+ ">"
72
+ ];
73
+ });
74
+ function normalizeAndDeclareParameters(parameters, flags = TSSymbolFlags.ParameterSymbol) {
75
+ const namePolicy = useTSNamePolicy();
76
+ if (parameters.length === 0) return [];
77
+ if (typeof parameters[0] === "string") return parameters.map((paramName) => {
78
+ const name = namePolicy.getName(paramName, "parameter");
79
+ const TypeSlot = createSymbolSlot();
80
+ const symbol = createValueSymbol(name, { type: TypeSlot.firstSymbol });
81
+ return {
82
+ refkeys: symbol.refkeys,
83
+ symbol,
84
+ TypeSlot
85
+ };
86
+ });
87
+ else return parameters.map((param) => {
88
+ const nullishFlag = param.nullish ?? param.optional ? TSSymbolFlags.Nullish : TSSymbolFlags.None;
89
+ const TypeSlot = createSymbolSlot();
90
+ const symbol = createValueSymbol(param.name, {
91
+ refkeys: param.refkey,
92
+ tsFlags: flags | nullishFlag,
93
+ metadata: param.metadata,
94
+ type: TypeSlot.firstSymbol,
95
+ namePolicy: namePolicy.for("parameter")
96
+ });
97
+ return {
98
+ ...param,
99
+ symbol,
100
+ TypeSlot
101
+ };
102
+ });
103
+ }
104
+
105
+ //#endregion
106
+ export { TypeParameters };
107
+ //# sourceMappingURL=type-parameters.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-parameters.mjs","names":["createSymbolSlot","For","Indent","onCleanup","Show","taggedComponent","createValueSymbol","TSSymbolFlags","TypeRefContext","useTSNamePolicy","typeParametersTag","Symbol","typeParameter","param","_$createIntrinsic","children","_$memo","symbol","name","_$createComponent","when","extends","default","TypeParameters","props","parameters","undefined","typeParameters","normalizeAndDeclareParameters","delete","softline","each","comma","line","flags","ParameterSymbol","namePolicy","length","map","paramName","getName","TypeSlot","type","firstSymbol","refkeys","nullishFlag","nullish","optional","Nullish","None","refkey","tsFlags","metadata","for"],"sources":["../../../src/typescript/components/type-parameters.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 Children,\n createSymbolSlot,\n For,\n Indent,\n onCleanup,\n Show,\n SymbolSlot,\n taggedComponent\n} from \"@alloy-js/core\";\nimport {\n createValueSymbol,\n FunctionTypeParameterDescriptor,\n ParameterDescriptor,\n TSOutputSymbol,\n TSSymbolFlags,\n TypeParameterDescriptor,\n TypeRefContext,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\n\n/** Props for type parameters */\nexport interface TypeParametersProps {\n /** Parameters */\n parameters?: TypeParameterDescriptor[] | string[];\n /** Jsx Children */\n children?: Children;\n}\n\ninterface DeclaredTypeParameterDescriptor extends Omit<\n TypeParameterDescriptor,\n \"name\"\n> {\n symbol: TSOutputSymbol;\n}\n\ninterface DeclaredParameterDescriptor extends Omit<\n ParameterDescriptor,\n \"name\"\n> {\n symbol: TSOutputSymbol;\n TypeSlot: SymbolSlot;\n}\n\ninterface DeclaredFunctionTypeParameterDescriptor extends Omit<\n FunctionTypeParameterDescriptor,\n \"name\"\n> {\n symbol: TSOutputSymbol;\n TypeSlot: SymbolSlot;\n}\n\nconst typeParametersTag = Symbol(\"type-parameters\");\n\nfunction typeParameter(param: DeclaredTypeParameterDescriptor) {\n return (\n <group>\n {param.symbol.name}\n <Show when={!!param.extends}>\n {\" \"}\n extends\n <indent>\n {\" \"}\n <TypeRefContext>{param.extends}</TypeRefContext>\n </indent>\n </Show>\n <Show when={!!param.default}>\n {\" = \"}\n <TypeRefContext>{param.default}</TypeRefContext>\n </Show>\n </group>\n );\n}\n\n/**\n * Represent type parameters\n *\n * @example\n * ```ts\n * <A, B extends string>\n * ```\n */\nexport const TypeParameters = taggedComponent(\n typeParametersTag,\n function TypeParameters(props: TypeParametersProps) {\n if (props.children) {\n return props.children;\n }\n\n if (!props.parameters) {\n return undefined;\n }\n\n const typeParameters = normalizeAndDeclareParameters(props.parameters);\n\n onCleanup(() => {\n for (const param of typeParameters) {\n param.symbol.delete();\n }\n });\n\n return (\n <>\n {\"<\"}\n <group>\n <Indent softline>\n <For each={typeParameters} comma line>\n {param => typeParameter(param as DeclaredTypeParameterDescriptor)}\n </For>\n <ifBreak>,</ifBreak>\n </Indent>\n </group>\n {\">\"}\n </>\n );\n }\n);\n\nfunction normalizeAndDeclareParameters(\n parameters: FunctionTypeParameterDescriptor[] | string[],\n flags?: TSSymbolFlags\n): DeclaredTypeParameterDescriptor[];\nfunction normalizeAndDeclareParameters(\n parameters: TypeParameterDescriptor[] | string[],\n flags?: TSSymbolFlags\n): DeclaredFunctionTypeParameterDescriptor[];\nfunction normalizeAndDeclareParameters(\n parameters: ParameterDescriptor[] | string[],\n flags?: TSSymbolFlags\n): DeclaredParameterDescriptor[];\nfunction normalizeAndDeclareParameters(\n parameters: string[],\n flags?: TSSymbolFlags\n): DeclaredParameterDescriptor[] | DeclaredTypeParameterDescriptor[];\nfunction normalizeAndDeclareParameters(\n parameters:\n | ParameterDescriptor[]\n | FunctionTypeParameterDescriptor[]\n | TypeParameterDescriptor[]\n | string[],\n flags: TSSymbolFlags = TSSymbolFlags.ParameterSymbol\n): DeclaredParameterDescriptor[] | DeclaredTypeParameterDescriptor[] {\n const namePolicy = useTSNamePolicy();\n if (parameters.length === 0) {\n return [];\n }\n if (typeof parameters[0] === \"string\") {\n return (parameters as string[]).map(paramName => {\n const name = namePolicy.getName(paramName, \"parameter\");\n const TypeSlot = createSymbolSlot();\n const symbol = createValueSymbol(name, { type: TypeSlot.firstSymbol });\n\n return { refkeys: symbol.refkeys, symbol, TypeSlot };\n });\n } else {\n return (parameters as ParameterDescriptor[]).map(param => {\n const nullishFlag =\n (param.nullish ?? param.optional)\n ? TSSymbolFlags.Nullish\n : TSSymbolFlags.None;\n const TypeSlot = createSymbolSlot();\n const symbol = createValueSymbol(param.name, {\n refkeys: param.refkey,\n tsFlags: flags | nullishFlag,\n metadata: param.metadata,\n type: TypeSlot.firstSymbol,\n namePolicy: namePolicy.for(\"parameter\")\n });\n\n return {\n ...param,\n symbol,\n TypeSlot\n };\n });\n }\n}\n"],"mappings":""}
@@ -182,7 +182,7 @@ function TypescriptFileHeaderImports(props) {
182
182
  },
183
183
  hardline: true,
184
184
  children: ([module$1, importItem]) => {
185
- return [(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`import ${importItem === null ? "" : (0, __stryke_type_checks_is_string.isString)(importItem) ? importItem : ` ${importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${module$1}";`)];
185
+ return [(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`import ${importItem === null ? "" : (0, __stryke_type_checks_is_string.isString)(importItem) ? importItem : `${importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")}`} from "${module$1}";`)];
186
186
  }
187
187
  }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
188
188
  }
@@ -197,7 +197,7 @@ function TypescriptFileHeaderImports(props) {
197
197
  return Object.entries(builtinImports.value ?? {});
198
198
  },
199
199
  hardline: true,
200
- children: ([module$1, importItem]) => __alloy_js_core.code`import ${importItem === null ? "" : (0, __stryke_type_checks_is_string.isString)(importItem) ? importItem : ` ${importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${module$1.includes(":") ? module$1 : `${context?.config?.framework || "powerlines"}:${module$1}`}";`
200
+ children: ([module$1, importItem]) => __alloy_js_core.code`import ${importItem === null ? "" : (0, __stryke_type_checks_is_string.isString)(importItem) ? importItem : `${importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !(0, __stryke_type_checks_is_string.isString)(i) && i.default).length > 0 && importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => (0, __stryke_type_checks_is_string.isString)(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => (0, __stryke_type_checks_is_string.isString)(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")}`} from "${module$1.includes(":") ? module$1 : `${context?.config?.framework || "powerlines"}:${module$1}`}";`
201
201
  }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
202
202
  }
203
203
  }),
@@ -181,7 +181,7 @@ function TypescriptFileHeaderImports(props) {
181
181
  },
182
182
  hardline: true,
183
183
  children: ([module, importItem]) => {
184
- return [memo(() => code`import ${importItem === null ? "" : isString(importItem) ? importItem : ` ${importItem.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${module}";`)];
184
+ return [memo(() => code`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")}`} from "${module}";`)];
185
185
  }
186
186
  }), createIntrinsic("hbr", {})];
187
187
  }
@@ -196,7 +196,7 @@ function TypescriptFileHeaderImports(props) {
196
196
  return Object.entries(builtinImports.value ?? {});
197
197
  },
198
198
  hardline: true,
199
- children: ([module, importItem]) => code`import ${importItem === null ? "" : isString(importItem) ? importItem : ` ${importItem.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")} `} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
199
+ children: ([module, importItem]) => code`import ${importItem === null ? "" : isString(importItem) ? importItem : `${importItem.filter((i) => !isString(i) && i.default).map((i) => i.alias ? i.alias : i.name).join(", ") + (importItem.filter((i) => !isString(i) && i.default).length > 0 && importItem.filter((i) => isString(i) || !i.default).length > 0 ? ", " : "") + (importItem.filter((i) => isString(i) || !i.default).length > 0 ? `{ ${importItem.map((i) => isString(i) ? i : i.alias ? `${i.name} as ${i.alias}` : i.name).join(", ")} }` : "")}`} from "${module.includes(":") ? module : `${context?.config?.framework || "powerlines"}:${module}`}";`
200
200
  }), createIntrinsic("hbr", {})];
201
201
  }
202
202
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-file.mjs","names":["code","computed","For","Scope","Show","SourceDirectoryContext","splitProps","useContext","useScope","getSourceDirectoryData","ImportStatements","PackageContext","SourceFileContext","TSModuleScope","useSourceFile","getUniqueBy","appendPath","titleCase","isBoolean","isString","SingleLineComment","SourceFile","usePowerlinesSafe","TypescriptFile","props","children","path","imports","builtinImports","tsx","header","hashbang","rest","directoryContext","sdData","modulePath","scope","modules","add","pkg","addModule","export","addExport","_$createComponent","Provider","value","_$mergeProps","TypescriptFileHeader","TypescriptFileHeaderImports","filetype","disableEslint","disableBiome","disablePrettier","context","when","Boolean","_$memo","config","mode","_$createIntrinsic","variant","framework","importProps","builtinImportsProps","sourceFile","Object","fromEntries","entries","map","module","importItem","Array","isArray","i","alias","name","importedModules","size","keys","length","each","hardline","filter","default","join","includes","records"],"sources":["../../../src/typescript/components/typescript-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport {\n code,\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n disablePrettier = false,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disablePrettier)}>\n <SingleLineComment variant=\"slash-star\">\n {\"prettier-ignore\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show\n when={\n Boolean(disableEslint) ||\n Boolean(disablePrettier) ||\n Boolean(disableBiome)\n }>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>\n {code`NOTE: Do not edit this file manually - it will be overwritten automatically`}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For each={Object.entries(imports.value ?? {})} hardline>\n {([module, importItem]) => {\n return (\n <>\n {code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : ` ${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(i => (i.alias ? i.alias : i.name))\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .map(i =>\n isString(i)\n ? i\n : i.alias\n ? `${i.name} as ${i.alias}`\n : i.name\n )\n .join(\", \")} }`\n : \"\")\n } `\n } from \"${module}\";`}\n </>\n );\n }}\n </For>\n <hbr />\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : ` ${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(i => (i.alias ? i.alias : i.name))\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .map(i =>\n isString(i)\n ? i\n : i.alias\n ? `${i.name} as ${i.alias}`\n : i.name\n )\n .join(\", \")} }`\n : \"\")\n } `\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n <hbr />\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );\n}\n"],"mappings":""}
1
+ {"version":3,"file":"typescript-file.mjs","names":["code","computed","For","Scope","Show","SourceDirectoryContext","splitProps","useContext","useScope","getSourceDirectoryData","ImportStatements","PackageContext","SourceFileContext","TSModuleScope","useSourceFile","getUniqueBy","appendPath","titleCase","isBoolean","isString","SingleLineComment","SourceFile","usePowerlinesSafe","TypescriptFile","props","children","path","imports","builtinImports","tsx","header","hashbang","rest","directoryContext","sdData","modulePath","scope","modules","add","pkg","addModule","export","addExport","_$createComponent","Provider","value","_$mergeProps","TypescriptFileHeader","TypescriptFileHeaderImports","filetype","disableEslint","disableBiome","disablePrettier","context","when","Boolean","_$memo","config","mode","_$createIntrinsic","variant","framework","importProps","builtinImportsProps","sourceFile","Object","fromEntries","entries","map","module","importItem","Array","isArray","i","alias","name","importedModules","size","keys","length","each","hardline","filter","default","join","includes","records"],"sources":["../../../src/typescript/components/typescript-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport {\n code,\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n disablePrettier = false,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disablePrettier)}>\n <SingleLineComment variant=\"slash-star\">\n {\"prettier-ignore\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show\n when={\n Boolean(disableEslint) ||\n Boolean(disablePrettier) ||\n Boolean(disableBiome)\n }>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>\n {code`NOTE: Do not edit this file manually - it will be overwritten automatically`}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For each={Object.entries(imports.value ?? {})} hardline>\n {([module, importItem]) => {\n return (\n <>\n {code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(i => (i.alias ? i.alias : i.name))\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .map(i =>\n isString(i)\n ? i\n : i.alias\n ? `${i.name} as ${i.alias}`\n : i.name\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${module}\";`}\n </>\n );\n }}\n </For>\n <hbr />\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(i => (i.alias ? i.alias : i.name))\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .map(i =>\n isString(i)\n ? i\n : i.alias\n ? `${i.name} as ${i.alias}`\n : i.name\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n <hbr />\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );\n}\n"],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from "../../types/components.cjs";
2
- import * as _alloy_js_core5 from "@alloy-js/core";
2
+ import * as _alloy_js_core21 from "@alloy-js/core";
3
3
  import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
4
  import { InterfaceDeclarationProps, InterfaceMemberProps } from "@alloy-js/typescript";
5
5
 
@@ -14,11 +14,11 @@ interface TypescriptInterfacePropertyProps extends Omit<InterfaceMemberProps, "n
14
14
  /**
15
15
  * Generates a TypeScript interface for the given reflection class.
16
16
  */
17
- declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>): _alloy_js_core5.Children;
17
+ declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>): _alloy_js_core21.Children;
18
18
  /**
19
19
  * Generates a TypeScript interface property for the given reflection class.
20
20
  */
21
- declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps): _alloy_js_core5.Children;
21
+ declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps): _alloy_js_core21.Children;
22
22
  declare type __ΩTypeScriptInterfaceProps = any[];
23
23
  declare type __ΩTypescriptInterfacePropertyProps = any[];
24
24
  //#endregion
@@ -1 +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
+ {"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,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,5 +1,5 @@
1
1
  import { ComponentProps } from "../../types/components.mjs";
2
- import * as _alloy_js_core10 from "@alloy-js/core";
2
+ import * as _alloy_js_core7 from "@alloy-js/core";
3
3
  import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
4
  import { InterfaceDeclarationProps, InterfaceMemberProps } from "@alloy-js/typescript";
5
5
 
@@ -14,11 +14,11 @@ interface TypescriptInterfacePropertyProps extends Omit<InterfaceMemberProps, "n
14
14
  /**
15
15
  * Generates a TypeScript interface for the given reflection class.
16
16
  */
17
- declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>): _alloy_js_core10.Children;
17
+ declare function TypeScriptInterface<T extends Record<string, any> = Record<string, any>>(props: TypeScriptInterfaceProps<T>): _alloy_js_core7.Children;
18
18
  /**
19
19
  * Generates a TypeScript interface property for the given reflection class.
20
20
  */
21
- declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps): _alloy_js_core10.Children;
21
+ declare function TypescriptInterfaceProperty(props: TypescriptInterfacePropertyProps): _alloy_js_core7.Children;
22
22
  declare type __ΩTypeScriptInterfaceProps = any[];
23
23
  declare type __ΩTypescriptInterfacePropertyProps = any[];
24
24
  //#endregion
@@ -1 +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
+ {"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,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,5 +1,5 @@
1
1
  import { ComponentProps } from "../../types/components.cjs";
2
- import * as _alloy_js_core3 from "@alloy-js/core";
2
+ import * as _alloy_js_core18 from "@alloy-js/core";
3
3
  import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
4
  import { VarDeclarationProps } from "@alloy-js/typescript";
5
5
 
@@ -17,11 +17,11 @@ interface TypescriptObjectPropertyProps extends ComponentProps {
17
17
  /**
18
18
  * Generates a TypeScript object for the given reflection class.
19
19
  */
20
- declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core3.Children;
20
+ declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core18.Children;
21
21
  /**
22
22
  * Generates a TypeScript object property for the given reflection class.
23
23
  */
24
- declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core3.Children;
24
+ declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core18.Children;
25
25
  declare type __ΩComputedRef = any[];
26
26
  declare type __ΩTypescriptObjectProps = any[];
27
27
  declare type __ΩTypescriptObjectPropertyProps = any[];
@@ -1 +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,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
+ {"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,5 +1,5 @@
1
1
  import { ComponentProps } from "../../types/components.mjs";
2
- import * as _alloy_js_core8 from "@alloy-js/core";
2
+ import * as _alloy_js_core19 from "@alloy-js/core";
3
3
  import { ReflectionClass, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
4
4
  import { VarDeclarationProps } from "@alloy-js/typescript";
5
5
 
@@ -17,11 +17,11 @@ interface TypescriptObjectPropertyProps extends ComponentProps {
17
17
  /**
18
18
  * Generates a TypeScript object for the given reflection class.
19
19
  */
20
- declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core8.Children;
20
+ declare function TypescriptObject<T extends Record<string, any> = Record<string, any>>(props: TypescriptObjectProps<T>): _alloy_js_core19.Children;
21
21
  /**
22
22
  * Generates a TypeScript object property for the given reflection class.
23
23
  */
24
- declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core8.Children;
24
+ declare function TypescriptObjectProperty(props: TypescriptObjectPropertyProps): _alloy_js_core19.Children;
25
25
  declare type __ΩComputedRef = any[];
26
26
  declare type __ΩTypescriptObjectProps = any[];
27
27
  declare type __ΩTypescriptObjectPropertyProps = any[];
@@ -1 +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
+ {"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,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"}
@@ -0,0 +1,31 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_typescript_helpers_utilities = require('../helpers/utilities.cjs');
3
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let __alloy_js_core = require("@alloy-js/core");
5
+
6
+ //#region src/typescript/components/typescript-property-name.tsx
7
+ /**
8
+ * A TypeScript property name for an interface, class, or object member.
9
+ *
10
+ * @remarks
11
+ * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
12
+ */
13
+ function TypescriptPropertyName(props) {
14
+ if (props.name) return (0, __alloy_js_core_jsx_runtime.memo)(() => {
15
+ if (props.private) return `#${props.name}`;
16
+ return quoteIfNeeded(props.name);
17
+ });
18
+ else {
19
+ const declSymbol = (0, __alloy_js_core.useContext)(__alloy_js_core.MemberDeclarationContext);
20
+ if (!declSymbol) return "(no member declaration context)";
21
+ if (declSymbol.isPrivateMemberSymbol) return ["#", (0, __alloy_js_core_jsx_runtime.memo)(() => declSymbol.name)];
22
+ else return [(0, __alloy_js_core_jsx_runtime.memo)(() => quoteIfNeeded(declSymbol.name))];
23
+ }
24
+ }
25
+ function quoteIfNeeded(name) {
26
+ if (require_typescript_helpers_utilities.isValidJSIdentifier(name)) return name;
27
+ else return `"${name.replace(/"/g, "\\\"")}"`;
28
+ }
29
+
30
+ //#endregion
31
+ exports.TypescriptPropertyName = TypescriptPropertyName;
@@ -0,0 +1,24 @@
1
+ import * as _alloy_js_core20 from "@alloy-js/core";
2
+
3
+ //#region src/typescript/components/typescript-property-name.d.ts
4
+ interface TypescriptPropertyNameProps {
5
+ /**
6
+ * The name of the property.
7
+ */
8
+ name?: string;
9
+ /**
10
+ * Whether the property is a private property. If `true`, the property will be prefixed with `#`.
11
+ */
12
+ private?: boolean;
13
+ }
14
+ /**
15
+ * A TypeScript property name for an interface, class, or object member.
16
+ *
17
+ * @remarks
18
+ * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
19
+ */
20
+ declare function TypescriptPropertyName(props: TypescriptPropertyNameProps): _alloy_js_core20.Children;
21
+ declare type __ΩTypescriptPropertyNameProps = any[];
22
+ //#endregion
23
+ export { TypescriptPropertyName, TypescriptPropertyNameProps, __ΩTypescriptPropertyNameProps };
24
+ //# sourceMappingURL=typescript-property-name.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript-property-name.d.cts","names":[],"sources":["../../../src/typescript/components/typescript-property-name.tsx"],"sourcesContent":[],"mappings":";;;UAuBiB,2BAAA;;;AAAjB;EAkBgB,IAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;iBAAA,sBAAA,QAA8B,8BAA2B,gBAAA,CAAA"}
@@ -0,0 +1,24 @@
1
+ import * as _alloy_js_core16 from "@alloy-js/core";
2
+
3
+ //#region src/typescript/components/typescript-property-name.d.ts
4
+ interface TypescriptPropertyNameProps {
5
+ /**
6
+ * The name of the property.
7
+ */
8
+ name?: string;
9
+ /**
10
+ * Whether the property is a private property. If `true`, the property will be prefixed with `#`.
11
+ */
12
+ private?: boolean;
13
+ }
14
+ /**
15
+ * A TypeScript property name for an interface, class, or object member.
16
+ *
17
+ * @remarks
18
+ * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
19
+ */
20
+ declare function TypescriptPropertyName(props: TypescriptPropertyNameProps): _alloy_js_core16.Children;
21
+ declare type __ΩTypescriptPropertyNameProps = any[];
22
+ //#endregion
23
+ export { TypescriptPropertyName, TypescriptPropertyNameProps, __ΩTypescriptPropertyNameProps };
24
+ //# sourceMappingURL=typescript-property-name.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript-property-name.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-property-name.tsx"],"sourcesContent":[],"mappings":";;;UAuBiB,2BAAA;;;AAAjB;EAkBgB,IAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;iBAAA,sBAAA,QAA8B,8BAA2B,gBAAA,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { isValidJSIdentifier } from "../helpers/utilities.mjs";
2
+ import { memo } from "@alloy-js/core/jsx-runtime";
3
+ import { MemberDeclarationContext, useContext } from "@alloy-js/core";
4
+
5
+ //#region src/typescript/components/typescript-property-name.tsx
6
+ /**
7
+ * A TypeScript property name for an interface, class, or object member.
8
+ *
9
+ * @remarks
10
+ * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
11
+ */
12
+ function TypescriptPropertyName(props) {
13
+ if (props.name) return memo(() => {
14
+ if (props.private) return `#${props.name}`;
15
+ return quoteIfNeeded(props.name);
16
+ });
17
+ else {
18
+ const declSymbol = useContext(MemberDeclarationContext);
19
+ if (!declSymbol) return "(no member declaration context)";
20
+ if (declSymbol.isPrivateMemberSymbol) return ["#", memo(() => declSymbol.name)];
21
+ else return [memo(() => quoteIfNeeded(declSymbol.name))];
22
+ }
23
+ }
24
+ function quoteIfNeeded(name) {
25
+ if (isValidJSIdentifier(name)) return name;
26
+ else return `"${name.replace(/"/g, "\\\"")}"`;
27
+ }
28
+
29
+ //#endregion
30
+ export { TypescriptPropertyName };
31
+ //# sourceMappingURL=typescript-property-name.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript-property-name.mjs","names":["MemberDeclarationContext","useContext","memo","isValidJSIdentifier","TypescriptPropertyName","props","name","private","quoteIfNeeded","declSymbol","isPrivateMemberSymbol","_$memo","replace"],"sources":["../../../src/typescript/components/typescript-property-name.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 { MemberDeclarationContext, useContext } from \"@alloy-js/core\";\nimport { memo } from \"@alloy-js/core/jsx-runtime\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface TypescriptPropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function TypescriptPropertyName(props: TypescriptPropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":""}
@@ -0,0 +1,3 @@
1
+ const require_typescript_contexts_lexical_scope = require('./lexical-scope.cjs');
2
+
3
+ exports.LexicalScope = require_typescript_contexts_lexical_scope.LexicalScope;
@@ -0,0 +1,2 @@
1
+ import { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue } from "./lexical-scope.cjs";
2
+ export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue };
@@ -0,0 +1,2 @@
1
+ import { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue } from "./lexical-scope.mjs";
2
+ export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue };
@@ -0,0 +1,3 @@
1
+ import { LexicalScope } from "./lexical-scope.mjs";
2
+
3
+ export { LexicalScope };
@@ -0,0 +1,25 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
+ let __alloy_js_core = require("@alloy-js/core");
4
+ let __alloy_js_typescript = require("@alloy-js/typescript");
5
+
6
+ //#region src/typescript/contexts/lexical-scope.tsx
7
+ /**
8
+ * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
9
+ */
10
+ function LexicalScope(props) {
11
+ let scope;
12
+ if ("value" in props) {
13
+ if (!(props.value instanceof __alloy_js_typescript.TSLexicalScope)) throw new TypeError("LexicalScope value must be a TSLexicalScope instance");
14
+ scope = props.value;
15
+ } else scope = (0, __alloy_js_typescript.createLexicalScope)(props.name ?? "Lexical scope", props);
16
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Scope, {
17
+ value: scope,
18
+ get children() {
19
+ return props.children;
20
+ }
21
+ });
22
+ }
23
+
24
+ //#endregion
25
+ exports.LexicalScope = LexicalScope;
@@ -0,0 +1,17 @@
1
+ import * as _alloy_js_core17 from "@alloy-js/core";
2
+ import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
3
+
4
+ //#region src/typescript/contexts/lexical-scope.d.ts
5
+ interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}
6
+ interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}
7
+ type LexicalScopeProps = LexicalScopePropsWithScopeValue | LexicalScopePropsWithScopeInfo;
8
+ /**
9
+ * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
10
+ */
11
+ declare function LexicalScope(props: LexicalScopeProps): _alloy_js_core17.Children;
12
+ declare type __ΩLexicalScopePropsWithScopeValue = any[];
13
+ declare type __ΩLexicalScopePropsWithScopeInfo = any[];
14
+ declare type __ΩLexicalScopeProps = any[];
15
+ //#endregion
16
+ export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue };
17
+ //# sourceMappingURL=lexical-scope.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexical-scope.d.cts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"sourcesContent":[],"mappings":";;;;UAqBiB,+BAAA,SAAwC;UACxC,8BAAA,SAAuC,oBADxD;AACiB,KAEL,iBAAA,GACR,+BAHoD,GAIpD,8BAJsE;AAE1E;AAOA;;iBAAgB,YAAA,QAAoB,oBAAiB,gBAAA,CAAA"}
@@ -0,0 +1,17 @@
1
+ import * as _alloy_js_core13 from "@alloy-js/core";
2
+ import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
3
+
4
+ //#region src/typescript/contexts/lexical-scope.d.ts
5
+ interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}
6
+ interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}
7
+ type LexicalScopeProps = LexicalScopePropsWithScopeValue | LexicalScopePropsWithScopeInfo;
8
+ /**
9
+ * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
10
+ */
11
+ declare function LexicalScope(props: LexicalScopeProps): _alloy_js_core13.Children;
12
+ declare type __ΩLexicalScopePropsWithScopeValue = any[];
13
+ declare type __ΩLexicalScopePropsWithScopeInfo = any[];
14
+ declare type __ΩLexicalScopeProps = any[];
15
+ //#endregion
16
+ export { LexicalScope, LexicalScopeProps, LexicalScopePropsWithScopeInfo, LexicalScopePropsWithScopeValue, __ΩLexicalScopeProps, __ΩLexicalScopePropsWithScopeInfo, __ΩLexicalScopePropsWithScopeValue };
17
+ //# sourceMappingURL=lexical-scope.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexical-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"sourcesContent":[],"mappings":";;;;UAqBiB,+BAAA,SAAwC;UACxC,8BAAA,SAAuC,oBADxD;AACiB,KAEL,iBAAA,GACR,+BAHoD,GAIpD,8BAJsE;AAE1E;AAOA;;iBAAgB,YAAA,QAAoB,oBAAiB,gBAAA,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { Scope } from "@alloy-js/core";
3
+ import { TSLexicalScope, createLexicalScope } from "@alloy-js/typescript";
4
+
5
+ //#region src/typescript/contexts/lexical-scope.tsx
6
+ /**
7
+ * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
8
+ */
9
+ function LexicalScope(props) {
10
+ let scope;
11
+ if ("value" in props) {
12
+ if (!(props.value instanceof TSLexicalScope)) throw new TypeError("LexicalScope value must be a TSLexicalScope instance");
13
+ scope = props.value;
14
+ } else scope = createLexicalScope(props.name ?? "Lexical scope", props);
15
+ return createComponent(Scope, {
16
+ value: scope,
17
+ get children() {
18
+ return props.children;
19
+ }
20
+ });
21
+ }
22
+
23
+ //#endregion
24
+ export { LexicalScope };
25
+ //# sourceMappingURL=lexical-scope.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexical-scope.mjs","names":["Scope","createLexicalScope","TSLexicalScope","LexicalScope","props","scope","value","TypeError","name","_$createComponent","children"],"sources":["../../../src/typescript/contexts/lexical-scope.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 { Scope, ScopePropsWithInfo, ScopePropsWithValue } from \"@alloy-js/core\";\nimport { createLexicalScope, TSLexicalScope } from \"@alloy-js/typescript\";\n\nexport interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}\nexport interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}\n\nexport type LexicalScopeProps =\n | LexicalScopePropsWithScopeValue\n | LexicalScopePropsWithScopeInfo;\n\n/**\n * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.\n */\nexport function LexicalScope(props: LexicalScopeProps) {\n let scope;\n if (\"value\" in props) {\n if (!(props.value instanceof TSLexicalScope)) {\n throw new TypeError(\n \"LexicalScope value must be a TSLexicalScope instance\"\n );\n }\n scope = props.value;\n } else {\n scope = createLexicalScope(props.name ?? \"Lexical scope\", props);\n }\n\n return <Scope value={scope}>{props.children}</Scope>;\n}\n"],"mappings":""}