@xpack/doxygen2docusaurus 1.0.2

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 (273) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/bin/doxygen2docusaurus.js +45 -0
  4. package/dist/cli/main.d.ts +10 -0
  5. package/dist/cli/main.d.ts.map +1 -0
  6. package/dist/cli/main.js +66 -0
  7. package/dist/cli/main.js.map +1 -0
  8. package/dist/docusaurus/cli-options.d.ts +98 -0
  9. package/dist/docusaurus/cli-options.d.ts.map +1 -0
  10. package/dist/docusaurus/cli-options.js +212 -0
  11. package/dist/docusaurus/cli-options.js.map +1 -0
  12. package/dist/docusaurus/generator.d.ts +22 -0
  13. package/dist/docusaurus/generator.d.ts.map +1 -0
  14. package/dist/docusaurus/generator.js +461 -0
  15. package/dist/docusaurus/generator.js.map +1 -0
  16. package/dist/docusaurus/renderers/descriptiontype.d.ts +63 -0
  17. package/dist/docusaurus/renderers/descriptiontype.d.ts.map +1 -0
  18. package/dist/docusaurus/renderers/descriptiontype.js +674 -0
  19. package/dist/docusaurus/renderers/descriptiontype.js.map +1 -0
  20. package/dist/docusaurus/renderers/docinternalstype.d.ts +21 -0
  21. package/dist/docusaurus/renderers/docinternalstype.d.ts.map +1 -0
  22. package/dist/docusaurus/renderers/docinternalstype.js +159 -0
  23. package/dist/docusaurus/renderers/docinternalstype.js.map +1 -0
  24. package/dist/docusaurus/renderers/doclisttype.d.ts +6 -0
  25. package/dist/docusaurus/renderers/doclisttype.d.ts.map +1 -0
  26. package/dist/docusaurus/renderers/doclisttype.js +86 -0
  27. package/dist/docusaurus/renderers/doclisttype.js.map +1 -0
  28. package/dist/docusaurus/renderers/doctabletype.d.ts +15 -0
  29. package/dist/docusaurus/renderers/doctabletype.d.ts.map +1 -0
  30. package/dist/docusaurus/renderers/doctabletype.js +98 -0
  31. package/dist/docusaurus/renderers/doctabletype.js.map +1 -0
  32. package/dist/docusaurus/renderers/doctitletype.d.ts +6 -0
  33. package/dist/docusaurus/renderers/doctitletype.d.ts.map +1 -0
  34. package/dist/docusaurus/renderers/doctitletype.js +38 -0
  35. package/dist/docusaurus/renderers/doctitletype.js.map +1 -0
  36. package/dist/docusaurus/renderers/docvariablelisttype.d.ts +9 -0
  37. package/dist/docusaurus/renderers/docvariablelisttype.d.ts.map +1 -0
  38. package/dist/docusaurus/renderers/docvariablelisttype.js +57 -0
  39. package/dist/docusaurus/renderers/docvariablelisttype.js.map +1 -0
  40. package/dist/docusaurus/renderers/docxrefsecttype.d.ts +6 -0
  41. package/dist/docusaurus/renderers/docxrefsecttype.d.ts.map +1 -0
  42. package/dist/docusaurus/renderers/docxrefsecttype.js +44 -0
  43. package/dist/docusaurus/renderers/docxrefsecttype.js.map +1 -0
  44. package/dist/docusaurus/renderers/element-renderer-base.d.ts +12 -0
  45. package/dist/docusaurus/renderers/element-renderer-base.d.ts.map +1 -0
  46. package/dist/docusaurus/renderers/element-renderer-base.js +25 -0
  47. package/dist/docusaurus/renderers/element-renderer-base.js.map +1 -0
  48. package/dist/docusaurus/renderers/inctype.d.ts +6 -0
  49. package/dist/docusaurus/renderers/inctype.d.ts.map +1 -0
  50. package/dist/docusaurus/renderers/inctype.js +42 -0
  51. package/dist/docusaurus/renderers/inctype.js.map +1 -0
  52. package/dist/docusaurus/renderers/linkedtexttype.d.ts +6 -0
  53. package/dist/docusaurus/renderers/linkedtexttype.d.ts.map +1 -0
  54. package/dist/docusaurus/renderers/linkedtexttype.js +32 -0
  55. package/dist/docusaurus/renderers/linkedtexttype.js.map +1 -0
  56. package/dist/docusaurus/renderers/listingtype.d.ts +10 -0
  57. package/dist/docusaurus/renderers/listingtype.d.ts.map +1 -0
  58. package/dist/docusaurus/renderers/listingtype.js +121 -0
  59. package/dist/docusaurus/renderers/listingtype.js.map +1 -0
  60. package/dist/docusaurus/renderers/paramtype.d.ts +6 -0
  61. package/dist/docusaurus/renderers/paramtype.d.ts.map +1 -0
  62. package/dist/docusaurus/renderers/paramtype.js +63 -0
  63. package/dist/docusaurus/renderers/paramtype.js.map +1 -0
  64. package/dist/docusaurus/renderers/referencetype.d.ts +6 -0
  65. package/dist/docusaurus/renderers/referencetype.d.ts.map +1 -0
  66. package/dist/docusaurus/renderers/referencetype.js +42 -0
  67. package/dist/docusaurus/renderers/referencetype.js.map +1 -0
  68. package/dist/docusaurus/renderers/reftexttype.d.ts +6 -0
  69. package/dist/docusaurus/renderers/reftexttype.d.ts.map +1 -0
  70. package/dist/docusaurus/renderers/reftexttype.js +41 -0
  71. package/dist/docusaurus/renderers/reftexttype.js.map +1 -0
  72. package/dist/docusaurus/renderers/reftype.d.ts +6 -0
  73. package/dist/docusaurus/renderers/reftype.d.ts.map +1 -0
  74. package/dist/docusaurus/renderers/reftype.js +38 -0
  75. package/dist/docusaurus/renderers/reftype.js.map +1 -0
  76. package/dist/docusaurus/renderers/renderers.d.ts +33 -0
  77. package/dist/docusaurus/renderers/renderers.d.ts.map +1 -0
  78. package/dist/docusaurus/renderers/renderers.js +303 -0
  79. package/dist/docusaurus/renderers/renderers.js.map +1 -0
  80. package/dist/docusaurus/renderers/substringtype.d.ts +6 -0
  81. package/dist/docusaurus/renderers/substringtype.d.ts.map +1 -0
  82. package/dist/docusaurus/renderers/substringtype.js +24 -0
  83. package/dist/docusaurus/renderers/substringtype.js.map +1 -0
  84. package/dist/docusaurus/renderers/tableofcontentstype.d.ts +6 -0
  85. package/dist/docusaurus/renderers/tableofcontentstype.d.ts.map +1 -0
  86. package/dist/docusaurus/renderers/tableofcontentstype.js +41 -0
  87. package/dist/docusaurus/renderers/tableofcontentstype.js.map +1 -0
  88. package/dist/docusaurus/types.d.ts +53 -0
  89. package/dist/docusaurus/types.d.ts.map +1 -0
  90. package/dist/docusaurus/types.js +13 -0
  91. package/dist/docusaurus/types.js.map +1 -0
  92. package/dist/docusaurus/utils.d.ts +16 -0
  93. package/dist/docusaurus/utils.d.ts.map +1 -0
  94. package/dist/docusaurus/utils.js +169 -0
  95. package/dist/docusaurus/utils.js.map +1 -0
  96. package/dist/docusaurus/view-model/classes-vm.d.ts +35 -0
  97. package/dist/docusaurus/view-model/classes-vm.d.ts.map +1 -0
  98. package/dist/docusaurus/view-model/classes-vm.js +707 -0
  99. package/dist/docusaurus/view-model/classes-vm.js.map +1 -0
  100. package/dist/docusaurus/view-model/collection-base.d.ts +28 -0
  101. package/dist/docusaurus/view-model/collection-base.d.ts.map +1 -0
  102. package/dist/docusaurus/view-model/collection-base.js +155 -0
  103. package/dist/docusaurus/view-model/collection-base.js.map +1 -0
  104. package/dist/docusaurus/view-model/compound-base-vm.d.ts +112 -0
  105. package/dist/docusaurus/view-model/compound-base-vm.d.ts.map +1 -0
  106. package/dist/docusaurus/view-model/compound-base-vm.js +829 -0
  107. package/dist/docusaurus/view-model/compound-base-vm.js.map +1 -0
  108. package/dist/docusaurus/view-model/description-anchors.d.ts +17 -0
  109. package/dist/docusaurus/view-model/description-anchors.d.ts.map +1 -0
  110. package/dist/docusaurus/view-model/description-anchors.js +37 -0
  111. package/dist/docusaurus/view-model/description-anchors.js.map +1 -0
  112. package/dist/docusaurus/view-model/files-and-folders-vm.d.ts +45 -0
  113. package/dist/docusaurus/view-model/files-and-folders-vm.d.ts.map +1 -0
  114. package/dist/docusaurus/view-model/files-and-folders-vm.js +749 -0
  115. package/dist/docusaurus/view-model/files-and-folders-vm.js.map +1 -0
  116. package/dist/docusaurus/view-model/groups-vm.d.ts +20 -0
  117. package/dist/docusaurus/view-model/groups-vm.d.ts.map +1 -0
  118. package/dist/docusaurus/view-model/groups-vm.js +297 -0
  119. package/dist/docusaurus/view-model/groups-vm.js.map +1 -0
  120. package/dist/docusaurus/view-model/members-vm.d.ts +81 -0
  121. package/dist/docusaurus/view-model/members-vm.d.ts.map +1 -0
  122. package/dist/docusaurus/view-model/members-vm.js +1017 -0
  123. package/dist/docusaurus/view-model/members-vm.js.map +1 -0
  124. package/dist/docusaurus/view-model/namespaces-vm.d.ts +24 -0
  125. package/dist/docusaurus/view-model/namespaces-vm.d.ts.map +1 -0
  126. package/dist/docusaurus/view-model/namespaces-vm.js +527 -0
  127. package/dist/docusaurus/view-model/namespaces-vm.js.map +1 -0
  128. package/dist/docusaurus/view-model/options.d.ts +8 -0
  129. package/dist/docusaurus/view-model/options.d.ts.map +1 -0
  130. package/dist/docusaurus/view-model/options.js +42 -0
  131. package/dist/docusaurus/view-model/options.js.map +1 -0
  132. package/dist/docusaurus/view-model/pages-vm.d.ts +18 -0
  133. package/dist/docusaurus/view-model/pages-vm.d.ts.map +1 -0
  134. package/dist/docusaurus/view-model/pages-vm.js +160 -0
  135. package/dist/docusaurus/view-model/pages-vm.js.map +1 -0
  136. package/dist/docusaurus/view-model/tree-entries-vm.d.ts +44 -0
  137. package/dist/docusaurus/view-model/tree-entries-vm.d.ts.map +1 -0
  138. package/dist/docusaurus/view-model/tree-entries-vm.js +139 -0
  139. package/dist/docusaurus/view-model/tree-entries-vm.js.map +1 -0
  140. package/dist/docusaurus/view-model/view-model.d.ts +34 -0
  141. package/dist/docusaurus/view-model/view-model.d.ts.map +1 -0
  142. package/dist/docusaurus/view-model/view-model.js +284 -0
  143. package/dist/docusaurus/view-model/view-model.js.map +1 -0
  144. package/dist/docusaurus/workspace.d.ts +65 -0
  145. package/dist/docusaurus/workspace.d.ts.map +1 -0
  146. package/dist/docusaurus/workspace.js +350 -0
  147. package/dist/docusaurus/workspace.js.map +1 -0
  148. package/dist/doxygen/data-model/compounds/compounddef-dm.d.ts +97 -0
  149. package/dist/doxygen/data-model/compounds/compounddef-dm.d.ts.map +1 -0
  150. package/dist/doxygen/data-model/compounds/compounddef-dm.js +498 -0
  151. package/dist/doxygen/data-model/compounds/compounddef-dm.js.map +1 -0
  152. package/dist/doxygen/data-model/compounds/compoundreftype-dm.d.ts +27 -0
  153. package/dist/doxygen/data-model/compounds/compoundreftype-dm.d.ts.map +1 -0
  154. package/dist/doxygen/data-model/compounds/compoundreftype-dm.js +91 -0
  155. package/dist/doxygen/data-model/compounds/compoundreftype-dm.js.map +1 -0
  156. package/dist/doxygen/data-model/compounds/descriptiontype-dm.d.ts +1214 -0
  157. package/dist/doxygen/data-model/compounds/descriptiontype-dm.d.ts.map +1 -0
  158. package/dist/doxygen/data-model/compounds/descriptiontype-dm.js +5995 -0
  159. package/dist/doxygen/data-model/compounds/descriptiontype-dm.js.map +1 -0
  160. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.d.ts +22 -0
  161. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.d.ts.map +1 -0
  162. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.js +136 -0
  163. package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.js.map +1 -0
  164. package/dist/doxygen/data-model/compounds/doxygentype-dm.d.ts +14 -0
  165. package/dist/doxygen/data-model/compounds/doxygentype-dm.d.ts.map +1 -0
  166. package/dist/doxygen/data-model/compounds/doxygentype-dm.js +87 -0
  167. package/dist/doxygen/data-model/compounds/doxygentype-dm.js.map +1 -0
  168. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.d.ts +23 -0
  169. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.d.ts.map +1 -0
  170. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.js +104 -0
  171. package/dist/doxygen/data-model/compounds/enumvaluetype-dm.js.map +1 -0
  172. package/dist/doxygen/data-model/compounds/inctype-dm.d.ts +24 -0
  173. package/dist/doxygen/data-model/compounds/inctype-dm.d.ts.map +1 -0
  174. package/dist/doxygen/data-model/compounds/inctype-dm.js +84 -0
  175. package/dist/doxygen/data-model/compounds/inctype-dm.js.map +1 -0
  176. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.d.ts +33 -0
  177. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.d.ts.map +1 -0
  178. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.js +102 -0
  179. package/dist/doxygen/data-model/compounds/linkedtexttype-dm.js.map +1 -0
  180. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.d.ts +17 -0
  181. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.d.ts.map +1 -0
  182. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.js +69 -0
  183. package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.js.map +1 -0
  184. package/dist/doxygen/data-model/compounds/locationtype-dm.d.ts +24 -0
  185. package/dist/doxygen/data-model/compounds/locationtype-dm.d.ts.map +1 -0
  186. package/dist/doxygen/data-model/compounds/locationtype-dm.js +109 -0
  187. package/dist/doxygen/data-model/compounds/locationtype-dm.js.map +1 -0
  188. package/dist/doxygen/data-model/compounds/memberdeftype-dm.d.ts +67 -0
  189. package/dist/doxygen/data-model/compounds/memberdeftype-dm.d.ts.map +1 -0
  190. package/dist/doxygen/data-model/compounds/memberdeftype-dm.js +253 -0
  191. package/dist/doxygen/data-model/compounds/memberdeftype-dm.js.map +1 -0
  192. package/dist/doxygen/data-model/compounds/memberreftype-dm.d.ts +21 -0
  193. package/dist/doxygen/data-model/compounds/memberreftype-dm.d.ts.map +1 -0
  194. package/dist/doxygen/data-model/compounds/memberreftype-dm.js +105 -0
  195. package/dist/doxygen/data-model/compounds/memberreftype-dm.js.map +1 -0
  196. package/dist/doxygen/data-model/compounds/membertype-dm.d.ts +17 -0
  197. package/dist/doxygen/data-model/compounds/membertype-dm.d.ts.map +1 -0
  198. package/dist/doxygen/data-model/compounds/membertype-dm.js +87 -0
  199. package/dist/doxygen/data-model/compounds/membertype-dm.js.map +1 -0
  200. package/dist/doxygen/data-model/compounds/paramtype-dm.d.ts +25 -0
  201. package/dist/doxygen/data-model/compounds/paramtype-dm.d.ts.map +1 -0
  202. package/dist/doxygen/data-model/compounds/paramtype-dm.js +115 -0
  203. package/dist/doxygen/data-model/compounds/paramtype-dm.js.map +1 -0
  204. package/dist/doxygen/data-model/compounds/referencetype-dm.d.ts +26 -0
  205. package/dist/doxygen/data-model/compounds/referencetype-dm.d.ts.map +1 -0
  206. package/dist/doxygen/data-model/compounds/referencetype-dm.js +93 -0
  207. package/dist/doxygen/data-model/compounds/referencetype-dm.js.map +1 -0
  208. package/dist/doxygen/data-model/compounds/reftexttype-dm.d.ts +15 -0
  209. package/dist/doxygen/data-model/compounds/reftexttype-dm.d.ts.map +1 -0
  210. package/dist/doxygen/data-model/compounds/reftexttype-dm.js +80 -0
  211. package/dist/doxygen/data-model/compounds/reftexttype-dm.js.map +1 -0
  212. package/dist/doxygen/data-model/compounds/reftype-dm.d.ts +55 -0
  213. package/dist/doxygen/data-model/compounds/reftype-dm.d.ts.map +1 -0
  214. package/dist/doxygen/data-model/compounds/reftype-dm.js +152 -0
  215. package/dist/doxygen/data-model/compounds/reftype-dm.js.map +1 -0
  216. package/dist/doxygen/data-model/compounds/reimplementtype-dm.d.ts +20 -0
  217. package/dist/doxygen/data-model/compounds/reimplementtype-dm.d.ts.map +1 -0
  218. package/dist/doxygen/data-model/compounds/reimplementtype-dm.js +77 -0
  219. package/dist/doxygen/data-model/compounds/reimplementtype-dm.js.map +1 -0
  220. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.d.ts +34 -0
  221. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.d.ts.map +1 -0
  222. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.js +139 -0
  223. package/dist/doxygen/data-model/compounds/sectiondeftype-dm.js.map +1 -0
  224. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.d.ts +46 -0
  225. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.d.ts.map +1 -0
  226. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.js +235 -0
  227. package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.js.map +1 -0
  228. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.d.ts +17 -0
  229. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.d.ts.map +1 -0
  230. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.js +69 -0
  231. package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.js.map +1 -0
  232. package/dist/doxygen/data-model/data-model.d.ts +91 -0
  233. package/dist/doxygen/data-model/data-model.d.ts.map +1 -0
  234. package/dist/doxygen/data-model/data-model.js +245 -0
  235. package/dist/doxygen/data-model/data-model.js.map +1 -0
  236. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.d.ts +21 -0
  237. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.d.ts.map +1 -0
  238. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.js +95 -0
  239. package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.js.map +1 -0
  240. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.d.ts +20 -0
  241. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.d.ts.map +1 -0
  242. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.js +92 -0
  243. package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.js.map +1 -0
  244. package/dist/doxygen/data-model/doxygen-xml-parser.d.ts +261 -0
  245. package/dist/doxygen/data-model/doxygen-xml-parser.d.ts.map +1 -0
  246. package/dist/doxygen/data-model/doxygen-xml-parser.js +459 -0
  247. package/dist/doxygen/data-model/doxygen-xml-parser.js.map +1 -0
  248. package/dist/doxygen/data-model/index/indexcompoundtype-dm.d.ts +21 -0
  249. package/dist/doxygen/data-model/index/indexcompoundtype-dm.d.ts.map +1 -0
  250. package/dist/doxygen/data-model/index/indexcompoundtype-dm.js +96 -0
  251. package/dist/doxygen/data-model/index/indexcompoundtype-dm.js.map +1 -0
  252. package/dist/doxygen/data-model/index/indexdoxygentype-dm.d.ts +20 -0
  253. package/dist/doxygen/data-model/index/indexdoxygentype-dm.d.ts.map +1 -0
  254. package/dist/doxygen/data-model/index/indexdoxygentype-dm.js +93 -0
  255. package/dist/doxygen/data-model/index/indexdoxygentype-dm.js.map +1 -0
  256. package/dist/doxygen/data-model/index/indexmembertype-dm.d.ts +19 -0
  257. package/dist/doxygen/data-model/index/indexmembertype-dm.d.ts.map +1 -0
  258. package/dist/doxygen/data-model/index/indexmembertype-dm.js +89 -0
  259. package/dist/doxygen/data-model/index/indexmembertype-dm.js.map +1 -0
  260. package/dist/doxygen/data-model/types.d.ts +44 -0
  261. package/dist/doxygen/data-model/types.d.ts.map +1 -0
  262. package/dist/doxygen/data-model/types.js +24 -0
  263. package/dist/doxygen/data-model/types.js.map +1 -0
  264. package/dist/index.d.ts +43 -0
  265. package/dist/index.d.ts.map +1 -0
  266. package/dist/index.js +69 -0
  267. package/dist/index.js.map +1 -0
  268. package/dist/tsconfig.tsbuildinfo +1 -0
  269. package/package.json +99 -0
  270. package/template/css/custom.css +908 -0
  271. package/template/img/README.md +3 -0
  272. package/template/img/document-svgrepo-com.svg +5 -0
  273. package/template/img/folder-svgrepo-com.svg +5 -0
@@ -0,0 +1,459 @@
1
+ /*
2
+ * This file is part of the xPack project (http://xpack.github.io).
3
+ * Copyright (c) 2025 Liviu Ionescu. All rights reserved.
4
+ *
5
+ * Permission to use, copy, modify, and/or distribute this software
6
+ * for any purpose is hereby granted, under the terms of the MIT license.
7
+ *
8
+ * If a copy of the license was not distributed with this file, it can
9
+ * be obtained from https://opensource.org/licenses/MIT.
10
+ */
11
+ // ----------------------------------------------------------------------------
12
+ /**
13
+ * @file doxygen-xml-parser.ts
14
+ * @brief Provides the DoxygenXmlParser class for parsing Doxygen-generated
15
+ * XML files.
16
+ *
17
+ * This module defines the {@link DoxygenXmlParser} class, which is responsible
18
+ * for parsing XML output produced by Doxygen and constructing the internal
19
+ * data model used by doxygen2docusaurus. It supports parsing the main index,
20
+ * compound files, and configuration files, and provides utility methods for
21
+ * extracting attributes and inner elements from the XML structure.
22
+ *
23
+ * The parser is designed to preserve the original XML content and element
24
+ * order, ensuring accurate conversion to the documentation model. It is
25
+ * intended for use within the xPack doxygen2docusaurus CLI tool.
26
+ */
27
+ import assert from 'node:assert';
28
+ import * as util from 'node:util';
29
+ import { XMLParser } from 'fast-xml-parser';
30
+ // ----------------------------------------------------------------------------
31
+ /**
32
+ * The DoxygenXmlParser class is responsible for parsing
33
+ * Doxygen-generated XML files and constructing the internal data model.
34
+ *
35
+ * @remarks
36
+ * This class initialises the XML parser with options that preserve the order
37
+ * and structure of the original XML content, ensuring accurate conversion
38
+ * for documentation purposes. It maintains a counter for the number of files
39
+ * parsed and stores the resulting data model.
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * const parser = new DoxygenXmlParser({ options });
44
+ * const dataModel = await parser.parse();
45
+ * ```
46
+ *
47
+ * @public
48
+ */
49
+ export class DoxygenXmlParser {
50
+ /**
51
+ * The global configuration options.
52
+ */
53
+ options;
54
+ /**
55
+ * The XML parser instance configured for Doxygen XML.
56
+ */
57
+ xmlParser;
58
+ images = [];
59
+ /**
60
+ * Constructs a new instance of the DoxygenXmlParser class.
61
+ *
62
+ * @param options - The global configuration options
63
+ *
64
+ * @remarks
65
+ * This constructor initialises the XML parser with settings that preserve the
66
+ * order and structure of the original XML content, remove namespace prefixes,
67
+ * and ensure that both tag and attribute values are parsed. The values are
68
+ * not
69
+ * trimmed, maintaining fidelity to the source XML. The provided options are
70
+ * stored for use throughout the parsing process.
71
+ */
72
+ constructor(options) {
73
+ this.options = options;
74
+ this.xmlParser = new XMLParser({
75
+ preserveOrder: true,
76
+ removeNSPrefix: true,
77
+ ignoreAttributes: false,
78
+ parseTagValue: true,
79
+ parseAttributeValue: true,
80
+ trimValues: false,
81
+ });
82
+ }
83
+ // --------------------------------------------------------------------------
84
+ /**
85
+ * Determines whether the specified XML element has any attributes.
86
+ *
87
+ * @param element - The XML element to inspect for attributes
88
+ * @returns True if the element has attributes; otherwise, false
89
+ *
90
+ * @remarks
91
+ * This method checks for the presence of the ':\@' property on the XML
92
+ * element, which is the convention used by the XML parser for storing
93
+ * attributes. If this property exists, the element has attributes; if not,
94
+ * the element has no attributes. This is a prerequisite check before calling
95
+ * {@link DoxygenXmlParser.getAttributesNames} or other attribute-related
96
+ * methods.
97
+ */
98
+ hasAttributes(element) {
99
+ return Object.hasOwn(element, ':@');
100
+ }
101
+ /**
102
+ * Retrieves the names of all attributes present on the specified XML element.
103
+ *
104
+ * @param element - The XML element to inspect for attribute names
105
+ * @returns An array of strings containing the names of all attributes
106
+ *
107
+ * @remarks
108
+ * This method accesses the ':\@' property of the XML element, which is the
109
+ * convention used by the XML parser for storing attributes, and returns the
110
+ * keys of this object as an array of attribute names. The method assumes the
111
+ * element has attributes and does not perform validation - use
112
+ * {@link DoxygenXmlParser.hasAttributes} to check for attribute presence
113
+ * first.
114
+ */
115
+ getAttributesNames(element) {
116
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
117
+ return Object.keys(element[':@']);
118
+ }
119
+ /**
120
+ * Determines whether the specified attribute exists on the given XML element.
121
+ *
122
+ * @param element - The XML element to inspect
123
+ * @param name - The name of the attribute to check for
124
+ * @returns True if the attribute exists; otherwise, false
125
+ *
126
+ * @remarks
127
+ * This method checks for the presence of an attribute within the ':\@'
128
+ * property of the XML element, which is the convention used by the XML
129
+ * parser for storing attributes. It returns true if the attribute is found,
130
+ * otherwise false.
131
+ */
132
+ hasAttribute(element, name) {
133
+ if (Object.hasOwn(element, ':@')) {
134
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
135
+ const elementWithAttributes = element;
136
+ return Object.hasOwn(elementWithAttributes[':@'], name);
137
+ }
138
+ else {
139
+ return false;
140
+ }
141
+ }
142
+ /**
143
+ * Retrieves the value of a named attribute as a string.
144
+ *
145
+ * @param element - The XML element containing the attribute
146
+ * @param name - The name of the attribute to retrieve
147
+ * @returns The attribute value as a string
148
+ * @throws If the attribute does not exist
149
+ *
150
+ * @remarks
151
+ * This method checks whether the specified attribute exists on the XML
152
+ * element and returns its value as a string. If the attribute value is
153
+ * originally a number (as the XML parser may return numeric strings as
154
+ * numbers), it is converted to a string to maintain consistency with the
155
+ * DTD specification. If the attribute is missing, an error is thrown to
156
+ * indicate the absence.
157
+ */
158
+ getAttributeStringValue(element, name) {
159
+ if (this.hasAttribute(element, name)) {
160
+ const elementWithNamedAttribute = element[':@'];
161
+ const attributeValue = elementWithNamedAttribute[name];
162
+ if (typeof attributeValue === 'string') {
163
+ return attributeValue;
164
+ }
165
+ else if (typeof attributeValue === 'number') {
166
+ // The xml parser returns attributes like `refid="21"` as numbers,
167
+ // but the DTD defines them as strings and the applications expects
168
+ // strings.
169
+ return String(attributeValue);
170
+ }
171
+ }
172
+ throw new Error(`Element ${util.inspect(element)} does not have the ${name} attribute`);
173
+ }
174
+ /**
175
+ * Retrieves the value of a named attribute as a number.
176
+ *
177
+ * @param element - The XML element containing the attribute
178
+ * @param name - The name of the attribute to retrieve
179
+ * @returns The attribute value as a number
180
+ * @throws If the attribute does not exist or is not a number
181
+ *
182
+ * @remarks
183
+ * This method checks whether the specified attribute exists on the XML
184
+ * element and returns its value as a number. If the attribute is missing
185
+ * or its value is not a number, an error is thrown to indicate the absence
186
+ * or incorrect type.
187
+ */
188
+ getAttributeNumberValue(element, name) {
189
+ if (this.hasAttribute(element, name)) {
190
+ const elementWithNamedAttribute = element[':@'];
191
+ const attributeValue = elementWithNamedAttribute[name];
192
+ if (typeof attributeValue === 'number') {
193
+ return attributeValue;
194
+ }
195
+ }
196
+ throw new Error(`Element ${util.inspect(element)} does not have the ${name} number ` +
197
+ 'attribute');
198
+ }
199
+ /**
200
+ * Retrieves the value of a named attribute as a boolean.
201
+ *
202
+ * @param element - The XML element containing the attribute
203
+ * @param name - The name of the attribute to retrieve
204
+ * @returns True if the attribute value is 'yes' (case-insensitive);
205
+ * otherwise, false
206
+ * @throws If the attribute does not exist or is not a string
207
+ *
208
+ * @remarks
209
+ * This method checks whether the specified attribute exists on the XML
210
+ * element, and returns true if its value is the string 'yes'
211
+ * (case-insensitive). If the attribute is missing or its value is not a
212
+ * string, an error is thrown.
213
+ */
214
+ getAttributeBooleanValue(element, name) {
215
+ if (this.hasAttribute(element, name)) {
216
+ const elementWithNamedAttribute = element[':@'];
217
+ const attributeValue = elementWithNamedAttribute[name];
218
+ if (typeof attributeValue === 'string') {
219
+ return attributeValue.toLowerCase() === 'yes';
220
+ }
221
+ }
222
+ throw new Error(`Element ${util.inspect(element)} does not have the ${name} ` +
223
+ 'boolean attribute');
224
+ }
225
+ /**
226
+ * Determines whether the specified inner element exists on the given XML
227
+ * element.
228
+ *
229
+ * @param element - The XML element to inspect
230
+ * @param name - The name of the inner element to check for
231
+ * @returns True if the inner element exists; otherwise, false
232
+ *
233
+ * @remarks
234
+ * This method checks for the presence of a named property on the XML element.
235
+ * For text nodes ('#text'), it verifies the value is a string, number, or
236
+ * boolean. For other elements, it confirms the property is an array, as
237
+ * per the XML parser's convention.
238
+ */
239
+ hasInnerElement(element, name) {
240
+ if (Object.hasOwn(element, name)) {
241
+ if (name === '#text') {
242
+ const value = element['#text'];
243
+ return (typeof value === 'string' ||
244
+ typeof value === 'number' ||
245
+ typeof value === 'boolean');
246
+ }
247
+ else {
248
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
249
+ return Array.isArray(element[name]);
250
+ }
251
+ }
252
+ else {
253
+ return false;
254
+ }
255
+ }
256
+ /**
257
+ * Determines whether a named inner element contains text.
258
+ *
259
+ * @param element - The XML element to inspect
260
+ * @param name - The name of the inner element
261
+ * @returns True if the inner element contains text or is empty;
262
+ * otherwise, false
263
+ *
264
+ * @remarks
265
+ * This method checks if the specified inner element exists and contains a
266
+ * single text node, or is an empty array (representing an empty string).
267
+ * It asserts the expected structure and type of the value for robustness.
268
+ */
269
+ isInnerElementText(element, name) {
270
+ if (Object.hasOwn(element, name)) {
271
+ const innerElements = element[name];
272
+ // console.log('isInnerElementText', util.inspect(element,
273
+ // { compact: false, depth: 999 })
274
+ // assert(innerElements !== undefined)
275
+ if (innerElements.length === 1) {
276
+ // assert(innerElements[0] !== undefined)
277
+ if (Object.hasOwn(innerElements[0], '#text')) {
278
+ const value = innerElements[0]['#text'];
279
+ assert(typeof value === 'string' ||
280
+ typeof value === 'number' ||
281
+ typeof value === 'boolean');
282
+ return true;
283
+ }
284
+ }
285
+ else if (innerElements.length === 0) {
286
+ // Empty string.
287
+ return true;
288
+ }
289
+ }
290
+ return false;
291
+ }
292
+ /**
293
+ * Determines whether the XML element contains a text node.
294
+ *
295
+ * @param element - The XML element to inspect
296
+ * @returns True if the element contains a text node; otherwise, false
297
+ *
298
+ * @remarks
299
+ * This method checks for the presence of a '#text' property on the XML
300
+ * element, and verifies that its value is a string, number, or boolean.
301
+ */
302
+ hasInnerText(element) {
303
+ if (Object.hasOwn(element, '#text')) {
304
+ const value = element['#text'];
305
+ return (typeof value === 'string' ||
306
+ typeof value === 'number' ||
307
+ typeof value === 'boolean');
308
+ }
309
+ else {
310
+ return false;
311
+ }
312
+ }
313
+ /**
314
+ * Retrieves an array of named child elements from the given XML element.
315
+ *
316
+ * @typeParam T - The expected type of the child elements array
317
+ * (defaults to XmlElement[])
318
+ * @param element - The XML element containing the child elements
319
+ * @param name - The name of the child elements to retrieve
320
+ * @returns The array of child elements
321
+ * @throws If the child elements do not exist
322
+ *
323
+ * @remarks
324
+ * This method accesses the specified property on the XML element and
325
+ * returns it as an array of child elements. If the property is undefined,
326
+ * an error is thrown indicating the absence of the expected child element.
327
+ */
328
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
329
+ getInnerElements(element, name) {
330
+ // assert(Object.hasOwn(element, name) === true &&
331
+ // Array.isArray((element as { [name]: T })[name]))
332
+ const innerElements = element[name];
333
+ if (innerElements !== undefined) {
334
+ return innerElements;
335
+ }
336
+ throw new Error(`Element ${util.inspect(element, { compact: false, depth: 999 })} ` +
337
+ `does not have the ${name} child element`);
338
+ }
339
+ /**
340
+ * Retrieves the text content of a named child element.
341
+ *
342
+ * @param element - The XML element containing the child element
343
+ * @param name - The name of the child element
344
+ * @returns The text content of the child element
345
+ * @throws If the child element does not exist or contains more than one
346
+ * element
347
+ *
348
+ * @remarks
349
+ * This method accesses the specified child element and returns its text
350
+ * content. If the child element is missing, an error is thrown. If the
351
+ * child element is empty, an empty string is returned. If there is more
352
+ * than one child element, an error is thrown to indicate unexpected
353
+ * structure.
354
+ */
355
+ getInnerElementText(element, name) {
356
+ const innerElements = element[name];
357
+ // if (innerElements === undefined) {
358
+ // throw new Error('No inner elements')
359
+ // }
360
+ if (innerElements.length === 1) {
361
+ const value = innerElements[0]['#text'];
362
+ return value.toString();
363
+ }
364
+ else if (innerElements.length === 0) {
365
+ return '';
366
+ }
367
+ else {
368
+ throw new Error('Too many elements');
369
+ }
370
+ }
371
+ /**
372
+ * Retrieves the numeric value of a named child element.
373
+ *
374
+ * @param element - The XML element containing the child element
375
+ * @param name - The name of the child element
376
+ * @returns The numeric value of the child element
377
+ * @throws If the child element does not exist or contains more than one
378
+ * element
379
+ *
380
+ * @remarks
381
+ * This method accesses the specified child element and returns its value
382
+ * as a number. If the child element is missing, an error is thrown. If the
383
+ * child element is empty, NaN is returned. If there is more than one child
384
+ * element, an error is thrown to indicate unexpected structure.
385
+ */
386
+ getInnerElementNumber(element, name) {
387
+ const innerElements = element[name];
388
+ // if (innerElements === undefined) {
389
+ // throw new Error('No inner elements')
390
+ // }
391
+ if (innerElements.length === 1) {
392
+ const value = innerElements[0]['#text'];
393
+ return parseInt(value.toString());
394
+ }
395
+ else if (innerElements.length === 0) {
396
+ return NaN;
397
+ }
398
+ else {
399
+ throw new Error('Too many elements');
400
+ }
401
+ }
402
+ /**
403
+ * Retrieves the boolean value of a named child element.
404
+ *
405
+ * @param element - The XML element containing the child element
406
+ * @param name - The name of the child element
407
+ * @returns True if the child element's text is 'true'
408
+ * (case-insensitive); otherwise, false
409
+ * @throws If the child element does not exist or contains more than one
410
+ * element
411
+ *
412
+ * @remarks
413
+ * This method accesses the specified child element and returns its value
414
+ * as a boolean. If the child element is missing, an error is thrown. If
415
+ * the child element is empty, false is returned. If there is more than one
416
+ * child element, an error is thrown to indicate unexpected structure.
417
+ */
418
+ getInnerElementBoolean(element, name) {
419
+ const innerElements = element[name];
420
+ // if (innerElements === undefined) {
421
+ // throw new Error('No inner elements')
422
+ // }
423
+ if (innerElements.length === 1) {
424
+ const textValue = innerElements[0]['#text'];
425
+ const value = textValue.toString().trim().toLowerCase();
426
+ return value === 'true';
427
+ }
428
+ else if (innerElements.length === 0) {
429
+ return false;
430
+ }
431
+ else {
432
+ throw new Error('Too many elements');
433
+ }
434
+ }
435
+ /**
436
+ * Retrieves the text content of the XML element.
437
+ *
438
+ * @param element - The XML element to retrieve text from
439
+ * @returns The text content of the element
440
+ * @throws If the element does not contain a valid text node
441
+ *
442
+ * @remarks
443
+ * This method accesses the '#text' property of the XML element and
444
+ * returns its value as a string. It asserts that the value is of type
445
+ * string, number, or boolean before converting it to a string. If the
446
+ * property is missing or the value is of an unexpected type, an error is
447
+ * thrown.
448
+ */
449
+ getInnerText(element) {
450
+ // assert(Object.hasOwn(element, '#text') === true)
451
+ const value = element['#text'];
452
+ assert(typeof value === 'string' ||
453
+ typeof value === 'number' ||
454
+ typeof value === 'boolean');
455
+ return value.toString();
456
+ }
457
+ }
458
+ // ----------------------------------------------------------------------------
459
+ //# sourceMappingURL=doxygen-xml-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doxygen-xml-parser.js","sourceRoot":"","sources":["../../../src/doxygen/data-model/doxygen-xml-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,+EAA+E;AAE/E;;;;;;;;;;;;;;GAcG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAK3C,+EAA+E;AAE/E;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,OAAO,gBAAgB;IAC3B;;OAEG;IACH,OAAO,CAAY;IAEnB;;OAEG;IACH,SAAS,CAAW;IAEpB,MAAM,GAA2B,EAAE,CAAA;IAEnC;;;;;;;;;;;;OAYG;IACH,YAAY,OAAmB;QAC7B,IAAI,CAAC,O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;YACN,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;QACtC,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,OAAe;QAC1B,mDAAmD;QACnD,MAAM,KAAK,GAAI,OAAoD,CAAC,OAAO,CAAC,CAAA;QAC5E,MAAM,CACJ,OAAO,KAAK,KAAK,QAAQ;YACvB,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,KAAK,SAAS,CAC7B,CAAA;QACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;IACzB,CAAC;CACF;AAED,+EAA+E"}
@@ -0,0 +1,21 @@
1
+ import { DoxygenXmlParser } from '../doxygen-xml-parser.js';
2
+ import { IndexMemberDataModel } from './indexmembertype-dm.js';
3
+ import { AbstractDataModelBase } from '../types.js';
4
+ /**
5
+ * @public
6
+ */
7
+ export declare abstract class AbstractIndexCompoundType extends AbstractDataModelBase {
8
+ name: string;
9
+ members: IndexMemberDataModel[] | undefined;
10
+ refid: string;
11
+ kind: string;
12
+ constructor(xml: DoxygenXmlParser, element: object, elementName: string);
13
+ }
14
+ export type IndexCompoundKind = 'class' | 'struct' | 'union' | 'interface' | 'protocol' | 'category' | 'exception' | 'file' | 'namespace' | 'group' | 'page' | 'example' | 'dir' | 'type' | 'concept' | 'module';
15
+ /**
16
+ * @public
17
+ */
18
+ export declare class IndexCompoundDataModel extends AbstractIndexCompoundType {
19
+ constructor(xml: DoxygenXmlParser, element: object);
20
+ }
21
+ //# sourceMappingURL=indexcompoundtype-dm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexcompoundtype-dm.d.ts","sourceRoot":"","sources":["../../../../src/doxygen/data-model/index/indexcompoundtype-dm.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAanD;;GAEG;AACH,8BAAsB,yBAA0B,SAAQ,qBAAqB;IAE3E,IAAI,SAAK;IACT,OAAO,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAA;IAG3C,KAAK,SAAK;IACV,IAAI,SAAK;gBAEG,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;CA+DxE;AAyBD,MAAM,MAAM,iBAAiB,GACzB,OAAO,GACP,QAAQ,GACR,OAAO,GACP,WAAW,GACX,UAAU,GACV,UAAU,GACV,WAAW,GACX,MAAM,GACN,WAAW,GACX,OAAO,GACP,MAAM,GACN,SAAS,GACT,KAAK,GACL,MAAM,GACN,SAAS,GACT,QAAQ,CAAA;AAMZ;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,yBAAyB;gBACvD,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM;CAInD"}
@@ -0,0 +1,96 @@
1
+ /*
2
+ * This file is part of the xPack project (http://xpack.github.io).
3
+ * Copyright (c) 2025 Liviu Ionescu. All rights reserved.
4
+ *
5
+ * Permission to use, copy, modify, and/or distribute this software
6
+ * for any purpose is hereby granted, under the terms of the MIT license.
7
+ *
8
+ * If a copy of the license was not distributed with this file, it can
9
+ * be obtained from https://opensource.org/licenses/MIT.
10
+ */
11
+ // ----------------------------------------------------------------------------
12
+ import assert from 'node:assert';
13
+ import * as util from 'node:util';
14
+ import { IndexMemberDataModel } from './indexmembertype-dm.js';
15
+ import { AbstractDataModelBase } from '../types.js';
16
+ // ----------------------------------------------------------------------------
17
+ // <xsd:complexType name="CompoundType">
18
+ // <xsd:sequence>
19
+ // <xsd:element name="name" type="xsd:string"/>
20
+ // <xsd:element name="member" type="MemberType" minOccurs="0" maxOccurs="unbounded"/>
21
+ // </xsd:sequence>
22
+ // <xsd:attribute name="refid" type="xsd:string" use="required"/>
23
+ // <xsd:attribute name="kind" type="CompoundKind" use="required"/>
24
+ // </xsd:complexType>
25
+ /**
26
+ * @public
27
+ */
28
+ export class AbstractIndexCompoundType extends AbstractDataModelBase {
29
+ // Mandatory elements.
30
+ name = '';
31
+ members; // [0-n]
32
+ // Mandatory attributes.
33
+ refid = '';
34
+ kind = ''; // CompoundKind
35
+ constructor(xml, element, elementName) {
36
+ super(elementName);
37
+ // console.log(elementName, util.inspect(element, { compact: false, depth: 999 }))
38
+ // ------------------------------------------------------------------------
39
+ // Process elements.
40
+ const innerElements = xml.getInnerElements(element, elementName);
41
+ assert(innerElements.length > 0);
42
+ for (const innerElement of innerElements) {
43
+ if (xml.hasInnerText(innerElement)) {
44
+ // Ignore texts.
45
+ }
46
+ else if (xml.isInnerElementText(innerElement, 'name')) {
47
+ assert(this.name.length === 0);
48
+ this.name = xml.getInnerElementText(innerElement, 'name');
49
+ }
50
+ else if (xml.hasInnerElement(innerElement, 'member')) {
51
+ this.members ??= [];
52
+ this.members.push(new IndexMemberDataModel(xml, innerElement));
53
+ }
54
+ else {
55
+ console.error(util.inspect(innerElement));
56
+ console.error(`index ${elementName} element:`, Object.keys(innerElement), 'not implemented yet in', this.constructor.name);
57
+ }
58
+ }
59
+ // ------------------------------------------------------------------------
60
+ // Process attributes.
61
+ assert(xml.hasAttributes(element));
62
+ const attributesNames = xml.getAttributesNames(element);
63
+ // console.log(attributesNames)
64
+ for (const attributeName of attributesNames) {
65
+ // console.log(attributeName)
66
+ if (attributeName === '@_refid') {
67
+ this.refid = xml.getAttributeStringValue(element, '@_refid');
68
+ }
69
+ else if (attributeName === '@_kind') {
70
+ this.kind = xml.getAttributeStringValue(element, '@_kind');
71
+ }
72
+ else {
73
+ console.error(util.inspect(element, { compact: false, depth: 999 }));
74
+ console.error(`index ${elementName} attribute:`, attributeName, 'not implemented yet in', this.constructor.name);
75
+ }
76
+ }
77
+ assert(this.refid.length > 0);
78
+ assert(this.kind.length > 0);
79
+ // ------------------------------------------------------------------------
80
+ // console.log(util.inspect(this, { compact: false, depth: 999 }))
81
+ // console.log('compound: ', this.refid)
82
+ }
83
+ }
84
+ // ----------------------------------------------------------------------------
85
+ // <xsd:element name="compound" type="CompoundType" minOccurs="0" maxOccurs="unbounded"/>
86
+ /**
87
+ * @public
88
+ */
89
+ export class IndexCompoundDataModel extends AbstractIndexCompoundType {
90
+ constructor(xml, element) {
91
+ // console.log(elementName, util.inspect(element, { compact: false, depth: 999 }))
92
+ super(xml, element, 'compound');
93
+ }
94
+ }
95
+ // ----------------------------------------------------------------------------
96
+ //# sourceMappingURL=indexcompoundtype-dm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexcompoundtype-dm.js","sourceRoot":"","sources":["../../../../src/doxygen/data-model/index/indexcompoundtype-dm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,+EAA+E;AAE/E,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAGjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEnD,+EAA+E;AAE/E,wCAAwC;AACxC,mBAAmB;AACnB,mDAAmD;AACnD,yFAAyF;AACzF,oBAAoB;AACpB,mEAAmE;AACnE,oEAAoE;AACpE,qBAAqB;AAErB;;GAEG;AACH,MAAM,OAAgB,yBAA0B,SAAQ,qBAAqB;IAC3E,sBAAsB;IACtB,IAAI,GAAG,EAAE,CAAA;IACT,OAAO,CAAoC,CAAC,QAAQ;IAEpD,wBAAwB;IACxB,KAAK,GAAG,EAAE,CAAA;IACV,IAAI,GAAG,EAAE,CAAA,CAAC,eAAe;IAEzB,YAAY,GAAqB,EAAE,OAAe,EAAE,WAAmB;QACrE,KAAK,CAAC,WAAW,CAAC,CAAA;QAElB,kFAAkF;QAElF,2EAA2E;QAC3E,oBAAoB;QAEpB,MAAM,aAAa,GAAG,GAAG,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;QAChE,MA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IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;YAC9D,CAAC;iBAAM,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;gBACtC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,uBAAuB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;YAC5D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;gBACpE,OAAO,CAAC,KAAK,CACX,SAAS,WAAW,aAAa,EACjC,aAAa,EACb,wBAAwB,EACxB,IAAI,CAAC,WAAW,CAAC,IAAI,CACtB,CAAA;YACH,CAAC;QACH,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAC7B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QAE5B,2EAA2E;QAE3E,kEAAkE;QAClE,wCAAwC;IAC1C,CAAC;CACF;AA2CD,+EAA+E;AAE/E,yFAAyF;AAEzF;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,yBAAyB;IACnE,YAAY,GAAqB,EAAE,OAAe;QAChD,kFAAkF;QAClF,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;IACjC,CAAC;CACF;AAED,+EAA+E"}
@@ -0,0 +1,20 @@
1
+ import { DoxygenXmlParser } from '../doxygen-xml-parser.js';
2
+ import { IndexCompoundDataModel } from './indexcompoundtype-dm.js';
3
+ import { AbstractDataModelBase } from '../types.js';
4
+ /**
5
+ * @public
6
+ */
7
+ export declare abstract class AbstractIndexDoxygenType extends AbstractDataModelBase {
8
+ version: string;
9
+ lang: string;
10
+ compounds?: IndexCompoundDataModel[] | undefined;
11
+ noNamespaceSchemaLocation?: string | undefined;
12
+ constructor(xml: DoxygenXmlParser, element: object, elementName: string);
13
+ }
14
+ /**
15
+ * @public
16
+ */
17
+ export declare class DoxygenIndexDataModel extends AbstractIndexDoxygenType {
18
+ constructor(xml: DoxygenXmlParser, element: object);
19
+ }
20
+ //# sourceMappingURL=indexdoxygentype-dm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexdoxygentype-dm.d.ts","sourceRoot":"","sources":["../../../../src/doxygen/data-model/index/indexdoxygentype-dm.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAanD;;GAEG;AACH,8BAAsB,wBAAyB,SAAQ,qBAAqB;IAE1E,OAAO,SAAK;IACZ,IAAI,SAAK;IAGT,SAAS,CAAC,EAAE,sBAAsB,EAAE,GAAG,SAAS,CAAA;IAGhD,yBAAyB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;gBAElC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;CA4DxE;AAMD;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,wBAAwB;gBACrD,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM;CAInD"}