@ts-for-gir/cli 3.0.0-beta.9 → 3.0.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 (760) hide show
  1. package/README.md +160 -35
  2. package/lib/commands/doc.d.ts +1 -17
  3. package/lib/commands/doc.js +7 -13
  4. package/lib/commands/doc.js.map +1 -1
  5. package/lib/commands/generate.d.ts +1 -37
  6. package/lib/commands/generate.js +8 -24
  7. package/lib/commands/generate.js.map +1 -1
  8. package/lib/commands/list.d.ts +1 -11
  9. package/lib/commands/list.js +6 -10
  10. package/lib/commands/list.js.map +1 -1
  11. package/lib/config.d.ts +21 -5
  12. package/lib/config.js +164 -86
  13. package/lib/config.js.map +1 -1
  14. package/lib/generation-handler.d.ts +3 -4
  15. package/lib/generation-handler.js +7 -11
  16. package/lib/generation-handler.js.map +1 -1
  17. package/lib/index.d.ts +0 -12
  18. package/lib/index.js +0 -12
  19. package/lib/index.js.map +1 -1
  20. package/lib/module-loader.d.ts +35 -24
  21. package/lib/module-loader.js +3 -8
  22. package/lib/module-loader.js.map +1 -1
  23. package/lib/utils.d.ts +0 -262
  24. package/lib/utils.js +8 -371
  25. package/lib/utils.js.map +1 -1
  26. package/package.json +32 -37
  27. package/src/commands/doc.ts +9 -14
  28. package/src/commands/generate.ts +10 -24
  29. package/src/commands/list.ts +8 -10
  30. package/src/config.ts +178 -92
  31. package/src/generation-handler.ts +11 -12
  32. package/src/index.ts +0 -12
  33. package/src/module-loader.ts +39 -31
  34. package/src/utils.ts +8 -401
  35. package/lib/conflict-resolver.d.ts +0 -155
  36. package/lib/conflict-resolver.js +0 -1103
  37. package/lib/conflict-resolver.js.map +0 -1
  38. package/lib/constants.d.ts +0 -18
  39. package/lib/constants.js +0 -23
  40. package/lib/constants.js.map +0 -1
  41. package/lib/dependency-manager.d.ts +0 -34
  42. package/lib/dependency-manager.js +0 -78
  43. package/lib/dependency-manager.js.map +0 -1
  44. package/lib/generator.d.ts +0 -5
  45. package/lib/generator.js +0 -2
  46. package/lib/generator.js.map +0 -1
  47. package/lib/gir-factory.d.ts +0 -51
  48. package/lib/gir-factory.js +0 -361
  49. package/lib/gir-factory.js.map +0 -1
  50. package/lib/gir-module.d.ts +0 -257
  51. package/lib/gir-module.js +0 -2086
  52. package/lib/gir-module.js.map +0 -1
  53. package/lib/html-doc-generator.d.ts +0 -13
  54. package/lib/html-doc-generator.js +0 -18
  55. package/lib/html-doc-generator.js.map +0 -1
  56. package/lib/injection/callbacks/gjs/Gio-2.0.d.ts +0 -2
  57. package/lib/injection/callbacks/gjs/Gio-2.0.js +0 -36
  58. package/lib/injection/callbacks/gjs/Gio-2.0.js.map +0 -1
  59. package/lib/injection/callbacks/gjs/index.d.ts +0 -2
  60. package/lib/injection/callbacks/gjs/index.js +0 -3
  61. package/lib/injection/callbacks/gjs/index.js.map +0 -1
  62. package/lib/injection/callbacks/index.d.ts +0 -4
  63. package/lib/injection/callbacks/index.js +0 -4
  64. package/lib/injection/callbacks/index.js.map +0 -1
  65. package/lib/injection/callbacks/node-gtk/index.d.ts +0 -2
  66. package/lib/injection/callbacks/node-gtk/index.js +0 -2
  67. package/lib/injection/callbacks/node-gtk/index.js.map +0 -1
  68. package/lib/injection/classes/GLib-2-0.d.ts +0 -2
  69. package/lib/injection/classes/GLib-2-0.js +0 -35
  70. package/lib/injection/classes/GLib-2-0.js.map +0 -1
  71. package/lib/injection/classes/gjs/GLib-2.0.d.ts +0 -2
  72. package/lib/injection/classes/gjs/GLib-2.0.js +0 -200
  73. package/lib/injection/classes/gjs/GLib-2.0.js.map +0 -1
  74. package/lib/injection/classes/gjs/GObject-2.0.d.ts +0 -2
  75. package/lib/injection/classes/gjs/GObject-2.0.js +0 -634
  76. package/lib/injection/classes/gjs/GObject-2.0.js.map +0 -1
  77. package/lib/injection/classes/gjs/Gio-2.0.d.ts +0 -5
  78. package/lib/injection/classes/gjs/Gio-2.0.js +0 -218
  79. package/lib/injection/classes/gjs/Gio-2.0.js.map +0 -1
  80. package/lib/injection/classes/gjs/index.d.ts +0 -2
  81. package/lib/injection/classes/gjs/index.js +0 -5
  82. package/lib/injection/classes/gjs/index.js.map +0 -1
  83. package/lib/injection/classes/index.d.ts +0 -4
  84. package/lib/injection/classes/index.js +0 -5
  85. package/lib/injection/classes/index.js.map +0 -1
  86. package/lib/injection/classes/node-gtk/GLib-2.0.d.ts +0 -2
  87. package/lib/injection/classes/node-gtk/GLib-2.0.js +0 -19
  88. package/lib/injection/classes/node-gtk/GLib-2.0.js.map +0 -1
  89. package/lib/injection/classes/node-gtk/GObject-2.0.d.ts +0 -2
  90. package/lib/injection/classes/node-gtk/GObject-2.0.js +0 -66
  91. package/lib/injection/classes/node-gtk/GObject-2.0.js.map +0 -1
  92. package/lib/injection/classes/node-gtk/Gdk-4.0.d.ts +0 -2
  93. package/lib/injection/classes/node-gtk/Gdk-4.0.js +0 -32
  94. package/lib/injection/classes/node-gtk/Gdk-4.0.js.map +0 -1
  95. package/lib/injection/classes/node-gtk/Gio-2.0.d.ts +0 -2
  96. package/lib/injection/classes/node-gtk/Gio-2.0.js +0 -14
  97. package/lib/injection/classes/node-gtk/Gio-2.0.js.map +0 -1
  98. package/lib/injection/classes/node-gtk/Graphene-1.0.d.ts +0 -2
  99. package/lib/injection/classes/node-gtk/Graphene-1.0.js +0 -133
  100. package/lib/injection/classes/node-gtk/Graphene-1.0.js.map +0 -1
  101. package/lib/injection/classes/node-gtk/Gtk-3.0.d.ts +0 -2
  102. package/lib/injection/classes/node-gtk/Gtk-3.0.js +0 -31
  103. package/lib/injection/classes/node-gtk/Gtk-3.0.js.map +0 -1
  104. package/lib/injection/classes/node-gtk/Gtk-4.0.d.ts +0 -2
  105. package/lib/injection/classes/node-gtk/Gtk-4.0.js +0 -52
  106. package/lib/injection/classes/node-gtk/Gtk-4.0.js.map +0 -1
  107. package/lib/injection/classes/node-gtk/Pango-1.0.d.ts +0 -2
  108. package/lib/injection/classes/node-gtk/Pango-1.0.js +0 -31
  109. package/lib/injection/classes/node-gtk/Pango-1.0.js.map +0 -1
  110. package/lib/injection/classes/node-gtk/index.d.ts +0 -2
  111. package/lib/injection/classes/node-gtk/index.js +0 -19
  112. package/lib/injection/classes/node-gtk/index.js.map +0 -1
  113. package/lib/injection/index.d.ts +0 -3
  114. package/lib/injection/index.js +0 -4
  115. package/lib/injection/index.js.map +0 -1
  116. package/lib/injection/injector.d.ts +0 -17
  117. package/lib/injection/injector.js +0 -139
  118. package/lib/injection/injector.js.map +0 -1
  119. package/lib/logger.d.ts +0 -36
  120. package/lib/logger.js +0 -137
  121. package/lib/logger.js.map +0 -1
  122. package/lib/messages.d.ts +0 -31
  123. package/lib/messages.js +0 -46
  124. package/lib/messages.js.map +0 -1
  125. package/lib/symtable.d.ts +0 -24
  126. package/lib/symtable.js +0 -63
  127. package/lib/symtable.js.map +0 -1
  128. package/lib/template-processor.d.ts +0 -74
  129. package/lib/template-processor.js +0 -165
  130. package/lib/template-processor.js.map +0 -1
  131. package/lib/transformation.d.ts +0 -156
  132. package/lib/transformation.js +0 -523
  133. package/lib/transformation.js.map +0 -1
  134. package/lib/type-definition-generator.d.ts +0 -116
  135. package/lib/type-definition-generator.js +0 -991
  136. package/lib/type-definition-generator.js.map +0 -1
  137. package/lib/types/answer-version.d.ts +0 -4
  138. package/lib/types/answer-version.js +0 -2
  139. package/lib/types/answer-version.js.map +0 -1
  140. package/lib/types/build-type.d.ts +0 -1
  141. package/lib/types/build-type.js +0 -2
  142. package/lib/types/build-type.js.map +0 -1
  143. package/lib/types/class-parent.d.ts +0 -13
  144. package/lib/types/class-parent.js +0 -2
  145. package/lib/types/class-parent.js.map +0 -1
  146. package/lib/types/config-flags.d.ts +0 -4
  147. package/lib/types/config-flags.js +0 -2
  148. package/lib/types/config-flags.js.map +0 -1
  149. package/lib/types/conflict-child-element.d.ts +0 -10
  150. package/lib/types/conflict-child-element.js +0 -2
  151. package/lib/types/conflict-child-element.js.map +0 -1
  152. package/lib/types/conflict-grouped-element.d.ts +0 -6
  153. package/lib/types/conflict-grouped-element.js +0 -2
  154. package/lib/types/conflict-grouped-element.js.map +0 -1
  155. package/lib/types/conflict-grouped-elements.d.ts +0 -4
  156. package/lib/types/conflict-grouped-elements.js +0 -2
  157. package/lib/types/conflict-grouped-elements.js.map +0 -1
  158. package/lib/types/construct-name.d.ts +0 -1
  159. package/lib/types/construct-name.js +0 -2
  160. package/lib/types/construct-name.js.map +0 -1
  161. package/lib/types/dependency-map.d.ts +0 -4
  162. package/lib/types/dependency-map.js +0 -2
  163. package/lib/types/dependency-map.js.map +0 -1
  164. package/lib/types/dependency.d.ts +0 -15
  165. package/lib/types/dependency.js +0 -2
  166. package/lib/types/dependency.js.map +0 -1
  167. package/lib/types/environment.d.ts +0 -1
  168. package/lib/types/environment.js +0 -2
  169. package/lib/types/environment.js.map +0 -1
  170. package/lib/types/file-info.d.ts +0 -14
  171. package/lib/types/file-info.js +0 -2
  172. package/lib/types/file-info.js.map +0 -1
  173. package/lib/types/generate-config.d.ts +0 -32
  174. package/lib/types/generate-config.js +0 -2
  175. package/lib/types/generate-config.js.map +0 -1
  176. package/lib/types/generator-type.d.ts +0 -4
  177. package/lib/types/generator-type.js +0 -6
  178. package/lib/types/generator-type.js.map +0 -1
  179. package/lib/types/gir-alias-element.d.ts +0 -13
  180. package/lib/types/gir-alias-element.js +0 -2
  181. package/lib/types/gir-alias-element.js.map +0 -1
  182. package/lib/types/gir-annotation.d.ts +0 -9
  183. package/lib/types/gir-annotation.js +0 -2
  184. package/lib/types/gir-annotation.js.map +0 -1
  185. package/lib/types/gir-any-element.d.ts +0 -2
  186. package/lib/types/gir-any-element.js +0 -2
  187. package/lib/types/gir-any-element.js.map +0 -1
  188. package/lib/types/gir-any-type.d.ts +0 -5
  189. package/lib/types/gir-any-type.js +0 -2
  190. package/lib/types/gir-any-type.js.map +0 -1
  191. package/lib/types/gir-array-type.d.ts +0 -20
  192. package/lib/types/gir-array-type.js +0 -3
  193. package/lib/types/gir-array-type.js.map +0 -1
  194. package/lib/types/gir-bitfield-element.d.ts +0 -17
  195. package/lib/types/gir-bitfield-element.js +0 -2
  196. package/lib/types/gir-bitfield-element.js.map +0 -1
  197. package/lib/types/gir-boolean.d.ts +0 -1
  198. package/lib/types/gir-boolean.js +0 -2
  199. package/lib/types/gir-boolean.js.map +0 -1
  200. package/lib/types/gir-boxed-element.d.ts +0 -15
  201. package/lib/types/gir-boxed-element.js +0 -2
  202. package/lib/types/gir-boxed-element.js.map +0 -1
  203. package/lib/types/gir-c-include.d.ts +0 -7
  204. package/lib/types/gir-c-include.js +0 -2
  205. package/lib/types/gir-c-include.js.map +0 -1
  206. package/lib/types/gir-callable-attrs.d.ts +0 -15
  207. package/lib/types/gir-callable-attrs.js +0 -3
  208. package/lib/types/gir-callable-attrs.js.map +0 -1
  209. package/lib/types/gir-callable-param-element.d.ts +0 -30
  210. package/lib/types/gir-callable-param-element.js +0 -2
  211. package/lib/types/gir-callable-param-element.js.map +0 -1
  212. package/lib/types/gir-callable-param.d.ts +0 -7
  213. package/lib/types/gir-callable-param.js +0 -2
  214. package/lib/types/gir-callable-param.js.map +0 -1
  215. package/lib/types/gir-callable-return.d.ts +0 -22
  216. package/lib/types/gir-callable-return.js +0 -2
  217. package/lib/types/gir-callable-return.js.map +0 -1
  218. package/lib/types/gir-callback-element.d.ts +0 -15
  219. package/lib/types/gir-callback-element.js +0 -2
  220. package/lib/types/gir-callback-element.js.map +0 -1
  221. package/lib/types/gir-class-element.d.ts +0 -48
  222. package/lib/types/gir-class-element.js +0 -2
  223. package/lib/types/gir-class-element.js.map +0 -1
  224. package/lib/types/gir-constant-element.d.ts +0 -15
  225. package/lib/types/gir-constant-element.js +0 -2
  226. package/lib/types/gir-constant-element.js.map +0 -1
  227. package/lib/types/gir-constructor-element.d.ts +0 -8
  228. package/lib/types/gir-constructor-element.js +0 -2
  229. package/lib/types/gir-constructor-element.js.map +0 -1
  230. package/lib/types/gir-direction.d.ts +0 -5
  231. package/lib/types/gir-direction.js +0 -7
  232. package/lib/types/gir-direction.js.map +0 -1
  233. package/lib/types/gir-doc-element.d.ts +0 -68
  234. package/lib/types/gir-doc-element.js +0 -2
  235. package/lib/types/gir-doc-element.js.map +0 -1
  236. package/lib/types/gir-enum-element.d.ts +0 -19
  237. package/lib/types/gir-enum-element.js +0 -2
  238. package/lib/types/gir-enum-element.js.map +0 -1
  239. package/lib/types/gir-field-element.d.ts +0 -18
  240. package/lib/types/gir-field-element.js +0 -2
  241. package/lib/types/gir-field-element.js.map +0 -1
  242. package/lib/types/gir-function-element.d.ts +0 -8
  243. package/lib/types/gir-function-element.js +0 -2
  244. package/lib/types/gir-function-element.js.map +0 -1
  245. package/lib/types/gir-implements.d.ts +0 -8
  246. package/lib/types/gir-implements.js +0 -2
  247. package/lib/types/gir-implements.js.map +0 -1
  248. package/lib/types/gir-include.d.ts +0 -9
  249. package/lib/types/gir-include.js +0 -2
  250. package/lib/types/gir-include.js.map +0 -1
  251. package/lib/types/gir-info-attrs.d.ts +0 -13
  252. package/lib/types/gir-info-attrs.js +0 -2
  253. package/lib/types/gir-info-attrs.js.map +0 -1
  254. package/lib/types/gir-info-elements.d.ts +0 -5
  255. package/lib/types/gir-info-elements.js +0 -2
  256. package/lib/types/gir-info-elements.js.map +0 -1
  257. package/lib/types/gir-instance-parameter.d.ts +0 -21
  258. package/lib/types/gir-instance-parameter.js +0 -2
  259. package/lib/types/gir-instance-parameter.js.map +0 -1
  260. package/lib/types/gir-interface-element.d.ts +0 -31
  261. package/lib/types/gir-interface-element.js +0 -2
  262. package/lib/types/gir-interface-element.js.map +0 -1
  263. package/lib/types/gir-member-element.d.ts +0 -17
  264. package/lib/types/gir-member-element.js +0 -2
  265. package/lib/types/gir-member-element.js.map +0 -1
  266. package/lib/types/gir-method-element.d.ts +0 -13
  267. package/lib/types/gir-method-element.js +0 -2
  268. package/lib/types/gir-method-element.js.map +0 -1
  269. package/lib/types/gir-module-resolved-by.d.ts +0 -10
  270. package/lib/types/gir-module-resolved-by.js +0 -2
  271. package/lib/types/gir-module-resolved-by.js.map +0 -1
  272. package/lib/types/gir-modules-grouped-map.d.ts +0 -4
  273. package/lib/types/gir-modules-grouped-map.js +0 -2
  274. package/lib/types/gir-modules-grouped-map.js.map +0 -1
  275. package/lib/types/gir-modules-grouped.d.ts +0 -12
  276. package/lib/types/gir-modules-grouped.js +0 -2
  277. package/lib/types/gir-modules-grouped.js.map +0 -1
  278. package/lib/types/gir-namespace.d.ts +0 -30
  279. package/lib/types/gir-namespace.js +0 -2
  280. package/lib/types/gir-namespace.js.map +0 -1
  281. package/lib/types/gir-package.d.ts +0 -7
  282. package/lib/types/gir-package.js +0 -2
  283. package/lib/types/gir-package.js.map +0 -1
  284. package/lib/types/gir-prerequisite.d.ts +0 -5
  285. package/lib/types/gir-prerequisite.js +0 -2
  286. package/lib/types/gir-prerequisite.js.map +0 -1
  287. package/lib/types/gir-property-element.d.ts +0 -21
  288. package/lib/types/gir-property-element.js +0 -2
  289. package/lib/types/gir-property-element.js.map +0 -1
  290. package/lib/types/gir-record-element.d.ts +0 -30
  291. package/lib/types/gir-record-element.js +0 -2
  292. package/lib/types/gir-record-element.js.map +0 -1
  293. package/lib/types/gir-repository.d.ts +0 -16
  294. package/lib/types/gir-repository.js +0 -2
  295. package/lib/types/gir-repository.js.map +0 -1
  296. package/lib/types/gir-signal.d.ts +0 -25
  297. package/lib/types/gir-signal.js +0 -2
  298. package/lib/types/gir-signal.js.map +0 -1
  299. package/lib/types/gir-transfer-ownership-type.d.ts +0 -5
  300. package/lib/types/gir-transfer-ownership-type.js +0 -7
  301. package/lib/types/gir-transfer-ownership-type.js.map +0 -1
  302. package/lib/types/gir-transfer-ownership.d.ts +0 -5
  303. package/lib/types/gir-transfer-ownership.js +0 -2
  304. package/lib/types/gir-transfer-ownership.js.map +0 -1
  305. package/lib/types/gir-type.d.ts +0 -14
  306. package/lib/types/gir-type.js +0 -2
  307. package/lib/types/gir-type.js.map +0 -1
  308. package/lib/types/gir-union-element.d.ts +0 -22
  309. package/lib/types/gir-union-element.js +0 -2
  310. package/lib/types/gir-union-element.js.map +0 -1
  311. package/lib/types/gir-unparsed-number.d.ts +0 -2
  312. package/lib/types/gir-unparsed-number.js +0 -2
  313. package/lib/types/gir-unparsed-number.js.map +0 -1
  314. package/lib/types/gir-var-args.d.ts +0 -5
  315. package/lib/types/gir-var-args.js +0 -2
  316. package/lib/types/gir-var-args.js.map +0 -1
  317. package/lib/types/gir-virtual-method.d.ts +0 -10
  318. package/lib/types/gir-virtual-method.js +0 -2
  319. package/lib/types/gir-virtual-method.js.map +0 -1
  320. package/lib/types/index.d.ts +0 -119
  321. package/lib/types/index.js +0 -120
  322. package/lib/types/index.js.map +0 -1
  323. package/lib/types/inheritance-table.d.ts +0 -3
  324. package/lib/types/inheritance-table.js +0 -2
  325. package/lib/types/inheritance-table.js.map +0 -1
  326. package/lib/types/injection-callback.d.ts +0 -16
  327. package/lib/types/injection-callback.js +0 -2
  328. package/lib/types/injection-callback.js.map +0 -1
  329. package/lib/types/injection-class.d.ts +0 -25
  330. package/lib/types/injection-class.js +0 -2
  331. package/lib/types/injection-class.js.map +0 -1
  332. package/lib/types/injection-function.d.ts +0 -7
  333. package/lib/types/injection-function.js +0 -2
  334. package/lib/types/injection-function.js.map +0 -1
  335. package/lib/types/injection-generic-parameter.d.ts +0 -2
  336. package/lib/types/injection-generic-parameter.js +0 -2
  337. package/lib/types/injection-generic-parameter.js.map +0 -1
  338. package/lib/types/injection-instance-parameter.d.ts +0 -2
  339. package/lib/types/injection-instance-parameter.js +0 -2
  340. package/lib/types/injection-instance-parameter.js.map +0 -1
  341. package/lib/types/injection-parameter.d.ts +0 -8
  342. package/lib/types/injection-parameter.js +0 -2
  343. package/lib/types/injection-parameter.js.map +0 -1
  344. package/lib/types/injection-property.d.ts +0 -4
  345. package/lib/types/injection-property.js +0 -2
  346. package/lib/types/injection-property.js.map +0 -1
  347. package/lib/types/injection-type.d.ts +0 -2
  348. package/lib/types/injection-type.js +0 -2
  349. package/lib/types/injection-type.js.map +0 -1
  350. package/lib/types/injection.d.ts +0 -5
  351. package/lib/types/injection.js +0 -2
  352. package/lib/types/injection.js.map +0 -1
  353. package/lib/types/local-name-check.d.ts +0 -4
  354. package/lib/types/local-name-check.js +0 -2
  355. package/lib/types/local-name-check.js.map +0 -1
  356. package/lib/types/local-name-type.d.ts +0 -1
  357. package/lib/types/local-name-type.js +0 -2
  358. package/lib/types/local-name-type.js.map +0 -1
  359. package/lib/types/local-name.d.ts +0 -7
  360. package/lib/types/local-name.js +0 -2
  361. package/lib/types/local-name.js.map +0 -1
  362. package/lib/types/local-names.d.ts +0 -4
  363. package/lib/types/local-names.js +0 -2
  364. package/lib/types/local-names.js.map +0 -1
  365. package/lib/types/module-type.d.ts +0 -1
  366. package/lib/types/module-type.js +0 -2
  367. package/lib/types/module-type.js.map +0 -1
  368. package/lib/types/parsed-gir.d.ts +0 -4
  369. package/lib/types/parsed-gir.js +0 -2
  370. package/lib/types/parsed-gir.js.map +0 -1
  371. package/lib/types/part-of-class.d.ts +0 -7
  372. package/lib/types/part-of-class.js +0 -2
  373. package/lib/types/part-of-class.js.map +0 -1
  374. package/lib/types/part-of-module.d.ts +0 -6
  375. package/lib/types/part-of-module.js +0 -2
  376. package/lib/types/part-of-module.js.map +0 -1
  377. package/lib/types/promisify-func.d.ts +0 -5
  378. package/lib/types/promisify-func.js +0 -2
  379. package/lib/types/promisify-func.js.map +0 -1
  380. package/lib/types/resolve-type.d.ts +0 -4
  381. package/lib/types/resolve-type.js +0 -6
  382. package/lib/types/resolve-type.js.map +0 -1
  383. package/lib/types/sym-table-items.d.ts +0 -4
  384. package/lib/types/sym-table-items.js +0 -2
  385. package/lib/types/sym-table-items.js.map +0 -1
  386. package/lib/types/transformation-case.d.ts +0 -1
  387. package/lib/types/transformation-case.js +0 -2
  388. package/lib/types/transformation-case.js.map +0 -1
  389. package/lib/types/transformations.d.ts +0 -11
  390. package/lib/types/transformations.js +0 -2
  391. package/lib/types/transformations.js.map +0 -1
  392. package/lib/types/ts-alias.d.ts +0 -10
  393. package/lib/types/ts-alias.js +0 -2
  394. package/lib/types/ts-alias.js.map +0 -1
  395. package/lib/types/ts-callback-interface.d.ts +0 -10
  396. package/lib/types/ts-callback-interface.js +0 -2
  397. package/lib/types/ts-callback-interface.js.map +0 -1
  398. package/lib/types/ts-callback.d.ts +0 -17
  399. package/lib/types/ts-callback.js +0 -2
  400. package/lib/types/ts-callback.js.map +0 -1
  401. package/lib/types/ts-class.d.ts +0 -85
  402. package/lib/types/ts-class.js +0 -2
  403. package/lib/types/ts-class.js.map +0 -1
  404. package/lib/types/ts-doc-tag.d.ts +0 -21
  405. package/lib/types/ts-doc-tag.js +0 -2
  406. package/lib/types/ts-doc-tag.js.map +0 -1
  407. package/lib/types/ts-doc.d.ts +0 -20
  408. package/lib/types/ts-doc.js +0 -2
  409. package/lib/types/ts-doc.js.map +0 -1
  410. package/lib/types/ts-enum.d.ts +0 -12
  411. package/lib/types/ts-enum.js +0 -2
  412. package/lib/types/ts-enum.js.map +0 -1
  413. package/lib/types/ts-function.d.ts +0 -44
  414. package/lib/types/ts-function.js +0 -2
  415. package/lib/types/ts-function.js.map +0 -1
  416. package/lib/types/ts-generic-parameter.d.ts +0 -8
  417. package/lib/types/ts-generic-parameter.js +0 -2
  418. package/lib/types/ts-generic-parameter.js.map +0 -1
  419. package/lib/types/ts-instance-parameter.d.ts +0 -4
  420. package/lib/types/ts-instance-parameter.js +0 -2
  421. package/lib/types/ts-instance-parameter.js.map +0 -1
  422. package/lib/types/ts-member.d.ts +0 -10
  423. package/lib/types/ts-member.js +0 -2
  424. package/lib/types/ts-member.js.map +0 -1
  425. package/lib/types/ts-method.d.ts +0 -5
  426. package/lib/types/ts-method.js +0 -2
  427. package/lib/types/ts-method.js.map +0 -1
  428. package/lib/types/ts-parameter.d.ts +0 -15
  429. package/lib/types/ts-parameter.js +0 -2
  430. package/lib/types/ts-parameter.js.map +0 -1
  431. package/lib/types/ts-property.d.ts +0 -17
  432. package/lib/types/ts-property.js +0 -2
  433. package/lib/types/ts-property.js.map +0 -1
  434. package/lib/types/ts-signal.d.ts +0 -17
  435. package/lib/types/ts-signal.js +0 -2
  436. package/lib/types/ts-signal.js.map +0 -1
  437. package/lib/types/ts-type-name.d.ts +0 -1
  438. package/lib/types/ts-type-name.js +0 -2
  439. package/lib/types/ts-type-name.js.map +0 -1
  440. package/lib/types/ts-type-separator.d.ts +0 -1
  441. package/lib/types/ts-type-separator.js +0 -2
  442. package/lib/types/ts-type-separator.js.map +0 -1
  443. package/lib/types/ts-type.d.ts +0 -22
  444. package/lib/types/ts-type.js +0 -2
  445. package/lib/types/ts-type.js.map +0 -1
  446. package/lib/types/ts-var.d.ts +0 -17
  447. package/lib/types/ts-var.js +0 -2
  448. package/lib/types/ts-var.js.map +0 -1
  449. package/lib/types/type-gir-alias.d.ts +0 -2
  450. package/lib/types/type-gir-alias.js +0 -2
  451. package/lib/types/type-gir-alias.js.map +0 -1
  452. package/lib/types/type-gir-class.d.ts +0 -2
  453. package/lib/types/type-gir-class.js +0 -2
  454. package/lib/types/type-gir-class.js.map +0 -1
  455. package/lib/types/type-gir-element.d.ts +0 -3
  456. package/lib/types/type-gir-element.js +0 -2
  457. package/lib/types/type-gir-element.js.map +0 -1
  458. package/lib/types/type-gir-enumeration-member.d.ts +0 -2
  459. package/lib/types/type-gir-enumeration-member.js +0 -2
  460. package/lib/types/type-gir-enumeration-member.js.map +0 -1
  461. package/lib/types/type-gir-enumeration.d.ts +0 -2
  462. package/lib/types/type-gir-enumeration.js +0 -2
  463. package/lib/types/type-gir-enumeration.js.map +0 -1
  464. package/lib/types/type-gir-function.d.ts +0 -1
  465. package/lib/types/type-gir-function.js +0 -2
  466. package/lib/types/type-gir-function.js.map +0 -1
  467. package/lib/types/type-gir-interface.d.ts +0 -2
  468. package/lib/types/type-gir-interface.js +0 -2
  469. package/lib/types/type-gir-interface.js.map +0 -1
  470. package/lib/types/type-gir-method.d.ts +0 -2
  471. package/lib/types/type-gir-method.js +0 -2
  472. package/lib/types/type-gir-method.js.map +0 -1
  473. package/lib/types/type-gir-parameter.d.ts +0 -1
  474. package/lib/types/type-gir-parameter.js +0 -2
  475. package/lib/types/type-gir-parameter.js.map +0 -1
  476. package/lib/types/type-gir-property.d.ts +0 -2
  477. package/lib/types/type-gir-property.js +0 -2
  478. package/lib/types/type-gir-property.js.map +0 -1
  479. package/lib/types/type-gir-variable.d.ts +0 -1
  480. package/lib/types/type-gir-variable.js +0 -2
  481. package/lib/types/type-gir-variable.js.map +0 -1
  482. package/lib/types/type-ts-element.d.ts +0 -3
  483. package/lib/types/type-ts-element.js +0 -2
  484. package/lib/types/type-ts-element.js.map +0 -1
  485. package/lib/types/type-ts-enumeration-member.d.ts +0 -2
  486. package/lib/types/type-ts-enumeration-member.js +0 -2
  487. package/lib/types/type-ts-enumeration-member.js.map +0 -1
  488. package/lib/types/type-ts-function.d.ts +0 -1
  489. package/lib/types/type-ts-function.js +0 -2
  490. package/lib/types/type-ts-function.js.map +0 -1
  491. package/lib/types/type-ts-property.d.ts +0 -1
  492. package/lib/types/type-ts-property.js +0 -2
  493. package/lib/types/type-ts-property.js.map +0 -1
  494. package/lib/types/user-config-load-result.d.ts +0 -6
  495. package/lib/types/user-config-load-result.js +0 -2
  496. package/lib/types/user-config-load-result.js.map +0 -1
  497. package/lib/types/user-config.d.ts +0 -40
  498. package/lib/types/user-config.js +0 -2
  499. package/lib/types/user-config.js.map +0 -1
  500. package/src/conflict-resolver.ts +0 -1358
  501. package/src/constants.ts +0 -29
  502. package/src/dependency-manager.ts +0 -91
  503. package/src/generator.ts +0 -10
  504. package/src/gir-factory.ts +0 -499
  505. package/src/gir-module.ts +0 -2827
  506. package/src/html-doc-generator.ts +0 -23
  507. package/src/injection/callbacks/gjs/Gio-2.0.ts +0 -37
  508. package/src/injection/callbacks/gjs/index.ts +0 -5
  509. package/src/injection/callbacks/index.ts +0 -6
  510. package/src/injection/callbacks/node-gtk/index.ts +0 -3
  511. package/src/injection/classes/GLib-2-0.ts +0 -36
  512. package/src/injection/classes/gjs/GLib-2.0.ts +0 -201
  513. package/src/injection/classes/gjs/GObject-2.0.ts +0 -635
  514. package/src/injection/classes/gjs/Gio-2.0.ts +0 -219
  515. package/src/injection/classes/gjs/index.ts +0 -7
  516. package/src/injection/classes/index.ts +0 -7
  517. package/src/injection/classes/node-gtk/GLib-2.0.ts +0 -20
  518. package/src/injection/classes/node-gtk/GObject-2.0.ts +0 -67
  519. package/src/injection/classes/node-gtk/Gdk-4.0.ts +0 -33
  520. package/src/injection/classes/node-gtk/Gio-2.0.ts +0 -15
  521. package/src/injection/classes/node-gtk/Graphene-1.0.ts +0 -134
  522. package/src/injection/classes/node-gtk/Gtk-3.0.ts +0 -32
  523. package/src/injection/classes/node-gtk/Gtk-4.0.ts +0 -53
  524. package/src/injection/classes/node-gtk/Pango-1.0.ts +0 -32
  525. package/src/injection/classes/node-gtk/index.ts +0 -21
  526. package/src/injection/index.ts +0 -3
  527. package/src/injection/injector.ts +0 -184
  528. package/src/logger.ts +0 -134
  529. package/src/messages.ts +0 -69
  530. package/src/symtable.ts +0 -72
  531. package/src/template-processor.ts +0 -199
  532. package/src/transformation.ts +0 -583
  533. package/src/type-definition-generator.ts +0 -1460
  534. package/src/types/answer-version.ts +0 -4
  535. package/src/types/build-type.ts +0 -1
  536. package/src/types/class-parent.ts +0 -14
  537. package/src/types/config-flags.ts +0 -5
  538. package/src/types/conflict-child-element.ts +0 -11
  539. package/src/types/conflict-grouped-element.ts +0 -7
  540. package/src/types/conflict-grouped-elements.ts +0 -5
  541. package/src/types/construct-name.ts +0 -11
  542. package/src/types/dependency-map.ts +0 -4
  543. package/src/types/dependency.ts +0 -16
  544. package/src/types/environment.ts +0 -1
  545. package/src/types/file-info.ts +0 -14
  546. package/src/types/generate-config.ts +0 -33
  547. package/src/types/generator-type.ts +0 -4
  548. package/src/types/gir-alias-element.ts +0 -15
  549. package/src/types/gir-annotation.ts +0 -10
  550. package/src/types/gir-any-element.ts +0 -35
  551. package/src/types/gir-any-type.ts +0 -7
  552. package/src/types/gir-array-type.ts +0 -23
  553. package/src/types/gir-bitfield-element.ts +0 -20
  554. package/src/types/gir-boolean.ts +0 -1
  555. package/src/types/gir-boxed-element.ts +0 -19
  556. package/src/types/gir-c-include.ts +0 -7
  557. package/src/types/gir-callable-attrs.ts +0 -19
  558. package/src/types/gir-callable-param-element.ts +0 -45
  559. package/src/types/gir-callable-param.ts +0 -9
  560. package/src/types/gir-callable-return.ts +0 -25
  561. package/src/types/gir-callback-element.ts +0 -28
  562. package/src/types/gir-class-element.ts +0 -71
  563. package/src/types/gir-constant-element.ts +0 -17
  564. package/src/types/gir-constructor-element.ts +0 -18
  565. package/src/types/gir-direction.ts +0 -5
  566. package/src/types/gir-doc-element.ts +0 -73
  567. package/src/types/gir-enum-element.ts +0 -28
  568. package/src/types/gir-field-element.ts +0 -31
  569. package/src/types/gir-function-element.ts +0 -19
  570. package/src/types/gir-implements.ts +0 -9
  571. package/src/types/gir-include.ts +0 -9
  572. package/src/types/gir-info-attrs.ts +0 -16
  573. package/src/types/gir-info-elements.ts +0 -8
  574. package/src/types/gir-instance-parameter.ts +0 -25
  575. package/src/types/gir-interface-element.ts +0 -53
  576. package/src/types/gir-member-element.ts +0 -19
  577. package/src/types/gir-method-element.ts +0 -25
  578. package/src/types/gir-module-resolved-by.ts +0 -11
  579. package/src/types/gir-modules-grouped-map.ts +0 -5
  580. package/src/types/gir-modules-grouped.ts +0 -13
  581. package/src/types/gir-namespace.ts +0 -47
  582. package/src/types/gir-package.ts +0 -7
  583. package/src/types/gir-prerequisite.ts +0 -5
  584. package/src/types/gir-property-element.ts +0 -31
  585. package/src/types/gir-record-element.ts +0 -47
  586. package/src/types/gir-repository.ts +0 -20
  587. package/src/types/gir-signal.ts +0 -43
  588. package/src/types/gir-transfer-ownership-type.ts +0 -5
  589. package/src/types/gir-transfer-ownership.ts +0 -6
  590. package/src/types/gir-type.ts +0 -16
  591. package/src/types/gir-union-element.ts +0 -35
  592. package/src/types/gir-unparsed-number.ts +0 -2
  593. package/src/types/gir-var-args.ts +0 -6
  594. package/src/types/gir-virtual-method.ts +0 -22
  595. package/src/types/index.ts +0 -119
  596. package/src/types/inheritance-table.ts +0 -3
  597. package/src/types/injection-callback.ts +0 -20
  598. package/src/types/injection-class.ts +0 -30
  599. package/src/types/injection-function.ts +0 -23
  600. package/src/types/injection-generic-parameter.ts +0 -3
  601. package/src/types/injection-instance-parameter.ts +0 -3
  602. package/src/types/injection-parameter.ts +0 -9
  603. package/src/types/injection-property.ts +0 -7
  604. package/src/types/injection-type.ts +0 -3
  605. package/src/types/injection.ts +0 -6
  606. package/src/types/local-name-check.ts +0 -5
  607. package/src/types/local-name-type.ts +0 -1
  608. package/src/types/local-name.ts +0 -8
  609. package/src/types/local-names.ts +0 -5
  610. package/src/types/module-type.ts +0 -1
  611. package/src/types/parsed-gir.ts +0 -5
  612. package/src/types/part-of-class.ts +0 -9
  613. package/src/types/part-of-module.ts +0 -8
  614. package/src/types/resolve-type.ts +0 -4
  615. package/src/types/sym-table-items.ts +0 -5
  616. package/src/types/transformation-case.ts +0 -7
  617. package/src/types/transformations.ts +0 -12
  618. package/src/types/ts-alias.ts +0 -11
  619. package/src/types/ts-callback-interface.ts +0 -11
  620. package/src/types/ts-callback.ts +0 -21
  621. package/src/types/ts-class.ts +0 -109
  622. package/src/types/ts-doc-tag.ts +0 -23
  623. package/src/types/ts-doc.ts +0 -23
  624. package/src/types/ts-enum.ts +0 -15
  625. package/src/types/ts-function.ts +0 -59
  626. package/src/types/ts-generic-parameter.ts +0 -8
  627. package/src/types/ts-instance-parameter.ts +0 -4
  628. package/src/types/ts-member.ts +0 -11
  629. package/src/types/ts-method.ts +0 -6
  630. package/src/types/ts-parameter.ts +0 -20
  631. package/src/types/ts-property.ts +0 -22
  632. package/src/types/ts-signal.ts +0 -21
  633. package/src/types/ts-type-name.ts +0 -1
  634. package/src/types/ts-type-separator.ts +0 -1
  635. package/src/types/ts-type.ts +0 -25
  636. package/src/types/ts-var.ts +0 -21
  637. package/src/types/type-gir-alias.ts +0 -2
  638. package/src/types/type-gir-class.ts +0 -2
  639. package/src/types/type-gir-element.ts +0 -25
  640. package/src/types/type-gir-enumeration-member.ts +0 -2
  641. package/src/types/type-gir-enumeration.ts +0 -2
  642. package/src/types/type-gir-function.ts +0 -8
  643. package/src/types/type-gir-interface.ts +0 -2
  644. package/src/types/type-gir-method.ts +0 -2
  645. package/src/types/type-gir-parameter.ts +0 -1
  646. package/src/types/type-gir-property.ts +0 -2
  647. package/src/types/type-gir-variable.ts +0 -1
  648. package/src/types/type-ts-element.ts +0 -13
  649. package/src/types/type-ts-enumeration-member.ts +0 -2
  650. package/src/types/type-ts-function.ts +0 -1
  651. package/src/types/type-ts-property.ts +0 -1
  652. package/src/types/user-config-load-result.ts +0 -6
  653. package/src/types/user-config.ts +0 -41
  654. package/templates/Cogl-2.0.d.ts +0 -0
  655. package/templates/Gjs/GObject-2.0.d.ts +0 -238
  656. package/templates/Gjs/Gio-2.0.d.ts +0 -64
  657. package/templates/Gjs/Gjs.d.ts +0 -204
  658. package/templates/Gjs/Gjs.js +0 -21
  659. package/templates/Gjs/GnomeShell.d.ts +0 -152
  660. package/templates/Gjs/GnomeShell.js +0 -10
  661. package/templates/Gjs/index.d.ts +0 -594
  662. package/templates/Gjs/index.js +0 -4
  663. package/templates/Gjs/misc/dbusUtils.d.ts +0 -15
  664. package/templates/Gjs/misc/dbusUtils.js +0 -6
  665. package/templates/Gjs/misc/extensionUtils.d.ts +0 -99
  666. package/templates/Gjs/misc/extensionUtils.js +0 -6
  667. package/templates/Gjs/misc/fileUtils.d.ts +0 -51
  668. package/templates/Gjs/misc/fileUtils.js +0 -6
  669. package/templates/Gjs/misc/gnomeSession.d.ts +0 -74
  670. package/templates/Gjs/misc/gnomeSession.js +0 -6
  671. package/templates/Gjs/misc/parentalControlsManager.d.ts +0 -42
  672. package/templates/Gjs/misc/parentalControlsManager.js +0 -6
  673. package/templates/Gjs/misc/signals.d.ts +0 -15
  674. package/templates/Gjs/misc/signals.js +0 -6
  675. package/templates/Gjs/module.d.ts +0 -6
  676. package/templates/Gjs/module.js +0 -16
  677. package/templates/Gjs/tsconfig.alias.json +0 -10
  678. package/templates/Gjs/ui/accessDialog.d.ts +0 -19
  679. package/templates/Gjs/ui/accessDialog.js +0 -6
  680. package/templates/Gjs/ui/altTab.d.ts +0 -124
  681. package/templates/Gjs/ui/altTab.js +0 -6
  682. package/templates/Gjs/ui/animation.d.ts +0 -58
  683. package/templates/Gjs/ui/animation.js +0 -6
  684. package/templates/Gjs/ui/appDisplay.d.ts +0 -204
  685. package/templates/Gjs/ui/appDisplay.js +0 -6
  686. package/templates/Gjs/ui/appFavorites.d.ts +0 -34
  687. package/templates/Gjs/ui/appFavorites.js +0 -6
  688. package/templates/Gjs/ui/appMenu.d.ts +0 -74
  689. package/templates/Gjs/ui/appMenu.js +0 -6
  690. package/templates/Gjs/ui/audioDeviceSelection.d.ts +0 -51
  691. package/templates/Gjs/ui/audioDeviceSelection.js +0 -6
  692. package/templates/Gjs/ui/background.d.ts +0 -255
  693. package/templates/Gjs/ui/background.js +0 -5
  694. package/templates/Gjs/ui/backgroundMenu.d.ts +0 -19
  695. package/templates/Gjs/ui/backgroundMenu.js +0 -5
  696. package/templates/Gjs/ui/barLevel.d.ts +0 -42
  697. package/templates/Gjs/ui/barLevel.js +0 -5
  698. package/templates/Gjs/ui/boxpointer.d.ts +0 -103
  699. package/templates/Gjs/ui/boxpointer.js +0 -5
  700. package/templates/Gjs/ui/calendar.d.ts +0 -261
  701. package/templates/Gjs/ui/calendar.js +0 -5
  702. package/templates/Gjs/ui/components/__init__.d.ts +0 -9
  703. package/templates/Gjs/ui/components/__init__.js +0 -6
  704. package/templates/Gjs/ui/components/automountManager.d.ts +0 -8
  705. package/templates/Gjs/ui/components/automountManager.js +0 -6
  706. package/templates/Gjs/ui/components/autorunManager.d.ts +0 -8
  707. package/templates/Gjs/ui/components/autorunManager.js +0 -6
  708. package/templates/Gjs/ui/components/index.d.ts +0 -6
  709. package/templates/Gjs/ui/components/index.js +0 -6
  710. package/templates/Gjs/ui/components/keyring.d.ts +0 -19
  711. package/templates/Gjs/ui/components/keyring.js +0 -6
  712. package/templates/Gjs/ui/components/networkAgent.d.ts +0 -10
  713. package/templates/Gjs/ui/components/networkAgent.js +0 -6
  714. package/templates/Gjs/ui/components/polkitAgent.d.ts +0 -19
  715. package/templates/Gjs/ui/components/polkitAgent.js +0 -6
  716. package/templates/Gjs/ui/components/telepathyClient.d.ts +0 -10
  717. package/templates/Gjs/ui/components/telepathyClient.js +0 -6
  718. package/templates/Gjs/ui/dialog.d.ts +0 -78
  719. package/templates/Gjs/ui/dialog.js +0 -0
  720. package/templates/Gjs/ui/dnd.d.ts +0 -127
  721. package/templates/Gjs/ui/dnd.js +0 -6
  722. package/templates/Gjs/ui/iconGrid.d.ts +0 -172
  723. package/templates/Gjs/ui/iconGrid.js +0 -6
  724. package/templates/Gjs/ui/layout.d.ts +0 -311
  725. package/templates/Gjs/ui/layout.js +0 -6
  726. package/templates/Gjs/ui/main.d.ts +0 -215
  727. package/templates/Gjs/ui/main.js +0 -6
  728. package/templates/Gjs/ui/messageList.d.ts +0 -113
  729. package/templates/Gjs/ui/messageList.js +0 -6
  730. package/templates/Gjs/ui/messageTray.d.ts +0 -423
  731. package/templates/Gjs/ui/messageTray.js +0 -6
  732. package/templates/Gjs/ui/modalDialog.d.ts +0 -96
  733. package/templates/Gjs/ui/modalDialog.js +0 -6
  734. package/templates/Gjs/ui/mpris.d.ts +0 -78
  735. package/templates/Gjs/ui/mpris.js +0 -6
  736. package/templates/Gjs/ui/notificationDaemon.d.ts +0 -5
  737. package/templates/Gjs/ui/notificationDaemon.js +0 -6
  738. package/templates/Gjs/ui/panel.d.ts +0 -65
  739. package/templates/Gjs/ui/panel.js +0 -6
  740. package/templates/Gjs/ui/panelMenu.d.ts +0 -51
  741. package/templates/Gjs/ui/panelMenu.js +0 -6
  742. package/templates/Gjs/ui/popupMenu.d.ts +0 -228
  743. package/templates/Gjs/ui/popupMenu.js +0 -6
  744. package/templates/Gjs/ui/ripples.d.ts +0 -44
  745. package/templates/Gjs/ui/ripples.js +0 -6
  746. package/templates/Gjs/ui/search.d.ts +0 -158
  747. package/templates/Gjs/ui/search.js +0 -6
  748. package/templates/Gjs/ui/switcherPopup.d.ts +0 -107
  749. package/templates/Gjs/ui/switcherPopup.js +0 -6
  750. package/templates/Gjs/ui/userWidget.d.ts +0 -13
  751. package/templates/Gjs/ui/userWidget.js +0 -6
  752. package/templates/Granite-1.0.d.ts +0 -7
  753. package/templates/Granite-7.0.d.ts +0 -7
  754. package/templates/GstBase-0.10.d.ts +0 -5
  755. package/templates/RygelServer-2.6.d.ts +0 -3
  756. package/templates/node-gtk/GObject-2.0.d.ts +0 -57
  757. package/templates/node-gtk/index.d.ts +0 -40
  758. package/templates/node-gtk/index.js +0 -9
  759. package/templates/node-gtk/module.d.ts +0 -6
  760. package/templates/node-gtk/module.js +0 -17
@@ -1,1358 +0,0 @@
1
- import { GirFactory } from './gir-factory.js'
2
- import { Logger } from './logger.js'
3
- import { NO_TSDATA } from './messages.js'
4
- import { isEqual, merge, clone, typeIsOptional } from './utils.js'
5
- import { SIGNAL_METHOD_NAMES, MAX_CLASS_PARENT_DEPTH } from './constants.js'
6
- import type {
7
- Environment,
8
- GirClassElement,
9
- GirRecordElement,
10
- GirUnionElement,
11
- GirInterfaceElement,
12
- GirCallableParamElement,
13
- GirMethodElement,
14
- GirVirtualMethodElement,
15
- GirConstructorElement,
16
- GirFunctionElement,
17
- GirPropertyElement,
18
- GirFieldElement,
19
- TsSignal,
20
- TsFunction,
21
- TsProperty,
22
- TsVar,
23
- TsTypeSeparator,
24
- TsType,
25
- TsClass,
26
- TsParameter,
27
- TypeGirFunction,
28
- TypeGirProperty,
29
- ConflictChildElement,
30
- ConflictGroupedElements,
31
- ConflictGroupedElement,
32
- } from './types/index.js'
33
-
34
- /**
35
- * Resolve conflicts between types caused by overloads / inheritances and implementations
36
- * With multiple implementations or a inherit it can happen that the interfaces / parent have the same method and/or property names with incompatible types,
37
- * we are trying to resolve this conflicts by merging, overloading or removing this conflicts.
38
- */
39
- export class ConflictResolver {
40
- private log: Logger
41
-
42
- private girFactory = new GirFactory()
43
-
44
- constructor(private readonly environment: Environment, private readonly verbose: boolean) {
45
- this.log = new Logger(environment, verbose, 'ConflictResolver')
46
- }
47
-
48
- private girElArrToChildArr<T = TsFunction | TsProperty | TsVar>(
49
- dataArr: Array<
50
- | GirMethodElement
51
- | GirVirtualMethodElement
52
- | GirConstructorElement
53
- | GirFunctionElement
54
- | GirPropertyElement
55
- | GirFieldElement
56
- >,
57
- depth: number,
58
- ): ConflictChildElement<T>[] {
59
- return dataArr
60
- .filter((data) => !!data?._tsData)
61
- .map((data) => {
62
- if (!data?._tsData) throw new Error('_tsData not set!')
63
- return {
64
- depth,
65
- data: data?._tsData as unknown as T,
66
- }
67
- })
68
- }
69
-
70
- private tsElArrToChildArr<T extends ConflictChildElement>(
71
- dataArr: Array<TsFunction | TsProperty | TsVar>,
72
- depth: number,
73
- ): T[] {
74
- return dataArr
75
- .filter((m) => !!m)
76
- .map((data) => {
77
- return {
78
- depth,
79
- data,
80
- } as T
81
- })
82
- }
83
-
84
- /**
85
- * Get class elements and parent elements (implementations and inherits)
86
- * @param tsClass
87
- * @param depth
88
- * @returns
89
- */
90
- private getClassElements(tsClass: TsClass, depth: number, processedClasses: string[]) {
91
- const tsClassFullPackageSymName = `${tsClass.namespace}-${tsClass.version}.${tsClass.namespace}.${tsClass.name}`
92
-
93
- const signalMethods: ConflictChildElement<TsFunction>[] = []
94
- const propertySignalMethods: ConflictChildElement<TsFunction>[] = []
95
- const methods: ConflictChildElement<TsFunction>[] = []
96
- const virtualMethods: ConflictChildElement<TsFunction>[] = []
97
- const staticFunctions: ConflictChildElement<TsFunction>[] = []
98
- const constructors: ConflictChildElement<TsFunction>[] = []
99
-
100
- const properties: ConflictChildElement<TsProperty | TsVar>[] = []
101
- const fields: ConflictChildElement<TsProperty | TsVar>[] = []
102
- const constructProps: ConflictChildElement<TsProperty | TsVar>[] = []
103
-
104
- const depthLimitReached = depth >= MAX_CLASS_PARENT_DEPTH
105
- const classAlreadyProcessed = processedClasses.includes(tsClassFullPackageSymName)
106
-
107
- if (depthLimitReached || classAlreadyProcessed) {
108
- if (depthLimitReached) {
109
- this.log.error(`[getClassElements] Maximum recursion depth reached (limit: ${MAX_CLASS_PARENT_DEPTH})!`)
110
- }
111
- return {
112
- signalMethods,
113
- propertySignalMethods,
114
- methods,
115
- virtualMethods,
116
- staticFunctions,
117
- constructors,
118
- properties,
119
- fields,
120
- constructProps,
121
- }
122
- }
123
-
124
- // Signals
125
- const _signals = tsClass.signals.map((s) => s._tsData).filter((s) => !!s) as TsSignal[]
126
- for (const tsSignal of _signals) {
127
- signalMethods.push(...this.tsElArrToChildArr<ConflictChildElement<TsFunction>>(tsSignal.tsMethods, depth))
128
- }
129
- // Property signals
130
- propertySignalMethods.push(
131
- ...this.tsElArrToChildArr<ConflictChildElement<TsFunction>>(tsClass.propertySignalMethods, depth),
132
- )
133
- // Methods
134
- if (tsClass.methods.length) methods.push(...this.girElArrToChildArr<TsFunction>(tsClass.methods, depth))
135
- // Virtual methods
136
- if (tsClass.virtualMethods.length)
137
- virtualMethods.push(...this.girElArrToChildArr<TsFunction>(tsClass.virtualMethods, depth))
138
- // Static functions
139
- if (tsClass.staticFunctions.length)
140
- staticFunctions.push(...this.girElArrToChildArr<TsFunction>(tsClass.staticFunctions, depth))
141
- // Constructors
142
- if (tsClass.constructors.length)
143
- constructors.push(...this.girElArrToChildArr<TsFunction>(tsClass.constructors, depth))
144
- // Properties
145
- if (tsClass.properties.length)
146
- properties.push(...this.girElArrToChildArr<TsProperty | TsVar>(tsClass.properties, depth))
147
- // Fields
148
- if (tsClass.fields.length) fields.push(...this.girElArrToChildArr<TsProperty | TsVar>(tsClass.fields, depth))
149
- // Constructor properties
150
- if (tsClass.constructProps.length)
151
- constructProps.push(...this.girElArrToChildArr<TsProperty | TsVar>(tsClass.constructProps, depth))
152
-
153
- for (const ifacePackageFullSymName of Object.keys(tsClass.implements)) {
154
- if (tsClassFullPackageSymName === ifacePackageFullSymName) {
155
- this.log.warn("[getImplementedInterfaceElements] A interface can't implement itself")
156
- continue
157
- }
158
-
159
- const { interface: implementation, depth: parentDepth } = tsClass.implements[ifacePackageFullSymName]
160
- const implementationElements = this.getClassElements(
161
- implementation,
162
- parentDepth + depth + 1,
163
- processedClasses,
164
- )
165
-
166
- signalMethods.push(...implementationElements.signalMethods)
167
- propertySignalMethods.push(...implementationElements.propertySignalMethods)
168
- methods.push(...implementationElements.methods)
169
- virtualMethods.push(...implementationElements.virtualMethods)
170
- staticFunctions.push(...implementationElements.staticFunctions)
171
- constructors.push(...implementationElements.constructors)
172
- properties.push(...implementationElements.properties)
173
- fields.push(...implementationElements.fields)
174
- constructProps.push(...implementationElements.constructProps)
175
- }
176
-
177
- for (const ifaceFullPackageSymName of Object.keys(tsClass.inherit)) {
178
- if (tsClassFullPackageSymName === ifaceFullPackageSymName) {
179
- this.log.warn("[getClassElements] A class can't inherit itself")
180
- continue
181
- }
182
-
183
- const { class: inherit, depth: parentDepth } = tsClass.inherit[ifaceFullPackageSymName]
184
- const inheritElements = this.getClassElements(inherit, parentDepth + depth + 1, processedClasses)
185
-
186
- signalMethods.push(...inheritElements.signalMethods)
187
- propertySignalMethods.push(...inheritElements.propertySignalMethods)
188
- methods.push(...inheritElements.methods)
189
- virtualMethods.push(...inheritElements.virtualMethods)
190
- staticFunctions.push(...inheritElements.staticFunctions)
191
- constructors.push(...inheritElements.constructors)
192
- properties.push(...inheritElements.properties)
193
- fields.push(...inheritElements.fields)
194
- constructProps.push(...inheritElements.constructProps)
195
- }
196
-
197
- processedClasses.push(tsClassFullPackageSymName)
198
-
199
- return {
200
- signalMethods,
201
- propertySignalMethods,
202
- methods,
203
- virtualMethods,
204
- staticFunctions,
205
- constructors,
206
- properties,
207
- fields,
208
- constructProps,
209
- }
210
- }
211
-
212
- private tsElementIsMethod(el: TsFunction | TsVar) {
213
- return !this.tsElementIsStatic(el) && this.tsElementIsMethodOrFunction(el)
214
- }
215
-
216
- private tsElementIsStaticFunction(el: TsFunction | TsVar) {
217
- return this.tsElementIsStatic(el) && this.tsElementIsMethodOrFunction(el)
218
- }
219
-
220
- private tsElementIsProperty(el: TsFunction | TsVar) {
221
- return !this.tsElementIsStatic(el) && this.tsElementIsPropertyOrVariable(el)
222
- }
223
-
224
- private tsElementIsStaticProperty(el: TsFunction | TsVar) {
225
- return this.tsElementIsStatic(el) && this.tsElementIsPropertyOrVariable(el)
226
- }
227
-
228
- private tsElementIsSignal(el: TsFunction | TsVar) {
229
- return el.tsTypeName === 'event-methods'
230
- }
231
-
232
- private tsElementIsConstructor(el: TsFunction | TsVar) {
233
- return el.tsTypeName === 'constructor'
234
- }
235
-
236
- private tsElementIsMethodOrFunction(el: TsFunction | TsVar) {
237
- return el.tsTypeName === 'function' || el.tsTypeName === 'method' || el.tsTypeName === 'static-function'
238
- }
239
-
240
- private tsElementIsPropertyOrVariable(el: TsFunction | TsVar | TsProperty) {
241
- return (
242
- el.tsTypeName === 'constant' ||
243
- el.tsTypeName === 'constructor-property' ||
244
- el.tsTypeName === 'property' ||
245
- el.tsTypeName === 'static-property'
246
- )
247
- }
248
-
249
- private tsElementIsStatic(el: TsFunction | TsVar) {
250
- return (
251
- // el.tsTypeName === 'constructor' ||
252
- (el as TsFunction).isStatic || el.tsTypeName === 'static-property' || el.tsTypeName === 'static-function'
253
- )
254
- }
255
-
256
- private typeIsString(type: TsType) {
257
- return (
258
- type.type === 'string' ||
259
- (type.type.startsWith("'") && type.type.endsWith("'")) ||
260
- (type.type.startsWith('"') && type.type.endsWith('"'))
261
- )
262
- }
263
-
264
- private mergeTypes(leftSeparator: TsTypeSeparator, ...types: Array<TsType | undefined>) {
265
- const dest: TsType[] = []
266
-
267
- for (const type of types) {
268
- if (!type) continue
269
- if (!dest.find((destType) => isEqual(destType, type))) {
270
- dest.push({ ...type, leftSeparator })
271
- }
272
- }
273
-
274
- return dest
275
- }
276
-
277
- private setTypesProperty(types: TsType[], property: 'optional', value: boolean) {
278
- for (const type of types) {
279
- type[property] = value
280
- }
281
- return types
282
- }
283
-
284
- /**
285
- * Merges two parameter name and type of two parameters
286
- * @param a
287
- * @param b
288
- * @returns
289
- */
290
- private mergeParam(a: GirCallableParamElement | undefined, b: GirCallableParamElement | undefined) {
291
- if (!a?._tsData && !b?._tsData) {
292
- throw new Error('At least one parameter must be defined!')
293
- }
294
-
295
- let dest: GirCallableParamElement
296
-
297
- if (a?._tsData && b?._tsData) {
298
- dest = merge({}, clone(a), clone(b))
299
- if (!dest._tsData) {
300
- throw new Error('Error on merge parameters!')
301
- }
302
- dest._tsData.type = []
303
- dest._tsData.type = this.mergeTypes('|', ...a._tsData.type, ...b._tsData.type)
304
- if (a._tsData.name !== b._tsData.name) {
305
- dest._tsData.name = `${a._tsData.name}_or_${b._tsData.name}`
306
- }
307
- } else {
308
- dest = clone((a || b) as GirCallableParamElement)
309
- if (!dest._tsData) {
310
- throw new Error('Error on merge parameters!')
311
- }
312
- // If `a` or `b` is undefined make the types optional
313
- dest._tsData.type = this.setTypesProperty(dest._tsData.type, 'optional', true)
314
- }
315
-
316
- if (typeIsOptional(dest._tsData.type)) {
317
- dest._tsData.type = this.setTypesProperty(dest._tsData.type, 'optional', true)
318
- }
319
-
320
- return dest
321
- }
322
-
323
- /**
324
- * Merges parameter names and types of multiple functions
325
- * @param params
326
- * @returns
327
- */
328
- private mergeParams(...params: GirCallableParamElement[][]) {
329
- let dest: GirCallableParamElement[] = []
330
-
331
- for (const a of params) {
332
- for (const b of params) {
333
- if (a === b) {
334
- continue
335
- }
336
- if (isEqual(a, b)) {
337
- dest = clone(a)
338
- } else {
339
- const length = Math.max(a.length, b.length)
340
- dest = new Array<GirCallableParamElement>(length)
341
- for (let i = 0; i < length; i++) {
342
- const aParam = a[i] as GirCallableParamElement | undefined
343
- const bParam = b[i] as GirCallableParamElement | undefined
344
- dest[i] = this.mergeParam(aParam, bParam)
345
- }
346
- }
347
- }
348
- }
349
-
350
- return dest
351
- }
352
-
353
- private paramCanBeOptional(
354
- girParam: GirCallableParamElement,
355
- girParams: GirCallableParamElement[],
356
- skip: GirCallableParamElement[] = [],
357
- ) {
358
- if (!girParam._tsData) return false
359
- let canBeOptional = true
360
- const index = girParams.indexOf(girParam)
361
- const following = girParams
362
- .slice(index)
363
- .filter((p) => !!p._tsData)
364
- .filter(() => !skip.includes(girParam))
365
- .filter((p) => p.$.direction !== 'out')
366
- .map((p) => p._tsData)
367
-
368
- if (following.some((p) => p && !typeIsOptional(p.type))) {
369
- canBeOptional = false
370
- }
371
-
372
- return canBeOptional
373
- }
374
-
375
- /**
376
- * In Typescript no optional parameters are allowed if the following ones are not optional
377
- * @param girParams
378
- * @returns
379
- */
380
- private fixOptionalParameters(girParams: GirCallableParamElement[]) {
381
- for (const girParam of girParams) {
382
- if (!girParam._tsData) throw new Error(NO_TSDATA('fixOptionalParameters'))
383
- if (typeIsOptional(girParam._tsData.type) && !this.paramCanBeOptional(girParam, girParams)) {
384
- this.setTypesProperty(girParam._tsData.type, 'optional', false)
385
- }
386
- }
387
- return girParams
388
- }
389
-
390
- /**
391
- * Merge function types and parameters together
392
- * @param baseFunc The function to change or null if you want to create a new property
393
- * @param funcs The functions you want to merge
394
- * @returns
395
- */
396
- public mergeFunctions(baseFunc: TsFunction | null, ...funcs: TsFunction[]) {
397
- const returnTypesMap: TsType[] = []
398
- for (const func of funcs) {
399
- returnTypesMap.push(...func.returnTypes)
400
- }
401
- const returnTypes = this.mergeTypes('|', ...returnTypesMap)
402
-
403
- const inParamsMap = funcs.map((func) => func.inParams)
404
- const inParams: GirCallableParamElement[] = []
405
- if (this.paramsHasConflict(...inParamsMap)) {
406
- inParams.push(...this.mergeParams(...inParamsMap))
407
- }
408
-
409
- const outParamsMap = funcs.map((func) => func.outParams)
410
- const outParams: GirCallableParamElement[] = []
411
- if (this.paramsHasConflict(...outParamsMap)) {
412
- outParams.push(...this.mergeParams(...outParamsMap))
413
- }
414
-
415
- if (!funcs[0]) {
416
- throw new Error('At least one function must exist!')
417
- }
418
-
419
- if (baseFunc) {
420
- baseFunc.returnTypes = returnTypes
421
- return baseFunc
422
- }
423
-
424
- return this.girFactory.newTsFunction(
425
- {
426
- name: funcs[0].name,
427
- returnTypes: returnTypes,
428
- isStatic: funcs[0].isStatic || false,
429
- inParams: inParams.map((inParam) => inParam._tsData).filter((inParam) => !!inParam) as TsParameter[],
430
- outParams: outParams
431
- .map((outParam) => outParam._tsData)
432
- .filter((outParam) => !!outParam) as TsParameter[],
433
- girTypeName: funcs[0].girTypeName,
434
- },
435
- funcs[0].parent,
436
- )
437
- }
438
-
439
- /**
440
- * Merge property types together
441
- * @param baseProp The property to change or null if you want to create a new property
442
- * @param props The properties you want to merge
443
- * @returns
444
- */
445
- public mergeProperties(typeSeparator: TsTypeSeparator, baseProp: TsProperty | null, ...props: TsProperty[]) {
446
- const typesMap: TsType[] = []
447
- for (const prop of props) {
448
- typesMap.push(...prop.type)
449
- }
450
-
451
- const types = this.mergeTypes(typeSeparator, ...typesMap)
452
-
453
- // Merge readonly
454
- let readonly = false
455
- for (const prop of props) {
456
- readonly = readonly || prop.readonly || false
457
- }
458
-
459
- if (!props[0] || !props[0].name) {
460
- throw new Error('At least one property to merge must exist!')
461
- }
462
-
463
- if (baseProp) {
464
- baseProp.type = types
465
- baseProp.readonly = readonly
466
- return baseProp
467
- }
468
-
469
- const newProp = this.girFactory.newTsProperty({
470
- readonly: readonly,
471
- isStatic: props[0].isStatic || false,
472
- name: props[0].name,
473
- type: types,
474
- girTypeName: props[0].girTypeName,
475
- })
476
- return newProp
477
- }
478
-
479
- /**
480
- * Check if there is a type conflict between the ts elements a and b
481
- * @param a
482
- * @param b
483
- * @returns
484
- */
485
- public hasConflict(a: ConflictChildElement, b: ConflictChildElement) {
486
- if (a !== b && a.data.name === b.data.name) {
487
- const name = a.data.name
488
- // Ignore element with name of:
489
- if (name === 'constructor' || name === '_init') {
490
- return false
491
- }
492
- if (this.elementHasConflict(a.data, b.data)) {
493
- return true
494
- }
495
- }
496
-
497
- return false
498
- }
499
-
500
- public newAnyTsProperty(name: string, girTypeName: TypeGirProperty) {
501
- return this.girFactory.newTsProperty({
502
- name,
503
- girTypeName,
504
- type: [{ type: 'any' }],
505
- })
506
- }
507
-
508
- /**
509
- * Returns a new any function: `name(...args: any[]): any`
510
- * @param name The name of the function
511
- */
512
- public newAnyTsFunction(name: string, girTypeName: TypeGirFunction, isStatic: boolean, parent: TsClass | null) {
513
- return this.girFactory.newTsFunction(
514
- {
515
- name,
516
- isStatic,
517
- inParams: [
518
- {
519
- name: 'args',
520
- isRest: true,
521
- type: [this.girFactory.newTsType({ type: 'any', isArray: true })],
522
- },
523
- ],
524
- returnTypes: [{ type: 'any' }],
525
- girTypeName,
526
- },
527
- parent,
528
- )
529
- }
530
-
531
- public getCompatibleTsProperty(elements: TsProperty[], baseProp: TsProperty) {
532
- return elements.find((prop) => !this.propertyHasConflict(baseProp, prop))
533
- }
534
-
535
- public getCompatibleTsFunction(elements: TsFunction[], baseFunc: TsFunction) {
536
- return elements.find((func) => !this.functionHasConflict(baseFunc, func))
537
- }
538
-
539
- /**
540
- * Use this instead of `getCompatibleTsProperty` and `getCompatibleTsProperty` if you can, because it's much faster
541
- * @param elements
542
- * @param name
543
- * @returns
544
- */
545
- public getTsElementByName(elements: (TsProperty | TsFunction)[], name: string) {
546
- return elements.find((el) => el.name === name)
547
- }
548
-
549
- protected canAddConflictProperty(conflictProperties: TsProperty[], prop: TsProperty) {
550
- const canAdd =
551
- prop.name &&
552
- // Only one property can be defined, no overloads
553
- !this.getTsElementByName(conflictProperties, prop.name) &&
554
- // Do not set properties with signal method names
555
- !SIGNAL_METHOD_NAMES(this.environment).includes(prop.name)
556
-
557
- return canAdd
558
- }
559
-
560
- public groupSignalConflicts(signalsMethods: ConflictChildElement<TsFunction>[], baseClass: TsClass) {
561
- const groupedConflicts: ConflictGroupedElements = {}
562
- for (const base of signalsMethods) {
563
- for (const b of signalsMethods) {
564
- if (base === b) {
565
- continue
566
- }
567
-
568
- if (base.data.name !== 'connect' && base.data.name !== 'connect_after') {
569
- continue
570
- }
571
-
572
- const sigNameParam = base.data.inParams[0]
573
- // const callbackParam = base.data.inParams[1]
574
-
575
- const eventName = sigNameParam?._tsData?.type?.[0]?.type
576
- // TODO do not render the callback type as a full string, create a TSCallback instead
577
- // const callbackType = callbackParam?._tsData?.type?.[0]?.type
578
- // console.debug('eventName', eventName, callbackType)
579
-
580
- if (!eventName || eventName === 'string') {
581
- continue
582
- }
583
- groupedConflicts[eventName] ||= {
584
- baseElements: [],
585
- inheritedElements: [],
586
- baseClass,
587
- }
588
-
589
- const groupedConflict = groupedConflicts[eventName]
590
- const isBaseElement = base.depth === 0
591
- if (isBaseElement) {
592
- if (!groupedConflict.baseElements.find((c) => isEqual(c.data, base.data))) {
593
- groupedConflict.baseElements.push(base)
594
- }
595
- } else {
596
- if (!groupedConflict.inheritedElements.find((c) => isEqual(c.data, base.data))) {
597
- groupedConflict.inheritedElements.push(base)
598
- }
599
- }
600
- }
601
- }
602
-
603
- return groupedConflicts
604
- }
605
-
606
- public fixSignalConflicts(groupedElements: ConflictGroupedElements) {
607
- for (const eventName of Object.keys(groupedElements)) {
608
- const elements = groupedElements[eventName]
609
-
610
- const bases = elements.baseElements
611
-
612
- if (!bases.length) {
613
- // TODO
614
- // return this.fixIndirectSignalConflicts(elements.inheritedElements, elements.baseClass)
615
- return
616
- }
617
-
618
- for (const base of bases) {
619
- if (base.data.hasUnresolvedConflict) {
620
- continue
621
- }
622
- for (const b of elements.inheritedElements) {
623
- if (b === base || b.data.hasUnresolvedConflict) {
624
- continue
625
- }
626
- // TODO
627
- }
628
- }
629
- }
630
- }
631
-
632
- /**
633
- * Check conflicts between the implementations / inheritances
634
- * To fix type errors like:
635
- * ```
636
- * Interface 'PopoverMenu' can\'t simultaneously extend types 'Popover' and 'Native'.
637
- * Named property 'parent' of types 'Popover' and 'Native' are not identical.
638
- */
639
- public fixIndirectConflicts(name: string, elements: ConflictChildElement[], baseClass: TsClass) {
640
- for (const base of elements) {
641
- if (base.data.hasUnresolvedConflict) {
642
- continue
643
- }
644
- for (const b of elements) {
645
- if (b === base || b.data.hasUnresolvedConflict) {
646
- continue
647
- }
648
-
649
- const className = `${baseClass.namespace}-${baseClass.version}.${baseClass.name}`
650
-
651
- // If a element is a function / method
652
- if (this.tsElementIsMethodOrFunction(base.data)) {
653
- const baseFunc = base.data as TsFunction
654
-
655
- // Function vs. Property
656
- if (this.tsElementIsPropertyOrVariable(b.data)) {
657
- this.log.debug(`${className}.${name} External Function vs. Property`, baseFunc, b.data)
658
- b.data.hasUnresolvedConflict = true
659
- }
660
-
661
- // Function vs. Signal
662
- else if (this.tsElementIsSignal(b.data)) {
663
- this.log.debug(`${className}.${name} External Function vs. Signal`, baseFunc, b.data)
664
- baseFunc.hasUnresolvedConflict = true
665
- }
666
-
667
- // Function vs. Function
668
- else if (this.tsElementIsMethodOrFunction(b.data)) {
669
- const bFunc = b.data as TsFunction
670
- this.log.debug(
671
- `${className}.${name} External Function vs. Function`,
672
- baseFunc.inParams.map((p) => p._tsData?.name).join(', '),
673
- bFunc.inParams.map((p) => p._tsData?.name).join(', '),
674
- )
675
-
676
- // Just add conflicting methods to the class
677
- if (!baseClass.conflictMethods.includes(baseFunc)) {
678
- baseClass.conflictMethods.push(baseFunc)
679
- }
680
- if (!baseClass.conflictMethods.includes(bFunc)) {
681
- baseClass.conflictMethods.push(bFunc)
682
- }
683
- }
684
-
685
- // Function vs. Constructor
686
- else if (this.tsElementIsConstructor(base.data)) {
687
- const bConstr = b.data as TsFunction
688
- this.log.debug(`${className}.${name} External Function vs. Constructor`, baseFunc, bConstr)
689
-
690
- // Just add conflicting methods to the class
691
- if (!baseClass.conflictMethods.includes(baseFunc)) {
692
- baseClass.conflictMethods.push(baseFunc)
693
- }
694
- if (!baseClass.conflictMethods.includes(bConstr)) {
695
- baseClass.conflictMethods.push(bConstr)
696
- }
697
- }
698
-
699
- // Function vs. Unknown
700
- else {
701
- this.log.debug(`${className}.${name} External Unknown ${b.data.tsTypeName}`, baseFunc, b.data)
702
- baseFunc.hasUnresolvedConflict = true
703
- }
704
- }
705
-
706
- // If a element is a constructor
707
- else if (this.tsElementIsConstructor(base.data)) {
708
- const baseConstr = base.data as TsFunction
709
-
710
- // Constructor vs. Function
711
- if (this.tsElementIsMethodOrFunction(b.data)) {
712
- const bFunc = b.data as TsFunction
713
- this.log.debug(
714
- `${className}.${name} External Constructor vs. Function`,
715
- baseConstr.inParams.map((p) => p._tsData?.name).join(', '),
716
- bFunc.inParams.map((p) => p._tsData?.name).join(', '),
717
- )
718
-
719
- if (!baseClass.conflictMethods.includes(baseConstr)) {
720
- baseClass.conflictMethods.push(baseConstr)
721
- }
722
- if (!baseClass.conflictMethods.includes(bFunc)) {
723
- baseClass.conflictMethods.push(bFunc)
724
- }
725
- }
726
-
727
- // Constructor vs. Constructor
728
- else if (this.tsElementIsConstructor(base.data)) {
729
- this.log.debug(`${className}.${name} External Constructor vs. Constructor`, baseConstr, b.data)
730
-
731
- const anyFunc = this.newAnyTsFunction(
732
- name,
733
- baseConstr.girTypeName,
734
- baseConstr.isStatic,
735
- baseConstr.parent,
736
- )
737
-
738
- // Check if any function is not already added
739
- if (!this.getTsElementByName(baseClass.conflictMethods, anyFunc.name)) {
740
- baseClass.conflictMethods.push(anyFunc)
741
- }
742
- }
743
- }
744
-
745
- // If a element is a property / variable
746
- else if (this.tsElementIsPropertyOrVariable(base.data)) {
747
- const baseProp = base.data as TsProperty
748
-
749
- // Property vs. Function
750
- if (this.tsElementIsMethodOrFunction(b.data)) {
751
- const bFunc = b.data as TsFunction
752
- this.log.debug(
753
- `${className}.${name} External Property vs. Function`,
754
- baseProp.type[0].type,
755
- bFunc,
756
- )
757
- baseProp.hasUnresolvedConflict = true
758
- }
759
-
760
- // Property vs. Property
761
- else if (this.tsElementIsPropertyOrVariable(b.data)) {
762
- const bProp = b.data as TsProperty
763
- this.log.debug(
764
- `${className}.${name} External Property vs. Property`,
765
- baseProp.type[0].type,
766
- bProp.type[0].type,
767
- )
768
-
769
- switch (name) {
770
- case 'parent':
771
- case 'window':
772
- case 'parent_instance':
773
- case 'priv':
774
- const mergedProp = this.mergeProperties('&', null, baseProp, bProp)
775
- if (this.canAddConflictProperty(baseClass.conflictProperties, mergedProp)) {
776
- baseClass.conflictProperties.push(mergedProp)
777
- }
778
- break
779
-
780
- default:
781
- const anyProp = this.newAnyTsProperty(name, baseProp.girTypeName)
782
- if (this.canAddConflictProperty(baseClass.conflictProperties, anyProp)) {
783
- baseClass.conflictProperties.push(anyProp)
784
- }
785
- break
786
- }
787
- }
788
-
789
- // Property vs. Signal
790
- else if (this.tsElementIsSignal(b.data)) {
791
- this.log.debug(`${className}.${name} External Property vs. Signal`, baseProp, b.data)
792
- base.data.hasUnresolvedConflict = true
793
- } else {
794
- this.log.error(`${className}.${name} External Unknown ${b.data.tsTypeName}`, baseProp, b.data)
795
- }
796
- }
797
-
798
- // Other
799
- else {
800
- this.log.error(`${className}.${name} External Unknown ${base.data.tsTypeName}`)
801
- base.data.hasUnresolvedConflict = true
802
- }
803
- }
804
- }
805
- }
806
-
807
- /**
808
- * Check conflicts within the class itself (ignores implementations / inheritances)
809
- */
810
- public fixInternalConflicts(name: string, elements: ConflictChildElement[], baseClass: TsClass) {
811
- for (const base of elements) {
812
- if (base.data.hasUnresolvedConflict) {
813
- continue
814
- }
815
- for (const b of elements) {
816
- if (b === base || b.data.hasUnresolvedConflict) {
817
- continue
818
- }
819
-
820
- const className = `${baseClass.namespace}-${baseClass.version}.${baseClass.name}`
821
-
822
- // Conflict between injected and original elements
823
- if (base.data.isInjected !== b.data.isInjected) {
824
- if (!base.data.isInjected) {
825
- base.data.hasUnresolvedConflict = true
826
- } else if (!b.data.isInjected) {
827
- b.data.hasUnresolvedConflict = true
828
- }
829
- // Copy doc from original element if not set in the injected element
830
- if (!b.data.doc.text && base.data.doc.text) {
831
- b.data.doc = base.data.doc
832
- } else if (!base.data.doc.text && b.data.doc.text) {
833
- base.data.doc = b.data.doc
834
- }
835
- continue
836
- }
837
-
838
- // If a element is a function / method
839
- if (this.tsElementIsMethodOrFunction(base.data)) {
840
- const baseFunc = base.data as TsFunction
841
-
842
- // Function vs. Property
843
- if (this.tsElementIsPropertyOrVariable(b.data)) {
844
- this.log.debug(`${className}.${name} Internal Function vs. Property`, baseFunc, b.data)
845
- b.data.hasUnresolvedConflict = true
846
- }
847
-
848
- // Function vs. Signal
849
- else if (this.tsElementIsSignal(b.data)) {
850
- this.log.debug(`${className}.${name} Internal Function vs. Signal`, baseFunc, b.data)
851
- // Do nothing
852
- }
853
-
854
- // Function vs. Function
855
- else if (this.tsElementIsMethodOrFunction(b.data)) {
856
- const bFunc = b.data as TsFunction
857
- this.log.debug(
858
- `${className}.${name} Internal Function vs. Function`,
859
- baseFunc.inParams.map((p) => p._tsData?.name).join(', '),
860
- bFunc.inParams.map((p) => p._tsData?.name).join(', '),
861
- )
862
-
863
- // Conflict between virtual and non-virtual methods (this should only occur in node-gtk, because Gjs has a vfunc_ prefix for virtual methods)
864
- if (baseFunc.isVirtual !== bFunc.isVirtual) {
865
- if (!baseFunc.isVirtual) {
866
- baseFunc.hasUnresolvedConflict = true
867
- } else {
868
- bFunc.hasUnresolvedConflict = true
869
- }
870
- continue
871
- }
872
-
873
- // Do nothing..
874
- } else {
875
- this.log.error(`${className}.${name} Internal Unknown ${b.data.tsTypeName}`, baseFunc, b.data)
876
- b.data.hasUnresolvedConflict = true
877
- }
878
- }
879
-
880
- // If a element is a property / variable
881
- else if (this.tsElementIsPropertyOrVariable(base.data)) {
882
- const baseProp = base.data as TsProperty
883
-
884
- // Property vs. Function
885
- if (this.tsElementIsMethodOrFunction(b.data)) {
886
- const bFunc = b.data as TsFunction
887
- this.log.debug(
888
- `${className}.${name} Internal Property vs. Function`,
889
- baseProp.type[0].type,
890
- bFunc,
891
- )
892
- baseProp.hasUnresolvedConflict = true
893
- }
894
-
895
- // Property vs. Property
896
- else if (this.tsElementIsPropertyOrVariable(b.data)) {
897
- const bProp = b.data as TsProperty
898
- this.log.debug(
899
- `${className}.${name} Internal Property vs. Property`,
900
- baseProp.type[0].type,
901
- bProp.type[0].type,
902
- )
903
-
904
- switch (name) {
905
- case 'parent':
906
- case 'window':
907
- case 'parent_instance':
908
- this.mergeProperties('&', baseProp, baseProp, bProp)
909
- break
910
-
911
- default:
912
- // Set property type to any
913
- baseProp.type = [this.girFactory.newTsType({ ...bProp.type, type: 'any' })]
914
- break
915
- }
916
- }
917
-
918
- // Property vs. Signal
919
- else if (this.tsElementIsSignal(b.data)) {
920
- this.log.debug(`${className}.${name} Internal Property vs. Signal`, baseProp, b.data)
921
- base.data.hasUnresolvedConflict = true
922
- } else {
923
- this.log.error(`${className}.${name} Internal Unknown ${b.data.tsTypeName}`, baseProp, b.data)
924
- }
925
- }
926
-
927
- // If a element is a signal
928
- else if (this.tsElementIsSignal(base.data)) {
929
- const baseSig = base.data as TsSignal
930
- // Signal vs. Function
931
- if (this.tsElementIsMethodOrFunction(b.data)) {
932
- this.log.debug(`${className}.${name} Internal Signal vs. Function`, baseSig, b.data)
933
- // Do nothing
934
- }
935
- // Signal vs. Property
936
- else if (this.tsElementIsPropertyOrVariable(b.data)) {
937
- this.log.debug(`${className}.${name} Internal Signal vs. Property`, baseSig, b.data)
938
- b.data.hasUnresolvedConflict = true
939
- }
940
- }
941
-
942
- // Other
943
- else {
944
- this.log.error(`${className}.${name} Internal Unknown ${base.data.tsTypeName}`)
945
- }
946
- }
947
- }
948
- }
949
-
950
- /**
951
- * Check conflicts of the class with implementations and inheritances
952
- */
953
- public fixDirectConflicts(name: string, elements: ConflictGroupedElement) {
954
- const className = `${elements.baseClass.namespace}-${elements.baseClass.version}.${elements.baseClass.name}`
955
-
956
- for (const base of elements.baseElements) {
957
- if (base.data.hasUnresolvedConflict) {
958
- continue
959
- }
960
-
961
- // Each conflicting elements
962
- for (const b of elements.inheritedElements) {
963
- if (b === base || b.data.hasUnresolvedConflict) {
964
- continue
965
- }
966
-
967
- // If base element is a function
968
- if (this.tsElementIsMethodOrFunction(base.data)) {
969
- const baseFunc = base.data as TsFunction
970
-
971
- // Function vs. Function
972
- if (this.tsElementIsMethodOrFunction(b.data)) {
973
- const bFunc = b.data as TsFunction
974
- this.log.debug(
975
- `${className}.${name} Direct Function vs. Function`,
976
- baseFunc.inParams.map((p) => p._tsData?.name).join(', '),
977
- bFunc.inParams.map((p) => p._tsData?.name).join(', '),
978
- )
979
-
980
- // Add a function to overload methods if there is not already a compatible version
981
- if (
982
- !baseFunc.overloads.includes(bFunc) &&
983
- !this.getCompatibleTsFunction(baseFunc.overloads, bFunc)
984
- ) {
985
- baseFunc.overloads.push(bFunc)
986
- }
987
- }
988
-
989
- // Function vs. Constructor
990
- else if (this.tsElementIsConstructor(b.data)) {
991
- const bConstr = b.data as TsFunction
992
- this.log.debug(
993
- `${className}.${name} Direct Function vs. Constructor`,
994
- baseFunc.inParams.map((p) => p._tsData?.name).join(', '),
995
- bConstr.inParams.map((p) => p._tsData?.name).join(', '),
996
- )
997
-
998
- // Add a function to overload methods if there is not already a compatible version
999
- if (!this.getCompatibleTsFunction(baseFunc.overloads, bConstr)) {
1000
- baseFunc.overloads.push(bConstr)
1001
- }
1002
- }
1003
-
1004
- // Function vs. Property
1005
- else if (this.tsElementIsPropertyOrVariable(b.data)) {
1006
- this.log.debug(`${className}.${name} Direct Function vs. Property`)
1007
- b.data.hasUnresolvedConflict = true
1008
- }
1009
-
1010
- // Function vs. Signal
1011
- else if (this.tsElementIsSignal(b.data)) {
1012
- this.log.debug(`${className}.${name} Direct Function vs. Signal`)
1013
- // Do nothing
1014
- }
1015
- }
1016
-
1017
- // If base element is a property / variable
1018
- else if (this.tsElementIsPropertyOrVariable(base.data)) {
1019
- const baseProp = base.data as TsProperty
1020
-
1021
- // Property vs. Property
1022
- if (this.tsElementIsPropertyOrVariable(b.data)) {
1023
- const bProp = b.data as TsProperty
1024
- this.log.debug(
1025
- `${className}.${name} Direct Property vs. Property`,
1026
- baseProp.type[0].type,
1027
- bProp.type[0].type,
1028
- )
1029
- switch (name) {
1030
- case 'parent':
1031
- case 'window':
1032
- case 'parent_instance':
1033
- this.mergeProperties('&', baseProp, baseProp, bProp)
1034
- break
1035
-
1036
- default:
1037
- // Set property type to any
1038
- baseProp.type = [this.girFactory.newTsType({ ...bProp.type, type: 'any' })]
1039
- break
1040
- }
1041
- }
1042
-
1043
- // Property vs. Function
1044
- else if (this.tsElementIsMethodOrFunction(b.data)) {
1045
- this.log.debug(`${className}.${name} Direct Property vs. Function`)
1046
- baseProp.hasUnresolvedConflict = true
1047
- }
1048
-
1049
- // Property vs. Signal
1050
- else if (this.tsElementIsSignal(b.data)) {
1051
- this.log.debug(`${className}.${name} Direct Property vs. Signal`)
1052
- baseProp.hasUnresolvedConflict = true
1053
- }
1054
- }
1055
-
1056
- // If base element is a signal method
1057
- else if (this.tsElementIsSignal(base.data)) {
1058
- // Signal vs. Property
1059
- if (this.tsElementIsPropertyOrVariable(b.data)) {
1060
- this.log.debug(`${className}.${name} Direct Signal vs. Property`)
1061
- b.data.hasUnresolvedConflict = true
1062
- }
1063
-
1064
- // Signal vs. Function
1065
- if (this.tsElementIsMethodOrFunction(b.data)) {
1066
- this.log.debug(`${className}.${name} Direct Signal vs. Function`)
1067
- const bFunc = b.data as TsFunction
1068
- const baseSignal = base.data as TsFunction
1069
- // Add parent class incompatible method as overload
1070
- if (!this.getCompatibleTsFunction(baseSignal.overloads, bFunc)) {
1071
- baseSignal.overloads.push(bFunc)
1072
- }
1073
- }
1074
- }
1075
- // If a element is a constructor
1076
- else if (this.tsElementIsConstructor(base.data)) {
1077
- const baseConstr = base.data as TsFunction
1078
-
1079
- // Constructor vs. Function
1080
- if (this.tsElementIsMethodOrFunction(b.data)) {
1081
- const bFunc = b.data as TsFunction
1082
- this.log.debug(
1083
- `${className}.${name} Direct Constructor vs. Function`,
1084
- baseConstr.inParams.map((p) => p._tsData?.name).join(', '),
1085
- bFunc.inParams.map((p) => p._tsData?.name).join(', '),
1086
- )
1087
-
1088
- // Add a function to overload methods if there is not already a compatible version
1089
- if (!this.getCompatibleTsFunction(baseConstr.overloads, bFunc)) {
1090
- baseConstr.overloads.push(bFunc)
1091
- }
1092
- }
1093
-
1094
- // Constructor vs. Constructor
1095
- else if (this.tsElementIsConstructor(base.data)) {
1096
- const bConstr = b.data as TsFunction
1097
- this.log.debug(`${className}.${name} Direct Constructor vs. Constructor`, baseConstr, bConstr)
1098
-
1099
- // Add the constructor to overload methods if there is not already a compatible version
1100
- if (!this.getCompatibleTsFunction(baseConstr.overloads, bConstr)) {
1101
- baseConstr.overloads.push(bConstr)
1102
- }
1103
- }
1104
- } else {
1105
- this.log.warn(`{className}.${name} Unknown ${base.data.tsTypeName}`, base)
1106
- base.data.hasUnresolvedConflict = true
1107
- }
1108
- }
1109
- }
1110
- }
1111
-
1112
- /**
1113
- * Fix the conflicts of a class
1114
- * @param groupedElements
1115
- */
1116
- public fixConflicts(groupedElements: ConflictGroupedElements) {
1117
- for (const key of Object.keys(groupedElements)) {
1118
- const elements = groupedElements[key]
1119
- // Remove the key prefix `_`
1120
- const name = key.substring(1)
1121
-
1122
- if (elements.baseElements.length === 0) {
1123
- this.fixIndirectConflicts(name, elements.inheritedElements, elements.baseClass)
1124
- }
1125
- this.fixInternalConflicts(name, elements.baseElements, elements.baseClass)
1126
-
1127
- this.fixDirectConflicts(name, elements)
1128
- }
1129
- }
1130
-
1131
- /**
1132
- * Group conflicts by name and sort them by depth for simpler handling of conflicts
1133
- */
1134
- public groupConflicts(elements: ConflictChildElement[], tsClass: TsClass) {
1135
- const groupedConflicts: ConflictGroupedElements = {}
1136
-
1137
- const IGNORE_CONFLICT_NAMES = ['$gtype', '__gtype__']
1138
-
1139
- for (const a of elements) {
1140
- const name = a.data.name
1141
- for (const b of elements) {
1142
- if (
1143
- a === b ||
1144
- !name ||
1145
- !b.data.name ||
1146
- IGNORE_CONFLICT_NAMES.includes(name) ||
1147
- IGNORE_CONFLICT_NAMES.includes(b.data.name)
1148
- ) {
1149
- continue
1150
- }
1151
- if (a && name && b && b.data.name && a !== b && this.hasConflict(a, b)) {
1152
- const key = `_${name}` // if the key would be `toString` this would be always true so we prefix `_`
1153
- groupedConflicts[key] ||= {
1154
- baseElements: [],
1155
- inheritedElements: [],
1156
- baseClass: tsClass,
1157
- }
1158
- const groupedConflict = groupedConflicts[key]
1159
- const isBaseElement = a.depth === 0
1160
- if (isBaseElement) {
1161
- if (!groupedConflict.baseElements.find((c) => isEqual(c.data, a.data))) {
1162
- groupedConflict.baseElements.push(a)
1163
- }
1164
- } else {
1165
- if (
1166
- !groupedConflict.baseElements.find((c) => isEqual(c.data, a.data)) &&
1167
- !groupedConflict.inheritedElements.find((c) => isEqual(c.data, a.data))
1168
- ) {
1169
- groupedConflict.inheritedElements.push(a)
1170
- }
1171
- }
1172
- }
1173
- }
1174
- }
1175
-
1176
- // Sort by depth
1177
- for (const key of Object.keys(groupedConflicts)) {
1178
- groupedConflicts[key].inheritedElements = groupedConflicts[key].inheritedElements.sort(
1179
- (a, b) => a.depth - b.depth,
1180
- )
1181
- }
1182
-
1183
- return groupedConflicts
1184
- }
1185
-
1186
- /**
1187
- * With multiple implementations or a inherit it can happen that the interfaces / parent have the same method and/or property name with incompatible types.
1188
- * We merge these types here to solve this problem.
1189
- * @param girClass
1190
- */
1191
- public repairClass(girClass: GirClassElement | GirUnionElement | GirInterfaceElement | GirRecordElement) {
1192
- if (!girClass._tsData) throw new Error(NO_TSDATA('repairClass'))
1193
-
1194
- const classElements = this.getClassElements(girClass._tsData, 0, [])
1195
-
1196
- // Do not pass a reference of the array here
1197
- const elements = [
1198
- ...classElements.signalMethods,
1199
- ...classElements.propertySignalMethods,
1200
- ...classElements.methods,
1201
- ...classElements.virtualMethods,
1202
- ...classElements.staticFunctions,
1203
- ...classElements.constructors,
1204
- ...classElements.properties,
1205
- ...classElements.fields,
1206
- ]
1207
-
1208
- const groupedElementConflicts = this.groupConflicts(elements, girClass._tsData)
1209
- const groupedConstructPropConflicts = this.groupConflicts(classElements.constructProps, girClass._tsData)
1210
-
1211
- this.fixConflicts(groupedElementConflicts)
1212
- this.fixConflicts(groupedConstructPropConflicts)
1213
-
1214
- return girClass
1215
- }
1216
-
1217
- /**
1218
- * Returns true if `p1s` and `p2s` conflicting with each other.
1219
- * The parameters must have the same length and the same type but can have different names
1220
- * @param params
1221
- * @returns
1222
- */
1223
- public paramsHasConflict(...params: GirCallableParamElement[][]) {
1224
- let conflict = false
1225
- for (const p1s of params) {
1226
- for (const p2s of params) {
1227
- if (p1s.length !== p2s.length) {
1228
- conflict = true
1229
- return conflict
1230
- }
1231
-
1232
- for (const [i, p1] of p1s.entries()) {
1233
- const p2 = p2s[i]
1234
- if (p2._tsData && p1._tsData) {
1235
- if (this.typesHasConflict(p2._tsData?.type, p1._tsData?.type)) {
1236
- conflict = true
1237
- return conflict
1238
- }
1239
- } else {
1240
- conflict = true
1241
- return conflict
1242
- }
1243
- }
1244
- }
1245
- }
1246
-
1247
- return conflict
1248
- }
1249
-
1250
- public typesHasConflict(a: TsType[], b: TsType[]) {
1251
- if (a.length !== b.length) {
1252
- return true
1253
- }
1254
- // return !isEqual(a, b.data)
1255
- for (let i = 0; i < a.length; i++) {
1256
- const aType = a[i]
1257
- const bType = b[i]
1258
- if (
1259
- aType.type !== bType.type ||
1260
- aType.nullable !== bType.nullable ||
1261
- aType.optional !== bType.optional ||
1262
- aType.isFunction !== bType.isFunction ||
1263
- aType.isCallback !== bType.isCallback ||
1264
- aType.isArray !== bType.isArray ||
1265
- aType.callbacks.length !== bType.callbacks.length ||
1266
- aType.generics.length !== bType.generics.length ||
1267
- !isEqual(aType.callbacks, bType.callbacks) ||
1268
- !isEqual(aType.generics, bType.generics) ||
1269
- !isEqual(aType, bType) // TODO
1270
- ) {
1271
- return true
1272
- }
1273
- }
1274
-
1275
- return false
1276
- }
1277
-
1278
- /**
1279
- * Returns `true` if the function / method types of `a` and `b` are not compatible with each other.
1280
- * The parameters must have the same length and the same type but can have different names
1281
- * @param a
1282
- * @param b
1283
- * @returns
1284
- */
1285
- public functionHasConflict(a: TsFunction, b: TsFunction) {
1286
- // TODO find a better solution for that, not all this methods are conflicting
1287
- if (a.isVirtual !== b.isVirtual) {
1288
- return true
1289
- }
1290
-
1291
- if (this.typesHasConflict(a.returnTypes, b.returnTypes)) {
1292
- return true
1293
- }
1294
-
1295
- if (this.paramsHasConflict(a.inParams, b.inParams)) {
1296
- return true
1297
- }
1298
-
1299
- if (this.paramsHasConflict(a.outParams, b.outParams)) {
1300
- return true
1301
- }
1302
-
1303
- return false
1304
- }
1305
-
1306
- /**
1307
- * Returns `true` if the property types of `a` and `b` are not compatible with each other.
1308
- * @param a
1309
- * @param b
1310
- * @returns
1311
- */
1312
- public propertyHasConflict(a: TsVar & TsProperty, b: TsVar & TsProperty) {
1313
- if (!!a.isStatic !== !!b.isStatic) return false
1314
- if (a.name !== b.name) return false
1315
-
1316
- if (!!a.readonly !== !!b.readonly || this.typesHasConflict(a.type, b.type)) return true
1317
-
1318
- return false
1319
- }
1320
-
1321
- public signalHasConflict(a: TsSignal, b: TsSignal) {
1322
- if (!!a.isStatic !== !!b.isStatic) return false
1323
- if (a.name !== b.name) return false
1324
-
1325
- // TODO
1326
- return false
1327
- }
1328
-
1329
- /**
1330
- * Returns true if the elements (properties or methods) of `a` and `b` are not compatible with each other (has no conflict).
1331
- * @param a
1332
- * @param b
1333
- * @returns
1334
- */
1335
- public elementHasConflict(
1336
- a: TsFunction | TsVar | TsProperty | TsSignal,
1337
- b: TsFunction | TsVar | TsProperty | TsSignal,
1338
- ) {
1339
- if (a.name !== b.name) {
1340
- return false
1341
- } else if (this.tsElementIsStatic(a) !== this.tsElementIsStatic(b)) {
1342
- return false
1343
- } else if (this.tsElementIsMethodOrFunction(a) && this.tsElementIsMethodOrFunction(b)) {
1344
- return this.functionHasConflict(a as TsFunction, b as TsFunction)
1345
- } else if (this.tsElementIsPropertyOrVariable(a) && this.tsElementIsPropertyOrVariable(b)) {
1346
- return this.propertyHasConflict(a as TsVar & TsProperty, b as TsVar & TsProperty)
1347
- } else if (this.tsElementIsConstructor(a) && this.tsElementIsConstructor(b)) {
1348
- return this.functionHasConflict(a as TsFunction, b as TsFunction)
1349
- } else if (this.tsElementIsSignal(a) && this.tsElementIsSignal(b)) {
1350
- // TODO
1351
- return this.signalHasConflict(a as TsSignal, b as TsSignal)
1352
- } else if (a.tsTypeName !== b.tsTypeName) {
1353
- return true
1354
- } else {
1355
- return true
1356
- }
1357
- }
1358
- }