@xpack/doxygen2docusaurus 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +2 -1
- package/bin/doxygen2docusaurus.js +1 -1
- package/dist/cli/main.d.ts +0 -14
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +0 -34
- package/dist/cli/main.js.map +1 -1
- package/dist/docusaurus/cli-options.d.ts +3 -292
- package/dist/docusaurus/cli-options.d.ts.map +1 -1
- package/dist/docusaurus/cli-options.js +6 -290
- package/dist/docusaurus/cli-options.js.map +1 -1
- package/dist/docusaurus/generator.d.ts +0 -172
- package/dist/docusaurus/generator.d.ts.map +1 -1
- package/dist/docusaurus/generator.js +20 -280
- package/dist/docusaurus/generator.js.map +1 -1
- package/dist/docusaurus/renderers/descriptiontype.d.ts +0 -417
- package/dist/docusaurus/renderers/descriptiontype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/descriptiontype.js +11 -555
- package/dist/docusaurus/renderers/descriptiontype.js.map +1 -1
- package/dist/docusaurus/renderers/docinternalstype.d.ts +0 -132
- package/dist/docusaurus/renderers/docinternalstype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/docinternalstype.js +0 -156
- package/dist/docusaurus/renderers/docinternalstype.js.map +1 -1
- package/dist/docusaurus/renderers/doclisttype.d.ts +0 -22
- package/dist/docusaurus/renderers/doclisttype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/doclisttype.js +0 -42
- package/dist/docusaurus/renderers/doclisttype.js.map +1 -1
- package/dist/docusaurus/renderers/doctabletype.d.ts +0 -88
- package/dist/docusaurus/renderers/doctabletype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/doctabletype.js +1 -113
- package/dist/docusaurus/renderers/doctabletype.js.map +1 -1
- package/dist/docusaurus/renderers/doctitletype.d.ts +0 -22
- package/dist/docusaurus/renderers/doctitletype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/doctitletype.js +0 -42
- package/dist/docusaurus/renderers/doctitletype.js.map +1 -1
- package/dist/docusaurus/renderers/docvariablelisttype.d.ts +0 -44
- package/dist/docusaurus/renderers/docvariablelisttype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/docvariablelisttype.js +1 -69
- package/dist/docusaurus/renderers/docvariablelisttype.js.map +1 -1
- package/dist/docusaurus/renderers/docxrefsecttype.d.ts +0 -22
- package/dist/docusaurus/renderers/docxrefsecttype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/docxrefsecttype.js +0 -38
- package/dist/docusaurus/renderers/docxrefsecttype.js.map +1 -1
- package/dist/docusaurus/renderers/element-renderer-base.d.ts +0 -74
- package/dist/docusaurus/renderers/element-renderer-base.d.ts.map +1 -1
- package/dist/docusaurus/renderers/element-renderer-base.js +0 -64
- package/dist/docusaurus/renderers/element-renderer-base.js.map +1 -1
- package/dist/docusaurus/renderers/inctype.d.ts +0 -23
- package/dist/docusaurus/renderers/inctype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/inctype.js +0 -41
- package/dist/docusaurus/renderers/inctype.js.map +1 -1
- package/dist/docusaurus/renderers/linkedtexttype.d.ts +0 -22
- package/dist/docusaurus/renderers/linkedtexttype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/linkedtexttype.js +0 -45
- package/dist/docusaurus/renderers/linkedtexttype.js.map +1 -1
- package/dist/docusaurus/renderers/listingtype.d.ts +0 -52
- package/dist/docusaurus/renderers/listingtype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/listingtype.js +1 -88
- package/dist/docusaurus/renderers/listingtype.js.map +1 -1
- package/dist/docusaurus/renderers/paramtype.d.ts +0 -22
- package/dist/docusaurus/renderers/paramtype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/paramtype.js +2 -51
- package/dist/docusaurus/renderers/paramtype.js.map +1 -1
- package/dist/docusaurus/renderers/referencetype.d.ts +0 -23
- package/dist/docusaurus/renderers/referencetype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/referencetype.js +0 -38
- package/dist/docusaurus/renderers/referencetype.js.map +1 -1
- package/dist/docusaurus/renderers/reftexttype.d.ts +0 -22
- package/dist/docusaurus/renderers/reftexttype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/reftexttype.js +0 -38
- package/dist/docusaurus/renderers/reftexttype.js.map +1 -1
- package/dist/docusaurus/renderers/reftype.d.ts +0 -22
- package/dist/docusaurus/renderers/reftype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/reftype.js +0 -38
- package/dist/docusaurus/renderers/reftype.js.map +1 -1
- package/dist/docusaurus/renderers/renderers.d.ts +0 -151
- package/dist/docusaurus/renderers/renderers.d.ts.map +1 -1
- package/dist/docusaurus/renderers/renderers.js +4 -184
- package/dist/docusaurus/renderers/renderers.js.map +1 -1
- package/dist/docusaurus/renderers/substringtype.d.ts +0 -22
- package/dist/docusaurus/renderers/substringtype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/substringtype.js +0 -39
- package/dist/docusaurus/renderers/substringtype.js.map +1 -1
- package/dist/docusaurus/renderers/tableofcontentstype.d.ts +0 -22
- package/dist/docusaurus/renderers/tableofcontentstype.d.ts.map +1 -1
- package/dist/docusaurus/renderers/tableofcontentstype.js +0 -39
- package/dist/docusaurus/renderers/tableofcontentstype.js.map +1 -1
- package/dist/docusaurus/types.d.ts +0 -110
- package/dist/docusaurus/types.d.ts.map +1 -1
- package/dist/docusaurus/types.js +0 -11
- package/dist/docusaurus/types.js.map +1 -1
- package/dist/docusaurus/utils.d.ts +0 -214
- package/dist/docusaurus/utils.d.ts.map +1 -1
- package/dist/docusaurus/utils.js +0 -296
- package/dist/docusaurus/utils.js.map +1 -1
- package/dist/docusaurus/view-model/classes-vm.d.ts +0 -137
- package/dist/docusaurus/view-model/classes-vm.d.ts.map +1 -1
- package/dist/docusaurus/view-model/classes-vm.js +9 -225
- package/dist/docusaurus/view-model/classes-vm.js.map +1 -1
- package/dist/docusaurus/view-model/collection-base.d.ts +0 -120
- package/dist/docusaurus/view-model/collection-base.d.ts.map +1 -1
- package/dist/docusaurus/view-model/collection-base.js +11 -101
- package/dist/docusaurus/view-model/collection-base.js.map +1 -1
- package/dist/docusaurus/view-model/compound-base-vm.d.ts +2 -147
- package/dist/docusaurus/view-model/compound-base-vm.d.ts.map +1 -1
- package/dist/docusaurus/view-model/compound-base-vm.js +47 -225
- package/dist/docusaurus/view-model/compound-base-vm.js.map +1 -1
- package/dist/docusaurus/view-model/concepts-vm.d.ts +26 -0
- package/dist/docusaurus/view-model/concepts-vm.d.ts.map +1 -0
- package/dist/docusaurus/view-model/concepts-vm.js +329 -0
- package/dist/docusaurus/view-model/concepts-vm.js.map +1 -0
- package/dist/docusaurus/view-model/description-anchors.d.ts +0 -58
- package/dist/docusaurus/view-model/description-anchors.d.ts.map +1 -1
- package/dist/docusaurus/view-model/description-anchors.js +0 -71
- package/dist/docusaurus/view-model/description-anchors.js.map +1 -1
- package/dist/docusaurus/view-model/files-and-folders-vm.d.ts +0 -247
- package/dist/docusaurus/view-model/files-and-folders-vm.d.ts.map +1 -1
- package/dist/docusaurus/view-model/files-and-folders-vm.js +61 -353
- package/dist/docusaurus/view-model/files-and-folders-vm.js.map +1 -1
- package/dist/docusaurus/view-model/groups-vm.d.ts +0 -148
- package/dist/docusaurus/view-model/groups-vm.d.ts.map +1 -1
- package/dist/docusaurus/view-model/groups-vm.js +2 -223
- package/dist/docusaurus/view-model/groups-vm.js.map +1 -1
- package/dist/docusaurus/view-model/members-vm.d.ts +0 -552
- package/dist/docusaurus/view-model/members-vm.d.ts.map +1 -1
- package/dist/docusaurus/view-model/members-vm.js +17 -702
- package/dist/docusaurus/view-model/members-vm.js.map +1 -1
- package/dist/docusaurus/view-model/namespaces-vm.d.ts +4 -199
- package/dist/docusaurus/view-model/namespaces-vm.d.ts.map +1 -1
- package/dist/docusaurus/view-model/namespaces-vm.js +79 -284
- package/dist/docusaurus/view-model/namespaces-vm.js.map +1 -1
- package/dist/docusaurus/view-model/options.d.ts +0 -43
- package/dist/docusaurus/view-model/options.d.ts.map +1 -1
- package/dist/docusaurus/view-model/options.js +0 -57
- package/dist/docusaurus/view-model/options.js.map +1 -1
- package/dist/docusaurus/view-model/pages-vm.d.ts +0 -115
- package/dist/docusaurus/view-model/pages-vm.d.ts.map +1 -1
- package/dist/docusaurus/view-model/pages-vm.js +0 -162
- package/dist/docusaurus/view-model/pages-vm.js.map +1 -1
- package/dist/docusaurus/view-model/tree-entries-vm.d.ts +8 -142
- package/dist/docusaurus/view-model/tree-entries-vm.d.ts.map +1 -1
- package/dist/docusaurus/view-model/tree-entries-vm.js +54 -174
- package/dist/docusaurus/view-model/tree-entries-vm.js.map +1 -1
- package/dist/docusaurus/view-model/view-model.d.ts +0 -125
- package/dist/docusaurus/view-model/view-model.d.ts.map +1 -1
- package/dist/docusaurus/view-model/view-model.js +20 -182
- package/dist/docusaurus/view-model/view-model.js.map +1 -1
- package/dist/docusaurus/workspace.d.ts +1 -126
- package/dist/docusaurus/workspace.d.ts.map +1 -1
- package/dist/docusaurus/workspace.js +8 -221
- package/dist/docusaurus/workspace.js.map +1 -1
- package/dist/doxygen/data-model/compounds/compounddef-dm.d.ts +5 -492
- package/dist/doxygen/data-model/compounds/compounddef-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/compounddef-dm.js +23 -672
- package/dist/doxygen/data-model/compounds/compounddef-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/compoundreftype-dm.d.ts +0 -129
- package/dist/doxygen/data-model/compounds/compoundreftype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/compoundreftype-dm.js +1 -145
- package/dist/doxygen/data-model/compounds/compoundreftype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/descriptiontype-dm.d.ts +104 -2848
- package/dist/doxygen/data-model/compounds/descriptiontype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/descriptiontype-dm.js +73 -3975
- package/dist/doxygen/data-model/compounds/descriptiontype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.d.ts +0 -165
- package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.js +0 -229
- package/dist/doxygen/data-model/compounds/docvarlistentrytype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/doxygentype-dm.d.ts +0 -70
- package/dist/doxygen/data-model/compounds/doxygentype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/doxygentype-dm.js +0 -105
- package/dist/doxygen/data-model/compounds/doxygentype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/enumvaluetype-dm.d.ts +0 -84
- package/dist/doxygen/data-model/compounds/enumvaluetype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/enumvaluetype-dm.js +1 -122
- package/dist/doxygen/data-model/compounds/enumvaluetype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/inctype-dm.d.ts +0 -116
- package/dist/doxygen/data-model/compounds/inctype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/inctype-dm.js +3 -155
- package/dist/doxygen/data-model/compounds/inctype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/linkedtexttype-dm.d.ts +3 -138
- package/dist/doxygen/data-model/compounds/linkedtexttype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/linkedtexttype-dm.js +5 -180
- package/dist/doxygen/data-model/compounds/linkedtexttype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.d.ts +0 -76
- package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.js +0 -107
- package/dist/doxygen/data-model/compounds/listofallmemberstype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/locationtype-dm.d.ts +0 -162
- package/dist/doxygen/data-model/compounds/locationtype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/locationtype-dm.js +4 -203
- package/dist/doxygen/data-model/compounds/locationtype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/memberdeftype-dm.d.ts +2 -443
- package/dist/doxygen/data-model/compounds/memberdeftype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/memberdeftype-dm.js +19 -475
- package/dist/doxygen/data-model/compounds/memberdeftype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/memberreftype-dm.d.ts +0 -141
- package/dist/doxygen/data-model/compounds/memberreftype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/memberreftype-dm.js +0 -176
- package/dist/doxygen/data-model/compounds/memberreftype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/membertype-dm.d.ts +0 -101
- package/dist/doxygen/data-model/compounds/membertype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/membertype-dm.js +0 -115
- package/dist/doxygen/data-model/compounds/membertype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/paramtype-dm.d.ts +0 -164
- package/dist/doxygen/data-model/compounds/paramtype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/paramtype-dm.js +0 -208
- package/dist/doxygen/data-model/compounds/paramtype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/referencetype-dm.d.ts +0 -139
- package/dist/doxygen/data-model/compounds/referencetype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/referencetype-dm.js +2 -175
- package/dist/doxygen/data-model/compounds/referencetype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/reftexttype-dm.d.ts +0 -120
- package/dist/doxygen/data-model/compounds/reftexttype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/reftexttype-dm.js +2 -141
- package/dist/doxygen/data-model/compounds/reftexttype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/reftype-dm.d.ts +0 -268
- package/dist/doxygen/data-model/compounds/reftype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/reftype-dm.js +4 -326
- package/dist/doxygen/data-model/compounds/reftype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/reimplementtype-dm.d.ts +0 -105
- package/dist/doxygen/data-model/compounds/reimplementtype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/reimplementtype-dm.js +1 -139
- package/dist/doxygen/data-model/compounds/reimplementtype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/sectiondeftype-dm.d.ts +0 -168
- package/dist/doxygen/data-model/compounds/sectiondeftype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/sectiondeftype-dm.js +0 -209
- package/dist/doxygen/data-model/compounds/sectiondeftype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.d.ts +0 -267
- package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.js +0 -354
- package/dist/doxygen/data-model/compounds/tableofcontentstype-dm.js.map +1 -1
- package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.d.ts +0 -66
- package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.js +0 -97
- package/dist/doxygen/data-model/compounds/templateparamlisttype-dm.js.map +1 -1
- package/dist/doxygen/data-model/data-model.d.ts +0 -149
- package/dist/doxygen/data-model/data-model.d.ts.map +1 -1
- package/dist/doxygen/data-model/data-model.js +4 -197
- package/dist/doxygen/data-model/data-model.js.map +1 -1
- package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.d.ts +0 -115
- package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.js +4 -129
- package/dist/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.js.map +1 -1
- package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.d.ts +0 -87
- package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.js +0 -118
- package/dist/doxygen/data-model/doxyfile/doxyfiletype-dm.js.map +1 -1
- package/dist/doxygen/data-model/doxygen-xml-parser.d.ts +0 -253
- package/dist/doxygen/data-model/doxygen-xml-parser.d.ts.map +1 -1
- package/dist/doxygen/data-model/doxygen-xml-parser.js +0 -291
- package/dist/doxygen/data-model/doxygen-xml-parser.js.map +1 -1
- package/dist/doxygen/data-model/index/indexcompoundtype-dm.d.ts +0 -98
- package/dist/doxygen/data-model/index/indexcompoundtype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/index/indexcompoundtype-dm.js +2 -122
- package/dist/doxygen/data-model/index/indexcompoundtype-dm.js.map +1 -1
- package/dist/doxygen/data-model/index/indexdoxygentype-dm.d.ts +0 -82
- package/dist/doxygen/data-model/index/indexdoxygentype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/index/indexdoxygentype-dm.js +0 -114
- package/dist/doxygen/data-model/index/indexdoxygentype-dm.js.map +1 -1
- package/dist/doxygen/data-model/index/indexmembertype-dm.d.ts +0 -85
- package/dist/doxygen/data-model/index/indexmembertype-dm.d.ts.map +1 -1
- package/dist/doxygen/data-model/index/indexmembertype-dm.js +1 -107
- package/dist/doxygen/data-model/index/indexmembertype-dm.js.map +1 -1
- package/dist/doxygen/data-model/types.d.ts +0 -104
- package/dist/doxygen/data-model/types.d.ts.map +1 -1
- package/dist/doxygen/data-model/types.js +0 -52
- package/dist/doxygen/data-model/types.js.map +1 -1
- package/dist/index.d.ts +4 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -42
- package/dist/index.js.map +1 -1
- package/package.json +45 -51
- package/src/cli/main.ts +122 -0
- package/src/docusaurus/cli-options.ts +560 -0
- package/src/docusaurus/generator.ts +788 -0
- package/src/docusaurus/renderers/descriptiontype.ts +1299 -0
- package/src/docusaurus/renderers/docinternalstype.ts +354 -0
- package/src/docusaurus/renderers/doclisttype.ts +134 -0
- package/src/docusaurus/renderers/doctabletype.ts +220 -0
- package/src/docusaurus/renderers/doctitletype.ts +77 -0
- package/src/docusaurus/renderers/docvariablelisttype.ts +123 -0
- package/src/docusaurus/renderers/docxrefsecttype.ts +84 -0
- package/src/docusaurus/renderers/element-renderer-base.ts +112 -0
- package/src/docusaurus/renderers/inctype.ts +75 -0
- package/src/docusaurus/renderers/linkedtexttype.ts +64 -0
- package/src/docusaurus/renderers/listingtype.ts +235 -0
- package/src/docusaurus/renderers/paramtype.ts +116 -0
- package/src/docusaurus/renderers/referencetype.ts +83 -0
- package/src/docusaurus/renderers/reftexttype.ts +81 -0
- package/src/docusaurus/renderers/reftype.ts +77 -0
- package/src/docusaurus/renderers/renderers.ts +756 -0
- package/src/docusaurus/renderers/substringtype.ts +53 -0
- package/src/docusaurus/renderers/tableofcontentstype.ts +74 -0
- package/src/docusaurus/types.ts +187 -0
- package/src/docusaurus/utils.ts +409 -0
- package/src/docusaurus/view-model/README.md +12 -0
- package/src/docusaurus/view-model/classes-vm.ts +1088 -0
- package/src/docusaurus/view-model/collection-base.ts +352 -0
- package/src/docusaurus/view-model/compound-base-vm.ts +1340 -0
- package/src/docusaurus/view-model/concepts-vm.ts +719 -0
- package/src/docusaurus/view-model/description-anchors.ts +107 -0
- package/src/docusaurus/view-model/files-and-folders-vm.ts +1293 -0
- package/src/docusaurus/view-model/groups-vm.ts +548 -0
- package/src/docusaurus/view-model/members-vm.ts +1943 -0
- package/src/docusaurus/view-model/namespaces-vm.ts +1018 -0
- package/src/docusaurus/view-model/options.ts +95 -0
- package/src/docusaurus/view-model/pages-vm.ts +342 -0
- package/src/docusaurus/view-model/tree-entries-vm.ts +376 -0
- package/src/docusaurus/view-model/view-model.ts +513 -0
- package/src/docusaurus/workspace.ts +588 -0
- package/src/doxygen/data-model/README.md +13 -0
- package/src/doxygen/data-model/compounds/compounddef-dm.ts +1156 -0
- package/src/doxygen/data-model/compounds/compoundreftype-dm.ts +266 -0
- package/src/doxygen/data-model/compounds/descriptiontype-dm.ts +10107 -0
- package/src/doxygen/data-model/compounds/docvarlistentrytype-dm.ts +354 -0
- package/src/doxygen/data-model/compounds/doxygentype-dm.ts +187 -0
- package/src/doxygen/data-model/compounds/enumvaluetype-dm.ts +218 -0
- package/src/doxygen/data-model/compounds/inctype-dm.ts +217 -0
- package/src/doxygen/data-model/compounds/linkedtexttype-dm.ts +288 -0
- package/src/doxygen/data-model/compounds/listofallmemberstype-dm.ts +160 -0
- package/src/doxygen/data-model/compounds/locationtype-dm.ts +284 -0
- package/src/doxygen/data-model/compounds/memberdeftype-dm.ts +874 -0
- package/src/doxygen/data-model/compounds/memberreftype-dm.ts +270 -0
- package/src/doxygen/data-model/compounds/membertype-dm.ts +239 -0
- package/src/doxygen/data-model/compounds/paramtype-dm.ts +302 -0
- package/src/doxygen/data-model/compounds/referencetype-dm.ts +248 -0
- package/src/doxygen/data-model/compounds/reftexttype-dm.ts +234 -0
- package/src/doxygen/data-model/compounds/reftype-dm.ts +430 -0
- package/src/doxygen/data-model/compounds/reimplementtype-dm.ts +201 -0
- package/src/doxygen/data-model/compounds/sectiondeftype-dm.ts +330 -0
- package/src/doxygen/data-model/compounds/tableofcontentstype-dm.ts +563 -0
- package/src/doxygen/data-model/compounds/templateparamlisttype-dm.ts +150 -0
- package/src/doxygen/data-model/data-model.ts +377 -0
- package/src/doxygen/data-model/doxyfile/doxyfileoptiontype-dm.ts +271 -0
- package/src/doxygen/data-model/doxyfile/doxyfiletype-dm.ts +200 -0
- package/src/doxygen/data-model/doxygen-xml-parser.ts +522 -0
- package/src/doxygen/data-model/index/indexcompoundtype-dm.ts +256 -0
- package/src/doxygen/data-model/index/indexdoxygentype-dm.ts +196 -0
- package/src/doxygen/data-model/index/indexmembertype-dm.ts +230 -0
- package/src/doxygen/data-model/types.ts +175 -0
- package/src/doxygen/data-model/xsds/README.md +6 -0
- package/src/doxygen/data-model/xsds/compound.xsd +1699 -0
- package/src/doxygen/data-model/xsds/doxyfile.xsd +355 -0
- package/src/doxygen/data-model/xsds/index.xsd +72 -0
- package/src/doxygen/data-model/xsds/xml.xsd +23 -0
- package/src/index.ts +261 -0
- package/src/tsconfig.json +10 -0
- package/dist/doxygen2docusaurus.d.ts +0 -4774
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/tsdoc-metadata.json +0 -11
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the xPack project (http://xpack.github.io).
|
|
3
|
+
* Copyright (c) 2025-2026 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
|
+
|
|
14
|
+
import assert from 'node:assert'
|
|
15
|
+
import * as util from 'node:util'
|
|
16
|
+
|
|
17
|
+
import { XMLParser } from 'fast-xml-parser'
|
|
18
|
+
import { XmlElement } from './types.js'
|
|
19
|
+
import { CliOptions } from '../../docusaurus/cli-options.js'
|
|
20
|
+
import { AbstractDocImageType } from './compounds/descriptiontype-dm.js'
|
|
21
|
+
|
|
22
|
+
// ----------------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* XML parser for Doxygen-generated documentation files.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This class initialises the XML parser with options that preserve the order
|
|
29
|
+
* and structure of the original XML content, ensuring accurate conversion
|
|
30
|
+
* for documentation purposes. It maintains a counter for the number of files
|
|
31
|
+
* parsed and stores the resulting data model.
|
|
32
|
+
*
|
|
33
|
+
* The parser is configured to handle Doxygen's specific XML format whilst
|
|
34
|
+
* maintaining fidelity to the source structure and content organisation.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const parser = new DoxygenXmlParser({ options });
|
|
39
|
+
* const dataModel = await parser.parse();
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
export class DoxygenXmlParser {
|
|
46
|
+
/**
|
|
47
|
+
* The global configuration options for the parsing operation.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Contains the command-line interface options that control the behaviour
|
|
51
|
+
* of the parser throughout the XML processing workflow.
|
|
52
|
+
*/
|
|
53
|
+
options: CliOptions
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The XML parser instance configured specifically for Doxygen XML format.
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* Configured with settings that preserve element order, remove namespace
|
|
60
|
+
* prefixes, and maintain fidelity to the original XML structure for
|
|
61
|
+
* accurate data model construction.
|
|
62
|
+
*/
|
|
63
|
+
xmlParser: XMLParser
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Collection of image references extracted during XML parsing.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* Accumulates image elements found in the documentation content,
|
|
70
|
+
* allowing for centralised image processing and reference management.
|
|
71
|
+
*/
|
|
72
|
+
images: AbstractDocImageType[] = []
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Constructs a new instance of the DoxygenXmlParser class.
|
|
76
|
+
*
|
|
77
|
+
* @param options - The global configuration options
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* This constructor initialises the XML parser with settings that preserve the
|
|
81
|
+
* order and structure of the original XML content, remove namespace prefixes,
|
|
82
|
+
* and ensure that both tag and attribute values are parsed. The values are
|
|
83
|
+
* not trimmed, maintaining fidelity to the source XML. The provided options
|
|
84
|
+
* are stored for use throughout the parsing process.
|
|
85
|
+
*/
|
|
86
|
+
constructor(options: CliOptions) {
|
|
87
|
+
this.options = options
|
|
88
|
+
|
|
89
|
+
this.xmlParser = new XMLParser({
|
|
90
|
+
preserveOrder: true,
|
|
91
|
+
removeNSPrefix: true,
|
|
92
|
+
ignoreAttributes: false,
|
|
93
|
+
parseTagValue: true,
|
|
94
|
+
parseAttributeValue: true,
|
|
95
|
+
trimValues: false,
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// --------------------------------------------------------------------------
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Determines whether the specified XML element has any attributes.
|
|
103
|
+
*
|
|
104
|
+
* @param element - The XML element to inspect for attributes
|
|
105
|
+
* @returns True if the element has attributes; otherwise, false
|
|
106
|
+
*
|
|
107
|
+
* @remarks
|
|
108
|
+
* This method checks for the presence of the ':\@' property on the XML
|
|
109
|
+
* element, which is the convention used by the XML parser for storing
|
|
110
|
+
* attributes. If this property exists, the element has attributes; if not,
|
|
111
|
+
* the element has no attributes. This is a prerequisite check before calling
|
|
112
|
+
* {@link DoxygenXmlParser.getAttributesNames} or other attribute-related
|
|
113
|
+
* methods.
|
|
114
|
+
*/
|
|
115
|
+
hasAttributes(element: object): boolean {
|
|
116
|
+
return Object.hasOwn(element, ':@')
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Retrieves the names of all attributes present on the specified XML element.
|
|
121
|
+
*
|
|
122
|
+
* @param element - The XML element to inspect for attribute names
|
|
123
|
+
* @returns An array of strings containing the names of all attributes
|
|
124
|
+
*
|
|
125
|
+
* @remarks
|
|
126
|
+
* This method accesses the ':\@' property of the XML element, which is the
|
|
127
|
+
* convention used by the XML parser for storing attributes, and returns the
|
|
128
|
+
* keys of this object as an array of attribute names. The method assumes the
|
|
129
|
+
* element has attributes and does not perform validation - use
|
|
130
|
+
* {@link DoxygenXmlParser.hasAttributes} to check for attribute presence
|
|
131
|
+
* first.
|
|
132
|
+
*/
|
|
133
|
+
getAttributesNames(element: object): string[] {
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
135
|
+
return Object.keys((element as { ':@': {} })[':@'])
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Determines whether the specified attribute exists on the given XML element.
|
|
140
|
+
*
|
|
141
|
+
* @param element - The XML element to inspect
|
|
142
|
+
* @param name - The name of the attribute to check for
|
|
143
|
+
* @returns True if the attribute exists; otherwise, false
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* This method checks for the presence of an attribute within the ':\@'
|
|
147
|
+
* property of the XML element, which is the convention used by the XML
|
|
148
|
+
* parser for storing attributes. It returns true if the attribute is found,
|
|
149
|
+
* otherwise false.
|
|
150
|
+
*/
|
|
151
|
+
hasAttribute(element: object, name: string): boolean {
|
|
152
|
+
if (Object.hasOwn(element, ':@')) {
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
154
|
+
const elementWithAttributes = element as { ':@': {} }
|
|
155
|
+
return Object.hasOwn(elementWithAttributes[':@'], name)
|
|
156
|
+
} else {
|
|
157
|
+
return false
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Retrieves the value of a named attribute as a string.
|
|
163
|
+
*
|
|
164
|
+
* @param element - The XML element containing the attribute
|
|
165
|
+
* @param name - The name of the attribute to retrieve
|
|
166
|
+
* @returns The attribute value as a string
|
|
167
|
+
* @throws If the attribute does not exist
|
|
168
|
+
*
|
|
169
|
+
* @remarks
|
|
170
|
+
* This method checks whether the specified attribute exists on the XML
|
|
171
|
+
* element and returns its value as a string. If the attribute value is
|
|
172
|
+
* originally a number (as the XML parser may return numeric strings as
|
|
173
|
+
* numbers), it is converted to a string to maintain consistency with the
|
|
174
|
+
* DTD specification. If the attribute is missing, an error is thrown to
|
|
175
|
+
* indicate the absence.
|
|
176
|
+
*/
|
|
177
|
+
getAttributeStringValue(element: object, name: string): string {
|
|
178
|
+
if (this.hasAttribute(element, name)) {
|
|
179
|
+
const elementWithNamedAttribute = (
|
|
180
|
+
element as { ':@': { [name]: string } }
|
|
181
|
+
)[':@']
|
|
182
|
+
const attributeValue = elementWithNamedAttribute[name]
|
|
183
|
+
if (typeof attributeValue === 'string') {
|
|
184
|
+
return attributeValue
|
|
185
|
+
} else if (typeof attributeValue === 'number') {
|
|
186
|
+
// The xml parser returns attributes like `refid="21"` as numbers,
|
|
187
|
+
// but the DTD defines them as strings and the applications expects
|
|
188
|
+
// strings.
|
|
189
|
+
return String(attributeValue)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
throw new Error(
|
|
193
|
+
`Element ${util.inspect(element)} does not have the ${name} attribute`
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Retrieves the value of a named attribute as a number.
|
|
199
|
+
*
|
|
200
|
+
* @param element - The XML element containing the attribute
|
|
201
|
+
* @param name - The name of the attribute to retrieve
|
|
202
|
+
* @returns The attribute value as a number
|
|
203
|
+
* @throws If the attribute does not exist or is not a number
|
|
204
|
+
*
|
|
205
|
+
* @remarks
|
|
206
|
+
* This method checks whether the specified attribute exists on the XML
|
|
207
|
+
* element and returns its value as a number. If the attribute is missing
|
|
208
|
+
* or its value is not a number, an error is thrown to indicate the absence
|
|
209
|
+
* or incorrect type.
|
|
210
|
+
*/
|
|
211
|
+
getAttributeNumberValue(element: object, name: string): number {
|
|
212
|
+
if (this.hasAttribute(element, name)) {
|
|
213
|
+
const elementWithNamedAttribute = (
|
|
214
|
+
element as { ':@': { [name]: number } }
|
|
215
|
+
)[':@']
|
|
216
|
+
const attributeValue = elementWithNamedAttribute[name]
|
|
217
|
+
if (typeof attributeValue === 'number') {
|
|
218
|
+
return attributeValue
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
throw new Error(
|
|
222
|
+
`Element ${util.inspect(element)} does not have the ${name} number ` +
|
|
223
|
+
'attribute'
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Retrieves the value of a named attribute as a boolean.
|
|
229
|
+
*
|
|
230
|
+
* @param element - The XML element containing the attribute
|
|
231
|
+
* @param name - The name of the attribute to retrieve
|
|
232
|
+
* @returns True if the attribute value is 'yes' (case-insensitive);
|
|
233
|
+
* otherwise, false
|
|
234
|
+
* @throws If the attribute does not exist or is not a string
|
|
235
|
+
*
|
|
236
|
+
* @remarks
|
|
237
|
+
* This method checks whether the specified attribute exists on the XML
|
|
238
|
+
* element, and returns true if its value is the string 'yes'
|
|
239
|
+
* (case-insensitive). If the attribute is missing or its value is not a
|
|
240
|
+
* string, an error is thrown.
|
|
241
|
+
*/
|
|
242
|
+
getAttributeBooleanValue(element: object, name: string): boolean {
|
|
243
|
+
if (this.hasAttribute(element, name)) {
|
|
244
|
+
const elementWithNamedAttribute = (
|
|
245
|
+
element as { ':@': { [name]: string } }
|
|
246
|
+
)[':@']
|
|
247
|
+
const attributeValue = elementWithNamedAttribute[name]
|
|
248
|
+
if (typeof attributeValue === 'string') {
|
|
249
|
+
return attributeValue.toLowerCase() === 'yes'
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
throw new Error(
|
|
253
|
+
`Element ${util.inspect(element)} does not have the ${name} ` +
|
|
254
|
+
'boolean attribute'
|
|
255
|
+
)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Determines whether the specified inner element exists on the given XML
|
|
260
|
+
* element.
|
|
261
|
+
*
|
|
262
|
+
* @param element - The XML element to inspect
|
|
263
|
+
* @param name - The name of the inner element to check for
|
|
264
|
+
* @returns True if the inner element exists; otherwise, false
|
|
265
|
+
*
|
|
266
|
+
* @remarks
|
|
267
|
+
* This method checks for the presence of a named property on the XML element.
|
|
268
|
+
* For text nodes ('#text'), it verifies the value is a string, number, or
|
|
269
|
+
* boolean. For other elements, it confirms the property is an array, as
|
|
270
|
+
* per the XML parser's convention.
|
|
271
|
+
*/
|
|
272
|
+
hasInnerElement(element: object, name: string): boolean {
|
|
273
|
+
if (Object.hasOwn(element, name)) {
|
|
274
|
+
if (name === '#text') {
|
|
275
|
+
const value = (element as { ['#text']: string | number | boolean })[
|
|
276
|
+
'#text'
|
|
277
|
+
]
|
|
278
|
+
return (
|
|
279
|
+
typeof value === 'string' ||
|
|
280
|
+
typeof value === 'number' ||
|
|
281
|
+
typeof value === 'boolean'
|
|
282
|
+
)
|
|
283
|
+
} else {
|
|
284
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
285
|
+
return Array.isArray((element as { [name]: any })[name])
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
return false
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Determines whether a named inner element contains text.
|
|
294
|
+
*
|
|
295
|
+
* @param element - The XML element to inspect
|
|
296
|
+
* @param name - The name of the inner element
|
|
297
|
+
* @returns True if the inner element contains text or is empty;
|
|
298
|
+
* otherwise, false
|
|
299
|
+
*
|
|
300
|
+
* @remarks
|
|
301
|
+
* This method checks if the specified inner element exists and contains a
|
|
302
|
+
* single text node, or is an empty array (representing an empty string).
|
|
303
|
+
* It asserts the expected structure and type of the value for robustness.
|
|
304
|
+
*/
|
|
305
|
+
isInnerElementText(element: object, name: string): boolean {
|
|
306
|
+
if (Object.hasOwn(element, name)) {
|
|
307
|
+
const innerElements: XmlElement[] | undefined = (
|
|
308
|
+
element as { [name]: XmlElement[] }
|
|
309
|
+
)[name]
|
|
310
|
+
// console.log('isInnerElementText', util.inspect(element,
|
|
311
|
+
// { compact: false, depth: 999 })
|
|
312
|
+
// assert(innerElements !== undefined)
|
|
313
|
+
if (innerElements.length === 1) {
|
|
314
|
+
// assert(innerElements[0] !== undefined)
|
|
315
|
+
if (Object.hasOwn(innerElements[0], '#text')) {
|
|
316
|
+
const value = (
|
|
317
|
+
innerElements[0] as { ['#text']: string | number | boolean }
|
|
318
|
+
)['#text']
|
|
319
|
+
assert(
|
|
320
|
+
typeof value === 'string' ||
|
|
321
|
+
typeof value === 'number' ||
|
|
322
|
+
typeof value === 'boolean'
|
|
323
|
+
)
|
|
324
|
+
return true
|
|
325
|
+
}
|
|
326
|
+
} else if (innerElements.length === 0) {
|
|
327
|
+
// Empty string.
|
|
328
|
+
return true
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return false
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Determines whether the XML element contains a text node.
|
|
336
|
+
*
|
|
337
|
+
* @param element - The XML element to inspect
|
|
338
|
+
* @returns True if the element contains a text node; otherwise, false
|
|
339
|
+
*
|
|
340
|
+
* @remarks
|
|
341
|
+
* This method checks for the presence of a '#text' property on the XML
|
|
342
|
+
* element, and verifies that its value is a string, number, or boolean.
|
|
343
|
+
*/
|
|
344
|
+
hasInnerText(element: object): boolean {
|
|
345
|
+
if (Object.hasOwn(element, '#text')) {
|
|
346
|
+
const value = (element as { ['#text']: string | number | boolean })[
|
|
347
|
+
'#text'
|
|
348
|
+
]
|
|
349
|
+
return (
|
|
350
|
+
typeof value === 'string' ||
|
|
351
|
+
typeof value === 'number' ||
|
|
352
|
+
typeof value === 'boolean'
|
|
353
|
+
)
|
|
354
|
+
} else {
|
|
355
|
+
return false
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Retrieves an array of named child elements from the given XML element.
|
|
361
|
+
*
|
|
362
|
+
* @typeParam T - The expected type of the child elements array
|
|
363
|
+
* (defaults to XmlElement[])
|
|
364
|
+
* @param element - The XML element containing the child elements
|
|
365
|
+
* @param name - The name of the child elements to retrieve
|
|
366
|
+
* @returns The array of child elements
|
|
367
|
+
* @throws If the child elements do not exist
|
|
368
|
+
*
|
|
369
|
+
* @remarks
|
|
370
|
+
* This method accesses the specified property on the XML element and
|
|
371
|
+
* returns it as an array of child elements. If the property is undefined,
|
|
372
|
+
* an error is thrown indicating the absence of the expected child element.
|
|
373
|
+
*/
|
|
374
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
375
|
+
getInnerElements<T = XmlElement[]>(element: object, name: string): T {
|
|
376
|
+
// assert(Object.hasOwn(element, name) === true &&
|
|
377
|
+
// Array.isArray((element as { [name]: T })[name]))
|
|
378
|
+
const innerElements: T | undefined = (element as { [name]: T })[name]
|
|
379
|
+
if (innerElements !== undefined) {
|
|
380
|
+
return innerElements
|
|
381
|
+
}
|
|
382
|
+
throw new Error(
|
|
383
|
+
`Element ${util.inspect(element, { compact: false, depth: 999 })} ` +
|
|
384
|
+
`does not have the ${name} child element`
|
|
385
|
+
)
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Retrieves the text content of a named child element.
|
|
390
|
+
*
|
|
391
|
+
* @param element - The XML element containing the child element
|
|
392
|
+
* @param name - The name of the child element
|
|
393
|
+
* @returns The text content of the child element
|
|
394
|
+
* @throws If the child element does not exist or contains more than one
|
|
395
|
+
* element
|
|
396
|
+
*
|
|
397
|
+
* @remarks
|
|
398
|
+
* This method accesses the specified child element and returns its text
|
|
399
|
+
* content. If the child element is missing, an error is thrown. If the
|
|
400
|
+
* child element is empty, an empty string is returned. If there is more
|
|
401
|
+
* than one child element, an error is thrown to indicate unexpected
|
|
402
|
+
* structure.
|
|
403
|
+
*/
|
|
404
|
+
getInnerElementText(element: object, name: string): string {
|
|
405
|
+
const innerElements: XmlElement[] | undefined = (
|
|
406
|
+
element as { [name]: XmlElement[] }
|
|
407
|
+
)[name]
|
|
408
|
+
|
|
409
|
+
// if (innerElements === undefined) {
|
|
410
|
+
// throw new Error('No inner elements')
|
|
411
|
+
// }
|
|
412
|
+
if (innerElements.length === 1) {
|
|
413
|
+
const value = (
|
|
414
|
+
innerElements[0] as { ['#text']: string | number | boolean }
|
|
415
|
+
)['#text']
|
|
416
|
+
return value.toString()
|
|
417
|
+
} else if (innerElements.length === 0) {
|
|
418
|
+
return ''
|
|
419
|
+
} else {
|
|
420
|
+
throw new Error('Too many elements')
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Retrieves the numeric value of a named child element.
|
|
426
|
+
*
|
|
427
|
+
* @param element - The XML element containing the child element
|
|
428
|
+
* @param name - The name of the child element
|
|
429
|
+
* @returns The numeric value of the child element
|
|
430
|
+
* @throws If the child element does not exist or contains more than one
|
|
431
|
+
* element
|
|
432
|
+
*
|
|
433
|
+
* @remarks
|
|
434
|
+
* This method accesses the specified child element and returns its value
|
|
435
|
+
* as a number. If the child element is missing, an error is thrown. If the
|
|
436
|
+
* child element is empty, NaN is returned. If there is more than one child
|
|
437
|
+
* element, an error is thrown to indicate unexpected structure.
|
|
438
|
+
*/
|
|
439
|
+
getInnerElementNumber(element: object, name: string): number {
|
|
440
|
+
const innerElements: XmlElement[] | undefined = (
|
|
441
|
+
element as { [name]: XmlElement[] }
|
|
442
|
+
)[name]
|
|
443
|
+
|
|
444
|
+
// if (innerElements === undefined) {
|
|
445
|
+
// throw new Error('No inner elements')
|
|
446
|
+
// }
|
|
447
|
+
if (innerElements.length === 1) {
|
|
448
|
+
const value = (
|
|
449
|
+
innerElements[0] as { ['#text']: string | number | boolean }
|
|
450
|
+
)['#text']
|
|
451
|
+
return parseInt(value.toString())
|
|
452
|
+
} else if (innerElements.length === 0) {
|
|
453
|
+
return NaN
|
|
454
|
+
} else {
|
|
455
|
+
throw new Error('Too many elements')
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Retrieves the boolean value of a named child element.
|
|
461
|
+
*
|
|
462
|
+
* @param element - The XML element containing the child element
|
|
463
|
+
* @param name - The name of the child element
|
|
464
|
+
* @returns True if the child element's text is 'true'
|
|
465
|
+
* (case-insensitive); otherwise, false
|
|
466
|
+
* @throws If the child element does not exist or contains more than one
|
|
467
|
+
* element
|
|
468
|
+
*
|
|
469
|
+
* @remarks
|
|
470
|
+
* This method accesses the specified child element and returns its value
|
|
471
|
+
* as a boolean. If the child element is missing, an error is thrown. If
|
|
472
|
+
* the child element is empty, false is returned. If there is more than one
|
|
473
|
+
* child element, an error is thrown to indicate unexpected structure.
|
|
474
|
+
*/
|
|
475
|
+
getInnerElementBoolean(element: object, name: string): boolean {
|
|
476
|
+
const innerElements: XmlElement[] | undefined = (
|
|
477
|
+
element as { [name]: XmlElement[] }
|
|
478
|
+
)[name]
|
|
479
|
+
|
|
480
|
+
// if (innerElements === undefined) {
|
|
481
|
+
// throw new Error('No inner elements')
|
|
482
|
+
// }
|
|
483
|
+
if (innerElements.length === 1) {
|
|
484
|
+
const textValue = (
|
|
485
|
+
innerElements[0] as { ['#text']: string | number | boolean }
|
|
486
|
+
)['#text']
|
|
487
|
+
const value = textValue.toString().trim().toLowerCase()
|
|
488
|
+
return value === 'true'
|
|
489
|
+
} else if (innerElements.length === 0) {
|
|
490
|
+
return false
|
|
491
|
+
} else {
|
|
492
|
+
throw new Error('Too many elements')
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Retrieves the text content of the XML element.
|
|
498
|
+
*
|
|
499
|
+
* @param element - The XML element to retrieve text from
|
|
500
|
+
* @returns The text content of the element
|
|
501
|
+
* @throws If the element does not contain a valid text node
|
|
502
|
+
*
|
|
503
|
+
* @remarks
|
|
504
|
+
* This method accesses the '#text' property of the XML element and
|
|
505
|
+
* returns its value as a string. It asserts that the value is of type
|
|
506
|
+
* string, number, or boolean before converting it to a string. If the
|
|
507
|
+
* property is missing or the value is of an unexpected type, an error is
|
|
508
|
+
* thrown.
|
|
509
|
+
*/
|
|
510
|
+
getInnerText(element: object): string {
|
|
511
|
+
// assert(Object.hasOwn(element, '#text') === true)
|
|
512
|
+
const value = (element as { ['#text']: string | number | boolean })['#text']
|
|
513
|
+
assert(
|
|
514
|
+
typeof value === 'string' ||
|
|
515
|
+
typeof value === 'number' ||
|
|
516
|
+
typeof value === 'boolean'
|
|
517
|
+
)
|
|
518
|
+
return value.toString()
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// ----------------------------------------------------------------------------
|