@gtkx/codegen 0.21.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 (340) hide show
  1. package/LICENSE +373 -0
  2. package/dist/dsl/context.d.ts +104 -0
  3. package/dist/dsl/context.d.ts.map +1 -0
  4. package/dist/dsl/context.js +140 -0
  5. package/dist/dsl/context.js.map +1 -0
  6. package/dist/dsl/emit.d.ts +28 -0
  7. package/dist/dsl/emit.d.ts.map +1 -0
  8. package/dist/dsl/emit.js +41 -0
  9. package/dist/dsl/emit.js.map +1 -0
  10. package/dist/dsl/identifier.d.ts +28 -0
  11. package/dist/dsl/identifier.d.ts.map +1 -0
  12. package/dist/dsl/identifier.js +45 -0
  13. package/dist/dsl/identifier.js.map +1 -0
  14. package/dist/dsl/imports.d.ts +58 -0
  15. package/dist/dsl/imports.d.ts.map +1 -0
  16. package/dist/dsl/imports.js +107 -0
  17. package/dist/dsl/imports.js.map +1 -0
  18. package/dist/dsl/module.d.ts +53 -0
  19. package/dist/dsl/module.d.ts.map +1 -0
  20. package/dist/dsl/module.js +76 -0
  21. package/dist/dsl/module.js.map +1 -0
  22. package/dist/ffi/pipeline.d.ts +19 -0
  23. package/dist/ffi/pipeline.d.ts.map +1 -0
  24. package/dist/ffi/pipeline.js +107 -0
  25. package/dist/ffi/pipeline.js.map +1 -0
  26. package/dist/fingerprint.d.ts +30 -0
  27. package/dist/fingerprint.d.ts.map +1 -0
  28. package/dist/fingerprint.js +33 -0
  29. package/dist/fingerprint.js.map +1 -0
  30. package/dist/gi-store.d.ts +34 -0
  31. package/dist/gi-store.d.ts.map +1 -0
  32. package/dist/gi-store.js +154 -0
  33. package/dist/gi-store.js.map +1 -0
  34. package/dist/gir/boxed.d.ts +66 -0
  35. package/dist/gir/boxed.d.ts.map +1 -0
  36. package/dist/gir/boxed.js +49 -0
  37. package/dist/gir/boxed.js.map +1 -0
  38. package/dist/gir/callback.d.ts +15 -0
  39. package/dist/gir/callback.d.ts.map +1 -0
  40. package/dist/gir/callback.js +17 -0
  41. package/dist/gir/callback.js.map +1 -0
  42. package/dist/gir/class.d.ts +49 -0
  43. package/dist/gir/class.d.ts.map +1 -0
  44. package/dist/gir/class.js +42 -0
  45. package/dist/gir/class.js.map +1 -0
  46. package/dist/gir/enum.d.ts +39 -0
  47. package/dist/gir/enum.d.ts.map +1 -0
  48. package/dist/gir/enum.js +24 -0
  49. package/dist/gir/enum.js.map +1 -0
  50. package/dist/gir/field.d.ts +27 -0
  51. package/dist/gir/field.d.ts.map +1 -0
  52. package/dist/gir/field.js +19 -0
  53. package/dist/gir/field.js.map +1 -0
  54. package/dist/gir/function.d.ts +47 -0
  55. package/dist/gir/function.d.ts.map +1 -0
  56. package/dist/gir/function.js +28 -0
  57. package/dist/gir/function.js.map +1 -0
  58. package/dist/gir/namespace.d.ts +65 -0
  59. package/dist/gir/namespace.d.ts.map +1 -0
  60. package/dist/gir/namespace.js +60 -0
  61. package/dist/gir/namespace.js.map +1 -0
  62. package/dist/gir/parameter.d.ts +82 -0
  63. package/dist/gir/parameter.d.ts.map +1 -0
  64. package/dist/gir/parameter.js +66 -0
  65. package/dist/gir/parameter.js.map +1 -0
  66. package/dist/gir/parse.d.ts +78 -0
  67. package/dist/gir/parse.d.ts.map +1 -0
  68. package/dist/gir/parse.js +155 -0
  69. package/dist/gir/parse.js.map +1 -0
  70. package/dist/gir/primitives.d.ts +36 -0
  71. package/dist/gir/primitives.d.ts.map +1 -0
  72. package/dist/gir/primitives.js +109 -0
  73. package/dist/gir/primitives.js.map +1 -0
  74. package/dist/gir/property.d.ts +29 -0
  75. package/dist/gir/property.d.ts.map +1 -0
  76. package/dist/gir/property.js +16 -0
  77. package/dist/gir/property.js.map +1 -0
  78. package/dist/gir/qualified-name.d.ts +37 -0
  79. package/dist/gir/qualified-name.d.ts.map +1 -0
  80. package/dist/gir/qualified-name.js +39 -0
  81. package/dist/gir/qualified-name.js.map +1 -0
  82. package/dist/gir/qualify.d.ts +32 -0
  83. package/dist/gir/qualify.d.ts.map +1 -0
  84. package/dist/gir/qualify.js +60 -0
  85. package/dist/gir/qualify.js.map +1 -0
  86. package/dist/gir/repository.d.ts +82 -0
  87. package/dist/gir/repository.d.ts.map +1 -0
  88. package/dist/gir/repository.js +122 -0
  89. package/dist/gir/repository.js.map +1 -0
  90. package/dist/gir/signal.d.ts +22 -0
  91. package/dist/gir/signal.d.ts.map +1 -0
  92. package/dist/gir/signal.js +20 -0
  93. package/dist/gir/signal.js.map +1 -0
  94. package/dist/gir/size.d.ts +67 -0
  95. package/dist/gir/size.d.ts.map +1 -0
  96. package/dist/gir/size.js +87 -0
  97. package/dist/gir/size.js.map +1 -0
  98. package/dist/gir/type-ref.d.ts +79 -0
  99. package/dist/gir/type-ref.d.ts.map +1 -0
  100. package/dist/gir/type-ref.js +101 -0
  101. package/dist/gir/type-ref.js.map +1 -0
  102. package/dist/index.d.ts +12 -0
  103. package/dist/index.d.ts.map +1 -0
  104. package/dist/index.js +12 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/jsx-store.d.ts +22 -0
  107. package/dist/jsx-store.d.ts.map +1 -0
  108. package/dist/jsx-store.js +40 -0
  109. package/dist/jsx-store.js.map +1 -0
  110. package/dist/react/compounds-meta.d.ts +18 -0
  111. package/dist/react/compounds-meta.d.ts.map +1 -0
  112. package/dist/react/compounds-meta.js +93 -0
  113. package/dist/react/compounds-meta.js.map +1 -0
  114. package/dist/react/compounds.d.ts +27 -0
  115. package/dist/react/compounds.d.ts.map +1 -0
  116. package/dist/react/compounds.js +164 -0
  117. package/dist/react/compounds.js.map +1 -0
  118. package/dist/react/internal.d.ts +14 -0
  119. package/dist/react/internal.d.ts.map +1 -0
  120. package/dist/react/internal.js +79 -0
  121. package/dist/react/internal.js.map +1 -0
  122. package/dist/react/jsx.d.ts +22 -0
  123. package/dist/react/jsx.d.ts.map +1 -0
  124. package/dist/react/jsx.js +134 -0
  125. package/dist/react/jsx.js.map +1 -0
  126. package/dist/react/pipeline.d.ts +13 -0
  127. package/dist/react/pipeline.d.ts.map +1 -0
  128. package/dist/react/pipeline.js +25 -0
  129. package/dist/react/pipeline.js.map +1 -0
  130. package/dist/react/props.d.ts +38 -0
  131. package/dist/react/props.d.ts.map +1 -0
  132. package/dist/react/props.js +231 -0
  133. package/dist/react/props.js.map +1 -0
  134. package/dist/react/slot-props.d.ts +10 -0
  135. package/dist/react/slot-props.d.ts.map +1 -0
  136. package/dist/react/slot-props.js +56 -0
  137. package/dist/react/slot-props.js.map +1 -0
  138. package/dist/react/widgets.d.ts +83 -0
  139. package/dist/react/widgets.d.ts.map +1 -0
  140. package/dist/react/widgets.js +152 -0
  141. package/dist/react/widgets.js.map +1 -0
  142. package/dist/runner.d.ts +55 -0
  143. package/dist/runner.d.ts.map +1 -0
  144. package/dist/runner.js +60 -0
  145. package/dist/runner.js.map +1 -0
  146. package/dist/store-fs.d.ts +109 -0
  147. package/dist/store-fs.d.ts.map +1 -0
  148. package/dist/store-fs.js +98 -0
  149. package/dist/store-fs.js.map +1 -0
  150. package/dist/transpile.d.ts +32 -0
  151. package/dist/transpile.d.ts.map +1 -0
  152. package/dist/transpile.js +63 -0
  153. package/dist/transpile.js.map +1 -0
  154. package/dist/typecheck-store.d.ts +41 -0
  155. package/dist/typecheck-store.d.ts.map +1 -0
  156. package/dist/typecheck-store.js +102 -0
  157. package/dist/typecheck-store.js.map +1 -0
  158. package/dist/writers/alias.d.ts +13 -0
  159. package/dist/writers/alias.d.ts.map +1 -0
  160. package/dist/writers/alias.js +17 -0
  161. package/dist/writers/alias.js.map +1 -0
  162. package/dist/writers/async.d.ts +22 -0
  163. package/dist/writers/async.d.ts.map +1 -0
  164. package/dist/writers/async.js +48 -0
  165. package/dist/writers/async.js.map +1 -0
  166. package/dist/writers/boxed-constructor.d.ts +26 -0
  167. package/dist/writers/boxed-constructor.d.ts.map +1 -0
  168. package/dist/writers/boxed-constructor.js +85 -0
  169. package/dist/writers/boxed-constructor.js.map +1 -0
  170. package/dist/writers/boxed-field-accessor.d.ts +18 -0
  171. package/dist/writers/boxed-field-accessor.d.ts.map +1 -0
  172. package/dist/writers/boxed-field-accessor.js +260 -0
  173. package/dist/writers/boxed-field-accessor.js.map +1 -0
  174. package/dist/writers/boxed-layout.d.ts +27 -0
  175. package/dist/writers/boxed-layout.d.ts.map +1 -0
  176. package/dist/writers/boxed-layout.js +128 -0
  177. package/dist/writers/boxed-layout.js.map +1 -0
  178. package/dist/writers/boxed.d.ts +20 -0
  179. package/dist/writers/boxed.d.ts.map +1 -0
  180. package/dist/writers/boxed.js +71 -0
  181. package/dist/writers/boxed.js.map +1 -0
  182. package/dist/writers/callables.d.ts +124 -0
  183. package/dist/writers/callables.d.ts.map +1 -0
  184. package/dist/writers/callables.js +283 -0
  185. package/dist/writers/callables.js.map +1 -0
  186. package/dist/writers/callback.d.ts +16 -0
  187. package/dist/writers/callback.d.ts.map +1 -0
  188. package/dist/writers/callback.js +38 -0
  189. package/dist/writers/callback.js.map +1 -0
  190. package/dist/writers/class-struct-record.d.ts +31 -0
  191. package/dist/writers/class-struct-record.d.ts.map +1 -0
  192. package/dist/writers/class-struct-record.js +67 -0
  193. package/dist/writers/class-struct-record.js.map +1 -0
  194. package/dist/writers/class-struct.d.ts +22 -0
  195. package/dist/writers/class-struct.d.ts.map +1 -0
  196. package/dist/writers/class-struct.js +85 -0
  197. package/dist/writers/class-struct.js.map +1 -0
  198. package/dist/writers/class.d.ts +16 -0
  199. package/dist/writers/class.d.ts.map +1 -0
  200. package/dist/writers/class.js +307 -0
  201. package/dist/writers/class.js.map +1 -0
  202. package/dist/writers/constant.d.ts +15 -0
  203. package/dist/writers/constant.d.ts.map +1 -0
  204. package/dist/writers/constant.js +23 -0
  205. package/dist/writers/constant.js.map +1 -0
  206. package/dist/writers/constants.d.ts +15 -0
  207. package/dist/writers/constants.d.ts.map +1 -0
  208. package/dist/writers/constants.js +23 -0
  209. package/dist/writers/constants.js.map +1 -0
  210. package/dist/writers/constructor-props.d.ts +32 -0
  211. package/dist/writers/constructor-props.d.ts.map +1 -0
  212. package/dist/writers/constructor-props.js +110 -0
  213. package/dist/writers/constructor-props.js.map +1 -0
  214. package/dist/writers/enum.d.ts +21 -0
  215. package/dist/writers/enum.d.ts.map +1 -0
  216. package/dist/writers/enum.js +48 -0
  217. package/dist/writers/enum.js.map +1 -0
  218. package/dist/writers/function.d.ts +40 -0
  219. package/dist/writers/function.d.ts.map +1 -0
  220. package/dist/writers/function.js +127 -0
  221. package/dist/writers/function.js.map +1 -0
  222. package/dist/writers/gtype-binding.d.ts +19 -0
  223. package/dist/writers/gtype-binding.d.ts.map +1 -0
  224. package/dist/writers/gtype-binding.js +40 -0
  225. package/dist/writers/gtype-binding.js.map +1 -0
  226. package/dist/writers/inheritance.d.ts +48 -0
  227. package/dist/writers/inheritance.d.ts.map +1 -0
  228. package/dist/writers/inheritance.js +90 -0
  229. package/dist/writers/inheritance.js.map +1 -0
  230. package/dist/writers/interface.d.ts +16 -0
  231. package/dist/writers/interface.d.ts.map +1 -0
  232. package/dist/writers/interface.js +155 -0
  233. package/dist/writers/interface.js.map +1 -0
  234. package/dist/writers/method.d.ts +150 -0
  235. package/dist/writers/method.d.ts.map +1 -0
  236. package/dist/writers/method.js +510 -0
  237. package/dist/writers/method.js.map +1 -0
  238. package/dist/writers/param-classify.d.ts +93 -0
  239. package/dist/writers/param-classify.d.ts.map +1 -0
  240. package/dist/writers/param-classify.js +163 -0
  241. package/dist/writers/param-classify.js.map +1 -0
  242. package/dist/writers/property-accessor.d.ts +19 -0
  243. package/dist/writers/property-accessor.d.ts.map +1 -0
  244. package/dist/writers/property-accessor.js +117 -0
  245. package/dist/writers/property-accessor.js.map +1 -0
  246. package/dist/writers/registration.d.ts +27 -0
  247. package/dist/writers/registration.d.ts.map +1 -0
  248. package/dist/writers/registration.js +30 -0
  249. package/dist/writers/registration.js.map +1 -0
  250. package/dist/writers/return-wrap.d.ts +39 -0
  251. package/dist/writers/return-wrap.d.ts.map +1 -0
  252. package/dist/writers/return-wrap.js +152 -0
  253. package/dist/writers/return-wrap.js.map +1 -0
  254. package/dist/writers/runtime-override.d.ts +18 -0
  255. package/dist/writers/runtime-override.d.ts.map +1 -0
  256. package/dist/writers/runtime-override.js +44 -0
  257. package/dist/writers/runtime-override.js.map +1 -0
  258. package/dist/writers/signal.d.ts +21 -0
  259. package/dist/writers/signal.d.ts.map +1 -0
  260. package/dist/writers/signal.js +260 -0
  261. package/dist/writers/signal.js.map +1 -0
  262. package/dist/writers/ts-type.d.ts +50 -0
  263. package/dist/writers/ts-type.d.ts.map +1 -0
  264. package/dist/writers/ts-type.js +75 -0
  265. package/dist/writers/ts-type.js.map +1 -0
  266. package/dist/writers/types-ts.d.ts +27 -0
  267. package/dist/writers/types-ts.d.ts.map +1 -0
  268. package/dist/writers/types-ts.js +97 -0
  269. package/dist/writers/types-ts.js.map +1 -0
  270. package/dist/writers/value.d.ts +89 -0
  271. package/dist/writers/value.d.ts.map +1 -0
  272. package/dist/writers/value.js +402 -0
  273. package/dist/writers/value.js.map +1 -0
  274. package/package.json +55 -0
  275. package/src/dsl/context.ts +146 -0
  276. package/src/dsl/emit.ts +42 -0
  277. package/src/dsl/identifier.ts +52 -0
  278. package/src/dsl/imports.ts +109 -0
  279. package/src/dsl/module.ts +75 -0
  280. package/src/ffi/pipeline.ts +113 -0
  281. package/src/fingerprint.ts +50 -0
  282. package/src/gi-store.ts +199 -0
  283. package/src/gir/boxed.ts +94 -0
  284. package/src/gir/callback.ts +26 -0
  285. package/src/gir/class.ts +79 -0
  286. package/src/gir/enum.ts +55 -0
  287. package/src/gir/field.ts +40 -0
  288. package/src/gir/function.ts +67 -0
  289. package/src/gir/namespace.ts +118 -0
  290. package/src/gir/parameter.ts +120 -0
  291. package/src/gir/parse.ts +171 -0
  292. package/src/gir/primitives.ts +137 -0
  293. package/src/gir/property.ts +39 -0
  294. package/src/gir/qualified-name.ts +55 -0
  295. package/src/gir/qualify.ts +64 -0
  296. package/src/gir/repository.ts +149 -0
  297. package/src/gir/signal.ts +36 -0
  298. package/src/gir/size.ts +129 -0
  299. package/src/gir/type-ref.ts +180 -0
  300. package/src/index.ts +16 -0
  301. package/src/jsx-store.ts +53 -0
  302. package/src/react/compounds-meta.ts +99 -0
  303. package/src/react/compounds.ts +204 -0
  304. package/src/react/internal.ts +91 -0
  305. package/src/react/jsx.ts +155 -0
  306. package/src/react/pipeline.ts +29 -0
  307. package/src/react/props.ts +307 -0
  308. package/src/react/slot-props.ts +57 -0
  309. package/src/react/widgets.ts +185 -0
  310. package/src/runner.ts +89 -0
  311. package/src/store-fs.ts +157 -0
  312. package/src/transpile.ts +80 -0
  313. package/src/typecheck-store.ts +136 -0
  314. package/src/writers/alias.ts +19 -0
  315. package/src/writers/async.ts +44 -0
  316. package/src/writers/boxed-constructor.ts +105 -0
  317. package/src/writers/boxed-field-accessor.ts +306 -0
  318. package/src/writers/boxed-layout.ts +166 -0
  319. package/src/writers/boxed.ts +77 -0
  320. package/src/writers/callables.ts +339 -0
  321. package/src/writers/callback.ts +40 -0
  322. package/src/writers/class-struct-record.ts +75 -0
  323. package/src/writers/class-struct.ts +96 -0
  324. package/src/writers/class.ts +384 -0
  325. package/src/writers/constant.ts +29 -0
  326. package/src/writers/constructor-props.ts +130 -0
  327. package/src/writers/enum.ts +53 -0
  328. package/src/writers/function.ts +136 -0
  329. package/src/writers/gtype-binding.ts +48 -0
  330. package/src/writers/inheritance.ts +104 -0
  331. package/src/writers/interface.ts +168 -0
  332. package/src/writers/method.ts +678 -0
  333. package/src/writers/param-classify.ts +178 -0
  334. package/src/writers/property-accessor.ts +139 -0
  335. package/src/writers/registration.ts +42 -0
  336. package/src/writers/return-wrap.ts +180 -0
  337. package/src/writers/runtime-override.ts +59 -0
  338. package/src/writers/signal.ts +318 -0
  339. package/src/writers/ts-type.ts +115 -0
  340. package/src/writers/value.ts +485 -0
package/LICENSE ADDED
@@ -0,0 +1,373 @@
1
+ Mozilla Public License Version 2.0
2
+ ==================================
3
+
4
+ 1. Definitions
5
+ --------------
6
+
7
+ 1.1. "Contributor"
8
+ means each individual or legal entity that creates, contributes to
9
+ the creation of, or owns Covered Software.
10
+
11
+ 1.2. "Contributor Version"
12
+ means the combination of the Contributions of others (if any) used
13
+ by a Contributor and that particular Contributor's Contribution.
14
+
15
+ 1.3. "Contribution"
16
+ means Covered Software of a particular Contributor.
17
+
18
+ 1.4. "Covered Software"
19
+ means Source Code Form to which the initial Contributor has attached
20
+ the notice in Exhibit A, the Executable Form of such Source Code
21
+ Form, and Modifications of such Source Code Form, in each case
22
+ including portions thereof.
23
+
24
+ 1.5. "Incompatible With Secondary Licenses"
25
+ means
26
+
27
+ (a) that the initial Contributor has attached the notice described
28
+ in Exhibit B to the Covered Software; or
29
+
30
+ (b) that the Covered Software was made available under the terms of
31
+ version 1.1 or earlier of the License, but not also under the
32
+ terms of a Secondary License.
33
+
34
+ 1.6. "Executable Form"
35
+ means any form of the work other than Source Code Form.
36
+
37
+ 1.7. "Larger Work"
38
+ means a work that combines Covered Software with other material, in
39
+ a separate file or files, that is not Covered Software.
40
+
41
+ 1.8. "License"
42
+ means this document.
43
+
44
+ 1.9. "Licensable"
45
+ means having the right to grant, to the maximum extent possible,
46
+ whether at the time of the initial grant or subsequently, any and
47
+ all of the rights conveyed by this License.
48
+
49
+ 1.10. "Modifications"
50
+ means any of the following:
51
+
52
+ (a) any file in Source Code Form that results from an addition to,
53
+ deletion from, or modification of the contents of Covered
54
+ Software; or
55
+
56
+ (b) any new file in Source Code Form that contains any Covered
57
+ Software.
58
+
59
+ 1.11. "Patent Claims" of a Contributor
60
+ means any patent claim(s), including without limitation, method,
61
+ process, and apparatus claims, in any patent Licensable by such
62
+ Contributor that would be infringed, but for the grant of the
63
+ License, by the making, using, selling, offering for sale, having
64
+ made, import, or transfer of either its Contributions or its
65
+ Contributor Version.
66
+
67
+ 1.12. "Secondary License"
68
+ means either the GNU General Public License, Version 2.0, the GNU
69
+ Lesser General Public License, Version 2.1, the GNU Affero General
70
+ Public License, Version 3.0, or any later versions of those
71
+ licenses.
72
+
73
+ 1.13. "Source Code Form"
74
+ means the form of the work preferred for making modifications.
75
+
76
+ 1.14. "You" (or "Your")
77
+ means an individual or a legal entity exercising rights under this
78
+ License. For legal entities, "You" includes any entity that
79
+ controls, is controlled by, or is under common control with You. For
80
+ purposes of this definition, "control" means (a) the power, direct
81
+ or indirect, to cause the direction or management of such entity,
82
+ whether by contract or otherwise, or (b) ownership of more than
83
+ fifty percent (50%) of the outstanding shares or beneficial
84
+ ownership of such entity.
85
+
86
+ 2. License Grants and Conditions
87
+ --------------------------------
88
+
89
+ 2.1. Grants
90
+
91
+ Each Contributor hereby grants You a world-wide, royalty-free,
92
+ non-exclusive license:
93
+
94
+ (a) under intellectual property rights (other than patent or trademark)
95
+ Licensable by such Contributor to use, reproduce, make available,
96
+ modify, display, perform, distribute, and otherwise exploit its
97
+ Contributions, either on an unmodified basis, with Modifications, or
98
+ as part of a Larger Work; and
99
+
100
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
101
+ for sale, have made, import, and otherwise transfer either its
102
+ Contributions or its Contributor Version.
103
+
104
+ 2.2. Effective Date
105
+
106
+ The licenses granted in Section 2.1 with respect to any Contribution
107
+ become effective for each Contribution on the date the Contributor first
108
+ distributes such Contribution.
109
+
110
+ 2.3. Limitations on Grant Scope
111
+
112
+ The licenses granted in this Section 2 are the only rights granted under
113
+ this License. No additional rights or licenses will be implied from the
114
+ distribution or licensing of Covered Software under this License.
115
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
116
+ Contributor:
117
+
118
+ (a) for any code that a Contributor has removed from Covered Software;
119
+ or
120
+
121
+ (b) for infringements caused by: (i) Your and any other third party's
122
+ modifications of Covered Software, or (ii) the combination of its
123
+ Contributions with other software (except as part of its Contributor
124
+ Version); or
125
+
126
+ (c) under Patent Claims infringed by Covered Software in the absence of
127
+ its Contributions.
128
+
129
+ This License does not grant any rights in the trademarks, service marks,
130
+ or logos of any Contributor (except as may be necessary to comply with
131
+ the notice requirements in Section 3.4).
132
+
133
+ 2.4. Subsequent Licenses
134
+
135
+ No Contributor makes additional grants as a result of Your choice to
136
+ distribute the Covered Software under a subsequent version of this
137
+ License (see Section 10.2) or under the terms of a Secondary License (if
138
+ permitted under the terms of Section 3.3).
139
+
140
+ 2.5. Representation
141
+
142
+ Each Contributor represents that the Contributor believes its
143
+ Contributions are its original creation(s) or it has sufficient rights
144
+ to grant the rights to its Contributions conveyed by this License.
145
+
146
+ 2.6. Fair Use
147
+
148
+ This License is not intended to limit any rights You have under
149
+ applicable copyright doctrines of fair use, fair dealing, or other
150
+ equivalents.
151
+
152
+ 2.7. Conditions
153
+
154
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155
+ in Section 2.1.
156
+
157
+ 3. Responsibilities
158
+ -------------------
159
+
160
+ 3.1. Distribution of Source Form
161
+
162
+ All distribution of Covered Software in Source Code Form, including any
163
+ Modifications that You create or to which You contribute, must be under
164
+ the terms of this License. You must inform recipients that the Source
165
+ Code Form of the Covered Software is governed by the terms of this
166
+ License, and how they can obtain a copy of this License. You may not
167
+ attempt to alter or restrict the recipients' rights in the Source Code
168
+ Form.
169
+
170
+ 3.2. Distribution of Executable Form
171
+
172
+ If You distribute Covered Software in Executable Form then:
173
+
174
+ (a) such Covered Software must also be made available in Source Code
175
+ Form, as described in Section 3.1, and You must inform recipients of
176
+ the Executable Form how they can obtain a copy of such Source Code
177
+ Form by reasonable means in a timely manner, at a charge no more
178
+ than the cost of distribution to the recipient; and
179
+
180
+ (b) You may distribute such Executable Form under the terms of this
181
+ License, or sublicense it under different terms, provided that the
182
+ license for the Executable Form does not attempt to limit or alter
183
+ the recipients' rights in the Source Code Form under this License.
184
+
185
+ 3.3. Distribution of a Larger Work
186
+
187
+ You may create and distribute a Larger Work under terms of Your choice,
188
+ provided that You also comply with the requirements of this License for
189
+ the Covered Software. If the Larger Work is a combination of Covered
190
+ Software with a work governed by one or more Secondary Licenses, and the
191
+ Covered Software is not Incompatible With Secondary Licenses, this
192
+ License permits You to additionally distribute such Covered Software
193
+ under the terms of such Secondary License(s), so that the recipient of
194
+ the Larger Work may, at their option, further distribute the Covered
195
+ Software under the terms of either this License or such Secondary
196
+ License(s).
197
+
198
+ 3.4. Notices
199
+
200
+ You may not remove or alter the substance of any license notices
201
+ (including copyright notices, patent notices, disclaimers of warranty,
202
+ or limitations of liability) contained within the Source Code Form of
203
+ the Covered Software, except that You may alter any license notices to
204
+ the extent required to remedy known factual inaccuracies.
205
+
206
+ 3.5. Application of Additional Terms
207
+
208
+ You may choose to offer, and to charge a fee for, warranty, support,
209
+ indemnity or liability obligations to one or more recipients of Covered
210
+ Software. However, You may do so only on Your own behalf, and not on
211
+ behalf of any Contributor. You must make it absolutely clear that any
212
+ such warranty, support, indemnity, or liability obligation is offered by
213
+ You alone, and You hereby agree to indemnify every Contributor for any
214
+ liability incurred by such Contributor as a result of warranty, support,
215
+ indemnity or liability terms You offer. You may include additional
216
+ disclaimers of warranty and limitations of liability specific to any
217
+ jurisdiction.
218
+
219
+ 4. Inability to Comply Due to Statute or Regulation
220
+ ---------------------------------------------------
221
+
222
+ If it is impossible for You to comply with any of the terms of this
223
+ License with respect to some or all of the Covered Software due to
224
+ statute, judicial order, or regulation then You must: (a) comply with
225
+ the terms of this License to the maximum extent possible; and (b)
226
+ describe the limitations and the code they affect. Such description must
227
+ be placed in a text file included with all distributions of the Covered
228
+ Software under this License. Except to the extent prohibited by statute
229
+ or regulation, such description must be sufficiently detailed for a
230
+ recipient of ordinary skill to be able to understand it.
231
+
232
+ 5. Termination
233
+ --------------
234
+
235
+ 5.1. The rights granted under this License will terminate automatically
236
+ if You fail to comply with any of its terms. However, if You become
237
+ compliant, then the rights granted under this License from a particular
238
+ Contributor are reinstated (a) provisionally, unless and until such
239
+ Contributor explicitly and finally terminates Your grants, and (b) on an
240
+ ongoing basis, if such Contributor fails to notify You of the
241
+ non-compliance by some reasonable means prior to 60 days after You have
242
+ come back into compliance. Moreover, Your grants from a particular
243
+ Contributor are reinstated on an ongoing basis if such Contributor
244
+ notifies You of the non-compliance by some reasonable means, this is the
245
+ first time You have received notice of non-compliance with this License
246
+ from such Contributor, and You become compliant prior to 30 days after
247
+ Your receipt of the notice.
248
+
249
+ 5.2. If You initiate litigation against any entity by asserting a patent
250
+ infringement claim (excluding declaratory judgment actions,
251
+ counter-claims, and cross-claims) alleging that a Contributor Version
252
+ directly or indirectly infringes any patent, then the rights granted to
253
+ You by any and all Contributors for the Covered Software under Section
254
+ 2.1 of this License shall terminate.
255
+
256
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257
+ end user license agreements (excluding distributors and resellers) which
258
+ have been validly granted by You or Your distributors under this License
259
+ prior to termination shall survive termination.
260
+
261
+ ************************************************************************
262
+ * *
263
+ * 6. Disclaimer of Warranty *
264
+ * ------------------------- *
265
+ * *
266
+ * Covered Software is provided under this License on an "as is" *
267
+ * basis, without warranty of any kind, either expressed, implied, or *
268
+ * statutory, including, without limitation, warranties that the *
269
+ * Covered Software is free of defects, merchantable, fit for a *
270
+ * particular purpose or non-infringing. The entire risk as to the *
271
+ * quality and performance of the Covered Software is with You. *
272
+ * Should any Covered Software prove defective in any respect, You *
273
+ * (not any Contributor) assume the cost of any necessary servicing, *
274
+ * repair, or correction. This disclaimer of warranty constitutes an *
275
+ * essential part of this License. No use of any Covered Software is *
276
+ * authorized under this License except under this disclaimer. *
277
+ * *
278
+ ************************************************************************
279
+
280
+ ************************************************************************
281
+ * *
282
+ * 7. Limitation of Liability *
283
+ * -------------------------- *
284
+ * *
285
+ * Under no circumstances and under no legal theory, whether tort *
286
+ * (including negligence), contract, or otherwise, shall any *
287
+ * Contributor, or anyone who distributes Covered Software as *
288
+ * permitted above, be liable to You for any direct, indirect, *
289
+ * special, incidental, or consequential damages of any character *
290
+ * including, without limitation, damages for lost profits, loss of *
291
+ * goodwill, work stoppage, computer failure or malfunction, or any *
292
+ * and all other commercial damages or losses, even if such party *
293
+ * shall have been informed of the possibility of such damages. This *
294
+ * limitation of liability shall not apply to liability for death or *
295
+ * personal injury resulting from such party's negligence to the *
296
+ * extent applicable law prohibits such limitation. Some *
297
+ * jurisdictions do not allow the exclusion or limitation of *
298
+ * incidental or consequential damages, so this exclusion and *
299
+ * limitation may not apply to You. *
300
+ * *
301
+ ************************************************************************
302
+
303
+ 8. Litigation
304
+ -------------
305
+
306
+ Any litigation relating to this License may be brought only in the
307
+ courts of a jurisdiction where the defendant maintains its principal
308
+ place of business and such litigation shall be governed by laws of that
309
+ jurisdiction, without reference to its conflict-of-law provisions.
310
+ Nothing in this Section shall prevent a party's ability to bring
311
+ cross-claims or counter-claims.
312
+
313
+ 9. Miscellaneous
314
+ ----------------
315
+
316
+ This License represents the complete agreement concerning the subject
317
+ matter hereof. If any provision of this License is held to be
318
+ unenforceable, such provision shall be reformed only to the extent
319
+ necessary to make it enforceable. Any law or regulation which provides
320
+ that the language of a contract shall be construed against the drafter
321
+ shall not be used to construe this License against a Contributor.
322
+
323
+ 10. Versions of the License
324
+ ---------------------------
325
+
326
+ 10.1. New Versions
327
+
328
+ Mozilla Foundation is the license steward. Except as provided in Section
329
+ 10.3, no one other than the license steward has the right to modify or
330
+ publish new versions of this License. Each version will be given a
331
+ distinguishing version number.
332
+
333
+ 10.2. Effect of New Versions
334
+
335
+ You may distribute the Covered Software under the terms of the version
336
+ of the License under which You originally received the Covered Software,
337
+ or under the terms of any subsequent version published by the license
338
+ steward.
339
+
340
+ 10.3. Modified Versions
341
+
342
+ If you create software not governed by this License, and you want to
343
+ create a new license for such software, you may create and use a
344
+ modified version of this License if you rename the license and remove
345
+ any references to the name of the license steward (except to note that
346
+ such modified license differs from this License).
347
+
348
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
349
+ Licenses
350
+
351
+ If You choose to distribute Source Code Form that is Incompatible With
352
+ Secondary Licenses under the terms of this version of the License, the
353
+ notice described in Exhibit B of this License must be attached.
354
+
355
+ Exhibit A - Source Code Form License Notice
356
+ -------------------------------------------
357
+
358
+ This Source Code Form is subject to the terms of the Mozilla Public
359
+ License, v. 2.0. If a copy of the MPL was not distributed with this
360
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
361
+
362
+ If it is not possible or desirable to put the notice in a particular
363
+ file, then You may include the notice in a location (such as a LICENSE
364
+ file in a relevant directory) where a recipient would be likely to look
365
+ for such a notice.
366
+
367
+ You may add additional accurate notices of copyright ownership.
368
+
369
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
370
+ ---------------------------------------------------------
371
+
372
+ This Source Code Form is "Incompatible With Secondary Licenses", as
373
+ defined by the Mozilla Public License, v. 2.0.
@@ -0,0 +1,104 @@
1
+ import type { GirNamespace } from "../gir/namespace.js";
2
+ import type { GirRepository } from "../gir/repository.js";
3
+ import { ModuleBuilder } from "./module.js";
4
+ /**
5
+ * Shared context handed to every writer for a single generated FFI module.
6
+ *
7
+ * Bundles the namespace the writer is emitting for, the broader repository
8
+ * (for cross-namespace lookups), and the in-progress {@link ModuleBuilder}.
9
+ * Writers also call back into this context to register cross-namespace
10
+ * runtime imports so individual writers do not need to know the relative
11
+ * path layout of the generated output.
12
+ *
13
+ * Generated bindings live in the `@gtkx/gi` package at `<ns>/<ns>.{js,d.ts}`,
14
+ * with a per-namespace barrel at `<ns>/index.js` and the augment overlay at
15
+ * `<ns>/augment/*.js`. The hand-written runtime is reached through the single
16
+ * `@gtkx/ffi` barrel; sibling generated namespaces are reached relative to the
17
+ * gi package root.
18
+ */
19
+ export declare class ModuleContext {
20
+ readonly namespace: GirNamespace;
21
+ readonly repository: GirRepository;
22
+ readonly module: ModuleBuilder;
23
+ /**
24
+ * @param namespace - The namespace this module corresponds to
25
+ * @param repository - The repository containing every loaded namespace
26
+ */
27
+ constructor(namespace: GirNamespace, repository: GirRepository);
28
+ /**
29
+ * Adds a named import from the `@gtkx/ffi` runtime barrel.
30
+ */
31
+ addRuntimeImport(name: string): void;
32
+ /**
33
+ * Adds a type-only named import from the `@gtkx/ffi` runtime barrel
34
+ * (`import { type Name }`), erased from the emitted `.js`.
35
+ */
36
+ addRuntimeTypeImport(name: string): void;
37
+ /**
38
+ * Adds a named import from the low-level `@gtkx/native` runtime.
39
+ *
40
+ * The transport primitives (`alloc`, `call`, `read`, `write`) live in
41
+ * `@gtkx/native`; generated bindings reach them directly so `@gtkx/ffi`
42
+ * stays the home of higher-level runtime helpers only.
43
+ */
44
+ addNativeImport(name: string): void;
45
+ /**
46
+ * Adds a type-only named import from `@gtkx/native`
47
+ * (`import { type Name }`), erased from the emitted `.js`.
48
+ */
49
+ addNativeTypeImport(name: string): void;
50
+ /** Adds the canonical `constructGObjectInstance` import from `@gtkx/ffi`. */
51
+ addConstructGObjectInstanceImport(): void;
52
+ /** Adds the `valueFromFfi` import from `@gtkx/ffi`. */
53
+ addValueFromFfiImport(): void;
54
+ /** Adds the `valueFromFfiOptional` import from `@gtkx/ffi`. */
55
+ addValueFromFfiOptionalImport(): void;
56
+ /**
57
+ * Adds the canonical side-effect imports for `gobject/object.js` and
58
+ * `gobject/value.js`.
59
+ *
60
+ * Skipped for the `GObject` namespace itself (those modules import its
61
+ * generated classes) and for `GLib`, which lives below GObject in the
62
+ * import graph. Letting GLib bootstrap creates a runtime cycle:
63
+ * `gobject.js` imports `glib.js` for `GLib.Variant` return-wrapping,
64
+ * `glib.js`'s bootstrap re-enters `gobject/value.js`, and `value.ts`
65
+ * touches `Value.prototype` before `gobject.js` has finished defining
66
+ * `Value`. Other namespaces install the override on first import.
67
+ */
68
+ addGObjectBootstrapImports(): void;
69
+ /**
70
+ * Adds a wildcard import for another namespace and returns the local
71
+ * alias used.
72
+ *
73
+ * Most namespaces are routed through their hand-written `index.js` so any
74
+ * prototype augmentations (Cairo `Context` methods, Gdk `RGBA`, Graphene
75
+ * structs, …) load whenever a generated module references the namespace.
76
+ * The foundational `gobject` and `glib` namespaces are routed straight to
77
+ * their generated module instead, because their indexes pull in modules
78
+ * that depend on values still mid-initialization, which would deadlock the
79
+ * import graph.
80
+ *
81
+ * For non-foundational namespaces a side-effect import is recorded
82
+ * alongside the wildcard so the foreign module loads even when its alias
83
+ * appears only in type positions. The wildcard alias is type-stripped out
84
+ * of the emitted `.js` whenever it is never read as a value, which would
85
+ * otherwise drop the foreign module from the runtime graph and skip its
86
+ * eager `*_get_type` registrations. The side-effect import survives type
87
+ * stripping and pins the module in place. The foundational `gobject` and
88
+ * `glib` wildcards are always read as values (enums, base classes) and so
89
+ * are never stripped, needing no side-effect pin.
90
+ *
91
+ * @param namespaceName - The other namespace (e.g. `"GLib"`)
92
+ */
93
+ addCrossNamespaceImport(namespaceName: string): string;
94
+ /**
95
+ * Renders a namespace-qualified reference to `typeName`: the bare name when
96
+ * it lives in this module's own namespace, otherwise `Alias.Name` with the
97
+ * foreign namespace imported on demand via {@link addCrossNamespaceImport}.
98
+ *
99
+ * @param namespaceName - The namespace the referenced type lives in
100
+ * @param typeName - The local type or export name within that namespace
101
+ */
102
+ qualify(namespaceName: string, typeName: string): string;
103
+ }
104
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/dsl/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAa;aAQF,SAAS,EAAE,YAAY;aACvB,UAAU,EAAE,aAAa;IAR7C,SAAgB,MAAM,gBAAuB;IAE7C;;;OAGG;gBAEiB,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,aAAa;IAG7C;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIpC;;;OAGG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxC;;;;;;OAMG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIvC,6EAA6E;IAC7E,iCAAiC,IAAI,IAAI;IAIzC,uDAAuD;IACvD,qBAAqB,IAAI,IAAI;IAI7B,+DAA+D;IAC/D,6BAA6B,IAAI,IAAI;IAIrC;;;;;;;;;;;OAWG;IACH,0BAA0B,IAAI,IAAI;IAOlC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,uBAAuB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAUtD;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;CAI3D"}
@@ -0,0 +1,140 @@
1
+ import { ModuleBuilder } from "./module.js";
2
+ /**
3
+ * Shared context handed to every writer for a single generated FFI module.
4
+ *
5
+ * Bundles the namespace the writer is emitting for, the broader repository
6
+ * (for cross-namespace lookups), and the in-progress {@link ModuleBuilder}.
7
+ * Writers also call back into this context to register cross-namespace
8
+ * runtime imports so individual writers do not need to know the relative
9
+ * path layout of the generated output.
10
+ *
11
+ * Generated bindings live in the `@gtkx/gi` package at `<ns>/<ns>.{js,d.ts}`,
12
+ * with a per-namespace barrel at `<ns>/index.js` and the augment overlay at
13
+ * `<ns>/augment/*.js`. The hand-written runtime is reached through the single
14
+ * `@gtkx/ffi` barrel; sibling generated namespaces are reached relative to the
15
+ * gi package root.
16
+ */
17
+ export class ModuleContext {
18
+ namespace;
19
+ repository;
20
+ module = new ModuleBuilder();
21
+ /**
22
+ * @param namespace - The namespace this module corresponds to
23
+ * @param repository - The repository containing every loaded namespace
24
+ */
25
+ constructor(namespace, repository) {
26
+ this.namespace = namespace;
27
+ this.repository = repository;
28
+ }
29
+ /**
30
+ * Adds a named import from the `@gtkx/ffi` runtime barrel.
31
+ */
32
+ addRuntimeImport(name) {
33
+ this.module.imports.addNamed("@gtkx/ffi", name);
34
+ }
35
+ /**
36
+ * Adds a type-only named import from the `@gtkx/ffi` runtime barrel
37
+ * (`import { type Name }`), erased from the emitted `.js`.
38
+ */
39
+ addRuntimeTypeImport(name) {
40
+ this.module.imports.addNamed("@gtkx/ffi", name, true);
41
+ }
42
+ /**
43
+ * Adds a named import from the low-level `@gtkx/native` runtime.
44
+ *
45
+ * The transport primitives (`alloc`, `call`, `read`, `write`) live in
46
+ * `@gtkx/native`; generated bindings reach them directly so `@gtkx/ffi`
47
+ * stays the home of higher-level runtime helpers only.
48
+ */
49
+ addNativeImport(name) {
50
+ this.module.imports.addNamed("@gtkx/native", name);
51
+ }
52
+ /**
53
+ * Adds a type-only named import from `@gtkx/native`
54
+ * (`import { type Name }`), erased from the emitted `.js`.
55
+ */
56
+ addNativeTypeImport(name) {
57
+ this.module.imports.addNamed("@gtkx/native", name, true);
58
+ }
59
+ /** Adds the canonical `constructGObjectInstance` import from `@gtkx/ffi`. */
60
+ addConstructGObjectInstanceImport() {
61
+ this.module.imports.addNamed("@gtkx/ffi", "constructGObjectInstance");
62
+ }
63
+ /** Adds the `valueFromFfi` import from `@gtkx/ffi`. */
64
+ addValueFromFfiImport() {
65
+ this.module.imports.addNamed("@gtkx/ffi", "valueFromFfi");
66
+ }
67
+ /** Adds the `valueFromFfiOptional` import from `@gtkx/ffi`. */
68
+ addValueFromFfiOptionalImport() {
69
+ this.module.imports.addNamed("@gtkx/ffi", "valueFromFfiOptional");
70
+ }
71
+ /**
72
+ * Adds the canonical side-effect imports for `gobject/object.js` and
73
+ * `gobject/value.js`.
74
+ *
75
+ * Skipped for the `GObject` namespace itself (those modules import its
76
+ * generated classes) and for `GLib`, which lives below GObject in the
77
+ * import graph. Letting GLib bootstrap creates a runtime cycle:
78
+ * `gobject.js` imports `glib.js` for `GLib.Variant` return-wrapping,
79
+ * `glib.js`'s bootstrap re-enters `gobject/value.js`, and `value.ts`
80
+ * touches `Value.prototype` before `gobject.js` has finished defining
81
+ * `Value`. Other namespaces install the override on first import.
82
+ */
83
+ addGObjectBootstrapImports() {
84
+ if (this.namespace.name === "GObject")
85
+ return;
86
+ if (this.namespace.name === "GLib")
87
+ return;
88
+ this.module.imports.addSideEffect("../gobject/augment/object.js");
89
+ this.module.imports.addSideEffect("../gobject/augment/value.js");
90
+ }
91
+ /**
92
+ * Adds a wildcard import for another namespace and returns the local
93
+ * alias used.
94
+ *
95
+ * Most namespaces are routed through their hand-written `index.js` so any
96
+ * prototype augmentations (Cairo `Context` methods, Gdk `RGBA`, Graphene
97
+ * structs, …) load whenever a generated module references the namespace.
98
+ * The foundational `gobject` and `glib` namespaces are routed straight to
99
+ * their generated module instead, because their indexes pull in modules
100
+ * that depend on values still mid-initialization, which would deadlock the
101
+ * import graph.
102
+ *
103
+ * For non-foundational namespaces a side-effect import is recorded
104
+ * alongside the wildcard so the foreign module loads even when its alias
105
+ * appears only in type positions. The wildcard alias is type-stripped out
106
+ * of the emitted `.js` whenever it is never read as a value, which would
107
+ * otherwise drop the foreign module from the runtime graph and skip its
108
+ * eager `*_get_type` registrations. The side-effect import survives type
109
+ * stripping and pins the module in place. The foundational `gobject` and
110
+ * `glib` wildcards are always read as values (enums, base classes) and so
111
+ * are never stripped, needing no side-effect pin.
112
+ *
113
+ * @param namespaceName - The other namespace (e.g. `"GLib"`)
114
+ */
115
+ addCrossNamespaceImport(namespaceName) {
116
+ if (namespaceName === this.namespace.name)
117
+ return namespaceName;
118
+ const directory = namespaceName.toLowerCase();
119
+ const isFoundational = directory === "gobject" || directory === "glib";
120
+ const path = isFoundational ? `../${directory}/${directory}.js` : `../${directory}/index.js`;
121
+ if (!isFoundational)
122
+ this.module.imports.addSideEffect(`../${directory}/${directory}.js`);
123
+ this.module.imports.addNamespace(path, namespaceName);
124
+ return namespaceName;
125
+ }
126
+ /**
127
+ * Renders a namespace-qualified reference to `typeName`: the bare name when
128
+ * it lives in this module's own namespace, otherwise `Alias.Name` with the
129
+ * foreign namespace imported on demand via {@link addCrossNamespaceImport}.
130
+ *
131
+ * @param namespaceName - The namespace the referenced type lives in
132
+ * @param typeName - The local type or export name within that namespace
133
+ */
134
+ qualify(namespaceName, typeName) {
135
+ if (namespaceName === this.namespace.name)
136
+ return typeName;
137
+ return `${this.addCrossNamespaceImport(namespaceName)}.${typeName}`;
138
+ }
139
+ }
140
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/dsl/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,aAAa;IAQF;IACA;IARJ,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;IAE7C;;;OAGG;IACH,YACoB,SAAuB,EACvB,UAAyB;QADzB,cAAS,GAAT,SAAS,CAAc;QACvB,eAAU,GAAV,UAAU,CAAe;IAC1C,CAAC;IAEJ;;OAEG;IACH,gBAAgB,CAAC,IAAY;QACzB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACH,oBAAoB,CAAC,IAAY;QAC7B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;OAMG;IACH,eAAe,CAAC,IAAY;QACxB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED;;;OAGG;IACH,mBAAmB,CAAC,IAAY;QAC5B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,6EAA6E;IAC7E,iCAAiC;QAC7B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAC,CAAC;IAC1E,CAAC;IAED,uDAAuD;IACvD,qBAAqB;QACjB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAC9D,CAAC;IAED,+DAA+D;IAC/D,6BAA6B;QACzB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,0BAA0B;QACtB,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO;QAC9C,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO;QAC3C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,8BAA8B,CAAC,CAAC;QAClE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,6BAA6B,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,uBAAuB,CAAC,aAAqB;QACzC,IAAI,aAAa,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI;YAAE,OAAO,aAAa,CAAC;QAChE,MAAM,SAAS,GAAG,aAAa,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,cAAc,GAAG,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,MAAM,CAAC;QACvE,MAAM,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,SAAS,IAAI,SAAS,KAAK,CAAC,CAAC,CAAC,MAAM,SAAS,WAAW,CAAC;QAC7F,IAAI,CAAC,cAAc;YAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,SAAS,IAAI,SAAS,KAAK,CAAC,CAAC;QAC1F,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QACtD,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,aAAqB,EAAE,QAAgB;QAC3C,IAAI,aAAa,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI;YAAE,OAAO,QAAQ,CAAC;QAC3D,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,aAAa,CAAC,IAAI,QAAQ,EAAE,CAAC;IACxE,CAAC;CACJ"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Tiny string-builder helpers used by the writers to assemble TypeScript
3
+ * source. The DSL deliberately stops short of modelling expressions or
4
+ * statements — writers compose strings directly using these primitives.
5
+ */
6
+ /**
7
+ * Indents each line of `block` by `level` four-space units.
8
+ *
9
+ * Lines that are empty stay empty (no trailing whitespace).
10
+ *
11
+ * @param block - The multi-line source fragment
12
+ * @param level - Number of indentation steps to apply
13
+ */
14
+ export declare const indent: (block: string, level: number) => string;
15
+ /**
16
+ * Joins `parts` with commas, dropping `undefined` entries.
17
+ */
18
+ export declare const joinArgs: (parts: ReadonlyArray<string | undefined>) => string;
19
+ /**
20
+ * Renders an array literal multi-line, indenting each element four spaces
21
+ * and adding a trailing comma.
22
+ *
23
+ * Empty input renders as `[]`.
24
+ *
25
+ * @param elements - Already-rendered element expressions
26
+ */
27
+ export declare const arrayLiteral: (elements: readonly string[]) => string;
28
+ //# sourceMappingURL=emit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/dsl/emit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,EAAE,OAAO,MAAM,KAAG,MAOrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,KAAG,MACK,CAAC;AAE1E;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,UAAU,SAAS,MAAM,EAAE,KAAG,MAI1D,CAAC"}