@ts-for-gir/lib 3.3.0 → 4.0.0-beta.10

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