typedoc 0.26.11 → 0.27.0-beta.1

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 (338) 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 +212 -239
  40. package/dist/lib/converter/factories/index-signature.d.ts +3 -3
  41. package/dist/lib/converter/factories/index-signature.js +43 -26
  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 +372 -2
  89. package/dist/lib/internationalization/locales/en.d.cts +343 -2
  90. package/dist/lib/internationalization/locales/jp.cjs +13 -14
  91. package/dist/lib/internationalization/locales/jp.d.cts +307 -1
  92. package/dist/lib/internationalization/locales/ko.cjs +12 -11
  93. package/dist/lib/internationalization/locales/ko.d.cts +221 -1
  94. package/dist/lib/internationalization/locales/zh.cjs +43 -19
  95. package/dist/lib/internationalization/locales/zh.d.cts +409 -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 +29 -16
  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 +624 -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 +14 -0
  154. package/dist/lib/output/output.js +91 -0
  155. package/dist/lib/output/plugins/AssetsPlugin.d.ts +9 -8
  156. package/dist/lib/output/plugins/AssetsPlugin.js +64 -80
  157. package/dist/lib/output/plugins/HierarchyPlugin.d.ts +7 -0
  158. package/dist/lib/output/plugins/HierarchyPlugin.js +67 -0
  159. package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
  160. package/dist/lib/output/plugins/IconsPlugin.js +28 -84
  161. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
  162. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
  163. package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
  164. package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
  165. package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
  166. package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
  167. package/dist/lib/output/plugins/index.d.ts +7 -6
  168. package/dist/lib/output/plugins/index.js +7 -15
  169. package/dist/lib/output/renderer.d.ts +14 -13
  170. package/dist/lib/output/renderer.js +130 -185
  171. package/dist/lib/output/theme.d.ts +9 -5
  172. package/dist/lib/output/theme.js +14 -62
  173. package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
  174. package/dist/lib/output/themes/MarkedPlugin.js +152 -117
  175. package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
  176. package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
  177. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
  178. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
  179. package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
  180. package/dist/lib/output/themes/default/Slugger.js +46 -0
  181. package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
  182. package/dist/lib/output/themes/default/layouts/default.js +48 -36
  183. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
  184. package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
  185. package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
  186. package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
  187. package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
  188. package/dist/lib/output/themes/default/partials/comment.js +52 -29
  189. package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
  190. package/dist/lib/output/themes/default/partials/footer.js +11 -14
  191. package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
  192. package/dist/lib/output/themes/default/partials/header.js +9 -13
  193. package/dist/lib/output/themes/default/partials/hierarchy.d.ts +4 -4
  194. package/dist/lib/output/themes/default/partials/hierarchy.js +12 -15
  195. package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
  196. package/dist/lib/output/themes/default/partials/icon.js +78 -73
  197. package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
  198. package/dist/lib/output/themes/default/partials/index.js +19 -22
  199. package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
  200. package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
  201. package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
  202. package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
  203. package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
  204. package/dist/lib/output/themes/default/partials/member.js +19 -24
  205. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
  206. package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
  207. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
  208. package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
  209. package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
  210. package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
  211. package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
  212. package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
  213. package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
  214. package/dist/lib/output/themes/default/partials/members.js +10 -42
  215. package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
  216. package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
  217. package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
  218. package/dist/lib/output/themes/default/partials/navigation.js +51 -62
  219. package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
  220. package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
  221. package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
  222. package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
  223. package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
  224. package/dist/lib/output/themes/default/partials/type.js +8 -388
  225. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
  226. package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
  227. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
  228. package/dist/lib/output/themes/default/partials/typeDetails.js +222 -0
  229. package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
  230. package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
  231. package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
  232. package/dist/lib/output/themes/default/templates/document.js +3 -7
  233. package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
  234. package/dist/lib/output/themes/default/templates/hierarchy.js +24 -22
  235. package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
  236. package/dist/lib/output/themes/default/templates/index.js +3 -7
  237. package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
  238. package/dist/lib/output/themes/default/templates/reflection.js +32 -34
  239. package/dist/lib/output/themes/lib.d.ts +17 -3
  240. package/dist/lib/output/themes/lib.js +118 -50
  241. package/dist/lib/serialization/components.d.ts +2 -5
  242. package/dist/lib/serialization/components.js +1 -2
  243. package/dist/lib/serialization/deserializer.d.ts +21 -7
  244. package/dist/lib/serialization/deserializer.js +138 -123
  245. package/dist/lib/serialization/events.d.ts +2 -2
  246. package/dist/lib/serialization/events.js +6 -5
  247. package/dist/lib/serialization/index.d.ts +5 -5
  248. package/dist/lib/serialization/index.js +4 -33
  249. package/dist/lib/serialization/schema.d.ts +8 -2
  250. package/dist/lib/serialization/schema.js +2 -2
  251. package/dist/lib/serialization/serializer.d.ts +11 -5
  252. package/dist/lib/serialization/serializer.js +32 -25
  253. package/dist/lib/utils/array.d.ts +3 -0
  254. package/dist/lib/utils/array.js +26 -27
  255. package/dist/lib/utils/component.d.ts +2 -44
  256. package/dist/lib/utils/component.js +10 -102
  257. package/dist/lib/utils/entry-point.d.ts +3 -4
  258. package/dist/lib/utils/entry-point.js +114 -85
  259. package/dist/lib/utils/enum.js +6 -14
  260. package/dist/lib/utils/events.js +6 -12
  261. package/dist/lib/utils/fs.js +50 -91
  262. package/dist/lib/utils/general.d.ts +2 -1
  263. package/dist/lib/utils/general.js +50 -40
  264. package/dist/lib/utils/highlighter.js +30 -57
  265. package/dist/lib/utils/hooks.js +7 -13
  266. package/dist/lib/utils/html-entities.d.ts +8926 -0
  267. package/dist/lib/utils/html-entities.js +2329 -0
  268. package/dist/lib/utils/html.d.ts +8 -0
  269. package/dist/lib/utils/html.js +81 -34
  270. package/dist/lib/utils/index.d.ts +22 -22
  271. package/dist/lib/utils/index.js +20 -91
  272. package/dist/lib/utils/jsx.d.ts +12 -6
  273. package/dist/lib/utils/jsx.elements.d.ts +1 -1
  274. package/dist/lib/utils/jsx.elements.js +3 -4
  275. package/dist/lib/utils/jsx.js +82 -52
  276. package/dist/lib/utils/loggers.d.ts +3 -3
  277. package/dist/lib/utils/loggers.js +36 -46
  278. package/dist/lib/utils/map.js +6 -13
  279. package/dist/lib/utils/minimalSourceFile.js +5 -7
  280. package/dist/lib/utils/options/declaration.d.ts +35 -7
  281. package/dist/lib/utils/options/declaration.js +20 -22
  282. package/dist/lib/utils/options/defaults.d.ts +3 -2
  283. package/dist/lib/utils/options/defaults.js +18 -38
  284. package/dist/lib/utils/options/help.d.ts +2 -2
  285. package/dist/lib/utils/options/help.js +7 -10
  286. package/dist/lib/utils/options/index.d.ts +6 -6
  287. package/dist/lib/utils/options/index.js +4 -18
  288. package/dist/lib/utils/options/options.d.ts +8 -5
  289. package/dist/lib/utils/options/options.js +47 -71
  290. package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
  291. package/dist/lib/utils/options/readers/arguments.js +15 -17
  292. package/dist/lib/utils/options/readers/index.d.ts +4 -4
  293. package/dist/lib/utils/options/readers/index.js +4 -11
  294. package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
  295. package/dist/lib/utils/options/readers/package-json.js +15 -21
  296. package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
  297. package/dist/lib/utils/options/readers/tsconfig.js +54 -63
  298. package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
  299. package/dist/lib/utils/options/readers/typedoc.js +44 -76
  300. package/dist/lib/utils/options/sources/index.d.ts +1 -1
  301. package/dist/lib/utils/options/sources/index.js +1 -5
  302. package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
  303. package/dist/lib/utils/options/sources/typedoc.js +232 -196
  304. package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
  305. package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
  306. package/dist/lib/utils/package-manifest.d.ts +1 -1
  307. package/dist/lib/utils/package-manifest.js +15 -19
  308. package/dist/lib/utils/paths.js +9 -15
  309. package/dist/lib/utils/perf.js +6 -11
  310. package/dist/lib/utils/plugins.d.ts +1 -1
  311. package/dist/lib/utils/plugins.js +7 -10
  312. package/dist/lib/utils/reflections.d.ts +1 -1
  313. package/dist/lib/utils/reflections.js +9 -12
  314. package/dist/lib/utils/set.js +2 -6
  315. package/dist/lib/utils/sort.d.ts +3 -3
  316. package/dist/lib/utils/sort.js +20 -24
  317. package/dist/lib/utils/tsconfig.d.ts +1 -1
  318. package/dist/lib/utils/tsconfig.js +13 -21
  319. package/dist/lib/utils/tsutils.d.ts +1 -1
  320. package/dist/lib/utils/tsutils.js +3 -30
  321. package/dist/lib/utils/validation.js +6 -12
  322. package/dist/lib/validation/documentation.d.ts +2 -2
  323. package/dist/lib/validation/documentation.js +26 -29
  324. package/dist/lib/validation/exports.d.ts +2 -2
  325. package/dist/lib/validation/exports.js +9 -11
  326. package/dist/lib/validation/links.d.ts +2 -2
  327. package/dist/lib/validation/links.js +4 -7
  328. package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
  329. package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
  330. package/package.json +17 -14
  331. package/static/main.js +4 -4
  332. package/static/style.css +109 -17
  333. package/tsdoc.json +30 -0
  334. package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
  335. package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
  336. package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
  337. package/dist/lib/output/themes/default/partials/parameter.js +0 -79
  338. package/dist/lib/utils/html-entities.json +0 -2326
@@ -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,28 +32,39 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
32
  }
34
33
  return useValue ? value : void 0;
35
34
  };
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.Comment = exports.CommentTag = void 0;
38
- const utils_1 = require("../../utils");
39
- const ReflectionSymbolId_1 = require("../reflections/ReflectionSymbolId");
40
- const general_1 = require("../../utils/general");
35
+ import { assertNever, removeIf } from "../../utils/index.js";
36
+ import { ReflectionSymbolId } from "../reflections/ReflectionSymbolId.js";
37
+ import { NonEnumerable } from "../../utils/general.js";
41
38
  /**
42
39
  * A model that represents a single TypeDoc comment tag.
43
40
  *
44
41
  * Tags are stored in the {@link Comment.blockTags} property.
45
42
  * @category Comments
46
43
  */
47
- class CommentTag {
44
+ export class CommentTag {
45
+ /**
46
+ * The name of this tag, e.g. `@returns`, `@example`
47
+ */
48
+ tag;
49
+ /**
50
+ * Some tags, (`@typedef`, `@param`, `@property`, etc.) may have a user defined identifier associated with them.
51
+ * If this tag is one of those, it will be parsed out and included here.
52
+ */
53
+ name;
54
+ /**
55
+ * The actual body text of this tag.
56
+ */
57
+ content;
58
+ /**
59
+ * A flag which may be set by plugins to prevent TypeDoc from rendering this tag, if the plugin provides
60
+ * custom rendering. Note: This flag is **not** serialized, it is expected to be set just before the comment
61
+ * is rendered.
62
+ */
63
+ skipRendering = false;
48
64
  /**
49
65
  * Create a new CommentTag instance.
50
66
  */
51
67
  constructor(tag, text) {
52
- /**
53
- * A flag which may be set by plugins to prevent TypeDoc from rendering this tag, if the plugin provides
54
- * custom rendering. Note: This flag is **not** serialized, it is expected to be set just before the comment
55
- * is rendered.
56
- */
57
- this.skipRendering = false;
58
68
  this.tag = tag;
59
69
  this.content = text;
60
70
  }
@@ -89,7 +99,6 @@ class CommentTag {
89
99
  this.content = Comment.deserializeDisplayParts(de, obj.content);
90
100
  }
91
101
  }
92
- exports.CommentTag = CommentTag;
93
102
  /**
94
103
  * A model that represents a comment.
95
104
  *
@@ -98,7 +107,6 @@ exports.CommentTag = CommentTag;
98
107
  * @category Comments
99
108
  */
100
109
  let Comment = (() => {
101
- var _a;
102
110
  let _sourcePath_decorators;
103
111
  let _sourcePath_initializers = [];
104
112
  let _sourcePath_extraInitializers = [];
@@ -108,347 +116,402 @@ let Comment = (() => {
108
116
  let _inheritedFromParentDeclaration_decorators;
109
117
  let _inheritedFromParentDeclaration_initializers = [];
110
118
  let _inheritedFromParentDeclaration_extraInitializers = [];
111
- return _a = class Comment {
112
- /**
113
- * Debugging utility for combining parts into a simple string. Not suitable for
114
- * rendering, but can be useful in tests.
115
- */
116
- static combineDisplayParts(parts) {
117
- let result = "";
118
- for (const item of parts || []) {
119
- switch (item.kind) {
120
- case "text":
121
- case "code":
122
- case "relative-link":
123
- result += item.text;
124
- break;
125
- case "inline-tag":
126
- result += `{${item.tag} ${item.text}}`;
127
- break;
128
- default:
129
- (0, utils_1.assertNever)(item);
130
- }
119
+ return class Comment {
120
+ static {
121
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
122
+ _sourcePath_decorators = [NonEnumerable];
123
+ _discoveryId_decorators = [NonEnumerable];
124
+ _inheritedFromParentDeclaration_decorators = [NonEnumerable];
125
+ __esDecorate(null, null, _sourcePath_decorators, { kind: "field", name: "sourcePath", static: false, private: false, access: { has: obj => "sourcePath" in obj, get: obj => obj.sourcePath, set: (obj, value) => { obj.sourcePath = value; } }, metadata: _metadata }, _sourcePath_initializers, _sourcePath_extraInitializers);
126
+ __esDecorate(null, null, _discoveryId_decorators, { kind: "field", name: "discoveryId", static: false, private: false, access: { has: obj => "discoveryId" in obj, get: obj => obj.discoveryId, set: (obj, value) => { obj.discoveryId = value; } }, metadata: _metadata }, _discoveryId_initializers, _discoveryId_extraInitializers);
127
+ __esDecorate(null, null, _inheritedFromParentDeclaration_decorators, { kind: "field", name: "inheritedFromParentDeclaration", static: false, private: false, access: { has: obj => "inheritedFromParentDeclaration" in obj, get: obj => obj.inheritedFromParentDeclaration, set: (obj, value) => { obj.inheritedFromParentDeclaration = value; } }, metadata: _metadata }, _inheritedFromParentDeclaration_initializers, _inheritedFromParentDeclaration_extraInitializers);
128
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
129
+ }
130
+ /**
131
+ * Debugging utility for combining parts into a simple string. Not suitable for
132
+ * rendering, but can be useful in tests.
133
+ */
134
+ static combineDisplayParts(parts) {
135
+ let result = "";
136
+ for (const item of parts || []) {
137
+ switch (item.kind) {
138
+ case "text":
139
+ case "code":
140
+ case "relative-link":
141
+ result += item.text;
142
+ break;
143
+ case "inline-tag":
144
+ result += `{${item.tag} ${item.text}}`;
145
+ break;
146
+ default:
147
+ assertNever(item);
131
148
  }
132
- return result;
133
- }
134
- /**
135
- * Helper utility to clone {@link Comment.summary} or {@link CommentTag.content}
136
- */
137
- static cloneDisplayParts(parts) {
138
- return parts.map((p) => ({ ...p }));
139
149
  }
140
- static serializeDisplayParts(serializer, parts) {
141
- return parts?.map((part) => {
142
- switch (part.kind) {
143
- case "text":
144
- case "code":
145
- return { ...part };
146
- case "inline-tag": {
147
- let target;
148
- if (typeof part.target === "string") {
149
- target = part.target;
150
+ return result;
151
+ }
152
+ /**
153
+ * Helper utility to clone {@link Comment.summary} or {@link CommentTag.content}
154
+ */
155
+ static cloneDisplayParts(parts) {
156
+ return parts.map((p) => ({ ...p }));
157
+ }
158
+ static serializeDisplayParts(serializer, parts) {
159
+ return parts?.map((part) => {
160
+ switch (part.kind) {
161
+ case "text":
162
+ case "code":
163
+ return { ...part };
164
+ case "inline-tag": {
165
+ let target;
166
+ if (typeof part.target === "string") {
167
+ target = part.target;
168
+ }
169
+ else if (part.target) {
170
+ if ("id" in part.target) {
171
+ target = part.target.id;
150
172
  }
151
- else if (part.target) {
152
- if ("id" in part.target) {
153
- target = part.target.id;
154
- }
155
- else {
156
- target = part.target.toObject(serializer);
157
- }
173
+ else {
174
+ target = part.target.toObject(serializer);
158
175
  }
159
- return {
160
- ...part,
161
- target,
176
+ }
177
+ return {
178
+ ...part,
179
+ target,
180
+ };
181
+ }
182
+ case "relative-link": {
183
+ return {
184
+ ...part,
185
+ };
186
+ }
187
+ }
188
+ });
189
+ }
190
+ //Since display parts are plain objects, this lives here
191
+ static deserializeDisplayParts(de, parts) {
192
+ const links = [];
193
+ const files = [];
194
+ const result = parts.map((part) => {
195
+ switch (part.kind) {
196
+ case "text":
197
+ case "code":
198
+ return { ...part };
199
+ case "inline-tag": {
200
+ if (typeof part.target === "number") {
201
+ const part2 = {
202
+ kind: part.kind,
203
+ tag: part.tag,
204
+ text: part.text,
205
+ target: undefined,
206
+ tsLinkText: part.tsLinkText,
162
207
  };
208
+ links.push([part.target, part2]);
209
+ return part2;
163
210
  }
164
- case "relative-link": {
211
+ else if (typeof part.target === "string" ||
212
+ part.target === undefined) {
165
213
  return {
166
- ...part,
214
+ kind: "inline-tag",
215
+ tag: part.tag,
216
+ text: part.text,
217
+ target: part.target,
218
+ tsLinkText: part.tsLinkText,
167
219
  };
168
220
  }
169
- }
170
- });
171
- }
172
- //Since display parts are plain objects, this lives here
173
- static deserializeDisplayParts(de, parts) {
174
- const links = [];
175
- const files = [];
176
- const result = parts.map((part) => {
177
- switch (part.kind) {
178
- case "text":
179
- case "code":
180
- return { ...part };
181
- case "inline-tag": {
182
- if (typeof part.target === "number") {
183
- const part2 = {
184
- kind: part.kind,
185
- tag: part.tag,
186
- text: part.text,
187
- target: undefined,
188
- tsLinkText: part.tsLinkText,
189
- };
190
- links.push([part.target, part2]);
191
- return part2;
192
- }
193
- else if (typeof part.target === "string" ||
194
- part.target === undefined) {
195
- return {
196
- kind: "inline-tag",
197
- tag: part.tag,
198
- text: part.text,
199
- target: part.target,
200
- tsLinkText: part.tsLinkText,
201
- };
202
- }
203
- else if (typeof part.target === "object") {
204
- return {
205
- kind: "inline-tag",
206
- tag: part.tag,
207
- text: part.text,
208
- target: new ReflectionSymbolId_1.ReflectionSymbolId(part.target),
209
- tsLinkText: part.tsLinkText,
210
- };
211
- }
212
- else {
213
- (0, utils_1.assertNever)(part.target);
214
- }
215
- break;
221
+ else if (typeof part.target === "object") {
222
+ return {
223
+ kind: "inline-tag",
224
+ tag: part.tag,
225
+ text: part.text,
226
+ target: new ReflectionSymbolId(part.target),
227
+ tsLinkText: part.tsLinkText,
228
+ };
216
229
  }
217
- case "relative-link": {
218
- if (part.target) {
219
- const part2 = {
220
- kind: "relative-link",
221
- text: part.text,
222
- target: null,
223
- };
224
- files.push([part.target, part2]);
225
- return part2;
226
- }
227
- return { ...part, target: undefined };
230
+ else {
231
+ assertNever(part.target);
228
232
  }
233
+ break;
229
234
  }
230
- });
231
- if (links.length || files.length) {
232
- de.defer((project) => {
233
- for (const [oldFileId, part] of files) {
234
- part.target = de.oldFileIdToNewFileId[oldFileId];
235
- }
236
- for (const [oldId, part] of links) {
237
- part.target = project.getReflectionById(de.oldIdToNewId[oldId] ?? -1);
238
- if (!part.target) {
239
- de.logger.warn(de.application.i18n.serialized_project_referenced_0_not_part_of_project(oldId.toString()));
240
- }
235
+ case "relative-link": {
236
+ if (part.target) {
237
+ const part2 = {
238
+ kind: "relative-link",
239
+ text: part.text,
240
+ target: null,
241
+ targetAnchor: part.targetAnchor,
242
+ };
243
+ files.push([part.target, part2]);
244
+ return part2;
241
245
  }
242
- });
246
+ return {
247
+ ...part,
248
+ target: undefined,
249
+ targetAnchor: part.targetAnchor,
250
+ };
251
+ }
243
252
  }
244
- return result;
245
- }
246
- /**
247
- * Splits the provided parts into a header (first line, as a string)
248
- * and body (remaining lines). If the header line contains inline tags
249
- * they will be serialized to a string.
250
- */
251
- static splitPartsToHeaderAndBody(parts) {
252
- let index = parts.findIndex((part) => {
253
- switch (part.kind) {
254
- case "text":
255
- case "code":
256
- return part.text.includes("\n");
257
- case "inline-tag":
258
- case "relative-link":
259
- return false;
253
+ });
254
+ if (links.length || files.length) {
255
+ de.defer((project) => {
256
+ for (const [oldFileId, part] of files) {
257
+ part.target = de.oldFileIdToNewFileId[oldFileId];
258
+ }
259
+ for (const [oldId, part] of links) {
260
+ part.target = project.getReflectionById(de.oldIdToNewId[oldId] ?? -1);
261
+ if (!part.target) {
262
+ de.logger.warn(de.application.i18n.serialized_project_referenced_0_not_part_of_project(oldId.toString()));
263
+ }
260
264
  }
261
265
  });
262
- if (index === -1) {
263
- return {
264
- header: _a.combineDisplayParts(parts),
265
- body: [],
266
- };
267
- }
268
- // Do not split a code block, stop the header at the end of the previous block
269
- if (parts[index].kind === "code") {
270
- --index;
271
- }
272
- if (index === -1) {
273
- return { header: "", body: _a.cloneDisplayParts(parts) };
274
- }
275
- let header = _a.combineDisplayParts(parts.slice(0, index));
276
- const split = parts[index].text.indexOf("\n");
277
- let body;
278
- if (split === -1) {
279
- header += parts[index].text;
280
- body = _a.cloneDisplayParts(parts.slice(index + 1));
281
- }
282
- else {
283
- header += parts[index].text.substring(0, split);
284
- body = _a.cloneDisplayParts(parts.slice(index));
285
- body[0].text = body[0].text.substring(split + 1);
286
- }
287
- if (!body[0].text) {
288
- body.shift();
289
- }
290
- return { header: header.trim(), body };
291
- }
292
- /**
293
- * Creates a new Comment instance.
294
- */
295
- constructor(summary = [], blockTags = [], modifierTags = new Set()) {
296
- /**
297
- * All associated block level tags.
298
- */
299
- this.blockTags = [];
300
- /**
301
- * All modifier tags present on the comment, e.g. `@alpha`, `@beta`.
302
- */
303
- this.modifierTags = new Set();
304
- /**
305
- * Full path to the file where this comment originated from, if any.
306
- * This field will not be serialized, so will not be present when handling JSON-revived reflections.
307
- *
308
- * Note: This field is non-enumerable to make testing comment contents with `deepEqual` easier.
309
- */
310
- this.sourcePath = __runInitializers(this, _sourcePath_initializers, void 0);
311
- /**
312
- * Internal discovery ID used to prevent symbol comments from
313
- * being duplicated on signatures. Only set when the comment was created
314
- * from a `ts.CommentRange`.
315
- * @internal
316
- */
317
- this.discoveryId = (__runInitializers(this, _sourcePath_extraInitializers), __runInitializers(this, _discoveryId_initializers, void 0));
318
- /**
319
- * If the comment was inherited from a different "parent" declaration
320
- * (see #2545), then it is desirable to know this as any `@param` tags
321
- * which do not apply should not cause warnings. This is not serialized,
322
- * and only set when the comment was created from a `ts.CommentRange`.
323
- */
324
- this.inheritedFromParentDeclaration = (__runInitializers(this, _discoveryId_extraInitializers), __runInitializers(this, _inheritedFromParentDeclaration_initializers, void 0));
325
- __runInitializers(this, _inheritedFromParentDeclaration_extraInitializers);
326
- this.summary = summary;
327
- this.blockTags = blockTags;
328
- this.modifierTags = modifierTags;
329
- extractLabelTag(this);
330
266
  }
331
- /**
332
- * Checks if this comment is roughly equal to the other comment.
333
- * This isn't exactly equal, but just "roughly equal" by the comment
334
- * text.
335
- */
336
- similarTo(other) {
337
- if (_a.combineDisplayParts(this.summary) !==
338
- _a.combineDisplayParts(other.summary)) {
339
- return false;
340
- }
341
- // Ignore modifier tags, as they could cause false negatives
342
- // if a cascaded modifier tag is present in one comment but not the other.
343
- if (this.blockTags.length !== other.blockTags.length) {
344
- return false;
345
- }
346
- for (let i = 0; i < this.blockTags.length; ++i) {
347
- if (!this.blockTags[i].similarTo(other.blockTags[i])) {
267
+ return result;
268
+ }
269
+ /**
270
+ * Splits the provided parts into a header (first line, as a string)
271
+ * and body (remaining lines). If the header line contains inline tags
272
+ * they will be serialized to a string.
273
+ */
274
+ static splitPartsToHeaderAndBody(parts) {
275
+ let index = parts.findIndex((part) => {
276
+ switch (part.kind) {
277
+ case "text":
278
+ case "code":
279
+ return part.text.includes("\n");
280
+ case "inline-tag":
281
+ case "relative-link":
348
282
  return false;
349
- }
350
283
  }
351
- return true;
352
- }
353
- /**
354
- * Create a deep clone of this comment.
355
- */
356
- clone() {
357
- const comment = new _a(_a.cloneDisplayParts(this.summary), this.blockTags.map((tag) => tag.clone()), new Set(this.modifierTags));
358
- comment.discoveryId = this.discoveryId;
359
- comment.sourcePath = this.sourcePath;
360
- comment.inheritedFromParentDeclaration =
361
- this.inheritedFromParentDeclaration;
362
- return comment;
284
+ });
285
+ if (index === -1) {
286
+ return {
287
+ header: Comment.combineDisplayParts(parts),
288
+ body: [],
289
+ };
363
290
  }
364
- /**
365
- * Returns true if this comment is completely empty.
366
- * @internal
367
- */
368
- isEmpty() {
369
- return !this.hasVisibleComponent() && this.modifierTags.size === 0;
291
+ // Do not split a code block, stop the header at the end of the previous block
292
+ if (parts[index].kind === "code") {
293
+ --index;
370
294
  }
371
- /**
372
- * Has this comment a visible component?
373
- *
374
- * @returns TRUE when this comment has a visible component.
375
- */
376
- hasVisibleComponent() {
377
- return (this.summary.some((x) => x.kind !== "text" || x.text !== "") ||
378
- this.blockTags.length > 0);
295
+ if (index === -1) {
296
+ return { header: "", body: Comment.cloneDisplayParts(parts) };
379
297
  }
380
- /**
381
- * Test whether this comment contains a tag with the given name.
382
- *
383
- * @param tagName The name of the tag to look for.
384
- * @returns TRUE when this comment contains a tag with the given name, otherwise FALSE.
385
- */
386
- hasModifier(tagName) {
387
- return this.modifierTags.has(tagName);
298
+ let header = Comment.combineDisplayParts(parts.slice(0, index));
299
+ const split = parts[index].text.indexOf("\n");
300
+ let body;
301
+ if (split === -1) {
302
+ header += parts[index].text;
303
+ body = Comment.cloneDisplayParts(parts.slice(index + 1));
388
304
  }
389
- removeModifier(tagName) {
390
- this.modifierTags.delete(tagName);
305
+ else {
306
+ header += parts[index].text.substring(0, split);
307
+ body = Comment.cloneDisplayParts(parts.slice(index));
308
+ body[0].text = body[0].text.substring(split + 1);
391
309
  }
392
- /**
393
- * Return the first tag with the given name.
394
- *
395
- * @param tagName The name of the tag to look for.
396
- * @returns The found tag or undefined.
397
- */
398
- getTag(tagName) {
399
- return this.blockTags.find((tag) => tag.tag === tagName);
310
+ if (!body[0].text) {
311
+ body.shift();
400
312
  }
401
- /**
402
- * Get all tags with the given tag name.
403
- */
404
- getTags(tagName) {
405
- return this.blockTags.filter((tag) => tag.tag === tagName);
313
+ return { header: header.trim(), body };
314
+ }
315
+ /**
316
+ * The content of the comment which is not associated with a block tag.
317
+ */
318
+ summary;
319
+ /**
320
+ * All associated block level tags.
321
+ */
322
+ blockTags = [];
323
+ /**
324
+ * All modifier tags present on the comment, e.g. `@alpha`, `@beta`.
325
+ */
326
+ modifierTags = new Set();
327
+ /**
328
+ * Label associated with this reflection, if any (https://tsdoc.org/pages/tags/label/)
329
+ */
330
+ label;
331
+ /**
332
+ * Full path to the file where this comment originated from, if any.
333
+ * This field will not be serialized, so will not be present when handling JSON-revived reflections.
334
+ *
335
+ * Note: This field is non-enumerable to make testing comment contents with `deepEqual` easier.
336
+ */
337
+ sourcePath = __runInitializers(this, _sourcePath_initializers, void 0);
338
+ /**
339
+ * Internal discovery ID used to prevent symbol comments from
340
+ * being duplicated on signatures. Only set when the comment was created
341
+ * from a `ts.CommentRange`.
342
+ * @internal
343
+ */
344
+ discoveryId = (__runInitializers(this, _sourcePath_extraInitializers), __runInitializers(this, _discoveryId_initializers, void 0));
345
+ /**
346
+ * If the comment was inherited from a different "parent" declaration
347
+ * (see #2545), then it is desirable to know this as any `@param` tags
348
+ * which do not apply should not cause warnings. This is not serialized,
349
+ * and only set when the comment was created from a `ts.CommentRange`.
350
+ */
351
+ inheritedFromParentDeclaration = (__runInitializers(this, _discoveryId_extraInitializers), __runInitializers(this, _inheritedFromParentDeclaration_initializers, void 0));
352
+ /**
353
+ * Creates a new Comment instance.
354
+ */
355
+ constructor(summary = [], blockTags = [], modifierTags = new Set()) {
356
+ __runInitializers(this, _inheritedFromParentDeclaration_extraInitializers);
357
+ this.summary = summary;
358
+ this.blockTags = blockTags;
359
+ this.modifierTags = modifierTags;
360
+ extractLabelTag(this);
361
+ }
362
+ /**
363
+ * Gets either the `@summary` tag, or a short version of the comment summary
364
+ * section for rendering in module/namespace pages.
365
+ */
366
+ getShortSummary(useFirstParagraph) {
367
+ const tag = this.getTag("@summary");
368
+ if (tag)
369
+ return tag.content;
370
+ if (!useFirstParagraph)
371
+ return [];
372
+ let partsEnd = this.summary.findIndex((part) => {
373
+ switch (part.kind) {
374
+ case "text":
375
+ return part.text.includes("\n\n");
376
+ case "code":
377
+ return part.text.includes("\n");
378
+ case "inline-tag":
379
+ case "relative-link":
380
+ return false;
381
+ default:
382
+ assertNever(part);
383
+ }
384
+ });
385
+ const foundEnd = partsEnd !== -1;
386
+ if (partsEnd === -1) {
387
+ partsEnd = this.summary.length - 1;
406
388
  }
407
- getIdentifiedTag(identifier, tagName) {
408
- return this.blockTags.find((tag) => tag.tag === tagName && tag.name === identifier);
389
+ const summaryParts = this.summary.slice(0, partsEnd);
390
+ if (partsEnd !== -1) {
391
+ const text = this.summary[partsEnd].text;
392
+ const paragraphEnd = text.indexOf("\n\n");
393
+ if (paragraphEnd !== -1) {
394
+ summaryParts.push({
395
+ ...this.summary[partsEnd],
396
+ text: text.slice(0, paragraphEnd),
397
+ });
398
+ }
399
+ else if (!foundEnd) {
400
+ summaryParts.push(this.summary[partsEnd]);
401
+ }
409
402
  }
410
- /**
411
- * Removes all block tags with the given tag name from the comment.
412
- * @param tagName
413
- */
414
- removeTags(tagName) {
415
- (0, utils_1.removeIf)(this.blockTags, (tag) => tag.tag === tagName);
403
+ return summaryParts;
404
+ }
405
+ /**
406
+ * Checks if this comment is roughly equal to the other comment.
407
+ * This isn't exactly equal, but just "roughly equal" by the comment
408
+ * text.
409
+ */
410
+ similarTo(other) {
411
+ if (Comment.combineDisplayParts(this.summary) !==
412
+ Comment.combineDisplayParts(other.summary)) {
413
+ return false;
416
414
  }
417
- toObject(serializer) {
418
- return {
419
- summary: _a.serializeDisplayParts(serializer, this.summary),
420
- blockTags: serializer.toObjectsOptional(this.blockTags),
421
- modifierTags: this.modifierTags.size > 0
422
- ? Array.from(this.modifierTags)
423
- : undefined,
424
- label: this.label,
425
- };
415
+ // Ignore modifier tags, as they could cause false negatives
416
+ // if a cascaded modifier tag is present in one comment but not the other.
417
+ if (this.blockTags.length !== other.blockTags.length) {
418
+ return false;
426
419
  }
427
- fromObject(de, obj) {
428
- this.summary = _a.deserializeDisplayParts(de, obj.summary);
429
- this.blockTags =
430
- obj.blockTags?.map((tagObj) => {
431
- const tag = new CommentTag(tagObj.tag, []);
432
- de.fromObject(tag, tagObj);
433
- return tag;
434
- }) || [];
435
- this.modifierTags = new Set(obj.modifierTags);
436
- this.label = obj.label;
420
+ for (let i = 0; i < this.blockTags.length; ++i) {
421
+ if (!this.blockTags[i].similarTo(other.blockTags[i])) {
422
+ return false;
423
+ }
437
424
  }
438
- },
439
- (() => {
440
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
441
- _sourcePath_decorators = [general_1.NonEnumerable];
442
- _discoveryId_decorators = [general_1.NonEnumerable];
443
- _inheritedFromParentDeclaration_decorators = [general_1.NonEnumerable];
444
- __esDecorate(null, null, _sourcePath_decorators, { kind: "field", name: "sourcePath", static: false, private: false, access: { has: obj => "sourcePath" in obj, get: obj => obj.sourcePath, set: (obj, value) => { obj.sourcePath = value; } }, metadata: _metadata }, _sourcePath_initializers, _sourcePath_extraInitializers);
445
- __esDecorate(null, null, _discoveryId_decorators, { kind: "field", name: "discoveryId", static: false, private: false, access: { has: obj => "discoveryId" in obj, get: obj => obj.discoveryId, set: (obj, value) => { obj.discoveryId = value; } }, metadata: _metadata }, _discoveryId_initializers, _discoveryId_extraInitializers);
446
- __esDecorate(null, null, _inheritedFromParentDeclaration_decorators, { kind: "field", name: "inheritedFromParentDeclaration", static: false, private: false, access: { has: obj => "inheritedFromParentDeclaration" in obj, get: obj => obj.inheritedFromParentDeclaration, set: (obj, value) => { obj.inheritedFromParentDeclaration = value; } }, metadata: _metadata }, _inheritedFromParentDeclaration_initializers, _inheritedFromParentDeclaration_extraInitializers);
447
- if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
448
- })(),
449
- _a;
425
+ return true;
426
+ }
427
+ /**
428
+ * Create a deep clone of this comment.
429
+ */
430
+ clone() {
431
+ const comment = new Comment(Comment.cloneDisplayParts(this.summary), this.blockTags.map((tag) => tag.clone()), new Set(this.modifierTags));
432
+ comment.discoveryId = this.discoveryId;
433
+ comment.sourcePath = this.sourcePath;
434
+ comment.inheritedFromParentDeclaration =
435
+ this.inheritedFromParentDeclaration;
436
+ return comment;
437
+ }
438
+ /**
439
+ * Returns true if this comment is completely empty.
440
+ * @internal
441
+ */
442
+ isEmpty() {
443
+ return !this.hasVisibleComponent() && this.modifierTags.size === 0;
444
+ }
445
+ /**
446
+ * Has this comment a visible component?
447
+ *
448
+ * @returns TRUE when this comment has a visible component.
449
+ */
450
+ hasVisibleComponent() {
451
+ return (this.summary.some((x) => x.kind !== "text" || x.text !== "") ||
452
+ this.blockTags.length > 0);
453
+ }
454
+ /**
455
+ * Test whether this comment contains a tag with the given name.
456
+ *
457
+ * @param tagName The name of the tag to look for.
458
+ * @returns TRUE when this comment contains a tag with the given name, otherwise FALSE.
459
+ */
460
+ hasModifier(tagName) {
461
+ return this.modifierTags.has(tagName);
462
+ }
463
+ removeModifier(tagName) {
464
+ this.modifierTags.delete(tagName);
465
+ }
466
+ /**
467
+ * Return the first tag with the given name.
468
+ *
469
+ * @param tagName The name of the tag to look for.
470
+ * @returns The found tag or undefined.
471
+ */
472
+ getTag(tagName) {
473
+ return this.blockTags.find((tag) => tag.tag === tagName);
474
+ }
475
+ /**
476
+ * Get all tags with the given tag name.
477
+ */
478
+ getTags(tagName) {
479
+ return this.blockTags.filter((tag) => tag.tag === tagName);
480
+ }
481
+ getIdentifiedTag(identifier, tagName) {
482
+ return this.blockTags.find((tag) => tag.tag === tagName && tag.name === identifier);
483
+ }
484
+ /**
485
+ * Removes all block tags with the given tag name from the comment.
486
+ * @param tagName
487
+ */
488
+ removeTags(tagName) {
489
+ removeIf(this.blockTags, (tag) => tag.tag === tagName);
490
+ }
491
+ toObject(serializer) {
492
+ return {
493
+ summary: Comment.serializeDisplayParts(serializer, this.summary),
494
+ blockTags: serializer.toObjectsOptional(this.blockTags),
495
+ modifierTags: this.modifierTags.size > 0
496
+ ? Array.from(this.modifierTags)
497
+ : undefined,
498
+ label: this.label,
499
+ };
500
+ }
501
+ fromObject(de, obj) {
502
+ this.summary = Comment.deserializeDisplayParts(de, obj.summary);
503
+ this.blockTags =
504
+ obj.blockTags?.map((tagObj) => {
505
+ const tag = new CommentTag(tagObj.tag, []);
506
+ de.fromObject(tag, tagObj);
507
+ return tag;
508
+ }) || [];
509
+ this.modifierTags = new Set(obj.modifierTags);
510
+ this.label = obj.label;
511
+ }
512
+ };
450
513
  })();
451
- exports.Comment = Comment;
514
+ export { Comment };
452
515
  function extractLabelTag(comment) {
453
516
  const index = comment.summary.findIndex((part) => part.kind === "inline-tag" && part.tag === "@label");
454
517
  if (index !== -1) {