@typespec/emitter-framework 0.15.0-dev.3 → 0.15.0

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 (253) hide show
  1. package/CHANGELOG.md +14 -16
  2. package/dist/src/python/builtins.d.ts +14 -0
  3. package/dist/src/python/builtins.d.ts.map +1 -0
  4. package/dist/src/python/builtins.js +29 -0
  5. package/dist/src/python/builtins.js.map +1 -0
  6. package/dist/src/python/components/array-expression/array-expression.d.ts +6 -0
  7. package/dist/src/python/components/array-expression/array-expression.d.ts.map +1 -0
  8. package/dist/src/python/components/array-expression/array-expression.js +11 -0
  9. package/dist/src/python/components/array-expression/array-expression.js.map +1 -0
  10. package/dist/src/python/components/array-expression/array-expression.test.d.ts +2 -0
  11. package/dist/src/python/components/array-expression/array-expression.test.d.ts.map +1 -0
  12. package/dist/src/python/components/array-expression/array-expression.test.js +19 -0
  13. package/dist/src/python/components/array-expression/array-expression.test.js.map +1 -0
  14. package/dist/src/python/components/array-expression/index.d.ts +2 -0
  15. package/dist/src/python/components/array-expression/index.d.ts.map +1 -0
  16. package/dist/src/python/components/array-expression/index.js +2 -0
  17. package/dist/src/python/components/array-expression/index.js.map +1 -0
  18. package/dist/src/python/components/atom/atom.d.ts +33 -0
  19. package/dist/src/python/components/atom/atom.d.ts.map +1 -0
  20. package/dist/src/python/components/atom/atom.js +88 -0
  21. package/dist/src/python/components/atom/atom.js.map +1 -0
  22. package/dist/src/python/components/atom/atom.test.d.ts +2 -0
  23. package/dist/src/python/components/atom/atom.test.d.ts.map +1 -0
  24. package/dist/src/python/components/atom/atom.test.js +224 -0
  25. package/dist/src/python/components/atom/atom.test.js.map +1 -0
  26. package/dist/src/python/components/atom/index.d.ts +2 -0
  27. package/dist/src/python/components/atom/index.d.ts.map +1 -0
  28. package/dist/src/python/components/atom/index.js +2 -0
  29. package/dist/src/python/components/atom/index.js.map +1 -0
  30. package/dist/src/python/components/class-declaration/class-bases.d.ts +45 -0
  31. package/dist/src/python/components/class-declaration/class-bases.d.ts.map +1 -0
  32. package/dist/src/python/components/class-declaration/class-bases.js +84 -0
  33. package/dist/src/python/components/class-declaration/class-bases.js.map +1 -0
  34. package/dist/src/python/components/class-declaration/class-body.d.ts +16 -0
  35. package/dist/src/python/components/class-declaration/class-body.d.ts.map +1 -0
  36. package/dist/src/python/components/class-declaration/class-body.js +52 -0
  37. package/dist/src/python/components/class-declaration/class-body.js.map +1 -0
  38. package/dist/src/python/components/class-declaration/class-declaration.d.ts +23 -0
  39. package/dist/src/python/components/class-declaration/class-declaration.d.ts.map +1 -0
  40. package/dist/src/python/components/class-declaration/class-declaration.js +118 -0
  41. package/dist/src/python/components/class-declaration/class-declaration.js.map +1 -0
  42. package/dist/src/python/components/class-declaration/class-declaration.test.d.ts +2 -0
  43. package/dist/src/python/components/class-declaration/class-declaration.test.d.ts.map +1 -0
  44. package/dist/src/python/components/class-declaration/class-declaration.test.js +1527 -0
  45. package/dist/src/python/components/class-declaration/class-declaration.test.js.map +1 -0
  46. package/dist/src/python/components/class-declaration/class-member.d.ts +16 -0
  47. package/dist/src/python/components/class-declaration/class-member.d.ts.map +1 -0
  48. package/dist/src/python/components/class-declaration/class-member.js +71 -0
  49. package/dist/src/python/components/class-declaration/class-member.js.map +1 -0
  50. package/dist/src/python/components/class-declaration/class-member.test.d.ts +2 -0
  51. package/dist/src/python/components/class-declaration/class-member.test.d.ts.map +1 -0
  52. package/dist/src/python/components/class-declaration/class-member.test.js +202 -0
  53. package/dist/src/python/components/class-declaration/class-member.test.js.map +1 -0
  54. package/dist/src/python/components/class-declaration/class-method.d.ts +22 -0
  55. package/dist/src/python/components/class-declaration/class-method.d.ts.map +1 -0
  56. package/dist/src/python/components/class-declaration/class-method.js +76 -0
  57. package/dist/src/python/components/class-declaration/class-method.js.map +1 -0
  58. package/dist/src/python/components/class-declaration/class-method.test.d.ts +2 -0
  59. package/dist/src/python/components/class-declaration/class-method.test.d.ts.map +1 -0
  60. package/dist/src/python/components/class-declaration/class-method.test.js +298 -0
  61. package/dist/src/python/components/class-declaration/class-method.test.js.map +1 -0
  62. package/dist/src/python/components/class-declaration/index.d.ts +7 -0
  63. package/dist/src/python/components/class-declaration/index.d.ts.map +1 -0
  64. package/dist/src/python/components/class-declaration/index.js +7 -0
  65. package/dist/src/python/components/class-declaration/index.js.map +1 -0
  66. package/dist/src/python/components/class-declaration/primitive-initializer.d.ts +22 -0
  67. package/dist/src/python/components/class-declaration/primitive-initializer.d.ts.map +1 -0
  68. package/dist/src/python/components/class-declaration/primitive-initializer.js +67 -0
  69. package/dist/src/python/components/class-declaration/primitive-initializer.js.map +1 -0
  70. package/dist/src/python/components/doc-element/doc-element.d.ts +46 -0
  71. package/dist/src/python/components/doc-element/doc-element.d.ts.map +1 -0
  72. package/dist/src/python/components/doc-element/doc-element.js +59 -0
  73. package/dist/src/python/components/doc-element/doc-element.js.map +1 -0
  74. package/dist/src/python/components/doc-element/index.d.ts +2 -0
  75. package/dist/src/python/components/doc-element/index.d.ts.map +1 -0
  76. package/dist/src/python/components/doc-element/index.js +2 -0
  77. package/dist/src/python/components/doc-element/index.js.map +1 -0
  78. package/dist/src/python/components/enum-declaration/enum-declaration.d.ts +8 -0
  79. package/dist/src/python/components/enum-declaration/enum-declaration.d.ts.map +1 -0
  80. package/dist/src/python/components/enum-declaration/enum-declaration.js +80 -0
  81. package/dist/src/python/components/enum-declaration/enum-declaration.js.map +1 -0
  82. package/dist/src/python/components/enum-declaration/enum-declaration.test.d.ts +2 -0
  83. package/dist/src/python/components/enum-declaration/enum-declaration.test.d.ts.map +1 -0
  84. package/dist/src/python/components/enum-declaration/enum-declaration.test.js +344 -0
  85. package/dist/src/python/components/enum-declaration/enum-declaration.test.js.map +1 -0
  86. package/dist/src/python/components/enum-declaration/enum-member.d.ts +9 -0
  87. package/dist/src/python/components/enum-declaration/enum-member.d.ts.map +1 -0
  88. package/dist/src/python/components/enum-declaration/enum-member.js +22 -0
  89. package/dist/src/python/components/enum-declaration/enum-member.js.map +1 -0
  90. package/dist/src/python/components/enum-declaration/index.d.ts +3 -0
  91. package/dist/src/python/components/enum-declaration/index.d.ts.map +1 -0
  92. package/dist/src/python/components/enum-declaration/index.js +3 -0
  93. package/dist/src/python/components/enum-declaration/index.js.map +1 -0
  94. package/dist/src/python/components/function-declaration/function-declaration.d.ts +24 -0
  95. package/dist/src/python/components/function-declaration/function-declaration.d.ts.map +1 -0
  96. package/dist/src/python/components/function-declaration/function-declaration.js +68 -0
  97. package/dist/src/python/components/function-declaration/function-declaration.js.map +1 -0
  98. package/dist/src/python/components/function-declaration/function-declaration.test.d.ts +2 -0
  99. package/dist/src/python/components/function-declaration/function-declaration.test.d.ts.map +1 -0
  100. package/dist/src/python/components/function-declaration/function-declaration.test.js +682 -0
  101. package/dist/src/python/components/function-declaration/function-declaration.test.js.map +1 -0
  102. package/dist/src/python/components/function-declaration/index.d.ts +2 -0
  103. package/dist/src/python/components/function-declaration/index.d.ts.map +1 -0
  104. package/dist/src/python/components/function-declaration/index.js +2 -0
  105. package/dist/src/python/components/function-declaration/index.js.map +1 -0
  106. package/dist/src/python/components/index.d.ts +12 -0
  107. package/dist/src/python/components/index.d.ts.map +1 -0
  108. package/dist/src/python/components/index.js +12 -0
  109. package/dist/src/python/components/index.js.map +1 -0
  110. package/dist/src/python/components/protocol-declaration/callable-parameters.d.ts +25 -0
  111. package/dist/src/python/components/protocol-declaration/callable-parameters.d.ts.map +1 -0
  112. package/dist/src/python/components/protocol-declaration/callable-parameters.js +33 -0
  113. package/dist/src/python/components/protocol-declaration/callable-parameters.js.map +1 -0
  114. package/dist/src/python/components/protocol-declaration/index.d.ts +3 -0
  115. package/dist/src/python/components/protocol-declaration/index.d.ts.map +1 -0
  116. package/dist/src/python/components/protocol-declaration/index.js +3 -0
  117. package/dist/src/python/components/protocol-declaration/index.js.map +1 -0
  118. package/dist/src/python/components/protocol-declaration/protocol-declaration.d.ts +8 -0
  119. package/dist/src/python/components/protocol-declaration/protocol-declaration.d.ts.map +1 -0
  120. package/dist/src/python/components/protocol-declaration/protocol-declaration.js +86 -0
  121. package/dist/src/python/components/protocol-declaration/protocol-declaration.js.map +1 -0
  122. package/dist/src/python/components/protocol-declaration/protocol-declaration.test.d.ts +2 -0
  123. package/dist/src/python/components/protocol-declaration/protocol-declaration.test.d.ts.map +1 -0
  124. package/dist/src/python/components/protocol-declaration/protocol-declaration.test.js +117 -0
  125. package/dist/src/python/components/protocol-declaration/protocol-declaration.test.js.map +1 -0
  126. package/dist/src/python/components/record-expression/index.d.ts +2 -0
  127. package/dist/src/python/components/record-expression/index.d.ts.map +1 -0
  128. package/dist/src/python/components/record-expression/index.js +2 -0
  129. package/dist/src/python/components/record-expression/index.js.map +1 -0
  130. package/dist/src/python/components/record-expression/record-expression.d.ts +6 -0
  131. package/dist/src/python/components/record-expression/record-expression.d.ts.map +1 -0
  132. package/dist/src/python/components/record-expression/record-expression.js +13 -0
  133. package/dist/src/python/components/record-expression/record-expression.js.map +1 -0
  134. package/dist/src/python/components/record-expression/record-expression.test.d.ts +2 -0
  135. package/dist/src/python/components/record-expression/record-expression.test.d.ts.map +1 -0
  136. package/dist/src/python/components/record-expression/record-expression.test.js +19 -0
  137. package/dist/src/python/components/record-expression/record-expression.test.js.map +1 -0
  138. package/dist/src/python/components/type-alias-declaration/index.d.ts +2 -0
  139. package/dist/src/python/components/type-alias-declaration/index.d.ts.map +1 -0
  140. package/dist/src/python/components/type-alias-declaration/index.js +2 -0
  141. package/dist/src/python/components/type-alias-declaration/index.js.map +1 -0
  142. package/dist/src/python/components/type-alias-declaration/type-alias-declaration.d.ts +16 -0
  143. package/dist/src/python/components/type-alias-declaration/type-alias-declaration.d.ts.map +1 -0
  144. package/dist/src/python/components/type-alias-declaration/type-alias-declaration.js +75 -0
  145. package/dist/src/python/components/type-alias-declaration/type-alias-declaration.js.map +1 -0
  146. package/dist/src/python/components/type-alias-declaration/type-alias-declaration.test.d.ts +2 -0
  147. package/dist/src/python/components/type-alias-declaration/type-alias-declaration.test.d.ts.map +1 -0
  148. package/dist/src/python/components/type-alias-declaration/type-alias-declaration.test.js +140 -0
  149. package/dist/src/python/components/type-alias-declaration/type-alias-declaration.test.js.map +1 -0
  150. package/dist/src/python/components/type-declaration/index.d.ts +2 -0
  151. package/dist/src/python/components/type-declaration/index.d.ts.map +1 -0
  152. package/dist/src/python/components/type-declaration/index.js +2 -0
  153. package/dist/src/python/components/type-declaration/index.js.map +1 -0
  154. package/dist/src/python/components/type-declaration/type-declaration.d.ts +11 -0
  155. package/dist/src/python/components/type-declaration/type-declaration.d.ts.map +1 -0
  156. package/dist/src/python/components/type-declaration/type-declaration.js +31 -0
  157. package/dist/src/python/components/type-declaration/type-declaration.js.map +1 -0
  158. package/dist/src/python/components/type-declaration/type-declaration.test.d.ts +2 -0
  159. package/dist/src/python/components/type-declaration/type-declaration.test.d.ts.map +1 -0
  160. package/dist/src/python/components/type-declaration/type-declaration.test.js +69 -0
  161. package/dist/src/python/components/type-declaration/type-declaration.test.js.map +1 -0
  162. package/dist/src/python/components/type-expression/index.d.ts +2 -0
  163. package/dist/src/python/components/type-expression/index.d.ts.map +1 -0
  164. package/dist/src/python/components/type-expression/index.js +2 -0
  165. package/dist/src/python/components/type-expression/index.js.map +1 -0
  166. package/dist/src/python/components/type-expression/type-expression.d.ts +12 -0
  167. package/dist/src/python/components/type-expression/type-expression.d.ts.map +1 -0
  168. package/dist/src/python/components/type-expression/type-expression.js +348 -0
  169. package/dist/src/python/components/type-expression/type-expression.js.map +1 -0
  170. package/dist/src/python/components/type-expression/type-expression.test.d.ts +2 -0
  171. package/dist/src/python/components/type-expression/type-expression.test.d.ts.map +1 -0
  172. package/dist/src/python/components/type-expression/type-expression.test.js +503 -0
  173. package/dist/src/python/components/type-expression/type-expression.test.js.map +1 -0
  174. package/dist/src/python/index.d.ts +4 -0
  175. package/dist/src/python/index.d.ts.map +1 -0
  176. package/dist/src/python/index.js +4 -0
  177. package/dist/src/python/index.js.map +1 -0
  178. package/dist/src/python/lib.d.ts +68 -0
  179. package/dist/src/python/lib.d.ts.map +1 -0
  180. package/dist/src/python/lib.js +38 -0
  181. package/dist/src/python/lib.js.map +1 -0
  182. package/dist/src/python/test-utils.d.ts +8 -0
  183. package/dist/src/python/test-utils.d.ts.map +1 -0
  184. package/dist/src/python/test-utils.js +25 -0
  185. package/dist/src/python/test-utils.js.map +1 -0
  186. package/dist/src/python/utils/index.d.ts +4 -0
  187. package/dist/src/python/utils/index.d.ts.map +1 -0
  188. package/dist/src/python/utils/index.js +4 -0
  189. package/dist/src/python/utils/index.js.map +1 -0
  190. package/dist/src/python/utils/operation.d.ts +27 -0
  191. package/dist/src/python/utils/operation.d.ts.map +1 -0
  192. package/dist/src/python/utils/operation.js +139 -0
  193. package/dist/src/python/utils/operation.js.map +1 -0
  194. package/dist/src/python/utils/refkey.d.ts +23 -0
  195. package/dist/src/python/utils/refkey.d.ts.map +1 -0
  196. package/dist/src/python/utils/refkey.js +36 -0
  197. package/dist/src/python/utils/refkey.js.map +1 -0
  198. package/dist/src/python/utils/type.d.ts +19 -0
  199. package/dist/src/python/utils/type.d.ts.map +1 -0
  200. package/dist/src/python/utils/type.js +24 -0
  201. package/dist/src/python/utils/type.js.map +1 -0
  202. package/package.json +12 -5
  203. package/package.json.bak +14 -6
  204. package/src/python/builtins.ts +43 -0
  205. package/src/python/components/array-expression/array-expression.test.tsx +14 -0
  206. package/src/python/components/array-expression/array-expression.tsx +11 -0
  207. package/src/python/components/array-expression/index.ts +1 -0
  208. package/src/python/components/atom/atom.test.tsx +244 -0
  209. package/src/python/components/atom/atom.tsx +95 -0
  210. package/src/python/components/atom/index.ts +1 -0
  211. package/src/python/components/class-declaration/class-bases.tsx +92 -0
  212. package/src/python/components/class-declaration/class-body.tsx +56 -0
  213. package/src/python/components/class-declaration/class-declaration.test.tsx +1414 -0
  214. package/src/python/components/class-declaration/class-declaration.tsx +116 -0
  215. package/src/python/components/class-declaration/class-member.test.tsx +194 -0
  216. package/src/python/components/class-declaration/class-member.tsx +67 -0
  217. package/src/python/components/class-declaration/class-method.test.tsx +250 -0
  218. package/src/python/components/class-declaration/class-method.tsx +97 -0
  219. package/src/python/components/class-declaration/index.ts +6 -0
  220. package/src/python/components/class-declaration/primitive-initializer.tsx +62 -0
  221. package/src/python/components/doc-element/doc-element.tsx +83 -0
  222. package/src/python/components/doc-element/index.ts +1 -0
  223. package/src/python/components/enum-declaration/enum-declaration.test.tsx +319 -0
  224. package/src/python/components/enum-declaration/enum-declaration.tsx +77 -0
  225. package/src/python/components/enum-declaration/enum-member.tsx +21 -0
  226. package/src/python/components/enum-declaration/index.ts +2 -0
  227. package/src/python/components/function-declaration/function-declaration.test.tsx +582 -0
  228. package/src/python/components/function-declaration/function-declaration.tsx +90 -0
  229. package/src/python/components/function-declaration/index.ts +1 -0
  230. package/src/python/components/index.ts +11 -0
  231. package/src/python/components/protocol-declaration/callable-parameters.tsx +44 -0
  232. package/src/python/components/protocol-declaration/index.ts +2 -0
  233. package/src/python/components/protocol-declaration/protocol-declaration.test.tsx +106 -0
  234. package/src/python/components/protocol-declaration/protocol-declaration.tsx +73 -0
  235. package/src/python/components/record-expression/index.ts +1 -0
  236. package/src/python/components/record-expression/record-expression.test.tsx +14 -0
  237. package/src/python/components/record-expression/record-expression.tsx +13 -0
  238. package/src/python/components/type-alias-declaration/index.ts +1 -0
  239. package/src/python/components/type-alias-declaration/type-alias-declaration.test.tsx +117 -0
  240. package/src/python/components/type-alias-declaration/type-alias-declaration.tsx +67 -0
  241. package/src/python/components/type-declaration/index.ts +1 -0
  242. package/src/python/components/type-declaration/type-declaration.test.tsx +58 -0
  243. package/src/python/components/type-declaration/type-declaration.tsx +26 -0
  244. package/src/python/components/type-expression/index.ts +1 -0
  245. package/src/python/components/type-expression/type-expression.test.tsx +463 -0
  246. package/src/python/components/type-expression/type-expression.tsx +333 -0
  247. package/src/python/index.ts +3 -0
  248. package/src/python/lib.ts +40 -0
  249. package/src/python/test-utils.tsx +31 -0
  250. package/src/python/utils/index.ts +3 -0
  251. package/src/python/utils/operation.ts +161 -0
  252. package/src/python/utils/refkey.ts +36 -0
  253. package/src/python/utils/type.ts +31 -0
@@ -0,0 +1,348 @@
1
+ import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
+ import { Experimental_OverridableComponent } from "#core/components/index.js";
3
+ import { useTsp } from "#core/context/index.js";
4
+ import { reportPythonDiagnostic } from "#python/lib.js";
5
+ import { code, For, List, mapJoin } from "@alloy-js/core";
6
+ import * as py from "@alloy-js/python";
7
+ import { isNeverType } from "@typespec/compiler";
8
+ import { datetimeModule, decimalModule, typingModule } from "../../builtins.js";
9
+ import { efRefkey } from "../../utils/refkey.js";
10
+ import { ArrayExpression } from "../array-expression/array-expression.js";
11
+ import { RecordExpression } from "../record-expression/record-expression.js";
12
+ export function TypeExpression(props) {
13
+ const {
14
+ $
15
+ } = useTsp();
16
+ const type = props.type;
17
+ if (!props.noReference && isDeclaration($, type)) {
18
+ return _$createComponent(Experimental_OverridableComponent, {
19
+ reference: true,
20
+ type: type,
21
+ get children() {
22
+ return _$createComponent(py.Reference, {
23
+ get refkey() {
24
+ return efRefkey(type);
25
+ }
26
+ });
27
+ }
28
+ });
29
+ }
30
+ switch (type.kind) {
31
+ case "Scalar": // Custom types based on primitives (Intrinsics)
32
+ case "Intrinsic":
33
+ // Language primitives like `string`, `number`, etc.
34
+ if (isNeverType(type)) {
35
+ return typingModule["."]["Never"];
36
+ }
37
+ return [_$memo(() => getScalarIntrinsicExpression($, type))];
38
+ case "Boolean":
39
+ case "Number":
40
+ case "String":
41
+ // Single literal values are wrapped in Literal[...]
42
+ return [_$memo(() => typingModule["."]["Literal"]), "[", _$memo(() => formatLiteralValue(type)), "]"];
43
+ case "Tuple":
44
+ return ["tuple[", _$createComponent(For, {
45
+ get each() {
46
+ return type.values;
47
+ },
48
+ comma: true,
49
+ space: true,
50
+ children: element => _$createComponent(TypeExpression, {
51
+ type: element
52
+ })
53
+ }), "]"];
54
+ case "Union":
55
+ {
56
+ const variants = Array.from(type.variants?.values?.() ?? []);
57
+
58
+ // Check if all variants are literals or named union variant refs with literal values
59
+ const isLiteralOrVariantRef = t => {
60
+ if (!t) return false;
61
+ if (isLiteral($, t)) return true;
62
+ // Named union variant with a literal inner value
63
+ if (t.kind === "UnionVariant" && t.union?.name) {
64
+ return isLiteral($, t.type);
65
+ }
66
+ return false;
67
+ };
68
+ const innerTypes = variants.map(v => v.type);
69
+ if (innerTypes.every(isLiteralOrVariantRef)) {
70
+ // All literals - render as Literal[...]
71
+ const literalValues = variants.map(v => {
72
+ const innerType = v.type;
73
+ // Named union variant ref with literal value
74
+ if (innerType.kind === "UnionVariant" && innerType.union?.name) {
75
+ const variantName = String(innerType.name).toUpperCase();
76
+ return code`${efRefkey(innerType.union)}.${variantName}`;
77
+ }
78
+ if (isLiteral($, innerType)) {
79
+ return formatLiteralValue(innerType);
80
+ }
81
+ return undefined;
82
+ }).filter(Boolean);
83
+ return [_$memo(() => typingModule["."]["Literal"]), "[", _$createComponent(List, {
84
+ children: literalValues,
85
+ joiner: ", "
86
+ }), "]"];
87
+ }
88
+
89
+ // Not all literals - render as union type
90
+ return mapJoin(() => variants, v => _$createComponent(TypeExpression, {
91
+ get type() {
92
+ return v.type;
93
+ }
94
+ }), {
95
+ joiner: " | "
96
+ });
97
+ }
98
+ case "UnionVariant":
99
+ {
100
+ // Union variant from a named union with a literal value
101
+ if (type.union && type.union.name && isLiteral($, type.type)) {
102
+ // Use the variant's name (e.g., "red", "active"), converted to UPPER_CASE by the enum
103
+ const variantName = String(type.name).toUpperCase();
104
+ return [_$memo(() => typingModule["."]["Literal"]), "[", _$memo(() => efRefkey(type.union)), ".", variantName, "]"];
105
+ }
106
+ // Unnamed union variant or non-literal value, unwrap to its inner type
107
+ return _$createComponent(TypeExpression, {
108
+ get type() {
109
+ return type.type;
110
+ }
111
+ });
112
+ }
113
+ case "ModelProperty":
114
+ return _$createComponent(TypeExpression, {
115
+ get type() {
116
+ return type.type;
117
+ }
118
+ });
119
+ case "Model":
120
+ if ($.array.is(type)) {
121
+ const elementType = type.indexer.value;
122
+ return _$createComponent(ArrayExpression, {
123
+ elementType: elementType
124
+ });
125
+ }
126
+ if ($.record.is(type)) {
127
+ const elementType = type.indexer.value;
128
+ return _$createComponent(RecordExpression, {
129
+ elementType: elementType
130
+ });
131
+ }
132
+
133
+ // TODO: When TypeSpec adds true generics support, handle generic type references here.
134
+ // Currently, TypeSpec templates are macros that expand to concrete types, so template
135
+ // instances (e.g., Response<string>) are treated as regular concrete types, not as
136
+ // parameterized generic types (e.g., Response[str]).
137
+ // When generics are implemented, this is where we would render: ClassName[TypeArg, ...]
138
+
139
+ // Regular named models should be handled as references
140
+ if (type.name) {
141
+ return _$createComponent(Experimental_OverridableComponent, {
142
+ reference: true,
143
+ type: type,
144
+ get children() {
145
+ return _$createComponent(py.Reference, {
146
+ get refkey() {
147
+ return efRefkey(type);
148
+ }
149
+ });
150
+ }
151
+ });
152
+ }
153
+ reportPythonDiagnostic($.program, {
154
+ code: "python-unsupported-type",
155
+ target: type
156
+ });
157
+ return [];
158
+ case "TemplateParameter":
159
+ return code`${String(type.node.id.sv)}`;
160
+ case "Operation":
161
+ {
162
+ // Render function types as typing.Callable[[ArgTypes...], ReturnType]
163
+ // If parameters cannot be enumerated, fall back to Callable[..., ReturnType]
164
+ let paramTypes = null;
165
+ const op = type;
166
+ if (op.parameters) {
167
+ try {
168
+ const {
169
+ $
170
+ } = useTsp();
171
+ const modelProps = $.model.getProperties(op.parameters);
172
+ paramTypes = Array.from(modelProps.values()).map(p => p.type);
173
+ } catch {
174
+ // Unknown/unsupported params shape
175
+ paramTypes = null;
176
+ }
177
+ } else {
178
+ paramTypes = [];
179
+ }
180
+ return [_$memo(() => typingModule["."]["Callable"]), "[", _$memo(() => paramTypes === null ? ["..."] : paramTypes.length > 0 ? ["[", _$createComponent(For, {
181
+ each: paramTypes,
182
+ comma: true,
183
+ space: true,
184
+ children: t => _$createComponent(TypeExpression, {
185
+ type: t
186
+ })
187
+ }), "]"] : ["[]"]), ", ", _$createComponent(TypeExpression, {
188
+ get type() {
189
+ return type.returnType;
190
+ }
191
+ }), "]"];
192
+ }
193
+ default:
194
+ reportPythonDiagnostic($.program, {
195
+ code: "python-unsupported-type",
196
+ target: type
197
+ });
198
+ // Return empty fragment - the diagnostic has already been reported
199
+ return [];
200
+ }
201
+ }
202
+
203
+ /**
204
+ * Checks if a type is a literal (string, numeric, or boolean).
205
+ */
206
+ function isLiteral($, type) {
207
+ return $.literal.isString(type) || $.literal.isNumeric(type) || $.literal.isBoolean(type);
208
+ }
209
+
210
+ /**
211
+ * Formats a literal type value for use in Python's Literal[...] syntax.
212
+ */
213
+ function formatLiteralValue(type) {
214
+ switch (type.kind) {
215
+ case "String":
216
+ return JSON.stringify(type.value);
217
+ case "Boolean":
218
+ return type.value ? "True" : "False";
219
+ case "Number":
220
+ return String(type.value);
221
+ default:
222
+ return String(type.value);
223
+ }
224
+ }
225
+ const intrinsicNameToPythonType = new Map([
226
+ // Core types
227
+ ["unknown", "Any"],
228
+ // Matches Python's `Any`
229
+ ["string", "str"],
230
+ // Matches Python's `str`
231
+ ["boolean", "bool"],
232
+ // Matches Python's `bool`
233
+ ["null", "None"],
234
+ // Matches Python's `None`
235
+ ["void", "None"],
236
+ // Matches Python's `None`
237
+ ["never", "Never"],
238
+ // Matches Python's `Never`
239
+ ["bytes", "bytes"],
240
+ // Matches Python's `bytes`
241
+
242
+ // Numeric types
243
+ ["numeric", "number"],
244
+ // Parent type for all numeric types
245
+ ["integer", "int"],
246
+ // Broad integer category, maps to `int`
247
+ ["float", "float"],
248
+ // Broad float category, maps to `float`
249
+ ["decimal", "Decimal"],
250
+ // Broad decimal category, maps to `Decimal`
251
+ ["decimal128", "Decimal"],
252
+ // 128-bit decimal category, maps to `Decimal`
253
+ ["int64", "int"],
254
+ // Use `int` to handle large 64-bit integers
255
+ ["int32", "int"],
256
+ // 32-bit integer fits in Python's `int`
257
+ ["int16", "int"],
258
+ // 16-bit integer
259
+ ["int8", "int"],
260
+ // 8-bit integer
261
+ ["safeint", "int"],
262
+ // Safe integer fits within Python limits
263
+ ["uint64", "int"],
264
+ // Use `int` for unsigned 64-bit integers
265
+ ["uint32", "int"],
266
+ // 32-bit unsigned integer
267
+ ["uint16", "int"],
268
+ // 16-bit unsigned integer
269
+ ["uint8", "int"],
270
+ // 8-bit unsigned integer
271
+ ["float32", "float"],
272
+ // Maps to Python's `float`
273
+ ["float64", "float"],
274
+ // Maps to Python's `float`.
275
+
276
+ // Date and time types
277
+ ["plainDate", "str"],
278
+ // Use `str` for plain calendar dates
279
+ ["plainTime", "str"],
280
+ // Use `str` for plain clock times
281
+ ["utcDateTime", "datetime"],
282
+ // Use `datetime` for UTC date-times
283
+ ["offsetDateTime", "str"],
284
+ // Use `str` for timezone-specific date-times
285
+ ["duration", "str"],
286
+ // Duration as an ISO 8601 string or custom format
287
+
288
+ // String types
289
+ ["url", "str"] // Matches Python's `str`
290
+ ]);
291
+ const pythonTypeToImport = new Map([["Any", typingModule["."]["Any"]], ["Never", typingModule["."]["Never"]], ["datetime", datetimeModule["."]["datetime"]], ["Decimal", decimalModule["."]["Decimal"]]]);
292
+ function getScalarIntrinsicExpression($, type) {
293
+ let intrinsicName;
294
+ if ($.scalar.is(type)) {
295
+ if ($.scalar.isUtcDateTime(type) || $.scalar.extendsUtcDateTime(type)) {
296
+ const encoding = $.scalar.getEncoding(type);
297
+ intrinsicName = "utcDateTime";
298
+ switch (encoding?.encoding) {
299
+ case "unixTimestamp":
300
+ case "rfc7231":
301
+ case "rfc3339":
302
+ default:
303
+ intrinsicName = `utcDateTime`;
304
+ break;
305
+ }
306
+ }
307
+ intrinsicName = $.scalar.getStdBase(type)?.name ?? "";
308
+ } else {
309
+ intrinsicName = type.name;
310
+ }
311
+ let pythonType = intrinsicNameToPythonType.get(intrinsicName);
312
+ const importModule = pythonTypeToImport.get(pythonType ?? "");
313
+ pythonType = importModule ? importModule : pythonType;
314
+ if (!pythonType) {
315
+ reportPythonDiagnostic($.program, {
316
+ code: "python-unsupported-scalar",
317
+ target: type
318
+ });
319
+ return "any";
320
+ }
321
+ return pythonType;
322
+ }
323
+
324
+ // TODO: When TypeSpec adds true generics support, add helper to detect generic type instances.
325
+ // Currently, TypeSpec templates expand to concrete types at compile time, so we treat all
326
+ // template instances as regular concrete types.
327
+
328
+ function isDeclaration($, type) {
329
+ switch (type.kind) {
330
+ case "Namespace":
331
+ case "Interface":
332
+ case "Enum":
333
+ case "Operation":
334
+ case "EnumMember":
335
+ case "UnionVariant":
336
+ return false;
337
+ case "Model":
338
+ if ($.array.is(type) || $.record.is(type)) {
339
+ return false;
340
+ }
341
+ return Boolean(type.name);
342
+ case "Union":
343
+ return Boolean(type.name);
344
+ default:
345
+ return false;
346
+ }
347
+ }
348
+ //# sourceMappingURL=type-expression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Experimental_OverridableComponent","useTsp","reportPythonDiagnostic","code","For","List","mapJoin","py","isNeverType","datetimeModule","decimalModule","typingModule","efRefkey","ArrayExpression","RecordExpression","TypeExpression","props","$","type","noReference","isDeclaration","_$createComponent","reference","children","Reference","refkey","kind","_$memo","getScalarIntrinsicExpression","formatLiteralValue","each","values","comma","space","element","variants","Array","from","isLiteralOrVariantRef","t","isLiteral","union","name","innerTypes","map","v","every","literalValues","innerType","variantName","String","toUpperCase","undefined","filter","Boolean","joiner","array","is","elementType","indexer","value","record","program","target","node","id","sv","paramTypes","op","parameters","modelProps","model","getProperties","p","length","returnType","literal","isString","isNumeric","isBoolean","JSON","stringify","intrinsicNameToPythonType","Map","pythonTypeToImport","intrinsicName","scalar","isUtcDateTime","extendsUtcDateTime","encoding","getEncoding","getStdBase","pythonType","get","importModule"],"sources":["../../../../../src/python/components/type-expression/type-expression.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,iCAAiC,QAAQ,2BAA2B;AAC7E,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,s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//# sourceMappingURL=type-expression.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-expression.test.d.ts","sourceRoot":"","sources":["../../../../../src/python/components/type-expression/type-expression.test.tsx"],"names":[],"mappings":""}