@gtkx/codegen 1.0.0-rc.4 → 1.1.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 (523) hide show
  1. package/README.md +5 -5
  2. package/dist/analysis/descriptor-render.d.ts +13 -9
  3. package/dist/analysis/descriptor-render.d.ts.map +1 -1
  4. package/dist/analysis/descriptor-render.js +80 -50
  5. package/dist/analysis/descriptor-render.js.map +1 -1
  6. package/dist/analysis/descriptor.d.ts +16 -7
  7. package/dist/analysis/descriptor.d.ts.map +1 -1
  8. package/dist/analysis/descriptor.js +15 -3
  9. package/dist/analysis/descriptor.js.map +1 -1
  10. package/dist/analysis/inheritance.d.ts +4 -3
  11. package/dist/analysis/inheritance.d.ts.map +1 -1
  12. package/dist/analysis/inheritance.js +103 -58
  13. package/dist/analysis/inheritance.js.map +1 -1
  14. package/dist/analysis/interface-conflicts.d.ts +23 -0
  15. package/dist/analysis/interface-conflicts.d.ts.map +1 -0
  16. package/dist/analysis/interface-conflicts.js +144 -0
  17. package/dist/analysis/interface-conflicts.js.map +1 -0
  18. package/dist/analysis/nul-terminated-bytes.d.ts +5 -0
  19. package/dist/analysis/nul-terminated-bytes.d.ts.map +1 -0
  20. package/dist/analysis/nul-terminated-bytes.js +18 -0
  21. package/dist/analysis/nul-terminated-bytes.js.map +1 -0
  22. package/dist/analysis/param-capability.d.ts +5 -0
  23. package/dist/analysis/param-capability.d.ts.map +1 -0
  24. package/dist/analysis/param-capability.js +129 -0
  25. package/dist/analysis/param-capability.js.map +1 -0
  26. package/dist/analysis/param-structure.d.ts +11 -4
  27. package/dist/analysis/param-structure.d.ts.map +1 -1
  28. package/dist/analysis/param-structure.js +42 -16
  29. package/dist/analysis/param-structure.js.map +1 -1
  30. package/dist/analysis/ts-type.d.ts.map +1 -1
  31. package/dist/analysis/ts-type.js +10 -17
  32. package/dist/analysis/ts-type.js.map +1 -1
  33. package/dist/analysis/type-key.d.ts +5 -0
  34. package/dist/analysis/type-key.d.ts.map +1 -0
  35. package/dist/analysis/type-key.js +9 -0
  36. package/dist/analysis/type-key.js.map +1 -0
  37. package/dist/analysis/type-shape.d.ts +8 -0
  38. package/dist/analysis/type-shape.d.ts.map +1 -0
  39. package/dist/analysis/type-shape.js +12 -0
  40. package/dist/analysis/type-shape.js.map +1 -0
  41. package/dist/compile.d.ts +12 -3
  42. package/dist/compile.d.ts.map +1 -1
  43. package/dist/compile.js +73 -24
  44. package/dist/compile.js.map +1 -1
  45. package/dist/docs/api-reference.d.ts +2 -2
  46. package/dist/docs/api-reference.d.ts.map +1 -1
  47. package/dist/docs/api-reference.js +17 -23
  48. package/dist/docs/api-reference.js.map +1 -1
  49. package/dist/docs/element-page.d.ts +4 -4
  50. package/dist/docs/element-page.d.ts.map +1 -1
  51. package/dist/docs/element-page.js +36 -22
  52. package/dist/docs/element-page.js.map +1 -1
  53. package/dist/docs/handwritten-props.d.ts +9 -0
  54. package/dist/docs/handwritten-props.d.ts.map +1 -0
  55. package/dist/docs/handwritten-props.js +149 -0
  56. package/dist/docs/handwritten-props.js.map +1 -0
  57. package/dist/docs/pipeline.d.ts.map +1 -1
  58. package/dist/docs/pipeline.js +87 -20
  59. package/dist/docs/pipeline.js.map +1 -1
  60. package/dist/docs/render.d.ts +26 -5
  61. package/dist/docs/render.d.ts.map +1 -1
  62. package/dist/docs/render.js +88 -25
  63. package/dist/docs/render.js.map +1 -1
  64. package/dist/docs/symbol-page.d.ts +17 -0
  65. package/dist/docs/symbol-page.d.ts.map +1 -1
  66. package/dist/docs/symbol-page.js +132 -44
  67. package/dist/docs/symbol-page.js.map +1 -1
  68. package/dist/fingerprint.d.ts +12 -1
  69. package/dist/fingerprint.d.ts.map +1 -1
  70. package/dist/fingerprint.js +44 -28
  71. package/dist/fingerprint.js.map +1 -1
  72. package/dist/gi.d.ts.map +1 -1
  73. package/dist/gi.js +1 -0
  74. package/dist/gi.js.map +1 -1
  75. package/dist/gir/ancestry.d.ts +8 -2
  76. package/dist/gir/ancestry.d.ts.map +1 -1
  77. package/dist/gir/ancestry.js +19 -1
  78. package/dist/gir/ancestry.js.map +1 -1
  79. package/dist/gir/annotations.d.ts +21 -0
  80. package/dist/gir/annotations.d.ts.map +1 -0
  81. package/dist/gir/annotations.js +15 -0
  82. package/dist/gir/annotations.js.map +1 -0
  83. package/dist/gir/callback.d.ts +1 -0
  84. package/dist/gir/callback.d.ts.map +1 -1
  85. package/dist/gir/callback.js +1 -0
  86. package/dist/gir/callback.js.map +1 -1
  87. package/dist/gir/class.d.ts +32 -1
  88. package/dist/gir/class.d.ts.map +1 -1
  89. package/dist/gir/class.js +8 -3
  90. package/dist/gir/class.js.map +1 -1
  91. package/dist/gir/cursor-overrides.d.ts +8 -0
  92. package/dist/gir/cursor-overrides.d.ts.map +1 -0
  93. package/dist/gir/cursor-overrides.js +6 -0
  94. package/dist/gir/cursor-overrides.js.map +1 -0
  95. package/dist/gir/emittable.d.ts +7 -0
  96. package/dist/gir/emittable.d.ts.map +1 -0
  97. package/dist/gir/emittable.js +3 -0
  98. package/dist/gir/emittable.js.map +1 -0
  99. package/dist/gir/enum.d.ts +21 -1
  100. package/dist/gir/enum.d.ts.map +1 -1
  101. package/dist/gir/enum.js +9 -9
  102. package/dist/gir/enum.js.map +1 -1
  103. package/dist/gir/field.d.ts +19 -3
  104. package/dist/gir/field.d.ts.map +1 -1
  105. package/dist/gir/field.js +7 -8
  106. package/dist/gir/field.js.map +1 -1
  107. package/dist/gir/function.d.ts +15 -0
  108. package/dist/gir/function.d.ts.map +1 -1
  109. package/dist/gir/function.js +28 -2
  110. package/dist/gir/function.js.map +1 -1
  111. package/dist/gir/libraries.d.ts +1 -3
  112. package/dist/gir/libraries.d.ts.map +1 -1
  113. package/dist/gir/libraries.js +0 -1
  114. package/dist/gir/libraries.js.map +1 -1
  115. package/dist/gir/library.d.ts +36 -0
  116. package/dist/gir/library.d.ts.map +1 -1
  117. package/dist/gir/library.js +35 -1
  118. package/dist/gir/library.js.map +1 -1
  119. package/dist/gir/namespace.d.ts +43 -1
  120. package/dist/gir/namespace.d.ts.map +1 -1
  121. package/dist/gir/namespace.js +8 -7
  122. package/dist/gir/namespace.js.map +1 -1
  123. package/dist/gir/parameter.d.ts +52 -1
  124. package/dist/gir/parameter.d.ts.map +1 -1
  125. package/dist/gir/parameter.js +8 -3
  126. package/dist/gir/parameter.js.map +1 -1
  127. package/dist/gir/parse.d.ts +3 -1
  128. package/dist/gir/parse.d.ts.map +1 -1
  129. package/dist/gir/parse.js +9 -9
  130. package/dist/gir/parse.js.map +1 -1
  131. package/dist/gir/primitives.d.ts +1 -0
  132. package/dist/gir/primitives.d.ts.map +1 -1
  133. package/dist/gir/primitives.js.map +1 -1
  134. package/dist/gir/property.d.ts +16 -0
  135. package/dist/gir/property.d.ts.map +1 -1
  136. package/dist/gir/property.js +3 -3
  137. package/dist/gir/property.js.map +1 -1
  138. package/dist/gir/record.d.ts +22 -0
  139. package/dist/gir/record.d.ts.map +1 -1
  140. package/dist/gir/record.js +3 -2
  141. package/dist/gir/record.js.map +1 -1
  142. package/dist/gir/size.d.ts +5 -4
  143. package/dist/gir/size.d.ts.map +1 -1
  144. package/dist/gir/size.js.map +1 -1
  145. package/dist/gir/type-id.d.ts +35 -0
  146. package/dist/gir/type-id.d.ts.map +1 -1
  147. package/dist/gir/type-id.js +1 -0
  148. package/dist/gir/type-id.js.map +1 -1
  149. package/dist/gir/type-ref.d.ts.map +1 -1
  150. package/dist/gir/type-ref.js +1 -0
  151. package/dist/gir/type-ref.js.map +1 -1
  152. package/dist/gir/type.d.ts +20 -0
  153. package/dist/gir/type.d.ts.map +1 -1
  154. package/dist/gir/type.js.map +1 -1
  155. package/dist/guards.d.ts +16 -0
  156. package/dist/guards.d.ts.map +1 -0
  157. package/dist/guards.js +11 -0
  158. package/dist/guards.js.map +1 -0
  159. package/dist/internal.d.ts +2 -0
  160. package/dist/internal.d.ts.map +1 -1
  161. package/dist/internal.js +2 -0
  162. package/dist/internal.js.map +1 -1
  163. package/dist/json.d.ts +3 -0
  164. package/dist/json.d.ts.map +1 -0
  165. package/dist/json.js +11 -0
  166. package/dist/json.js.map +1 -0
  167. package/dist/khronos/args.d.ts +7 -6
  168. package/dist/khronos/args.d.ts.map +1 -1
  169. package/dist/khronos/args.js +28 -6
  170. package/dist/khronos/args.js.map +1 -1
  171. package/dist/khronos/doc-context.d.ts +29 -0
  172. package/dist/khronos/doc-context.d.ts.map +1 -0
  173. package/dist/khronos/doc-context.js +29 -0
  174. package/dist/khronos/doc-context.js.map +1 -0
  175. package/dist/khronos/extensions.d.ts +13 -0
  176. package/dist/khronos/extensions.d.ts.map +1 -0
  177. package/dist/khronos/extensions.js +49 -0
  178. package/dist/khronos/extensions.js.map +1 -0
  179. package/dist/khronos/jsdoc.d.ts +17 -11
  180. package/dist/khronos/jsdoc.d.ts.map +1 -1
  181. package/dist/khronos/jsdoc.js +104 -46
  182. package/dist/khronos/jsdoc.js.map +1 -1
  183. package/dist/khronos/model.d.ts +42 -3
  184. package/dist/khronos/model.d.ts.map +1 -1
  185. package/dist/khronos/model.js +218 -63
  186. package/dist/khronos/model.js.map +1 -1
  187. package/dist/khronos/modules.d.ts +9 -6
  188. package/dist/khronos/modules.d.ts.map +1 -1
  189. package/dist/khronos/modules.js +112 -27
  190. package/dist/khronos/modules.js.map +1 -1
  191. package/dist/khronos/notes.d.ts +19 -0
  192. package/dist/khronos/notes.d.ts.map +1 -0
  193. package/dist/khronos/notes.js +35 -0
  194. package/dist/khronos/notes.js.map +1 -0
  195. package/dist/khronos/param-pair.d.ts +1 -1
  196. package/dist/khronos/param-pair.d.ts.map +1 -1
  197. package/dist/khronos/param-pair.js.map +1 -1
  198. package/dist/khronos/parse.d.ts.map +1 -1
  199. package/dist/khronos/parse.js +3 -4
  200. package/dist/khronos/parse.js.map +1 -1
  201. package/dist/khronos/pipeline.d.ts +4 -2
  202. package/dist/khronos/pipeline.d.ts.map +1 -1
  203. package/dist/khronos/pipeline.js +58 -27
  204. package/dist/khronos/pipeline.js.map +1 -1
  205. package/dist/khronos/plan.d.ts +3 -9
  206. package/dist/khronos/plan.d.ts.map +1 -1
  207. package/dist/khronos/plan.js +3 -3
  208. package/dist/khronos/plan.js.map +1 -1
  209. package/dist/khronos/render.d.ts +8 -6
  210. package/dist/khronos/render.d.ts.map +1 -1
  211. package/dist/khronos/render.js +35 -26
  212. package/dist/khronos/render.js.map +1 -1
  213. package/dist/khronos/select.d.ts +21 -4
  214. package/dist/khronos/select.d.ts.map +1 -1
  215. package/dist/khronos/select.js +47 -34
  216. package/dist/khronos/select.js.map +1 -1
  217. package/dist/react/element-config.d.ts +2 -2
  218. package/dist/react/element-config.d.ts.map +1 -1
  219. package/dist/react/element-config.js.map +1 -1
  220. package/dist/runner.d.ts +6 -8
  221. package/dist/runner.d.ts.map +1 -1
  222. package/dist/runner.js +16 -0
  223. package/dist/runner.js.map +1 -1
  224. package/dist/staging.d.ts +5 -0
  225. package/dist/staging.d.ts.map +1 -0
  226. package/dist/staging.js +57 -0
  227. package/dist/staging.js.map +1 -0
  228. package/dist/store/compile-store.d.ts +1 -1
  229. package/dist/store/compile-store.d.ts.map +1 -1
  230. package/dist/store/compile-store.js +4 -2
  231. package/dist/store/compile-store.js.map +1 -1
  232. package/dist/store/gi/callable-doc.d.ts +11 -0
  233. package/dist/store/gi/callable-doc.d.ts.map +1 -0
  234. package/dist/store/gi/callable-doc.js +62 -0
  235. package/dist/store/gi/callable-doc.js.map +1 -0
  236. package/dist/store/gi/callables.d.ts +9 -2
  237. package/dist/store/gi/callables.d.ts.map +1 -1
  238. package/dist/store/gi/callables.js +35 -40
  239. package/dist/store/gi/callables.js.map +1 -1
  240. package/dist/store/gi/callback.d.ts.map +1 -1
  241. package/dist/store/gi/callback.js +10 -6
  242. package/dist/store/gi/callback.js.map +1 -1
  243. package/dist/store/gi/class.d.ts.map +1 -1
  244. package/dist/store/gi/class.js +63 -40
  245. package/dist/store/gi/class.js.map +1 -1
  246. package/dist/store/gi/closure-invocation.d.ts +4 -0
  247. package/dist/store/gi/closure-invocation.d.ts.map +1 -0
  248. package/dist/store/gi/closure-invocation.js +22 -0
  249. package/dist/store/gi/closure-invocation.js.map +1 -0
  250. package/dist/store/gi/companion.d.ts.map +1 -1
  251. package/dist/store/gi/companion.js +6 -6
  252. package/dist/store/gi/companion.js.map +1 -1
  253. package/dist/store/gi/constant.d.ts.map +1 -1
  254. package/dist/store/gi/constant.js +12 -3
  255. package/dist/store/gi/constant.js.map +1 -1
  256. package/dist/store/gi/constructor-props.d.ts.map +1 -1
  257. package/dist/store/gi/constructor-props.js +18 -20
  258. package/dist/store/gi/constructor-props.js.map +1 -1
  259. package/dist/store/gi/doc-spec.d.ts +14 -0
  260. package/dist/store/gi/doc-spec.d.ts.map +1 -0
  261. package/dist/store/gi/doc-spec.js +23 -0
  262. package/dist/store/gi/doc-spec.js.map +1 -0
  263. package/dist/store/gi/enum.d.ts.map +1 -1
  264. package/dist/store/gi/enum.js +52 -19
  265. package/dist/store/gi/enum.js.map +1 -1
  266. package/dist/store/gi/function.d.ts +1 -3
  267. package/dist/store/gi/function.d.ts.map +1 -1
  268. package/dist/store/gi/function.js +50 -29
  269. package/dist/store/gi/function.js.map +1 -1
  270. package/dist/store/gi/gtype-binding.d.ts.map +1 -1
  271. package/dist/store/gi/gtype-binding.js +4 -1
  272. package/dist/store/gi/gtype-binding.js.map +1 -1
  273. package/dist/store/gi/interface.d.ts.map +1 -1
  274. package/dist/store/gi/interface.js +155 -26
  275. package/dist/store/gi/interface.js.map +1 -1
  276. package/dist/store/gi/item-comparators.d.ts.map +1 -1
  277. package/dist/store/gi/item-comparators.js +3 -5
  278. package/dist/store/gi/item-comparators.js.map +1 -1
  279. package/dist/store/gi/method.d.ts +11 -2
  280. package/dist/store/gi/method.d.ts.map +1 -1
  281. package/dist/store/gi/method.js +80 -45
  282. package/dist/store/gi/method.js.map +1 -1
  283. package/dist/store/gi/param-marshal.d.ts +6 -2
  284. package/dist/store/gi/param-marshal.d.ts.map +1 -1
  285. package/dist/store/gi/param-marshal.js +54 -5
  286. package/dist/store/gi/param-marshal.js.map +1 -1
  287. package/dist/store/gi/pipeline.d.ts.map +1 -1
  288. package/dist/store/gi/pipeline.js +23 -11
  289. package/dist/store/gi/pipeline.js.map +1 -1
  290. package/dist/store/gi/properties.d.ts +2 -1
  291. package/dist/store/gi/properties.d.ts.map +1 -1
  292. package/dist/store/gi/properties.js +7 -4
  293. package/dist/store/gi/properties.js.map +1 -1
  294. package/dist/store/gi/property-accessor.d.ts +12 -5
  295. package/dist/store/gi/property-accessor.d.ts.map +1 -1
  296. package/dist/store/gi/property-accessor.js +98 -46
  297. package/dist/store/gi/property-accessor.js.map +1 -1
  298. package/dist/store/gi/record-constructor.d.ts +8 -1
  299. package/dist/store/gi/record-constructor.d.ts.map +1 -1
  300. package/dist/store/gi/record-constructor.js +34 -11
  301. package/dist/store/gi/record-constructor.js.map +1 -1
  302. package/dist/store/gi/record-field-accessor.d.ts +3 -1
  303. package/dist/store/gi/record-field-accessor.d.ts.map +1 -1
  304. package/dist/store/gi/record-field-accessor.js +8 -3
  305. package/dist/store/gi/record-field-accessor.js.map +1 -1
  306. package/dist/store/gi/record-layout.d.ts +6 -1
  307. package/dist/store/gi/record-layout.d.ts.map +1 -1
  308. package/dist/store/gi/record-layout.js +9 -2
  309. package/dist/store/gi/record-layout.js.map +1 -1
  310. package/dist/store/gi/record.d.ts.map +1 -1
  311. package/dist/store/gi/record.js +21 -9
  312. package/dist/store/gi/record.js.map +1 -1
  313. package/dist/store/gi/registration.d.ts +1 -1
  314. package/dist/store/gi/registration.js +4 -4
  315. package/dist/store/gi/registration.js.map +1 -1
  316. package/dist/store/gi/runtime-override.d.ts +2 -1
  317. package/dist/store/gi/runtime-override.d.ts.map +1 -1
  318. package/dist/store/gi/runtime-override.js +8 -5
  319. package/dist/store/gi/runtime-override.js.map +1 -1
  320. package/dist/store/gi/signal.d.ts +2 -1
  321. package/dist/store/gi/signal.d.ts.map +1 -1
  322. package/dist/store/gi/signal.js +42 -37
  323. package/dist/store/gi/signal.js.map +1 -1
  324. package/dist/store/gi/value-marshalable.d.ts +1 -2
  325. package/dist/store/gi/value-marshalable.d.ts.map +1 -1
  326. package/dist/store/gi/value-marshalable.js +3 -2
  327. package/dist/store/gi/value-marshalable.js.map +1 -1
  328. package/dist/store/gi/vtable.d.ts +19 -1
  329. package/dist/store/gi/vtable.d.ts.map +1 -1
  330. package/dist/store/gi/vtable.js +257 -51
  331. package/dist/store/gi/vtable.js.map +1 -1
  332. package/dist/store/gi-store.d.ts +1 -0
  333. package/dist/store/gi-store.d.ts.map +1 -1
  334. package/dist/store/gi-store.js +15 -20
  335. package/dist/store/gi-store.js.map +1 -1
  336. package/dist/store/jsx/element-components.d.ts +1 -1
  337. package/dist/store/jsx/element-components.d.ts.map +1 -1
  338. package/dist/store/jsx/element-components.js +6 -4
  339. package/dist/store/jsx/element-components.js.map +1 -1
  340. package/dist/store/jsx/element-prop-imports.d.ts +1 -3
  341. package/dist/store/jsx/element-prop-imports.d.ts.map +1 -1
  342. package/dist/store/jsx/element-prop-imports.js.map +1 -1
  343. package/dist/store/jsx/element-prop-types.d.ts +3 -0
  344. package/dist/store/jsx/element-prop-types.d.ts.map +1 -1
  345. package/dist/store/jsx/element-prop-types.js +7 -1
  346. package/dist/store/jsx/element-prop-types.js.map +1 -1
  347. package/dist/store/jsx/generated-elements.d.ts +2 -1
  348. package/dist/store/jsx/generated-elements.d.ts.map +1 -1
  349. package/dist/store/jsx/generated-elements.js +13 -7
  350. package/dist/store/jsx/generated-elements.js.map +1 -1
  351. package/dist/store/jsx/intrinsic-elements.d.ts +4 -0
  352. package/dist/store/jsx/intrinsic-elements.d.ts.map +1 -1
  353. package/dist/store/jsx/intrinsic-elements.js.map +1 -1
  354. package/dist/store/jsx/jsx.d.ts.map +1 -1
  355. package/dist/store/jsx/jsx.js +10 -9
  356. package/dist/store/jsx/jsx.js.map +1 -1
  357. package/dist/store/jsx/metadata.d.ts.map +1 -1
  358. package/dist/store/jsx/metadata.js +5 -3
  359. package/dist/store/jsx/metadata.js.map +1 -1
  360. package/dist/store/jsx/pipeline.d.ts +1 -1
  361. package/dist/store/jsx/pipeline.d.ts.map +1 -1
  362. package/dist/store/jsx/pipeline.js.map +1 -1
  363. package/dist/store/jsx/props.d.ts +1 -7
  364. package/dist/store/jsx/props.d.ts.map +1 -1
  365. package/dist/store/jsx/props.js +14 -6
  366. package/dist/store/jsx/props.js.map +1 -1
  367. package/dist/store/jsx-store.d.ts.map +1 -1
  368. package/dist/store/jsx-store.js +3 -3
  369. package/dist/store/jsx-store.js.map +1 -1
  370. package/dist/store/resolve-store.d.ts +14 -3
  371. package/dist/store/resolve-store.d.ts.map +1 -1
  372. package/dist/store/resolve-store.js +98 -15
  373. package/dist/store/resolve-store.js.map +1 -1
  374. package/dist/store/store-fs.d.ts +9 -6
  375. package/dist/store/store-fs.d.ts.map +1 -1
  376. package/dist/store/store-fs.js +59 -25
  377. package/dist/store/store-fs.js.map +1 -1
  378. package/dist/store/store-links.d.ts +3 -0
  379. package/dist/store/store-links.d.ts.map +1 -0
  380. package/dist/store/store-links.js +39 -0
  381. package/dist/store/store-links.js.map +1 -0
  382. package/dist/writer/comparison-context.d.ts +4 -0
  383. package/dist/writer/comparison-context.d.ts.map +1 -0
  384. package/dist/writer/comparison-context.js +13 -0
  385. package/dist/writer/comparison-context.js.map +1 -0
  386. package/dist/writer/context.d.ts +3 -2
  387. package/dist/writer/context.d.ts.map +1 -1
  388. package/dist/writer/context.js +11 -3
  389. package/dist/writer/context.js.map +1 -1
  390. package/dist/writer/doc-tags.d.ts +21 -0
  391. package/dist/writer/doc-tags.d.ts.map +1 -0
  392. package/dist/writer/doc-tags.js +38 -0
  393. package/dist/writer/doc-tags.js.map +1 -0
  394. package/dist/writer/doc.d.ts +3 -1
  395. package/dist/writer/doc.d.ts.map +1 -1
  396. package/dist/writer/doc.js +19 -6
  397. package/dist/writer/doc.js.map +1 -1
  398. package/dist/writer/gtk-doc.d.ts +1 -1
  399. package/dist/writer/gtk-doc.d.ts.map +1 -1
  400. package/dist/writer/gtk-doc.js +64 -15
  401. package/dist/writer/gtk-doc.js.map +1 -1
  402. package/dist/writer/module.d.ts +17 -3
  403. package/dist/writer/module.d.ts.map +1 -1
  404. package/dist/writer/module.js +72 -3
  405. package/dist/writer/module.js.map +1 -1
  406. package/dist/xml.d.ts +7 -1
  407. package/dist/xml.d.ts.map +1 -1
  408. package/dist/xml.js +43 -1
  409. package/dist/xml.js.map +1 -1
  410. package/overrides/gdk/rgba.ts.ejs +26 -0
  411. package/overrides/gobject/object.ts.ejs +48 -3
  412. package/overrides/gobject/value.ts.ejs +7 -0
  413. package/overrides/graphene/structs.ts.ejs +55 -0
  414. package/package.json +15 -4
  415. package/src/analysis/descriptor-render.ts +130 -66
  416. package/src/analysis/descriptor.ts +35 -11
  417. package/src/analysis/inheritance.ts +166 -75
  418. package/src/analysis/interface-conflicts.ts +237 -0
  419. package/src/analysis/nul-terminated-bytes.ts +31 -0
  420. package/src/analysis/param-capability.ts +169 -0
  421. package/src/analysis/param-structure.ts +85 -25
  422. package/src/analysis/ts-type.ts +13 -17
  423. package/src/analysis/type-key.ts +14 -0
  424. package/src/analysis/type-shape.ts +24 -0
  425. package/src/compile.ts +110 -26
  426. package/src/docs/api-reference.ts +46 -34
  427. package/src/docs/element-page.ts +58 -49
  428. package/src/docs/handwritten-props.ts +230 -0
  429. package/src/docs/pipeline.ts +131 -21
  430. package/src/docs/render.ts +153 -35
  431. package/src/docs/symbol-page.ts +230 -80
  432. package/src/fingerprint.ts +86 -32
  433. package/src/gi.ts +1 -0
  434. package/src/gir/ancestry.ts +31 -1
  435. package/src/gir/annotations.ts +37 -0
  436. package/src/gir/callback.ts +2 -0
  437. package/src/gir/class.ts +42 -4
  438. package/src/gir/cursor-overrides.ts +12 -0
  439. package/src/gir/emittable.ts +8 -0
  440. package/src/gir/enum.ts +30 -10
  441. package/src/gir/field.ts +24 -9
  442. package/src/gir/function.ts +60 -9
  443. package/src/gir/libraries.ts +11 -3
  444. package/src/gir/library.ts +52 -3
  445. package/src/gir/namespace.ts +49 -7
  446. package/src/gir/parameter.ts +62 -3
  447. package/src/gir/parse.ts +13 -9
  448. package/src/gir/primitives.ts +1 -0
  449. package/src/gir/property.ts +18 -3
  450. package/src/gir/record.ts +24 -2
  451. package/src/gir/size.ts +8 -3
  452. package/src/gir/type-id.ts +49 -3
  453. package/src/gir/type-ref.ts +1 -0
  454. package/src/gir/type.ts +50 -6
  455. package/src/guards.ts +23 -0
  456. package/src/internal.ts +2 -0
  457. package/src/json.ts +11 -0
  458. package/src/khronos/args.ts +36 -13
  459. package/src/khronos/doc-context.ts +62 -0
  460. package/src/khronos/extensions.ts +85 -0
  461. package/src/khronos/jsdoc.ts +152 -56
  462. package/src/khronos/model.ts +314 -69
  463. package/src/khronos/modules.ts +150 -40
  464. package/src/khronos/notes.ts +74 -0
  465. package/src/khronos/param-pair.ts +1 -1
  466. package/src/khronos/parse.ts +3 -4
  467. package/src/khronos/pipeline.ts +95 -42
  468. package/src/khronos/plan.ts +4 -6
  469. package/src/khronos/render.ts +62 -50
  470. package/src/khronos/select.ts +91 -50
  471. package/src/react/element-config.ts +2 -2
  472. package/src/runner.ts +20 -9
  473. package/src/staging.ts +69 -0
  474. package/src/store/compile-store.ts +7 -5
  475. package/src/store/gi/callable-doc.ts +102 -0
  476. package/src/store/gi/callables.ts +58 -44
  477. package/src/store/gi/callback.ts +10 -9
  478. package/src/store/gi/class.ts +83 -49
  479. package/src/store/gi/closure-invocation.ts +26 -0
  480. package/src/store/gi/companion.ts +7 -6
  481. package/src/store/gi/constant.ts +14 -5
  482. package/src/store/gi/constructor-props.ts +19 -23
  483. package/src/store/gi/doc-spec.ts +38 -0
  484. package/src/store/gi/enum.ts +75 -26
  485. package/src/store/gi/function.ts +72 -44
  486. package/src/store/gi/gtype-binding.ts +7 -2
  487. package/src/store/gi/interface.ts +244 -37
  488. package/src/store/gi/item-comparators.ts +3 -5
  489. package/src/store/gi/method.ts +124 -69
  490. package/src/store/gi/param-marshal.ts +91 -6
  491. package/src/store/gi/pipeline.ts +28 -13
  492. package/src/store/gi/properties.ts +10 -5
  493. package/src/store/gi/property-accessor.ts +163 -75
  494. package/src/store/gi/record-constructor.ts +56 -19
  495. package/src/store/gi/record-field-accessor.ts +13 -4
  496. package/src/store/gi/record-layout.ts +12 -2
  497. package/src/store/gi/record.ts +24 -10
  498. package/src/store/gi/registration.ts +5 -5
  499. package/src/store/gi/runtime-override.ts +13 -6
  500. package/src/store/gi/signal.ts +54 -57
  501. package/src/store/gi/value-marshalable.ts +4 -2
  502. package/src/store/gi/vtable.ts +439 -61
  503. package/src/store/gi-store.ts +26 -31
  504. package/src/store/jsx/element-components.ts +8 -5
  505. package/src/store/jsx/element-prop-imports.ts +1 -3
  506. package/src/store/jsx/element-prop-types.ts +10 -1
  507. package/src/store/jsx/generated-elements.ts +17 -8
  508. package/src/store/jsx/intrinsic-elements.ts +4 -0
  509. package/src/store/jsx/jsx.ts +11 -9
  510. package/src/store/jsx/metadata.ts +6 -3
  511. package/src/store/jsx/pipeline.ts +1 -1
  512. package/src/store/jsx/props.ts +20 -7
  513. package/src/store/jsx-store.ts +3 -3
  514. package/src/store/resolve-store.ts +133 -18
  515. package/src/store/store-fs.ts +87 -34
  516. package/src/store/store-links.ts +49 -0
  517. package/src/writer/comparison-context.ts +18 -0
  518. package/src/writer/context.ts +14 -4
  519. package/src/writer/doc-tags.ts +70 -0
  520. package/src/writer/doc.ts +29 -6
  521. package/src/writer/gtk-doc.ts +82 -15
  522. package/src/writer/module.ts +114 -4
  523. package/src/xml.ts +61 -1
@@ -1,8 +1,19 @@
1
1
  import type { TypeId } from "./type-id.js";
2
2
  import type { GirType } from "./type.js";
3
3
  import { type GirNamespace } from "./namespace.js";
4
+ /**
5
+ * The parsed GIR universe: every requested namespace plus everything those namespaces include,
6
+ * with types resolvable across namespace boundaries.
7
+ */
4
8
  declare class Library {
5
9
  private static drive;
10
+ /**
11
+ * Parses the named GIR libraries along with every namespace they transitively include.
12
+ *
13
+ * @param libraries GIR identifiers to load, such as `Gtk-4.0`.
14
+ * @param girPath Directories searched, in order, for each `.gir` file.
15
+ * @returns A library holding every namespace that was parsed.
16
+ */
6
17
  static load(libraries: string[], girPath: string[]): Library;
7
18
  private namespacesByName;
8
19
  private namespaceById;
@@ -10,6 +21,7 @@ declare class Library {
10
21
  private nsIdByName;
11
22
  private typeTables;
12
23
  private girFilesValue;
24
+ /** Creates a library with no namespaces loaded; {@link Library.load} builds a populated one. */
13
25
  constructor();
14
26
  private ensureNsId;
15
27
  private registerNamespace;
@@ -30,13 +42,37 @@ declare class Library {
30
42
  private addValueDeclarations;
31
43
  private processIdentifier;
32
44
  private discoverNamespaces;
45
+ /** The loaded namespaces, keyed by their GIR name such as `Gtk`. */
33
46
  get namespaces(): Map<string, GirNamespace>;
47
+ /** Paths of the `.gir` files that were read, in the order they were discovered. */
34
48
  get girFiles(): string[];
49
+ /**
50
+ * Reads the type a {@link TypeId} points at.
51
+ *
52
+ * @param tid The type id to dereference.
53
+ * @returns The parsed type, or `undefined` when nothing has been parsed into that slot.
54
+ */
35
55
  typeFor(tid: TypeId): GirType | undefined;
56
+ /**
57
+ * Reads the name a {@link TypeId} was registered under.
58
+ *
59
+ * @param tid The type id to name.
60
+ * @returns The namespace and type name, or `undefined` for an anonymous type.
61
+ */
36
62
  nameFor(tid: TypeId): {
63
+ /** GIR namespace to qualify the type with, such as `Gtk`. */
37
64
  namespaceName: string;
65
+ /** Unqualified type name as GIR declares it, such as `Widget`. */
38
66
  typeName: string;
39
67
  } | undefined;
68
+ /**
69
+ * Looks up a type by the name a GIR file writes, resolving an unqualified name against the
70
+ * namespace it appears in and a `Namespace.Type` name against the loaded namespaces.
71
+ *
72
+ * @param currentNamespaceName Namespace the name is written in.
73
+ * @param name Type name, optionally qualified with a namespace prefix.
74
+ * @returns The parsed type, or `undefined` when the name is unknown or only a forward reference to it exists.
75
+ */
40
76
  resolveType(currentNamespaceName: string, name: string): GirType | undefined;
41
77
  }
42
78
  export { Library };
@@ -1 +1 @@
1
- {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../src/gir/library.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAqD,MAAM,EAAE,MAAM,cAAc,CAAC;AAC9F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAEH,KAAK,YAAY,EAIpB,MAAM,gBAAgB,CAAC;AAwCxB,cAAM,OAAO;IACT,OAAO,CAAC,MAAM,CAAC,KAAK;IAcpB,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO;IAO5D,OAAO,CAAC,gBAAgB,CAAwC;IAChE,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,UAAU,CAAkC;IACpD,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,aAAa,CAAgB;;IAQrC,OAAO,CAAC,UAAU;IAgBlB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,kBAAkB;IAoB1B,IAAW,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAEjD;IAED,I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AC,cAAc;IAOtB,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,kBAAkB;IAoB1B,oEAAoE;IACpE,IAAW,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAEjD;IAED,mFAAmF;IACnF,IAAW,QAAQ,IAAI,MAAM,EAAE,CAE9B;IAED;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAIzC;;;;;OAKG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QAClB,6DAA6D;QAC7D,aAAa,EAAE,MAAM,CAAC;QACtB,kEAAkE;QAClE,QAAQ,EAAE,MAAM,CAAC;KACpB,GAAG,SAAS;IAWb;;;;;;;OAOG;IACH,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;CAsB/E;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -24,6 +24,10 @@ const locateGirFile = (identifier, girPath) => {
24
24
  const tried = girPath.map((directory) => join(directory, filename)).join(", ");
25
25
  throw new Error(`GIR file ${filename} not found on girPath. Tried: ${tried}`);
26
26
  };
27
+ /**
28
+ * The parsed GIR universe: every requested namespace plus everything those namespaces include,
29
+ * with types resolvable across namespace boundaries.
30
+ */
27
31
  class Library {
28
32
  static drive(library, libraries, girPath) {
29
33
  const { discovered, girFiles } = library.discoverNamespaces(libraries, girPath);
@@ -35,6 +39,13 @@ class Library {
35
39
  }
36
40
  library.girFilesValue = girFiles;
37
41
  }
42
+ /**
43
+ * Parses the named GIR libraries along with every namespace they transitively include.
44
+ *
45
+ * @param libraries GIR identifiers to load, such as `Gtk-4.0`.
46
+ * @param girPath Directories searched, in order, for each `.gir` file.
47
+ * @returns A library holding every namespace that was parsed.
48
+ */
38
49
  static load(libraries, girPath) {
39
50
  const library = new Library();
40
51
  this.drive(library, libraries, girPath);
@@ -46,6 +57,7 @@ class Library {
46
57
  nsIdByName = new Map();
47
58
  typeTables = [];
48
59
  girFilesValue = [];
60
+ /** Creates a library with no namespaces loaded; {@link Library.load} builds a populated one. */
49
61
  constructor() {
50
62
  this.typeTables[INTERNAL_NS_ID] = { types: [], names: [], index: new Map() };
51
63
  this.namespaceById[INTERNAL_NS_ID] = undefined;
@@ -184,7 +196,7 @@ class Library {
184
196
  seen.add(namespaceName);
185
197
  const path = locateGirFile(identifier, girPath);
186
198
  girFiles.push(path);
187
- const header = parseNamespaceHeader(readRepositoryNode(path));
199
+ const header = parseNamespaceHeader(readRepositoryNode(path), path);
188
200
  const shell = this.registerNamespace(header);
189
201
  discovered.push({ header, shell });
190
202
  for (const include of header.includes) {
@@ -204,15 +216,29 @@ class Library {
204
216
  }
205
217
  return { discovered, girFiles };
206
218
  }
219
+ /** The loaded namespaces, keyed by their GIR name such as `Gtk`. */
207
220
  get namespaces() {
208
221
  return this.namespacesByName;
209
222
  }
223
+ /** Paths of the `.gir` files that were read, in the order they were discovered. */
210
224
  get girFiles() {
211
225
  return this.girFilesValue;
212
226
  }
227
+ /**
228
+ * Reads the type a {@link TypeId} points at.
229
+ *
230
+ * @param tid The type id to dereference.
231
+ * @returns The parsed type, or `undefined` when nothing has been parsed into that slot.
232
+ */
213
233
  typeFor(tid) {
214
234
  return this.typeTables[tid.nsId]?.types[tid.id];
215
235
  }
236
+ /**
237
+ * Reads the name a {@link TypeId} was registered under.
238
+ *
239
+ * @param tid The type id to name.
240
+ * @returns The namespace and type name, or `undefined` for an anonymous type.
241
+ */
216
242
  nameFor(tid) {
217
243
  const typeName = this.typeTables[tid.nsId]?.names[tid.id];
218
244
  const namespaceName = this.nsNameById[tid.nsId];
@@ -221,6 +247,14 @@ class Library {
221
247
  }
222
248
  return { namespaceName, typeName };
223
249
  }
250
+ /**
251
+ * Looks up a type by the name a GIR file writes, resolving an unqualified name against the
252
+ * namespace it appears in and a `Namespace.Type` name against the loaded namespaces.
253
+ *
254
+ * @param currentNamespaceName Namespace the name is written in.
255
+ * @param name Type name, optionally qualified with a namespace prefix.
256
+ * @returns The parsed type, or `undefined` when the name is unknown or only a forward reference to it exists.
257
+ */
224
258
  resolveType(currentNamespaceName, name) {
225
259
  const currentNsId = this.nsIdByName.get(currentNamespaceName);
226
260
  if (currentNsId === undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/gir/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACH,oBAAoB,EAGpB,oBAAoB,EACpB,qBAAqB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAUvD,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAW,EAAE;IACjD,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IAEnC,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,2BAA2B,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,UAAqB,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,UAAkB,EAAE,OAAiB,EAAU,EAAE;IACpE,MAAM,QAA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AC;IACnD,CAAC;CACJ;AAED,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { PrimitiveCategory } from \"./primitives.js\";\nimport type { CArrayType, HashTableType, ListType, ParseContext, TypeId } from \"./type-id.js\";\nimport type { GirType } from \"./type.js\";\nimport { callbackFromNode } from \"./callback.js\";\nimport {\n createNamespaceShell,\n type GirNamespace,\n type NamespaceHeader,\n parseNamespaceHeader,\n populateNamespaceBody,\n} from \"./namespace.js\";\nimport { parseGirFile, type RawNode } from \"./parse.js\";\nimport { splitOptionalNamespace } from \"./type-ref.js\";\n\ntype TypeTable = {\n types: (GirType | undefined)[];\n names: (string | undefined)[];\n index: Map<string, number>;\n};\n\ntype DiscoveredNamespace = { header: NamespaceHeader; shell: GirNamespace };\n\nconst INTERNAL_NS_ID = 0;\n\nconst readRepositoryNode = (path: string): RawNode => {\n const root = parseGirFile(path);\n const repository = root.repository;\n\n if (typeof repository !== \"object\" || repository === null) {\n throw new Error(`GIR file at ${path} has no <repository> root`);\n }\n\n return repository as RawNode;\n};\n\nconst locateGirFile = (identifier: string, girPath: string[]): string => {\n const filename = `${identifier}.gir`;\n\n for (const directory of girPath) {\n const candidate = join(directory, filename);\n\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n\n const tried = girPath.map((directory) => join(directory, filename)).join(\", \");\n throw new Error(`GIR file ${filename} not found on girPath. Tried: ${tried}`);\n};\n\nclass Library {\n private static drive(library: Library, libraries: string[], girPath: string[]): void {\n const { discovered, girFiles } = library.discoverNamespaces(libraries, girPath);\n\n for (const { header, shell } of discovered) {\n populateNamespaceBody(shell, header.namespaceNode, library.parseContext(shell.id));\n }\n\n for (const { shell } of discovered) {\n library.addDeclarations(shell);\n }\n\n library.girFilesValue = girFiles;\n }\n\n static load(libraries: string[], girPath: string[]): Library {\n const library = new Library();\n this.drive(library, libraries, girPath);\n\n return library;\n }\n\n private namespacesByName: Map<string, GirNamespace> = new Map();\n private namespaceById: (GirNamespace | undefined)[] = [];\n private nsNameById: string[] = [];\n private nsIdByName: Map<string, number> = new Map();\n private typeTables: TypeTable[] = [];\n private girFilesValue: string[] = [];\n\n constructor() {\n this.typeTables[INTERNAL_NS_ID] = { types: [], names: [], index: new Map() };\n this.namespaceById[INTERNAL_NS_ID] = undefined;\n this.nsNameById[INTERNAL_NS_ID] = \"$internal\";\n }\n\n private ensureNsId(name: string): number {\n const existing = this.nsIdByName.get(name);\n\n if (existing !== undefined) {\n return existing;\n }\n\n const nsId = this.typeTables.length;\n this.typeTables[nsId] = { types: [], names: [], index: new Map() };\n this.namespaceById[nsId] = undefined;\n this.nsNameById[nsId] = name;\n this.nsIdByName.set(name, nsId);\n\n return nsId;\n }\n\n private registerNamespace(header: NamespaceHeader): GirNamespace {\n const nsId = this.ensureNsId(header.name);\n const shell = createNamespaceShell(header, nsId);\n this.namespaceById[nsId] = shell;\n this.namespacesByName.set(header.name, shell);\n\n return shell;\n }\n\n private namespaceFor(nsId: number): GirNamespace {\n const namespace = this.namespaceById[nsId];\n\n if (namespace === undefined) {\n throw new Error(`No namespace registered for type table id ${String(nsId)}`);\n }\n\n return namespace;\n }\n\n private typeTableFor(nsId: number): TypeTable {\n const typeTable = this.typeTables[nsId];\n\n if (typeTable === undefined) {\n throw new Error(`No type table for namespace id ${String(nsId)}`);\n }\n\n return typeTable;\n }\n\n private insertIntoTypeTable(\n typeTable: TypeTable,\n slot: { type: GirType | undefined; indexKey?: string; displayName?: string },\n ): number {\n const id = typeTable.types.length;\n typeTable.types.push(slot.type);\n typeTable.names.push(slot.displayName);\n\n if (slot.indexKey !== undefined) {\n typeTable.index.set(slot.indexKey, id);\n }\n\n return id;\n }\n\n private resolveTypeId(nsId: number, name: string, type: GirType | undefined): number {\n const typeTable = this.typeTableFor(nsId);\n const existing = typeTable.index.get(name);\n\n if (existing !== undefined) {\n return existing;\n }\n\n return this.insertIntoTypeTable(typeTable, { type, indexKey: name, displayName: name });\n }\n\n private addType(nsId: number, name: string, type: GirType): void {\n this.typeTableFor(nsId).types[this.resolveTypeId(nsId, name, type)] = type;\n }\n\n private findType(nsId: number, name: string): TypeId {\n return { nsId, id: this.resolveTypeId(nsId, name, undefined) };\n }\n\n private addAnonymousType(nsId: number, type: GirType): TypeId {\n const typeTable = this.typeTableFor(nsId);\n const id = this.insertIntoTypeTable(typeTable, { type });\n\n return { nsId, id };\n }\n\n private findTypeByName(currentNsId: number, name: string): TypeId {\n const [namespaceName, localName] = splitOptionalNamespace(name);\n const targetNsId = namespaceName === undefined ? currentNsId : this.ensureNsId(namespaceName);\n\n return this.findType(targetNsId, localName);\n }\n\n private parseContext(nsId: number): ParseContext {\n const context: ParseContext = {\n nsId,\n findType: (name) => this.findTypeByName(nsId, name),\n addPrimitive: (category) => this.addPrimitive(category),\n addVarargs: () => this.addVarargs(),\n addContainer: (type: CArrayType | ListType | HashTableType) => this.addAnonymousType(nsId, type),\n addAnonymousCallback: (node) =>\n this.addAnonymousType(nsId, {\n kind: \"callback\",\n namespace: this.namespaceFor(nsId),\n value: callbackFromNode(node, context),\n }),\n };\n\n return context;\n }\n\n private addPrimitive(category: PrimitiveCategory): TypeId {\n return this.findOrAddContainer(`primitive:${category}`, { kind: \"primitive\", category });\n }\n\n private addVarargs(): TypeId {\n return this.findOrAddContainer(\"varargs\", { kind: \"varargs\" });\n }\n\n private findOrAddContainer(key: string, type: GirType): TypeId {\n const typeTable = this.typeTableFor(INTERNAL_NS_ID);\n const existing = typeTable.index.get(key);\n\n if (existing !== undefined) {\n return { nsId: INTERNAL_NS_ID, id: existing };\n }\n\n const id = this.insertIntoTypeTable(typeTable, { type, indexKey: key });\n\n return { nsId: INTERNAL_NS_ID, id };\n }\n\n private addDeclarations(shell: GirNamespace): void {\n this.addClassDeclarations(shell);\n this.addValueDeclarations(shell);\n }\n\n private addClassDeclarations(shell: GirNamespace): void {\n const nsId = shell.id;\n\n for (const value of shell.classes) {\n this.addType(nsId, value.name, { kind: \"class\", namespace: shell, value });\n }\n\n for (const value of shell.interfaces) {\n this.addType(nsId, value.name, { kind: \"interface\", namespace: shell, value });\n }\n\n for (const value of shell.records) {\n this.addType(nsId, value.name, { kind: \"record\", namespace: shell, value });\n }\n }\n\n private addValueDeclarations(shell: GirNamespace): void {\n const nsId = shell.id;\n\n for (const value of shell.enums) {\n this.addType(nsId, value.name, { kind: \"enum\", namespace: shell, value });\n }\n\n for (const value of shell.callbacks) {\n this.addType(nsId, value.name, { kind: \"callback\", namespace: shell, value });\n }\n\n for (const alias of shell.aliases) {\n this.addType(nsId, alias.name, { kind: \"alias\", namespace: shell, value: alias });\n }\n }\n\n private processIdentifier(input: {\n identifier: string;\n girPath: string[];\n seen: Set<string>;\n queue: string[];\n girFiles: string[];\n discovered: DiscoveredNamespace[];\n }): void {\n const { identifier, girPath, seen, queue, girFiles, discovered } = input;\n const namespaceName = identifier.split(\"-\", 1)[0] ?? identifier;\n\n if (seen.has(namespaceName)) {\n return;\n }\n\n seen.add(namespaceName);\n const path = locateGirFile(identifier, girPath);\n girFiles.push(path);\n const header = parseNamespaceHeader(readRepositoryNode(path));\n const shell = this.registerNamespace(header);\n discovered.push({ header, shell });\n\n for (const include of header.includes) {\n queue.push(`${include.name}-${include.version}`);\n }\n }\n\n private discoverNamespaces(\n libraries: string[],\n girPath: string[],\n ): { discovered: DiscoveredNamespace[]; girFiles: string[] } {\n const queue: string[] = [...libraries];\n const seen: Set<string> = new Set();\n const discovered: DiscoveredNamespace[] = [];\n const girFiles: string[] = [];\n\n while (queue.length > 0) {\n const identifier = queue.shift();\n\n if (identifier !== undefined) {\n this.processIdentifier({ identifier, girPath, seen, queue, girFiles, discovered });\n }\n }\n\n return { discovered, girFiles };\n }\n\n public get namespaces(): Map<string, GirNamespace> {\n return this.namespacesByName;\n }\n\n public get girFiles(): string[] {\n return this.girFilesValue;\n }\n\n typeFor(tid: TypeId): GirType | undefined {\n return this.typeTables[tid.nsId]?.types[tid.id];\n }\n\n nameFor(tid: TypeId): { namespaceName: string; typeName: string } | undefined {\n const typeName = this.typeTables[tid.nsId]?.names[tid.id];\n const namespaceName = this.nsNameById[tid.nsId];\n\n if (typeName === undefined || namespaceName === undefined) {\n return undefined;\n }\n\n return { namespaceName, typeName };\n }\n\n resolveType(currentNamespaceName: string, name: string): GirType | undefined {\n const currentNsId = this.nsIdByName.get(currentNamespaceName);\n\n if (currentNsId === undefined) {\n return undefined;\n }\n\n const [namespaceName, localName] = splitOptionalNamespace(name);\n const targetNsId = namespaceName === undefined ? currentNsId : this.nsIdByName.get(namespaceName);\n\n if (targetNsId === undefined) {\n return undefined;\n }\n\n const id = this.typeTableFor(targetNsId).index.get(localName);\n\n if (id === undefined) {\n return undefined;\n }\n\n return this.typeTableFor(targetNsId).types[id];\n }\n}\n\nexport { Library };\n"]}
1
+ {"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/gir/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EACH,oBAAoB,EAGpB,oBAAoB,EACpB,qBAAqB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAoBvD,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAW,EAAE;IACjD,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IAEnC,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,2BAA2B,CAAC,CAAC;IACpE,CAAC;I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AAE,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAE9D,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACnB,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;CACJ;AAED,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { PrimitiveCategory } from \"./primitives.js\";\nimport type { CArrayType, HashTableType, ListType, ParseContext, TypeId } from \"./type-id.js\";\nimport type { GirType } from \"./type.js\";\nimport { callbackFromNode } from \"./callback.js\";\nimport {\n createNamespaceShell,\n type GirNamespace,\n type NamespaceHeader,\n parseNamespaceHeader,\n populateNamespaceBody,\n} from \"./namespace.js\";\nimport { parseGirFile, type RawNode } from \"./parse.js\";\nimport { splitOptionalNamespace } from \"./type-ref.js\";\n\n/** The types belonging to one namespace, addressed by the id half of a {@link TypeId}. */\ntype TypeTable = {\n /** Parsed type in each slot, still `undefined` while only a forward reference to it has been seen. */\n types: (GirType | undefined)[];\n /** Declared name of each slot, `undefined` for anonymous types such as containers and inline callbacks. */\n names: (string | undefined)[];\n /** Slot id each named type occupies, so repeated references resolve to the same id. */\n index: Map<string, number>;\n};\n\n/** A namespace whose header has been read and whose shell is registered, before its body is parsed. */\ntype DiscoveredNamespace = {\n /** Attributes and includes read from the namespace's GIR file. */\n header: NamespaceHeader;\n /** Empty namespace registered for the header, populated once every header is known. */\n shell: GirNamespace;\n};\n\nconst INTERNAL_NS_ID = 0;\n\nconst readRepositoryNode = (path: string): RawNode => {\n const root = parseGirFile(path);\n const repository = root.repository;\n\n if (typeof repository !== \"object\" || repository === null) {\n throw new Error(`GIR file at ${path} has no <repository> root`);\n }\n\n return repository as RawNode;\n};\n\nconst locateGirFile = (identifier: string, girPath: string[]): string => {\n const filename = `${identifier}.gir`;\n\n for (const directory of girPath) {\n const candidate = join(directory, filename);\n\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n\n const tried = girPath.map((directory) => join(directory, filename)).join(\", \");\n throw new Error(`GIR file ${filename} not found on girPath. Tried: ${tried}`);\n};\n\n/**\n * The parsed GIR universe: every requested namespace plus everything those namespaces include,\n * with types resolvable across namespace boundaries.\n */\nclass Library {\n private static drive(library: Library, libraries: string[], girPath: string[]): void {\n const { discovered, girFiles } = library.discoverNamespaces(libraries, girPath);\n\n for (const { header, shell } of discovered) {\n populateNamespaceBody(shell, header.namespaceNode, library.parseContext(shell.id));\n }\n\n for (const { shell } of discovered) {\n library.addDeclarations(shell);\n }\n\n library.girFilesValue = girFiles;\n }\n\n /**\n * Parses the named GIR libraries along with every namespace they transitively include.\n *\n * @param libraries GIR identifiers to load, such as `Gtk-4.0`.\n * @param girPath Directories searched, in order, for each `.gir` file.\n * @returns A library holding every namespace that was parsed.\n */\n static load(libraries: string[], girPath: string[]): Library {\n const library = new Library();\n this.drive(library, libraries, girPath);\n\n return library;\n }\n\n private namespacesByName: Map<string, GirNamespace> = new Map();\n private namespaceById: (GirNamespace | undefined)[] = [];\n private nsNameById: string[] = [];\n private nsIdByName: Map<string, number> = new Map();\n private typeTables: TypeTable[] = [];\n private girFilesValue: string[] = [];\n\n /** Creates a library with no namespaces loaded; {@link Library.load} builds a populated one. */\n constructor() {\n this.typeTables[INTERNAL_NS_ID] = { types: [], names: [], index: new Map() };\n this.namespaceById[INTERNAL_NS_ID] = undefined;\n this.nsNameById[INTERNAL_NS_ID] = \"$internal\";\n }\n\n private ensureNsId(name: string): number {\n const existing = this.nsIdByName.get(name);\n\n if (existing !== undefined) {\n return existing;\n }\n\n const nsId = this.typeTables.length;\n this.typeTables[nsId] = { types: [], names: [], index: new Map() };\n this.namespaceById[nsId] = undefined;\n this.nsNameById[nsId] = name;\n this.nsIdByName.set(name, nsId);\n\n return nsId;\n }\n\n private registerNamespace(header: NamespaceHeader): GirNamespace {\n const nsId = this.ensureNsId(header.name);\n const shell = createNamespaceShell(header, nsId);\n this.namespaceById[nsId] = shell;\n this.namespacesByName.set(header.name, shell);\n\n return shell;\n }\n\n private namespaceFor(nsId: number): GirNamespace {\n const namespace = this.namespaceById[nsId];\n\n if (namespace === undefined) {\n throw new Error(`No namespace registered for type table id ${String(nsId)}`);\n }\n\n return namespace;\n }\n\n private typeTableFor(nsId: number): TypeTable {\n const typeTable = this.typeTables[nsId];\n\n if (typeTable === undefined) {\n throw new Error(`No type table for namespace id ${String(nsId)}`);\n }\n\n return typeTable;\n }\n\n private insertIntoTypeTable(\n typeTable: TypeTable,\n slot: { type: GirType | undefined; indexKey?: string; displayName?: string },\n ): number {\n const id = typeTable.types.length;\n typeTable.types.push(slot.type);\n typeTable.names.push(slot.displayName);\n\n if (slot.indexKey !== undefined) {\n typeTable.index.set(slot.indexKey, id);\n }\n\n return id;\n }\n\n private resolveTypeId(nsId: number, name: string, type: GirType | undefined): number {\n const typeTable = this.typeTableFor(nsId);\n const existing = typeTable.index.get(name);\n\n if (existing !== undefined) {\n return existing;\n }\n\n return this.insertIntoTypeTable(typeTable, { type, indexKey: name, displayName: name });\n }\n\n private addType(nsId: number, name: string, type: GirType): void {\n this.typeTableFor(nsId).types[this.resolveTypeId(nsId, name, type)] = type;\n }\n\n private findType(nsId: number, name: string): TypeId {\n return { nsId, id: this.resolveTypeId(nsId, name, undefined) };\n }\n\n private addAnonymousType(nsId: number, type: GirType): TypeId {\n const typeTable = this.typeTableFor(nsId);\n const id = this.insertIntoTypeTable(typeTable, { type });\n\n return { nsId, id };\n }\n\n private findTypeByName(currentNsId: number, name: string): TypeId {\n const [namespaceName, localName] = splitOptionalNamespace(name);\n const targetNsId = namespaceName === undefined ? currentNsId : this.ensureNsId(namespaceName);\n\n return this.findType(targetNsId, localName);\n }\n\n private parseContext(nsId: number): ParseContext {\n const context: ParseContext = {\n nsId,\n findType: (name) => this.findTypeByName(nsId, name),\n addPrimitive: (category) => this.addPrimitive(category),\n addVarargs: () => this.addVarargs(),\n addContainer: (type: CArrayType | ListType | HashTableType) => this.addAnonymousType(nsId, type),\n addAnonymousCallback: (node) =>\n this.addAnonymousType(nsId, {\n kind: \"callback\",\n namespace: this.namespaceFor(nsId),\n value: callbackFromNode(node, context),\n }),\n };\n\n return context;\n }\n\n private addPrimitive(category: PrimitiveCategory): TypeId {\n return this.findOrAddContainer(`primitive:${category}`, { kind: \"primitive\", category });\n }\n\n private addVarargs(): TypeId {\n return this.findOrAddContainer(\"varargs\", { kind: \"varargs\" });\n }\n\n private findOrAddContainer(key: string, type: GirType): TypeId {\n const typeTable = this.typeTableFor(INTERNAL_NS_ID);\n const existing = typeTable.index.get(key);\n\n if (existing !== undefined) {\n return { nsId: INTERNAL_NS_ID, id: existing };\n }\n\n const id = this.insertIntoTypeTable(typeTable, { type, indexKey: key });\n\n return { nsId: INTERNAL_NS_ID, id };\n }\n\n private addDeclarations(shell: GirNamespace): void {\n this.addClassDeclarations(shell);\n this.addValueDeclarations(shell);\n }\n\n private addClassDeclarations(shell: GirNamespace): void {\n const nsId = shell.id;\n\n for (const value of shell.classes) {\n this.addType(nsId, value.name, { kind: \"class\", namespace: shell, value });\n }\n\n for (const value of shell.interfaces) {\n this.addType(nsId, value.name, { kind: \"interface\", namespace: shell, value });\n }\n\n for (const value of shell.records) {\n this.addType(nsId, value.name, { kind: \"record\", namespace: shell, value });\n }\n }\n\n private addValueDeclarations(shell: GirNamespace): void {\n const nsId = shell.id;\n\n for (const value of shell.enums) {\n this.addType(nsId, value.name, { kind: \"enum\", namespace: shell, value });\n }\n\n for (const value of shell.callbacks) {\n this.addType(nsId, value.name, { kind: \"callback\", namespace: shell, value });\n }\n\n for (const alias of shell.aliases) {\n this.addType(nsId, alias.name, { kind: \"alias\", namespace: shell, value: alias });\n }\n }\n\n private processIdentifier(input: {\n identifier: string;\n girPath: string[];\n seen: Set<string>;\n queue: string[];\n girFiles: string[];\n discovered: DiscoveredNamespace[];\n }): void {\n const { identifier, girPath, seen, queue, girFiles, discovered } = input;\n const namespaceName = identifier.split(\"-\", 1)[0] ?? identifier;\n\n if (seen.has(namespaceName)) {\n return;\n }\n\n seen.add(namespaceName);\n const path = locateGirFile(identifier, girPath);\n girFiles.push(path);\n const header = parseNamespaceHeader(readRepositoryNode(path), path);\n const shell = this.registerNamespace(header);\n discovered.push({ header, shell });\n\n for (const include of header.includes) {\n queue.push(`${include.name}-${include.version}`);\n }\n }\n\n private discoverNamespaces(\n libraries: string[],\n girPath: string[],\n ): { discovered: DiscoveredNamespace[]; girFiles: string[] } {\n const queue: string[] = [...libraries];\n const seen: Set<string> = new Set();\n const discovered: DiscoveredNamespace[] = [];\n const girFiles: string[] = [];\n\n while (queue.length > 0) {\n const identifier = queue.shift();\n\n if (identifier !== undefined) {\n this.processIdentifier({ identifier, girPath, seen, queue, girFiles, discovered });\n }\n }\n\n return { discovered, girFiles };\n }\n\n /** The loaded namespaces, keyed by their GIR name such as `Gtk`. */\n public get namespaces(): Map<string, GirNamespace> {\n return this.namespacesByName;\n }\n\n /** Paths of the `.gir` files that were read, in the order they were discovered. */\n public get girFiles(): string[] {\n return this.girFilesValue;\n }\n\n /**\n * Reads the type a {@link TypeId} points at.\n *\n * @param tid The type id to dereference.\n * @returns The parsed type, or `undefined` when nothing has been parsed into that slot.\n */\n typeFor(tid: TypeId): GirType | undefined {\n return this.typeTables[tid.nsId]?.types[tid.id];\n }\n\n /**\n * Reads the name a {@link TypeId} was registered under.\n *\n * @param tid The type id to name.\n * @returns The namespace and type name, or `undefined` for an anonymous type.\n */\n nameFor(tid: TypeId): {\n /** GIR namespace to qualify the type with, such as `Gtk`. */\n namespaceName: string;\n /** Unqualified type name as GIR declares it, such as `Widget`. */\n typeName: string;\n } | undefined {\n const typeName = this.typeTables[tid.nsId]?.names[tid.id];\n const namespaceName = this.nsNameById[tid.nsId];\n\n if (typeName === undefined || namespaceName === undefined) {\n return undefined;\n }\n\n return { namespaceName, typeName };\n }\n\n /**\n * Looks up a type by the name a GIR file writes, resolving an unqualified name against the\n * namespace it appears in and a `Namespace.Type` name against the loaded namespaces.\n *\n * @param currentNamespaceName Namespace the name is written in.\n * @param name Type name, optionally qualified with a namespace prefix.\n * @returns The parsed type, or `undefined` when the name is unknown or only a forward reference to it exists.\n */\n resolveType(currentNamespaceName: string, name: string): GirType | undefined {\n const currentNsId = this.nsIdByName.get(currentNamespaceName);\n\n if (currentNsId === undefined) {\n return undefined;\n }\n\n const [namespaceName, localName] = splitOptionalNamespace(name);\n const targetNsId = namespaceName === undefined ? currentNsId : this.nsIdByName.get(namespaceName);\n\n if (targetNsId === undefined) {\n return undefined;\n }\n\n const id = this.typeTableFor(targetNsId).index.get(localName);\n\n if (id === undefined) {\n return undefined;\n }\n\n return this.typeTableFor(targetNsId).types[id];\n }\n}\n\nexport { Library };\n"]}
@@ -1,50 +1,92 @@
1
1
  import type { ParseContext, TypeId } from "./type-id.js";
2
+ import { type GirAnnotations } from "./annotations.js";
2
3
  import { type GirCallback } from "./callback.js";
3
4
  import { type GirClass } from "./class.js";
4
5
  import { type GirEnum } from "./enum.js";
5
6
  import { type GirFunction } from "./function.js";
6
7
  import { type RawNode } from "./parse.js";
7
8
  import { type GirRecord } from "./record.js";
9
+ /** A compile-time constant declared by a namespace. */
8
10
  type GirConstant = {
11
+ /** Local name within the namespace. */
9
12
  name: string;
13
+ /** Documentation text carried by the GIR node. */
10
14
  doc: string | undefined;
15
+ /** Release and deprecation annotations GIR carries on the constant. */
16
+ annotations: GirAnnotations;
17
+ /** Literal as written in the GIR, still to be interpreted according to {@link GirConstant.type}. */
11
18
  value: string;
19
+ /** Type of the constant, unresolved until looked up in the library's type tables. */
12
20
  type: TypeId | undefined;
13
21
  };
22
+ /** A named alias for another type. */
14
23
  type GirAlias = {
24
+ /** Local name within the namespace. */
15
25
  name: string;
26
+ /** Documentation text carried by the GIR node. */
16
27
  doc: string | undefined;
28
+ /** Release and deprecation annotations GIR carries on the alias. */
29
+ annotations: GirAnnotations;
30
+ /** C typedef name introduced by the alias. */
17
31
  cType: string | undefined;
32
+ /** Type the alias stands for, unresolved until looked up in the library's type tables. */
18
33
  target: TypeId | undefined;
34
+ /** C type name of the target, which decides how the alias marshals. */
19
35
  targetCType: string | undefined;
20
36
  };
37
+ /** Everything one GIR namespace declares, keyed into the library that parsed it. */
21
38
  type GirNamespace = {
39
+ /** Identifier of the namespace's type table within its library. */
22
40
  id: number;
41
+ /** Namespace name as it appears in the GIR, such as `Gtk`. */
23
42
  name: string;
43
+ /** Path of the `.gir` file the namespace was parsed from, named by every diagnostic the namespace causes. */
44
+ girFile: string;
45
+ /** The `shared-library` attribute verbatim: the objects to load symbols from, separated by commas. */
24
46
  sharedLibrary: string | undefined;
47
+ /** Prefixes stripped off C identifiers to derive export names, such as `gtk`. */
25
48
  cSymbolPrefixes: string[];
49
+ /** GObject classes declared by the namespace. */
26
50
  classes: GirClass[];
51
+ /** GObject interfaces declared by the namespace. */
27
52
  interfaces: GirClass[];
53
+ /** Structs and unions declared by the namespace. */
28
54
  records: GirRecord[];
55
+ /** Enumerations and bitfields declared by the namespace. */
29
56
  enums: GirEnum[];
57
+ /** Callback types declared by the namespace. */
30
58
  callbacks: GirCallback[];
59
+ /** Free functions declared by the namespace. */
31
60
  functions: GirFunction[];
61
+ /** Compile-time values, emitted as module-level `const` bindings. */
32
62
  constants: GirConstant[];
63
+ /** Typedefs, emitted as TypeScript type aliases and resolvable as types themselves. */
33
64
  aliases: GirAlias[];
34
65
  };
66
+ /** Another namespace a GIR repository depends on. */
35
67
  type NamespaceInclude = {
68
+ /** Name of the included namespace, such as `Gio`. */
36
69
  name: string;
70
+ /** Version of the included namespace, such as `2.0`. */
37
71
  version: string;
38
72
  };
73
+ /** A namespace's declaration and dependencies, read before its body is parsed. */
39
74
  type NamespaceHeader = {
75
+ /** Namespace name as it appears in the GIR, such as `Gtk`. */
40
76
  name: string;
77
+ /** Path of the `.gir` file the header was read from. */
78
+ girFile: string;
79
+ /** The `shared-library` attribute verbatim: the objects to load symbols from, separated by commas. */
41
80
  sharedLibrary: string | undefined;
81
+ /** Prefixes stripped off C identifiers to derive export names, such as `gtk`. */
42
82
  cSymbolPrefixes: string[];
83
+ /** Namespaces this repository includes, each of which is parsed in turn. */
43
84
  includes: NamespaceInclude[];
85
+ /** The `<namespace>` node whose children hold the declarations. */
44
86
  namespaceNode: RawNode;
45
87
  };
46
88
  declare const namespaceDirectory: (namespace: Pick<GirNamespace, "name">) => string;
47
- declare const parseNamespaceHeader: (repositoryNode: RawNode) => NamespaceHeader;
89
+ declare const parseNamespaceHeader: (repositoryNode: RawNode, path: string) => NamespaceHeader;
48
90
  declare const createNamespaceShell: (header: NamespaceHeader, id: number) => GirNamespace;
49
91
  declare const populateNamespaceBody: (shell: GirNamespace, namespaceNode: RawNode, context: ParseContext) => void;
50
92
  export { namespaceDirectory, parseNamespaceHeader, createNamespaceShell, populateNamespaceBody, type GirConstant, type GirAlias, type GirNamespace, type NamespaceHeader, };
@@ -1 +1 @@
1
- {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../src/gir/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAiD,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,KAAK,SAAS,EAAkC,MAAM,aAAa,CAAC;AAG7E,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,E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AAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,sGAAsG;IACtG,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,iFAAiF;IACjF,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,mEAAmE;IACnE,aAAa,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,QAAA,MAAM,kBAAkB,GAAI,WAAW,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,KAAG,MAAsC,CAAC;AAE3G,QAAA,MAAM,oBAAoB,GAAI,gBAAgB,OAAO,EAAE,MAAM,MAAM,KAAG,eAoBrE,CAAC;AAEF,QAAA,MAAM,oBAAoB,GAAI,QAAQ,eAAe,EAAE,IAAI,MAAM,KAAG,YAclE,CAAC;AAEH,QAAA,MAAM,qBAAqB,GAAI,OAAO,YAAY,EAAE,eAAe,OAAO,EAAE,SAAS,YAAY,KAAG,IAoBnG,CAAC;AAiBF,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,eAAe,GACvB,CAAC"}
@@ -1,22 +1,24 @@
1
+ import { documentedFromNode } from "./annotations.js";
1
2
  import { callbackFromNode } from "./callback.js";
2
3
  import { classFromNode } from "./class.js";
3
4
  import { enumFromNode } from "./enum.js";
4
5
  import { functionFromNode } from "./function.js";
5
- import { attr, getChild, getChildren, getDoc, nameAttr } from "./parse.js";
6
+ import { attr, getChild, getChildren, nameAttr } from "./parse.js";
6
7
  import { isVtableRecord, recordFromNode } from "./record.js";
7
8
  import { typeRefFromNode } from "./type-ref.js";
8
9
  const namespaceDirectory = (namespace) => namespace.name.toLowerCase();
9
- const parseNamespaceHeader = (repositoryNode) => {
10
+ const parseNamespaceHeader = (repositoryNode, path) => {
10
11
  const includes = getChildren(repositoryNode, "include").map((include) => ({
11
12
  name: nameAttr(include),
12
13
  version: attr(include, "version") ?? "",
13
14
  }));
14
15
  const namespaceNode = getChildren(repositoryNode, "namespace")[0];
15
16
  if (namespaceNode === undefined) {
16
- throw new Error("GIR repository has no <namespace> child");
17
+ throw new Error(`GIR file at ${path} has no <namespace> child in its <repository>`);
17
18
  }
18
19
  return {
19
20
  name: nameAttr(namespaceNode),
21
+ girFile: path,
20
22
  sharedLibrary: attr(namespaceNode, "shared-library"),
21
23
  cSymbolPrefixes: splitPrefixes(attr(namespaceNode, "c:symbol-prefixes")),
22
24
  includes,
@@ -26,6 +28,7 @@ const parseNamespaceHeader = (repositoryNode) => {
26
28
  const createNamespaceShell = (header, id) => ({
27
29
  id,
28
30
  name: header.name,
31
+ girFile: header.girFile,
29
32
  sharedLibrary: header.sharedLibrary,
30
33
  cSymbolPrefixes: header.cSymbolPrefixes,
31
34
  classes: [],
@@ -45,14 +48,12 @@ const populateNamespaceBody = (shell, namespaceNode, context) => {
45
48
  shell.callbacks = getChildren(namespaceNode, "callback").map((callback) => callbackFromNode(callback, context));
46
49
  shell.functions = getChildren(namespaceNode, "function").map((fn) => functionFromNode(fn, context));
47
50
  shell.constants = getChildren(namespaceNode, "constant").map((constant) => ({
48
- name: nameAttr(constant),
49
- doc: getDoc(constant),
51
+ ...documentedFromNode(constant),
50
52
  value: attr(constant, "value") ?? "",
51
53
  type: typeRefFromNode(constant, context),
52
54
  }));
53
55
  shell.aliases = getChildren(namespaceNode, "alias").map((alias) => ({
54
- name: nameAttr(alias),
55
- doc: getDoc(alias),
56
+ ...documentedFromNode(alias),
56
57
  cType: attr(alias, "c:type"),
57
58
  target: typeRefFromNode(alias, context),
58
59
  targetCType: attr(getChild(alias, "type"), "c:type"),
@@ -1 +1 @@
1
- {"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../src/gir/namespace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAoB,MAAM,eAAe,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AE,cAAc,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CACjE;IACD,GAAG,WAAW,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;CACrH,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,aAAsB,EAAa,EAAE,CAAC;IACxD,GAAG,WAAW,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC3G,GAAG,WAAW,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;CAClG,CAAC;AAEF,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,GAKxB,CAAC","sourcesContent":["import type { ParseContext, TypeId } from \"./type-id.js\";\nimport { callbackFromNode, type GirCallback } from \"./callback.js\";\nimport { classFromNode, type GirClass } from \"./class.js\";\nimport { enumFromNode, type GirEnum } from \"./enum.js\";\nimport { functionFromNode, type GirFunction } from \"./function.js\";\nimport { attr, getChild, getChildren, getDoc, nameAttr, type RawNode } from \"./parse.js\";\nimport { type GirRecord, isVtableRecord, recordFromNode } from \"./record.js\";\nimport { typeRefFromNode } from \"./type-ref.js\";\n\ntype GirConstant = {\n name: string;\n doc: string | undefined;\n value: string;\n type: TypeId | undefined;\n};\n\ntype GirAlias = {\n name: string;\n doc: string | undefined;\n cType: string | undefined;\n target: TypeId | undefined;\n targetCType: string | undefined;\n};\n\ntype GirNamespace = {\n id: number;\n name: string;\n sharedLibrary: string | undefined;\n cSymbolPrefixes: string[];\n classes: GirClass[];\n interfaces: GirClass[];\n records: GirRecord[];\n enums: GirEnum[];\n callbacks: GirCallback[];\n functions: GirFunction[];\n constants: GirConstant[];\n aliases: GirAlias[];\n};\n\ntype NamespaceInclude = {\n name: string;\n version: string;\n};\n\ntype NamespaceHeader = {\n name: string;\n sharedLibrary: string | undefined;\n cSymbolPrefixes: string[];\n includes: NamespaceInclude[];\n namespaceNode: RawNode;\n};\n\nconst namespaceDirectory = (namespace: Pick<GirNamespace, \"name\">): string => namespace.name.toLowerCase();\n\nconst parseNamespaceHeader = (repositoryNode: RawNode): NamespaceHeader => {\n const includes = getChildren(repositoryNode, \"include\").map<NamespaceInclude>((include) => ({\n name: nameAttr(include),\n version: attr(include, \"version\") ?? \"\",\n }));\n\n const namespaceNode = getChildren(repositoryNode, \"namespace\")[0];\n\n if (namespaceNode === undefined) {\n throw new Error(\"GIR repository has no <namespace> child\");\n }\n\n return {\n name: nameAttr(namespaceNode),\n sharedLibrary: attr(namespaceNode, \"shared-library\"),\n cSymbolPrefixes: splitPrefixes(attr(namespaceNode, \"c:symbol-prefixes\")),\n includes,\n namespaceNode,\n };\n};\n\nconst createNamespaceShell = (header: NamespaceHeader, id: number): GirNamespace => ({\n id,\n name: header.name,\n sharedLibrary: header.sharedLibrary,\n cSymbolPrefixes: header.cSymbolPrefixes,\n classes: [],\n interfaces: [],\n records: [],\n enums: [],\n callbacks: [],\n functions: [],\n constants: [],\n aliases: [],\n});\n\nconst populateNamespaceBody = (shell: GirNamespace, namespaceNode: RawNode, context: ParseContext): void => {\n shell.classes = getChildren(namespaceNode, \"class\").map((klass) => classFromNode(klass, false, context));\n shell.interfaces = getChildren(namespaceNode, \"interface\").map((iface) => classFromNode(iface, true, context));\n shell.records = collectRecords(namespaceNode, context);\n shell.enums = collectEnums(namespaceNode);\n shell.callbacks = getChildren(namespaceNode, \"callback\").map((callback) => callbackFromNode(callback, context));\n shell.functions = getChildren(namespaceNode, \"function\").map((fn) => functionFromNode(fn, context));\n\n shell.constants = getChildren(namespaceNode, \"constant\").map((constant) => ({\n name: nameAttr(constant),\n doc: getDoc(constant),\n value: attr(constant, \"value\") ?? \"\",\n type: typeRefFromNode(constant, context),\n }));\n\n shell.aliases = getChildren(namespaceNode, \"alias\").map((alias) => ({\n name: nameAttr(alias),\n doc: getDoc(alias),\n cType: attr(alias, \"c:type\"),\n target: typeRefFromNode(alias, context),\n targetCType: attr(getChild(alias, \"type\"), \"c:type\"),\n }));\n};\n\nconst splitPrefixes = (raw: string | undefined): string[] =>\n (raw ?? \"\").split(\",\").filter((prefix) => prefix.length > 0);\n\nconst collectRecords = (namespaceNode: RawNode, context: ParseContext): GirRecord[] => [\n ...getChildren(namespaceNode, \"record\").map((record) =>\n recordFromNode(record, isVtableRecord(record), false, context),\n ),\n ...getChildren(namespaceNode, \"union\").map((union) => recordFromNode(union, isVtableRecord(union), true, context)),\n];\n\nconst collectEnums = (namespaceNode: RawNode): GirEnum[] => [\n ...getChildren(namespaceNode, \"enumeration\").map((enumeration) => enumFromNode(enumeration, \"enumeration\")),\n ...getChildren(namespaceNode, \"bitfield\").map((bitfield) => enumFromNode(bitfield, \"bitfield\")),\n];\n\nexport {\n namespaceDirectory,\n parseNamespaceHeader,\n createNamespaceShell,\n populateNamespaceBody,\n type GirConstant,\n type GirAlias,\n type GirNamespace,\n type NamespaceHeader,\n};\n"]}
1
+ {"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../src/gir/namespace.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAoB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,aAAa,EAAiB,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAgB,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAoB,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;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AAY,GAAG,CAAC,aAAsB,EAAa,EAAE,CAAC;IACxD,GAAG,WAAW,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC3G,GAAG,WAAW,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;CAClG,CAAC;AAEF,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,GAKxB,CAAC","sourcesContent":["import type { ParseContext, TypeId } from \"./type-id.js\";\nimport { documentedFromNode, type GirAnnotations } from \"./annotations.js\";\nimport { callbackFromNode, type GirCallback } from \"./callback.js\";\nimport { classFromNode, type GirClass } from \"./class.js\";\nimport { enumFromNode, type GirEnum } from \"./enum.js\";\nimport { functionFromNode, type GirFunction } from \"./function.js\";\nimport { attr, getChild, getChildren, nameAttr, type RawNode } from \"./parse.js\";\nimport { type GirRecord, isVtableRecord, recordFromNode } from \"./record.js\";\nimport { typeRefFromNode } from \"./type-ref.js\";\n\n/** A compile-time constant declared by a namespace. */\ntype GirConstant = {\n /** Local name within the namespace. */\n name: string;\n /** Documentation text carried by the GIR node. */\n doc: string | undefined;\n /** Release and deprecation annotations GIR carries on the constant. */\n annotations: GirAnnotations;\n /** Literal as written in the GIR, still to be interpreted according to {@link GirConstant.type}. */\n value: string;\n /** Type of the constant, unresolved until looked up in the library's type tables. */\n type: TypeId | undefined;\n};\n\n/** A named alias for another type. */\ntype GirAlias = {\n /** Local name within the namespace. */\n name: string;\n /** Documentation text carried by the GIR node. */\n doc: string | undefined;\n /** Release and deprecation annotations GIR carries on the alias. */\n annotations: GirAnnotations;\n /** C typedef name introduced by the alias. */\n cType: string | undefined;\n /** Type the alias stands for, unresolved until looked up in the library's type tables. */\n target: TypeId | undefined;\n /** C type name of the target, which decides how the alias marshals. */\n targetCType: string | undefined;\n};\n\n/** Everything one GIR namespace declares, keyed into the library that parsed it. */\ntype GirNamespace = {\n /** Identifier of the namespace's type table within its library. */\n id: number;\n /** Namespace name as it appears in the GIR, such as `Gtk`. */\n name: string;\n /** Path of the `.gir` file the namespace was parsed from, named by every diagnostic the namespace causes. */\n girFile: string;\n /** The `shared-library` attribute verbatim: the objects to load symbols from, separated by commas. */\n sharedLibrary: string | undefined;\n /** Prefixes stripped off C identifiers to derive export names, such as `gtk`. */\n cSymbolPrefixes: string[];\n /** GObject classes declared by the namespace. */\n classes: GirClass[];\n /** GObject interfaces declared by the namespace. */\n interfaces: GirClass[];\n /** Structs and unions declared by the namespace. */\n records: GirRecord[];\n /** Enumerations and bitfields declared by the namespace. */\n enums: GirEnum[];\n /** Callback types declared by the namespace. */\n callbacks: GirCallback[];\n /** Free functions declared by the namespace. */\n functions: GirFunction[];\n /** Compile-time values, emitted as module-level `const` bindings. */\n constants: GirConstant[];\n /** Typedefs, emitted as TypeScript type aliases and resolvable as types themselves. */\n aliases: GirAlias[];\n};\n\n/** Another namespace a GIR repository depends on. */\ntype NamespaceInclude = {\n /** Name of the included namespace, such as `Gio`. */\n name: string;\n /** Version of the included namespace, such as `2.0`. */\n version: string;\n};\n\n/** A namespace's declaration and dependencies, read before its body is parsed. */\ntype NamespaceHeader = {\n /** Namespace name as it appears in the GIR, such as `Gtk`. */\n name: string;\n /** Path of the `.gir` file the header was read from. */\n girFile: string;\n /** The `shared-library` attribute verbatim: the objects to load symbols from, separated by commas. */\n sharedLibrary: string | undefined;\n /** Prefixes stripped off C identifiers to derive export names, such as `gtk`. */\n cSymbolPrefixes: string[];\n /** Namespaces this repository includes, each of which is parsed in turn. */\n includes: NamespaceInclude[];\n /** The `<namespace>` node whose children hold the declarations. */\n namespaceNode: RawNode;\n};\n\nconst namespaceDirectory = (namespace: Pick<GirNamespace, \"name\">): string => namespace.name.toLowerCase();\n\nconst parseNamespaceHeader = (repositoryNode: RawNode, path: string): NamespaceHeader => {\n const includes = getChildren(repositoryNode, \"include\").map<NamespaceInclude>((include) => ({\n name: nameAttr(include),\n version: attr(include, \"version\") ?? \"\",\n }));\n\n const namespaceNode = getChildren(repositoryNode, \"namespace\")[0];\n\n if (namespaceNode === undefined) {\n throw new Error(`GIR file at ${path} has no <namespace> child in its <repository>`);\n }\n\n return {\n name: nameAttr(namespaceNode),\n girFile: path,\n sharedLibrary: attr(namespaceNode, \"shared-library\"),\n cSymbolPrefixes: splitPrefixes(attr(namespaceNode, \"c:symbol-prefixes\")),\n includes,\n namespaceNode,\n };\n};\n\nconst createNamespaceShell = (header: NamespaceHeader, id: number): GirNamespace => ({\n id,\n name: header.name,\n girFile: header.girFile,\n sharedLibrary: header.sharedLibrary,\n cSymbolPrefixes: header.cSymbolPrefixes,\n classes: [],\n interfaces: [],\n records: [],\n enums: [],\n callbacks: [],\n functions: [],\n constants: [],\n aliases: [],\n});\n\nconst populateNamespaceBody = (shell: GirNamespace, namespaceNode: RawNode, context: ParseContext): void => {\n shell.classes = getChildren(namespaceNode, \"class\").map((klass) => classFromNode(klass, false, context));\n shell.interfaces = getChildren(namespaceNode, \"interface\").map((iface) => classFromNode(iface, true, context));\n shell.records = collectRecords(namespaceNode, context);\n shell.enums = collectEnums(namespaceNode);\n shell.callbacks = getChildren(namespaceNode, \"callback\").map((callback) => callbackFromNode(callback, context));\n shell.functions = getChildren(namespaceNode, \"function\").map((fn) => functionFromNode(fn, context));\n\n shell.constants = getChildren(namespaceNode, \"constant\").map((constant) => ({\n ...documentedFromNode(constant),\n value: attr(constant, \"value\") ?? \"\",\n type: typeRefFromNode(constant, context),\n }));\n\n shell.aliases = getChildren(namespaceNode, \"alias\").map((alias) => ({\n ...documentedFromNode(alias),\n cType: attr(alias, \"c:type\"),\n target: typeRefFromNode(alias, context),\n targetCType: attr(getChild(alias, \"type\"), \"c:type\"),\n }));\n};\n\nconst splitPrefixes = (raw: string | undefined): string[] =>\n (raw ?? \"\").split(\",\").filter((prefix) => prefix.length > 0);\n\nconst collectRecords = (namespaceNode: RawNode, context: ParseContext): GirRecord[] => [\n ...getChildren(namespaceNode, \"record\").map((record) =>\n recordFromNode(record, isVtableRecord(record), false, context),\n ),\n ...getChildren(namespaceNode, \"union\").map((union) => recordFromNode(union, isVtableRecord(union), true, context)),\n];\n\nconst collectEnums = (namespaceNode: RawNode): GirEnum[] => [\n ...getChildren(namespaceNode, \"enumeration\").map((enumeration) => enumFromNode(enumeration, \"enumeration\")),\n ...getChildren(namespaceNode, \"bitfield\").map((bitfield) => enumFromNode(bitfield, \"bitfield\")),\n];\n\nexport {\n namespaceDirectory,\n parseNamespaceHeader,\n createNamespaceShell,\n populateNamespaceBody,\n type GirConstant,\n type GirAlias,\n type GirNamespace,\n type NamespaceHeader,\n};\n"]}
@@ -1,33 +1,84 @@
1
1
  import type { ParseContext, TypeId } from "./type-id.js";
2
+ import { type GirAnnotations } from "./annotations.js";
2
3
  import { type RawNode } from "./parse.js";
4
+ /** Which way a parameter's value travels: into the call, back out of it, or both. */
3
5
  type ParameterDirection = "in" | "out" | "inout";
6
+ /** How much of a value the receiver takes ownership of: none, the whole value, or only its container. */
4
7
  type ParameterTransfer = "none" | "full" | "container";
8
+ /**
9
+ * How long a callback parameter stays valid: for the duration of the call, until its destroy notify runs,
10
+ * until the asynchronous operation invokes it, or forever.
11
+ */
5
12
  type CallbackScope = "call" | "notified" | "async" | "forever";
13
+ /**
14
+ * Bounds of an out parameter that points into the buffer of a sibling parameter instead of to an
15
+ * array of its own, which GIR describes as an array with no extent of any kind.
16
+ */
17
+ type GirCursorBounds = {
18
+ /** Position of the parameter holding the buffer the pointer points into. */
19
+ baseIndex: number;
20
+ /** Position of the parameter carrying that buffer's element count. */
21
+ lengthIndex: number;
22
+ };
23
+ /** A parameter of a {@link GirCallable}, with the annotations that decide how it is marshalled. */
6
24
  type GirParameter = {
25
+ /** The name GIR gives the parameter. */
7
26
  name: string;
27
+ /** What the parameter holds, absent when the GIR node declares no type. */
8
28
  type: TypeId | undefined;
29
+ /** The C spelling of the parameter's type, taken from its `type` or `array` child. */
30
+ cType: string | undefined;
31
+ /** Documentation prose from GIR, emitted as the parameter's `@param` text. */
32
+ doc: string | undefined;
33
+ /** Decides whether the parameter is an argument, part of the returned tuple, or both. */
9
34
  direction: ParameterDirection;
35
+ /** Ownership the marshalling descriptor is generated with, deciding whether the receiver frees the value. */
10
36
  transferOwnership: ParameterTransfer;
37
+ /** Whether the value may be null. */
11
38
  nullable: boolean;
39
+ /** Whether the caller may leave the parameter out entirely. */
12
40
  optional: boolean;
41
+ /** Whether the caller supplies the storage an out parameter writes into. */
13
42
  callerAllocates: boolean;
43
+ /** How long a callback parameter stays valid, absent when GIR carries no scope annotation. */
14
44
  scope: CallbackScope | undefined;
45
+ /** Position of the parameter carrying the callback's user data. */
15
46
  closureIndex: number | undefined;
47
+ /** Position of the parameter carrying the callback's destroy notify. */
16
48
  destroyIndex: number | undefined;
49
+ /** Whether the parameter is the `...` varargs marker. */
17
50
  isVarargs: boolean;
51
+ /** Where the buffer is that the parameter points into, when it carries a cursor rather than an array. */
52
+ cursor: GirCursorBounds | undefined;
18
53
  };
54
+ /** What a {@link GirCallable} hands back, with the annotations that decide how it is marshalled. */
19
55
  type GirReturnValue = {
56
+ /** What the callable returns, absent when the GIR node declares no type. */
20
57
  type: TypeId | undefined;
58
+ /** Documentation prose from GIR, emitted as the callable's `@returns` text. */
59
+ doc: string | undefined;
60
+ /** How much ownership the caller takes of the returned value. */
21
61
  transferOwnership: ParameterTransfer;
62
+ /** Whether the returned value may be null. */
22
63
  nullable: boolean;
64
+ /** Whether GIR marks the value as skipped, keeping it out of the generated signature. */
23
65
  skip: boolean;
24
66
  };
67
+ /** Anything GIR describes with parameters and a return value: functions, methods, signals, and callbacks. */
25
68
  type GirCallable = {
69
+ /** The name GIR gives the callable. */
26
70
  name: string;
71
+ /** The callable's documentation text, absent when GIR carries none. */
27
72
  doc: string | undefined;
73
+ /** Release and deprecation annotations GIR carries on the callable. */
74
+ annotations: GirAnnotations;
75
+ /** The parameters the callable takes, in declaration order. */
28
76
  parameters: GirParameter[];
77
+ /** What the callable hands back. */
29
78
  returnValue: GirReturnValue;
79
+ /** Whether the callable reports failure through a trailing `GError`. */
30
80
  throws: boolean;
81
+ /** Whether GIR exposes the callable to bindings. */
31
82
  introspectable: boolean;
32
83
  };
33
84
  declare const transferOwnership: (node: RawNode) => ParameterTransfer;
@@ -36,5 +87,5 @@ declare const isOutParameter: (parameter: GirParameter) => boolean;
36
87
  declare const isCallerAllocatedOut: (parameter: GirParameter) => boolean;
37
88
  declare const isInoutParameter: (parameter: GirParameter) => boolean;
38
89
  declare const parseCallable: (node: RawNode, context: ParseContext) => GirCallable;
39
- export { transferOwnership, parameterFromNode, isOutParameter, isCallerAllocatedOut, isInoutParameter, parseCallable, type ParameterTransfer, type GirParameter, type GirReturnValue, type GirCallable, };
90
+ export { transferOwnership, parameterFromNode, isOutParameter, isCallerAllocatedOut, isInoutParameter, parseCallable, type ParameterTransfer, type GirCursorBounds, type GirParameter, type GirReturnValue, type GirCallable, };
40
91
  //# sourceMappingURL=parameter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parameter.d.ts","sourceRoot":"","sources":["../../src/gir/parameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EASH,KAAK,OAAO,EACf,MAAM,YAAY,CAAC;AAGpB,KAAK,kBAAkB,GAAG,IAAI,GAAG,KAAK,GAAG,OAAO,CAAC;AACjD,KAAK,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;AACvD,KAAK,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/D,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,SA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