typedoc 0.26.11 → 0.27.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/bin/package.json +3 -0
  2. package/bin/typedoc +1 -1
  3. package/dist/index.d.ts +23 -13
  4. package/dist/index.js +22 -81
  5. package/dist/lib/application-events.js +1 -4
  6. package/dist/lib/application.d.ts +26 -16
  7. package/dist/lib/application.js +222 -242
  8. package/dist/lib/cli.js +3 -40
  9. package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
  10. package/dist/lib/converter/comments/blockLexer.js +24 -30
  11. package/dist/lib/converter/comments/declarationReference.js +10 -21
  12. package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +2 -2
  13. package/dist/lib/converter/comments/declarationReferenceResolver.js +40 -36
  14. package/dist/lib/converter/comments/discovery.d.ts +4 -4
  15. package/dist/lib/converter/comments/discovery.js +154 -172
  16. package/dist/lib/converter/comments/index.d.ts +4 -4
  17. package/dist/lib/converter/comments/index.js +39 -50
  18. package/dist/lib/converter/comments/lexer.d.ts +1 -1
  19. package/dist/lib/converter/comments/lexer.js +2 -5
  20. package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
  21. package/dist/lib/converter/comments/lineLexer.js +12 -15
  22. package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
  23. package/dist/lib/converter/comments/linkResolver.js +14 -21
  24. package/dist/lib/converter/comments/parser.d.ts +6 -6
  25. package/dist/lib/converter/comments/parser.js +69 -96
  26. package/dist/lib/converter/comments/rawLexer.d.ts +1 -1
  27. package/dist/lib/converter/comments/rawLexer.js +13 -16
  28. package/dist/lib/converter/comments/tagName.js +1 -4
  29. package/dist/lib/converter/comments/textParser.d.ts +4 -4
  30. package/dist/lib/converter/comments/textParser.js +28 -30
  31. package/dist/lib/converter/components.d.ts +2 -3
  32. package/dist/lib/converter/components.js +2 -7
  33. package/dist/lib/converter/context.d.ts +9 -9
  34. package/dist/lib/converter/context.js +54 -44
  35. package/dist/lib/converter/convert-expression.js +16 -23
  36. package/dist/lib/converter/converter-events.d.ts +1 -0
  37. package/dist/lib/converter/converter-events.js +2 -4
  38. package/dist/lib/converter/converter.d.ts +16 -13
  39. package/dist/lib/converter/converter.js +210 -238
  40. package/dist/lib/converter/factories/index-signature.d.ts +1 -1
  41. package/dist/lib/converter/factories/index-signature.js +11 -17
  42. package/dist/lib/converter/factories/signature.d.ts +2 -2
  43. package/dist/lib/converter/factories/signature.js +95 -106
  44. package/dist/lib/converter/index.d.ts +6 -7
  45. package/dist/lib/converter/index.js +3 -11
  46. package/dist/lib/converter/jsdoc.d.ts +1 -1
  47. package/dist/lib/converter/jsdoc.js +34 -41
  48. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +6 -21
  49. package/dist/lib/converter/plugins/CategoryPlugin.js +57 -139
  50. package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -5
  51. package/dist/lib/converter/plugins/CommentPlugin.js +153 -163
  52. package/dist/lib/converter/plugins/GroupPlugin.d.ts +10 -9
  53. package/dist/lib/converter/plugins/GroupPlugin.js +87 -124
  54. package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +3 -5
  55. package/dist/lib/converter/plugins/ImplementsPlugin.js +255 -321
  56. package/dist/lib/converter/plugins/IncludePlugin.d.ts +11 -0
  57. package/dist/lib/converter/plugins/IncludePlugin.js +72 -0
  58. package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +4 -3
  59. package/dist/lib/converter/plugins/InheritDocPlugin.js +41 -72
  60. package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +5 -5
  61. package/dist/lib/converter/plugins/LinkResolverPlugin.js +37 -58
  62. package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
  63. package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +49 -0
  64. package/dist/lib/converter/plugins/PackagePlugin.d.ts +4 -3
  65. package/dist/lib/converter/plugins/PackagePlugin.js +62 -111
  66. package/dist/lib/converter/plugins/SourcePlugin.d.ts +3 -5
  67. package/dist/lib/converter/plugins/SourcePlugin.js +69 -110
  68. package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -6
  69. package/dist/lib/converter/plugins/TypePlugin.js +95 -158
  70. package/dist/lib/converter/plugins/index.d.ts +10 -9
  71. package/dist/lib/converter/plugins/index.js +10 -21
  72. package/dist/lib/converter/symbols.d.ts +1 -1
  73. package/dist/lib/converter/symbols.js +234 -227
  74. package/dist/lib/converter/types.d.ts +2 -2
  75. package/dist/lib/converter/types.js +252 -237
  76. package/dist/lib/converter/utils/nodes.js +5 -13
  77. package/dist/lib/converter/utils/reflections.d.ts +1 -1
  78. package/dist/lib/converter/utils/reflections.js +4 -7
  79. package/dist/lib/converter/utils/repository.d.ts +1 -1
  80. package/dist/lib/converter/utils/repository.js +103 -97
  81. package/dist/lib/converter/utils/symbols.js +3 -9
  82. package/dist/lib/internationalization/index.d.ts +3 -4
  83. package/dist/lib/internationalization/index.js +3 -8
  84. package/dist/lib/internationalization/internationalization.d.ts +5 -4
  85. package/dist/lib/internationalization/internationalization.js +97 -103
  86. package/dist/lib/internationalization/locale-utils.cjs +8 -0
  87. package/dist/lib/internationalization/locale-utils.d.cts +8 -0
  88. package/dist/lib/internationalization/locales/en.cjs +366 -2
  89. package/dist/lib/internationalization/locales/en.d.cts +339 -2
  90. package/dist/lib/internationalization/locales/jp.cjs +8 -11
  91. package/dist/lib/internationalization/locales/jp.d.cts +310 -1
  92. package/dist/lib/internationalization/locales/ko.cjs +7 -9
  93. package/dist/lib/internationalization/locales/ko.d.cts +223 -1
  94. package/dist/lib/internationalization/locales/zh.cjs +7 -10
  95. package/dist/lib/internationalization/locales/zh.d.cts +381 -1
  96. package/dist/lib/internationalization/translatable.d.ts +4 -327
  97. package/dist/lib/internationalization/translatable.js +2 -360
  98. package/dist/lib/models/FileRegistry.d.ts +20 -9
  99. package/dist/lib/models/FileRegistry.js +54 -45
  100. package/dist/lib/models/ReflectionCategory.d.ts +2 -2
  101. package/dist/lib/models/ReflectionCategory.js +16 -12
  102. package/dist/lib/models/ReflectionGroup.d.ts +3 -3
  103. package/dist/lib/models/ReflectionGroup.js +23 -14
  104. package/dist/lib/models/comments/comment.d.ts +23 -37
  105. package/dist/lib/models/comments/comment.js +388 -325
  106. package/dist/lib/models/comments/index.d.ts +2 -2
  107. package/dist/lib/models/comments/index.js +1 -6
  108. package/dist/lib/models/index.d.ts +7 -7
  109. package/dist/lib/models/index.js +7 -23
  110. package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +2 -2
  111. package/dist/lib/models/reflections/ReflectionSymbolId.js +42 -34
  112. package/dist/lib/models/reflections/abstract.d.ts +17 -20
  113. package/dist/lib/models/reflections/abstract.js +249 -256
  114. package/dist/lib/models/reflections/container.d.ts +7 -7
  115. package/dist/lib/models/reflections/container.js +43 -16
  116. package/dist/lib/models/reflections/declaration.d.ts +15 -12
  117. package/dist/lib/models/reflections/declaration.js +150 -29
  118. package/dist/lib/models/reflections/document.d.ts +3 -3
  119. package/dist/lib/models/reflections/document.js +26 -13
  120. package/dist/lib/models/reflections/index.d.ts +15 -15
  121. package/dist/lib/models/reflections/index.js +12 -31
  122. package/dist/lib/models/reflections/kind.d.ts +1 -1
  123. package/dist/lib/models/reflections/kind.js +3 -6
  124. package/dist/lib/models/reflections/parameter.d.ts +5 -4
  125. package/dist/lib/models/reflections/parameter.js +11 -13
  126. package/dist/lib/models/reflections/project.d.ts +14 -9
  127. package/dist/lib/models/reflections/project.js +104 -56
  128. package/dist/lib/models/reflections/reference.d.ts +3 -3
  129. package/dist/lib/models/reflections/reference.js +6 -9
  130. package/dist/lib/models/reflections/signature.d.ts +8 -8
  131. package/dist/lib/models/reflections/signature.js +35 -14
  132. package/dist/lib/models/reflections/type-parameter.d.ts +5 -5
  133. package/dist/lib/models/reflections/type-parameter.js +9 -10
  134. package/dist/lib/models/reflections/utils.js +1 -4
  135. package/dist/lib/models/reflections/variant.d.ts +8 -7
  136. package/dist/lib/models/reflections/variant.js +1 -2
  137. package/dist/lib/models/sources/file.d.ts +2 -2
  138. package/dist/lib/models/sources/file.js +22 -5
  139. package/dist/lib/models/sources/index.d.ts +1 -1
  140. package/dist/lib/models/sources/index.js +1 -5
  141. package/dist/lib/models/types.d.ts +26 -13
  142. package/dist/lib/models/types.js +236 -151
  143. package/dist/lib/output/components.d.ts +5 -11
  144. package/dist/lib/output/components.js +84 -125
  145. package/dist/lib/output/events.d.ts +3 -3
  146. package/dist/lib/output/events.js +128 -94
  147. package/dist/lib/output/formatter.d.ts +84 -0
  148. package/dist/lib/output/formatter.js +619 -0
  149. package/dist/lib/output/index.d.ts +9 -8
  150. package/dist/lib/output/index.js +7 -19
  151. package/dist/lib/output/models/UrlMapping.d.ts +2 -2
  152. package/dist/lib/output/models/UrlMapping.js +4 -5
  153. package/dist/lib/output/output.d.ts +13 -0
  154. package/dist/lib/output/output.js +72 -0
  155. package/dist/lib/output/plugins/AssetsPlugin.d.ts +7 -8
  156. package/dist/lib/output/plugins/AssetsPlugin.js +62 -80
  157. package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
  158. package/dist/lib/output/plugins/IconsPlugin.js +28 -84
  159. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
  160. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
  161. package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
  162. package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
  163. package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
  164. package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
  165. package/dist/lib/output/plugins/index.d.ts +6 -6
  166. package/dist/lib/output/plugins/index.js +6 -15
  167. package/dist/lib/output/renderer.d.ts +14 -13
  168. package/dist/lib/output/renderer.js +129 -185
  169. package/dist/lib/output/theme.d.ts +9 -5
  170. package/dist/lib/output/theme.js +14 -62
  171. package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
  172. package/dist/lib/output/themes/MarkedPlugin.js +152 -117
  173. package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
  174. package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
  175. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
  176. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
  177. package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
  178. package/dist/lib/output/themes/default/Slugger.js +46 -0
  179. package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
  180. package/dist/lib/output/themes/default/layouts/default.js +47 -36
  181. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
  182. package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
  183. package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
  184. package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
  185. package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
  186. package/dist/lib/output/themes/default/partials/comment.js +52 -29
  187. package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
  188. package/dist/lib/output/themes/default/partials/footer.js +11 -14
  189. package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
  190. package/dist/lib/output/themes/default/partials/header.js +9 -13
  191. package/dist/lib/output/themes/default/partials/hierarchy.d.ts +3 -3
  192. package/dist/lib/output/themes/default/partials/hierarchy.js +9 -12
  193. package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
  194. package/dist/lib/output/themes/default/partials/icon.js +78 -73
  195. package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
  196. package/dist/lib/output/themes/default/partials/index.js +19 -22
  197. package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
  198. package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
  199. package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
  200. package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
  201. package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
  202. package/dist/lib/output/themes/default/partials/member.js +19 -24
  203. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
  204. package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
  205. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
  206. package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
  207. package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
  208. package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
  209. package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
  210. package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
  211. package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
  212. package/dist/lib/output/themes/default/partials/members.js +10 -42
  213. package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
  214. package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
  215. package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
  216. package/dist/lib/output/themes/default/partials/navigation.js +51 -62
  217. package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
  218. package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
  219. package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
  220. package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
  221. package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
  222. package/dist/lib/output/themes/default/partials/type.js +8 -388
  223. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
  224. package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
  225. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
  226. package/dist/lib/output/themes/default/partials/typeDetails.js +221 -0
  227. package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
  228. package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
  229. package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
  230. package/dist/lib/output/themes/default/templates/document.js +3 -7
  231. package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
  232. package/dist/lib/output/themes/default/templates/hierarchy.js +10 -13
  233. package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
  234. package/dist/lib/output/themes/default/templates/index.js +3 -7
  235. package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
  236. package/dist/lib/output/themes/default/templates/reflection.js +31 -34
  237. package/dist/lib/output/themes/lib.d.ts +17 -3
  238. package/dist/lib/output/themes/lib.js +110 -49
  239. package/dist/lib/serialization/components.d.ts +2 -5
  240. package/dist/lib/serialization/components.js +1 -2
  241. package/dist/lib/serialization/deserializer.d.ts +21 -7
  242. package/dist/lib/serialization/deserializer.js +138 -123
  243. package/dist/lib/serialization/events.d.ts +2 -2
  244. package/dist/lib/serialization/events.js +6 -5
  245. package/dist/lib/serialization/index.d.ts +5 -5
  246. package/dist/lib/serialization/index.js +4 -33
  247. package/dist/lib/serialization/schema.d.ts +8 -2
  248. package/dist/lib/serialization/schema.js +2 -2
  249. package/dist/lib/serialization/serializer.d.ts +11 -5
  250. package/dist/lib/serialization/serializer.js +32 -25
  251. package/dist/lib/utils/array.d.ts +3 -0
  252. package/dist/lib/utils/array.js +26 -27
  253. package/dist/lib/utils/component.d.ts +2 -44
  254. package/dist/lib/utils/component.js +10 -102
  255. package/dist/lib/utils/entry-point.d.ts +3 -4
  256. package/dist/lib/utils/entry-point.js +114 -85
  257. package/dist/lib/utils/enum.js +6 -14
  258. package/dist/lib/utils/events.js +6 -12
  259. package/dist/lib/utils/fs.js +50 -91
  260. package/dist/lib/utils/general.d.ts +2 -1
  261. package/dist/lib/utils/general.js +50 -40
  262. package/dist/lib/utils/highlighter.js +30 -57
  263. package/dist/lib/utils/hooks.js +7 -13
  264. package/dist/lib/utils/html-entities.d.ts +8926 -0
  265. package/dist/lib/utils/html-entities.js +2329 -0
  266. package/dist/lib/utils/html.d.ts +8 -0
  267. package/dist/lib/utils/html.js +81 -34
  268. package/dist/lib/utils/index.d.ts +22 -22
  269. package/dist/lib/utils/index.js +20 -91
  270. package/dist/lib/utils/jsx.d.ts +12 -5
  271. package/dist/lib/utils/jsx.elements.js +1 -4
  272. package/dist/lib/utils/jsx.js +53 -20
  273. package/dist/lib/utils/loggers.d.ts +3 -3
  274. package/dist/lib/utils/loggers.js +36 -46
  275. package/dist/lib/utils/map.js +6 -13
  276. package/dist/lib/utils/minimalSourceFile.js +5 -7
  277. package/dist/lib/utils/options/declaration.d.ts +33 -7
  278. package/dist/lib/utils/options/declaration.js +20 -22
  279. package/dist/lib/utils/options/defaults.d.ts +3 -2
  280. package/dist/lib/utils/options/defaults.js +18 -38
  281. package/dist/lib/utils/options/help.d.ts +2 -2
  282. package/dist/lib/utils/options/help.js +7 -10
  283. package/dist/lib/utils/options/index.d.ts +6 -6
  284. package/dist/lib/utils/options/index.js +4 -18
  285. package/dist/lib/utils/options/options.d.ts +8 -5
  286. package/dist/lib/utils/options/options.js +47 -71
  287. package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
  288. package/dist/lib/utils/options/readers/arguments.js +15 -17
  289. package/dist/lib/utils/options/readers/index.d.ts +4 -4
  290. package/dist/lib/utils/options/readers/index.js +4 -11
  291. package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
  292. package/dist/lib/utils/options/readers/package-json.js +15 -21
  293. package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
  294. package/dist/lib/utils/options/readers/tsconfig.js +54 -63
  295. package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
  296. package/dist/lib/utils/options/readers/typedoc.js +44 -76
  297. package/dist/lib/utils/options/sources/index.d.ts +1 -1
  298. package/dist/lib/utils/options/sources/index.js +1 -5
  299. package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
  300. package/dist/lib/utils/options/sources/typedoc.js +220 -196
  301. package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
  302. package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
  303. package/dist/lib/utils/package-manifest.d.ts +1 -1
  304. package/dist/lib/utils/package-manifest.js +15 -19
  305. package/dist/lib/utils/paths.js +9 -15
  306. package/dist/lib/utils/perf.js +6 -11
  307. package/dist/lib/utils/plugins.d.ts +1 -1
  308. package/dist/lib/utils/plugins.js +7 -10
  309. package/dist/lib/utils/reflections.d.ts +1 -1
  310. package/dist/lib/utils/reflections.js +9 -12
  311. package/dist/lib/utils/set.js +2 -6
  312. package/dist/lib/utils/sort.d.ts +3 -3
  313. package/dist/lib/utils/sort.js +20 -24
  314. package/dist/lib/utils/tsconfig.d.ts +1 -1
  315. package/dist/lib/utils/tsconfig.js +13 -21
  316. package/dist/lib/utils/tsutils.d.ts +1 -1
  317. package/dist/lib/utils/tsutils.js +3 -30
  318. package/dist/lib/utils/validation.js +6 -12
  319. package/dist/lib/validation/documentation.d.ts +2 -2
  320. package/dist/lib/validation/documentation.js +26 -29
  321. package/dist/lib/validation/exports.d.ts +2 -2
  322. package/dist/lib/validation/exports.js +9 -11
  323. package/dist/lib/validation/links.d.ts +2 -2
  324. package/dist/lib/validation/links.js +4 -7
  325. package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
  326. package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
  327. package/package.json +14 -11
  328. package/static/main.js +4 -4
  329. package/static/style.css +91 -2
  330. package/tsdoc.json +30 -0
  331. package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
  332. package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
  333. package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
  334. package/dist/lib/output/themes/default/partials/parameter.js +0 -79
  335. package/dist/lib/utils/html-entities.json +0 -2326
@@ -1,5 +1,6 @@
1
- import { type DeclarationReflection, type DocumentReflection } from "../../models";
2
- import { ConverterComponent } from "../components";
1
+ import { type DeclarationReflection, type DocumentReflection } from "../../models/index.js";
2
+ import { ConverterComponent } from "../components.js";
3
+ import type { Converter } from "../converter.js";
3
4
  /**
4
5
  * A handler that sorts and categorizes the found reflections in the resolving phase.
5
6
  *
@@ -10,18 +11,14 @@ export declare class CategoryPlugin extends ConverterComponent {
10
11
  accessor defaultCategory: string;
11
12
  accessor categoryOrder: string[];
12
13
  accessor categorizeByGroup: boolean;
13
- accessor boosts: Record<string, number>;
14
- usedBoosts: Set<string>;
15
14
  static defaultCategory: string;
16
15
  static WEIGHTS: string[];
17
- /**
18
- * Create a new CategoryPlugin instance.
19
- */
20
- initialize(): void;
16
+ constructor(owner: Converter);
17
+ private onRevive;
21
18
  /**
22
19
  * Triggered when the converter begins converting a project.
23
20
  */
24
- private onBegin;
21
+ private setup;
25
22
  /**
26
23
  * Triggered when the converter has finished resolving a project.
27
24
  *
@@ -35,21 +32,9 @@ export declare class CategoryPlugin extends ConverterComponent {
35
32
  * Create a categorized representation of the given list of reflections.
36
33
  *
37
34
  * @param reflections The reflections that should be categorized.
38
- * @param categorySearchBoosts A user-supplied map of category titles, for computing a
39
- * relevance boost to be used when searching
40
35
  * @returns An array containing all children of the given reflection categorized
41
36
  */
42
37
  private getReflectionCategories;
43
- /**
44
- * Return the category of a given reflection.
45
- *
46
- * @param reflection The reflection.
47
- * @returns The category the reflection belongs to
48
- *
49
- * @privateRemarks
50
- * If you change this, also update getGroups in GroupPlugin accordingly.
51
- */
52
- private extractCategories;
53
38
  /**
54
39
  * Callback used to sort categories by name.
55
40
  *
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
2
  function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
3
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
@@ -33,40 +32,19 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
32
  }
34
33
  return useValue ? value : void 0;
35
34
  };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
41
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
42
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
43
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
44
- };
45
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
46
- if (kind === "m") throw new TypeError("Private method is not writable");
47
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
48
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
49
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
50
- };
51
- Object.defineProperty(exports, "__esModule", { value: true });
52
- exports.CategoryPlugin = void 0;
53
- const models_1 = require("../../models");
54
- const models_2 = require("../../models");
55
- const components_1 = require("../components");
56
- const converter_1 = require("../converter");
57
- const utils_1 = require("../../utils");
35
+ import assert from "assert";
36
+ import { ApplicationEvents } from "../../application-events.js";
37
+ import { Comment, ContainerReflection, ReflectionCategory, ReflectionKind, } from "../../models/index.js";
38
+ import { Option, getSortFunction } from "../../utils/index.js";
39
+ import { ConverterComponent } from "../components.js";
40
+ import { ConverterEvents } from "../converter-events.js";
58
41
  /**
59
42
  * A handler that sorts and categorizes the found reflections in the resolving phase.
60
43
  *
61
44
  * The handler sets the ´category´ property of all reflections.
62
45
  */
63
46
  let CategoryPlugin = (() => {
64
- var _CategoryPlugin_defaultCategory_accessor_storage, _CategoryPlugin_categoryOrder_accessor_storage, _CategoryPlugin_categorizeByGroup_accessor_storage, _CategoryPlugin_boosts_accessor_storage;
65
- let _classDecorators = [(0, components_1.Component)({ name: "category" })];
66
- let _classDescriptor;
67
- let _classExtraInitializers = [];
68
- let _classThis;
69
- let _classSuper = components_1.ConverterComponent;
47
+ let _classSuper = ConverterComponent;
70
48
  let _defaultCategory_decorators;
71
49
  let _defaultCategory_initializers = [];
72
50
  let _defaultCategory_extraInitializers = [];
@@ -76,38 +54,49 @@ let CategoryPlugin = (() => {
76
54
  let _categorizeByGroup_decorators;
77
55
  let _categorizeByGroup_initializers = [];
78
56
  let _categorizeByGroup_extraInitializers = [];
79
- let _boosts_decorators;
80
- let _boosts_initializers = [];
81
- let _boosts_extraInitializers = [];
82
- var CategoryPlugin = _classThis = class extends _classSuper {
83
- constructor() {
84
- super(...arguments);
85
- _CategoryPlugin_defaultCategory_accessor_storage.set(this, __runInitializers(this, _defaultCategory_initializers, void 0));
86
- _CategoryPlugin_categoryOrder_accessor_storage.set(this, (__runInitializers(this, _defaultCategory_extraInitializers), __runInitializers(this, _categoryOrder_initializers, void 0)));
87
- _CategoryPlugin_categorizeByGroup_accessor_storage.set(this, (__runInitializers(this, _categoryOrder_extraInitializers), __runInitializers(this, _categorizeByGroup_initializers, void 0)));
88
- _CategoryPlugin_boosts_accessor_storage.set(this, (__runInitializers(this, _categorizeByGroup_extraInitializers), __runInitializers(this, _boosts_initializers, void 0)));
89
- this.usedBoosts = (__runInitializers(this, _boosts_extraInitializers), new Set());
57
+ return class CategoryPlugin extends _classSuper {
58
+ static {
59
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
60
+ _defaultCategory_decorators = [Option("defaultCategory")];
61
+ _categoryOrder_decorators = [Option("categoryOrder")];
62
+ _categorizeByGroup_decorators = [Option("categorizeByGroup")];
63
+ __esDecorate(this, null, _defaultCategory_decorators, { kind: "accessor", name: "defaultCategory", static: false, private: false, access: { has: obj => "defaultCategory" in obj, get: obj => obj.defaultCategory, set: (obj, value) => { obj.defaultCategory = value; } }, metadata: _metadata }, _defaultCategory_initializers, _defaultCategory_extraInitializers);
64
+ __esDecorate(this, null, _categoryOrder_decorators, { kind: "accessor", name: "categoryOrder", static: false, private: false, access: { has: obj => "categoryOrder" in obj, get: obj => obj.categoryOrder, set: (obj, value) => { obj.categoryOrder = value; } }, metadata: _metadata }, _categoryOrder_initializers, _categoryOrder_extraInitializers);
65
+ __esDecorate(this, null, _categorizeByGroup_decorators, { kind: "accessor", name: "categorizeByGroup", static: false, private: false, access: { has: obj => "categorizeByGroup" in obj, get: obj => obj.categorizeByGroup, set: (obj, value) => { obj.categorizeByGroup = value; } }, metadata: _metadata }, _categorizeByGroup_initializers, _categorizeByGroup_extraInitializers);
66
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
90
67
  }
91
- get defaultCategory() { return __classPrivateFieldGet(this, _CategoryPlugin_defaultCategory_accessor_storage, "f"); }
92
- set defaultCategory(value) { __classPrivateFieldSet(this, _CategoryPlugin_defaultCategory_accessor_storage, value, "f"); }
93
- get categoryOrder() { return __classPrivateFieldGet(this, _CategoryPlugin_categoryOrder_accessor_storage, "f"); }
94
- set categoryOrder(value) { __classPrivateFieldSet(this, _CategoryPlugin_categoryOrder_accessor_storage, value, "f"); }
95
- get categorizeByGroup() { return __classPrivateFieldGet(this, _CategoryPlugin_categorizeByGroup_accessor_storage, "f"); }
96
- set categorizeByGroup(value) { __classPrivateFieldSet(this, _CategoryPlugin_categorizeByGroup_accessor_storage, value, "f"); }
97
- get boosts() { return __classPrivateFieldGet(this, _CategoryPlugin_boosts_accessor_storage, "f"); }
98
- set boosts(value) { __classPrivateFieldSet(this, _CategoryPlugin_boosts_accessor_storage, value, "f"); }
99
- /**
100
- * Create a new CategoryPlugin instance.
101
- */
102
- initialize() {
103
- this.owner.on(converter_1.Converter.EVENT_BEGIN, this.onBegin.bind(this), -200);
104
- this.owner.on(converter_1.Converter.EVENT_RESOLVE_END, this.onEndResolve.bind(this), -200);
68
+ sortFunction;
69
+ #defaultCategory_accessor_storage = __runInitializers(this, _defaultCategory_initializers, void 0);
70
+ get defaultCategory() { return this.#defaultCategory_accessor_storage; }
71
+ set defaultCategory(value) { this.#defaultCategory_accessor_storage = value; }
72
+ #categoryOrder_accessor_storage = (__runInitializers(this, _defaultCategory_extraInitializers), __runInitializers(this, _categoryOrder_initializers, void 0));
73
+ get categoryOrder() { return this.#categoryOrder_accessor_storage; }
74
+ set categoryOrder(value) { this.#categoryOrder_accessor_storage = value; }
75
+ #categorizeByGroup_accessor_storage = (__runInitializers(this, _categoryOrder_extraInitializers), __runInitializers(this, _categorizeByGroup_initializers, void 0));
76
+ get categorizeByGroup() { return this.#categorizeByGroup_accessor_storage; }
77
+ set categorizeByGroup(value) { this.#categorizeByGroup_accessor_storage = value; }
78
+ // For use in static methods
79
+ static defaultCategory = "Other";
80
+ static WEIGHTS = [];
81
+ constructor(owner) {
82
+ super(owner);
83
+ __runInitializers(this, _categorizeByGroup_extraInitializers);
84
+ this.owner.on(ConverterEvents.RESOLVE_END, this.onEndResolve.bind(this), -200);
85
+ this.application.on(ApplicationEvents.REVIVE, this.onRevive.bind(this), -200);
86
+ }
87
+ onRevive(project) {
88
+ this.setup();
89
+ this.categorize(project);
90
+ for (const refl of project.getReflectionsByKind(ReflectionKind.SomeModule)) {
91
+ assert(refl.isDeclaration());
92
+ this.categorize(refl);
93
+ }
105
94
  }
106
95
  /**
107
96
  * Triggered when the converter begins converting a project.
108
97
  */
109
- onBegin(_context) {
110
- this.sortFunction = (0, utils_1.getSortFunction)(this.application.options);
98
+ setup() {
99
+ this.sortFunction = getSortFunction(this.application.options);
111
100
  // Set up static properties
112
101
  if (this.defaultCategory) {
113
102
  CategoryPlugin.defaultCategory = this.defaultCategory;
@@ -120,22 +109,15 @@ let CategoryPlugin = (() => {
120
109
  * @param context The context object describing the current state the converter is in.
121
110
  */
122
111
  onEndResolve(context) {
112
+ this.setup();
123
113
  const project = context.project;
124
114
  this.categorize(project);
125
115
  for (const id in project.reflections) {
126
116
  const reflection = project.reflections[id];
127
- if (reflection instanceof models_1.ContainerReflection) {
117
+ if (reflection instanceof ContainerReflection) {
128
118
  this.categorize(reflection);
129
119
  }
130
120
  }
131
- const unusedBoosts = new Set(Object.keys(this.boosts));
132
- for (const boost of this.usedBoosts) {
133
- unusedBoosts.delete(boost);
134
- }
135
- this.usedBoosts.clear();
136
- if (unusedBoosts.size) {
137
- context.logger.warn(context.i18n.not_all_search_category_boosts_used_0(Array.from(unusedBoosts).join("\n\t")));
138
- }
139
121
  }
140
122
  categorize(obj) {
141
123
  if (this.categorizeByGroup) {
@@ -181,14 +163,12 @@ let CategoryPlugin = (() => {
181
163
  * Create a categorized representation of the given list of reflections.
182
164
  *
183
165
  * @param reflections The reflections that should be categorized.
184
- * @param categorySearchBoosts A user-supplied map of category titles, for computing a
185
- * relevance boost to be used when searching
186
166
  * @returns An array containing all children of the given reflection categorized
187
167
  */
188
168
  getReflectionCategories(parent, reflections) {
189
169
  const categories = new Map();
190
170
  for (const child of reflections) {
191
- const childCategories = this.extractCategories(child);
171
+ const childCategories = CategoryPlugin.getCategories(child);
192
172
  if (childCategories.size === 0) {
193
173
  childCategories.add(CategoryPlugin.defaultCategory);
194
174
  }
@@ -198,16 +178,16 @@ let CategoryPlugin = (() => {
198
178
  category.children.push(child);
199
179
  }
200
180
  else {
201
- const cat = new models_2.ReflectionCategory(childCat);
181
+ const cat = new ReflectionCategory(childCat);
202
182
  cat.children.push(child);
203
183
  categories.set(childCat, cat);
204
184
  }
205
185
  }
206
186
  }
207
187
  if (parent.comment) {
208
- (0, utils_1.removeIf)(parent.comment.blockTags, (tag) => {
188
+ for (const tag of parent.comment.blockTags) {
209
189
  if (tag.tag === "@categoryDescription") {
210
- const { header, body } = models_1.Comment.splitPartsToHeaderAndBody(tag.content);
190
+ const { header, body } = Comment.splitPartsToHeaderAndBody(tag.content);
211
191
  const cat = categories.get(header);
212
192
  if (cat) {
213
193
  cat.description = body;
@@ -215,53 +195,14 @@ let CategoryPlugin = (() => {
215
195
  else {
216
196
  this.application.logger.warn(this.application.i18n.comment_for_0_includes_categoryDescription_for_1_but_no_child_in_group(parent.getFriendlyFullName(), header));
217
197
  }
218
- return true;
219
198
  }
220
- return false;
221
- });
199
+ }
222
200
  }
223
201
  for (const cat of categories.values()) {
224
202
  this.sortFunction(cat.children);
225
203
  }
226
204
  return Array.from(categories.values());
227
205
  }
228
- /**
229
- * Return the category of a given reflection.
230
- *
231
- * @param reflection The reflection.
232
- * @returns The category the reflection belongs to
233
- *
234
- * @privateRemarks
235
- * If you change this, also update getGroups in GroupPlugin accordingly.
236
- */
237
- extractCategories(reflection) {
238
- const categories = CategoryPlugin.getCategories(reflection);
239
- reflection.comment?.removeTags("@category");
240
- if (reflection.isDeclaration()) {
241
- for (const sig of reflection.getNonIndexSignatures()) {
242
- sig.comment?.removeTags("@category");
243
- }
244
- if (reflection.type?.type === "reflection") {
245
- reflection.type.declaration.comment?.removeTags("@category");
246
- for (const sig of reflection.type.declaration.getNonIndexSignatures()) {
247
- sig.comment?.removeTags("@category");
248
- }
249
- }
250
- }
251
- if (reflection.isDocument() && "category" in reflection.frontmatter) {
252
- categories.add(String(reflection.frontmatter["category"]));
253
- delete reflection.frontmatter["category"];
254
- }
255
- categories.delete("");
256
- for (const cat of categories) {
257
- if (cat in this.boosts) {
258
- this.usedBoosts.add(cat);
259
- reflection.relevanceBoost =
260
- (reflection.relevanceBoost ?? 1) * this.boosts[cat];
261
- }
262
- }
263
- return categories;
264
- }
265
206
  /**
266
207
  * Callback used to sort categories by name.
267
208
  *
@@ -296,7 +237,7 @@ let CategoryPlugin = (() => {
296
237
  return;
297
238
  for (const tag of comment.blockTags) {
298
239
  if (tag.tag === "@category") {
299
- categories.add(models_1.Comment.combineDisplayParts(tag.content).trim());
240
+ categories.add(Comment.combineDisplayParts(tag.content).trim());
300
241
  }
301
242
  }
302
243
  }
@@ -312,35 +253,12 @@ let CategoryPlugin = (() => {
312
253
  }
313
254
  }
314
255
  }
256
+ if (reflection.isDocument() && "category" in reflection.frontmatter) {
257
+ categories.add(String(reflection.frontmatter["category"]));
258
+ }
315
259
  categories.delete("");
316
260
  return categories;
317
261
  }
318
262
  };
319
- _CategoryPlugin_defaultCategory_accessor_storage = new WeakMap();
320
- _CategoryPlugin_categoryOrder_accessor_storage = new WeakMap();
321
- _CategoryPlugin_categorizeByGroup_accessor_storage = new WeakMap();
322
- _CategoryPlugin_boosts_accessor_storage = new WeakMap();
323
- __setFunctionName(_classThis, "CategoryPlugin");
324
- (() => {
325
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
326
- _defaultCategory_decorators = [(0, utils_1.Option)("defaultCategory")];
327
- _categoryOrder_decorators = [(0, utils_1.Option)("categoryOrder")];
328
- _categorizeByGroup_decorators = [(0, utils_1.Option)("categorizeByGroup")];
329
- _boosts_decorators = [(0, utils_1.Option)("searchCategoryBoosts")];
330
- __esDecorate(_classThis, null, _defaultCategory_decorators, { kind: "accessor", name: "defaultCategory", static: false, private: false, access: { has: obj => "defaultCategory" in obj, get: obj => obj.defaultCategory, set: (obj, value) => { obj.defaultCategory = value; } }, metadata: _metadata }, _defaultCategory_initializers, _defaultCategory_extraInitializers);
331
- __esDecorate(_classThis, null, _categoryOrder_decorators, { kind: "accessor", name: "categoryOrder", static: false, private: false, access: { has: obj => "categoryOrder" in obj, get: obj => obj.categoryOrder, set: (obj, value) => { obj.categoryOrder = value; } }, metadata: _metadata }, _categoryOrder_initializers, _categoryOrder_extraInitializers);
332
- __esDecorate(_classThis, null, _categorizeByGroup_decorators, { kind: "accessor", name: "categorizeByGroup", static: false, private: false, access: { has: obj => "categorizeByGroup" in obj, get: obj => obj.categorizeByGroup, set: (obj, value) => { obj.categorizeByGroup = value; } }, metadata: _metadata }, _categorizeByGroup_initializers, _categorizeByGroup_extraInitializers);
333
- __esDecorate(_classThis, null, _boosts_decorators, { kind: "accessor", name: "boosts", static: false, private: false, access: { has: obj => "boosts" in obj, get: obj => obj.boosts, set: (obj, value) => { obj.boosts = value; } }, metadata: _metadata }, _boosts_initializers, _boosts_extraInitializers);
334
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
335
- CategoryPlugin = _classThis = _classDescriptor.value;
336
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
337
- })();
338
- // For use in static methods
339
- _classThis.defaultCategory = "Other";
340
- _classThis.WEIGHTS = [];
341
- (() => {
342
- __runInitializers(_classThis, _classExtraInitializers);
343
- })();
344
- return CategoryPlugin = _classThis;
345
263
  })();
346
- exports.CategoryPlugin = CategoryPlugin;
264
+ export { CategoryPlugin };
@@ -1,4 +1,5 @@
1
- import { ConverterComponent } from "../components";
1
+ import { ConverterComponent } from "../components.js";
2
+ import type { Converter } from "../converter.js";
2
3
  /**
3
4
  * Handles most behavior triggered by comments. `@group` and `@category` are handled by their respective plugins, but everything else is here.
4
5
  *
@@ -66,10 +67,7 @@ export declare class CommentPlugin extends ConverterComponent {
66
67
  accessor defaultCategory: string;
67
68
  private _excludeKinds;
68
69
  private get excludeNotDocumentedKinds();
69
- /**
70
- * Create a new CommentPlugin instance.
71
- */
72
- initialize(): void;
70
+ constructor(owner: Converter);
73
71
  /**
74
72
  * Apply all comment tag modifiers to the given reflection.
75
73
  *