@depup/typedoc 0.28.17-depup.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 (390) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +34 -0
  3. package/bin/package.json +3 -0
  4. package/bin/typedoc +24 -0
  5. package/changes.json +22 -0
  6. package/dist/browser-locales/de.d.ts +2 -0
  7. package/dist/browser-locales/de.js +62 -0
  8. package/dist/browser-locales/en.d.ts +2 -0
  9. package/dist/browser-locales/en.js +62 -0
  10. package/dist/browser-locales/ja.d.ts +2 -0
  11. package/dist/browser-locales/ja.js +62 -0
  12. package/dist/browser-locales/ko.d.ts +2 -0
  13. package/dist/browser-locales/ko.js +62 -0
  14. package/dist/browser-locales/zh.d.ts +2 -0
  15. package/dist/browser-locales/zh.js +62 -0
  16. package/dist/browser-utils.d.ts +3 -0
  17. package/dist/browser-utils.js +3 -0
  18. package/dist/index.d.ts +49 -0
  19. package/dist/index.js +46 -0
  20. package/dist/lib/application-events.d.ts +5 -0
  21. package/dist/lib/application-events.js +5 -0
  22. package/dist/lib/application.d.ts +195 -0
  23. package/dist/lib/application.js +715 -0
  24. package/dist/lib/cli.d.ts +1 -0
  25. package/dist/lib/cli.js +111 -0
  26. package/dist/lib/converter/comments/blockLexer.d.ts +4 -0
  27. package/dist/lib/converter/comments/blockLexer.js +391 -0
  28. package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +3 -0
  29. package/dist/lib/converter/comments/declarationReferenceResolver.js +218 -0
  30. package/dist/lib/converter/comments/discovery.d.ts +14 -0
  31. package/dist/lib/converter/comments/discovery.js +563 -0
  32. package/dist/lib/converter/comments/index.d.ts +37 -0
  33. package/dist/lib/converter/comments/index.js +241 -0
  34. package/dist/lib/converter/comments/lexer.d.ts +17 -0
  35. package/dist/lib/converter/comments/lexer.js +10 -0
  36. package/dist/lib/converter/comments/lineLexer.d.ts +3 -0
  37. package/dist/lib/converter/comments/lineLexer.js +279 -0
  38. package/dist/lib/converter/comments/linkResolver.d.ts +20 -0
  39. package/dist/lib/converter/comments/linkResolver.js +186 -0
  40. package/dist/lib/converter/comments/parser.d.ts +18 -0
  41. package/dist/lib/converter/comments/parser.js +538 -0
  42. package/dist/lib/converter/comments/rawLexer.d.ts +8 -0
  43. package/dist/lib/converter/comments/rawLexer.js +218 -0
  44. package/dist/lib/converter/comments/tagName.d.ts +8 -0
  45. package/dist/lib/converter/comments/tagName.js +58 -0
  46. package/dist/lib/converter/comments/textParser.d.ts +33 -0
  47. package/dist/lib/converter/comments/textParser.js +372 -0
  48. package/dist/lib/converter/components.d.ts +4 -0
  49. package/dist/lib/converter/components.js +3 -0
  50. package/dist/lib/converter/context.d.ts +101 -0
  51. package/dist/lib/converter/context.js +311 -0
  52. package/dist/lib/converter/convert-expression.d.ts +9 -0
  53. package/dist/lib/converter/convert-expression.js +58 -0
  54. package/dist/lib/converter/converter-events.d.ts +13 -0
  55. package/dist/lib/converter/converter-events.js +13 -0
  56. package/dist/lib/converter/converter.d.ts +238 -0
  57. package/dist/lib/converter/converter.js +705 -0
  58. package/dist/lib/converter/factories/index-signature.d.ts +3 -0
  59. package/dist/lib/converter/factories/index-signature.js +50 -0
  60. package/dist/lib/converter/factories/signature.d.ts +14 -0
  61. package/dist/lib/converter/factories/signature.js +353 -0
  62. package/dist/lib/converter/factories/symbol-id.d.ts +3 -0
  63. package/dist/lib/converter/factories/symbol-id.js +47 -0
  64. package/dist/lib/converter/index.d.ts +5 -0
  65. package/dist/lib/converter/index.js +3 -0
  66. package/dist/lib/converter/jsdoc.d.ts +4 -0
  67. package/dist/lib/converter/jsdoc.js +135 -0
  68. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +48 -0
  69. package/dist/lib/converter/plugins/CategoryPlugin.js +278 -0
  70. package/dist/lib/converter/plugins/CommentPlugin.d.ts +128 -0
  71. package/dist/lib/converter/plugins/CommentPlugin.js +770 -0
  72. package/dist/lib/converter/plugins/GroupPlugin.d.ts +48 -0
  73. package/dist/lib/converter/plugins/GroupPlugin.js +281 -0
  74. package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +42 -0
  75. package/dist/lib/converter/plugins/ImplementsPlugin.js +438 -0
  76. package/dist/lib/converter/plugins/IncludePlugin.d.ts +14 -0
  77. package/dist/lib/converter/plugins/IncludePlugin.js +254 -0
  78. package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +32 -0
  79. package/dist/lib/converter/plugins/InheritDocPlugin.js +220 -0
  80. package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +13 -0
  81. package/dist/lib/converter/plugins/LinkResolverPlugin.js +88 -0
  82. package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
  83. package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +50 -0
  84. package/dist/lib/converter/plugins/PackagePlugin.d.ts +31 -0
  85. package/dist/lib/converter/plugins/PackagePlugin.js +188 -0
  86. package/dist/lib/converter/plugins/SourcePlugin.d.ts +36 -0
  87. package/dist/lib/converter/plugins/SourcePlugin.js +215 -0
  88. package/dist/lib/converter/plugins/TypePlugin.d.ts +16 -0
  89. package/dist/lib/converter/plugins/TypePlugin.js +108 -0
  90. package/dist/lib/converter/plugins/index.d.ts +10 -0
  91. package/dist/lib/converter/plugins/index.js +10 -0
  92. package/dist/lib/converter/symbols.d.ts +3 -0
  93. package/dist/lib/converter/symbols.js +861 -0
  94. package/dist/lib/converter/types.d.ts +10 -0
  95. package/dist/lib/converter/types.js +833 -0
  96. package/dist/lib/converter/utils/nodes.d.ts +7 -0
  97. package/dist/lib/converter/utils/nodes.js +26 -0
  98. package/dist/lib/converter/utils/reflections.d.ts +2 -0
  99. package/dist/lib/converter/utils/reflections.js +17 -0
  100. package/dist/lib/converter/utils/repository.d.ts +96 -0
  101. package/dist/lib/converter/utils/repository.js +295 -0
  102. package/dist/lib/converter/utils/symbols.d.ts +2 -0
  103. package/dist/lib/converter/utils/symbols.js +12 -0
  104. package/dist/lib/debug/index.d.ts +2 -0
  105. package/dist/lib/debug/index.js +2 -0
  106. package/dist/lib/debug/reflectionLifetimes.d.ts +3 -0
  107. package/dist/lib/debug/reflectionLifetimes.js +27 -0
  108. package/dist/lib/debug/rendererUrls.d.ts +6 -0
  109. package/dist/lib/debug/rendererUrls.js +68 -0
  110. package/dist/lib/internationalization/index.d.ts +7 -0
  111. package/dist/lib/internationalization/index.js +7 -0
  112. package/dist/lib/internationalization/internationalization.d.ts +65 -0
  113. package/dist/lib/internationalization/internationalization.js +64 -0
  114. package/dist/lib/internationalization/locale-utils.cjs +8 -0
  115. package/dist/lib/internationalization/locale-utils.d.cts +8 -0
  116. package/dist/lib/internationalization/locales/de.cjs +401 -0
  117. package/dist/lib/internationalization/locales/de.d.cts +368 -0
  118. package/dist/lib/internationalization/locales/en.cjs +411 -0
  119. package/dist/lib/internationalization/locales/en.d.cts +380 -0
  120. package/dist/lib/internationalization/locales/ja.cjs +320 -0
  121. package/dist/lib/internationalization/locales/ja.d.cts +307 -0
  122. package/dist/lib/internationalization/locales/ko.cjs +233 -0
  123. package/dist/lib/internationalization/locales/ko.d.cts +221 -0
  124. package/dist/lib/internationalization/locales/zh.cjs +488 -0
  125. package/dist/lib/internationalization/locales/zh.d.cts +452 -0
  126. package/dist/lib/internationalization/translatable.d.ts +21 -0
  127. package/dist/lib/internationalization/translatable.js +8 -0
  128. package/dist/lib/models/Comment.d.ts +241 -0
  129. package/dist/lib/models/Comment.js +534 -0
  130. package/dist/lib/models/ContainerReflection.d.ts +56 -0
  131. package/dist/lib/models/ContainerReflection.js +159 -0
  132. package/dist/lib/models/DeclarationReflection.d.ts +149 -0
  133. package/dist/lib/models/DeclarationReflection.js +287 -0
  134. package/dist/lib/models/DocumentReflection.d.ts +32 -0
  135. package/dist/lib/models/DocumentReflection.js +66 -0
  136. package/dist/lib/models/FileRegistry.d.ts +46 -0
  137. package/dist/lib/models/FileRegistry.js +133 -0
  138. package/dist/lib/models/ParameterReflection.d.ts +21 -0
  139. package/dist/lib/models/ParameterReflection.js +39 -0
  140. package/dist/lib/models/ProjectReflection.d.ts +112 -0
  141. package/dist/lib/models/ProjectReflection.js +417 -0
  142. package/dist/lib/models/ReferenceReflection.d.ts +49 -0
  143. package/dist/lib/models/ReferenceReflection.js +85 -0
  144. package/dist/lib/models/Reflection.d.ts +229 -0
  145. package/dist/lib/models/Reflection.js +495 -0
  146. package/dist/lib/models/ReflectionCategory.d.ts +31 -0
  147. package/dist/lib/models/ReflectionCategory.js +56 -0
  148. package/dist/lib/models/ReflectionGroup.d.ts +38 -0
  149. package/dist/lib/models/ReflectionGroup.js +72 -0
  150. package/dist/lib/models/ReflectionSymbolId.d.ts +63 -0
  151. package/dist/lib/models/ReflectionSymbolId.js +85 -0
  152. package/dist/lib/models/SignatureReflection.d.ts +50 -0
  153. package/dist/lib/models/SignatureReflection.js +96 -0
  154. package/dist/lib/models/SourceReference.d.ts +33 -0
  155. package/dist/lib/models/SourceReference.js +50 -0
  156. package/dist/lib/models/TypeParameterReflection.d.ts +30 -0
  157. package/dist/lib/models/TypeParameterReflection.js +45 -0
  158. package/dist/lib/models/index.d.ts +19 -0
  159. package/dist/lib/models/index.js +19 -0
  160. package/dist/lib/models/kind.d.ts +84 -0
  161. package/dist/lib/models/kind.js +231 -0
  162. package/dist/lib/models/types.d.ts +553 -0
  163. package/dist/lib/models/types.js +1296 -0
  164. package/dist/lib/models/utils.d.ts +1 -0
  165. package/dist/lib/models/utils.js +26 -0
  166. package/dist/lib/models/variant.d.ts +21 -0
  167. package/dist/lib/models/variant.js +1 -0
  168. package/dist/lib/output/components.d.ts +53 -0
  169. package/dist/lib/output/components.js +133 -0
  170. package/dist/lib/output/events.d.ts +175 -0
  171. package/dist/lib/output/events.js +195 -0
  172. package/dist/lib/output/formatter.d.ts +88 -0
  173. package/dist/lib/output/formatter.js +660 -0
  174. package/dist/lib/output/index.d.ts +9 -0
  175. package/dist/lib/output/index.js +7 -0
  176. package/dist/lib/output/output.d.ts +14 -0
  177. package/dist/lib/output/output.js +92 -0
  178. package/dist/lib/output/plugins/AssetsPlugin.d.ts +20 -0
  179. package/dist/lib/output/plugins/AssetsPlugin.js +160 -0
  180. package/dist/lib/output/plugins/HierarchyPlugin.d.ts +7 -0
  181. package/dist/lib/output/plugins/HierarchyPlugin.js +65 -0
  182. package/dist/lib/output/plugins/IconsPlugin.d.ts +12 -0
  183. package/dist/lib/output/plugins/IconsPlugin.js +54 -0
  184. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +22 -0
  185. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +222 -0
  186. package/dist/lib/output/plugins/NavigationPlugin.d.ts +7 -0
  187. package/dist/lib/output/plugins/NavigationPlugin.js +23 -0
  188. package/dist/lib/output/plugins/SitemapPlugin.d.ts +8 -0
  189. package/dist/lib/output/plugins/SitemapPlugin.js +82 -0
  190. package/dist/lib/output/plugins/index.d.ts +7 -0
  191. package/dist/lib/output/plugins/index.js +7 -0
  192. package/dist/lib/output/renderer.d.ts +227 -0
  193. package/dist/lib/output/renderer.js +387 -0
  194. package/dist/lib/output/router.d.ts +187 -0
  195. package/dist/lib/output/router.js +520 -0
  196. package/dist/lib/output/theme.d.ts +22 -0
  197. package/dist/lib/output/theme.js +17 -0
  198. package/dist/lib/output/themes/MarkedPlugin.d.ts +62 -0
  199. package/dist/lib/output/themes/MarkedPlugin.js +461 -0
  200. package/dist/lib/output/themes/default/DefaultTheme.d.ts +72 -0
  201. package/dist/lib/output/themes/default/DefaultTheme.js +367 -0
  202. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +105 -0
  203. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +151 -0
  204. package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
  205. package/dist/lib/output/themes/default/Slugger.js +60 -0
  206. package/dist/lib/output/themes/default/layouts/default.d.ts +6 -0
  207. package/dist/lib/output/themes/default/layouts/default.js +89 -0
  208. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +5 -0
  209. package/dist/lib/output/themes/default/partials/anchor-icon.js +9 -0
  210. package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +4 -0
  211. package/dist/lib/output/themes/default/partials/breadcrumb.js +11 -0
  212. package/dist/lib/output/themes/default/partials/comment.d.ts +8 -0
  213. package/dist/lib/output/themes/default/partials/comment.js +80 -0
  214. package/dist/lib/output/themes/default/partials/footer.d.ts +3 -0
  215. package/dist/lib/output/themes/default/partials/footer.js +37 -0
  216. package/dist/lib/output/themes/default/partials/header.d.ts +5 -0
  217. package/dist/lib/output/themes/default/partials/header.js +39 -0
  218. package/dist/lib/output/themes/default/partials/hierarchy.d.ts +4 -0
  219. package/dist/lib/output/themes/default/partials/hierarchy.js +32 -0
  220. package/dist/lib/output/themes/default/partials/icon.d.ts +20 -0
  221. package/dist/lib/output/themes/default/partials/icon.js +101 -0
  222. package/dist/lib/output/themes/default/partials/index.d.ts +4 -0
  223. package/dist/lib/output/themes/default/partials/index.js +24 -0
  224. package/dist/lib/output/themes/default/partials/member.d.ts +4 -0
  225. package/dist/lib/output/themes/default/partials/member.declaration.d.ts +4 -0
  226. package/dist/lib/output/themes/default/partials/member.declaration.js +35 -0
  227. package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +4 -0
  228. package/dist/lib/output/themes/default/partials/member.getterSetter.js +12 -0
  229. package/dist/lib/output/themes/default/partials/member.js +36 -0
  230. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +6 -0
  231. package/dist/lib/output/themes/default/partials/member.signature.body.js +33 -0
  232. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +5 -0
  233. package/dist/lib/output/themes/default/partials/member.signature.title.js +9 -0
  234. package/dist/lib/output/themes/default/partials/member.signatures.d.ts +4 -0
  235. package/dist/lib/output/themes/default/partials/member.signatures.js +9 -0
  236. package/dist/lib/output/themes/default/partials/member.sources.d.ts +4 -0
  237. package/dist/lib/output/themes/default/partials/member.sources.js +55 -0
  238. package/dist/lib/output/themes/default/partials/members.d.ts +4 -0
  239. package/dist/lib/output/themes/default/partials/members.js +17 -0
  240. package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
  241. package/dist/lib/output/themes/default/partials/moduleReflection.js +68 -0
  242. package/dist/lib/output/themes/default/partials/navigation.d.ts +10 -0
  243. package/dist/lib/output/themes/default/partials/navigation.js +144 -0
  244. package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +4 -0
  245. package/dist/lib/output/themes/default/partials/reflectionPreview.js +26 -0
  246. package/dist/lib/output/themes/default/partials/toolbar.d.ts +5 -0
  247. package/dist/lib/output/themes/default/partials/toolbar.js +13 -0
  248. package/dist/lib/output/themes/default/partials/type.d.ts +5 -0
  249. package/dist/lib/output/themes/default/partials/type.js +9 -0
  250. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +4 -0
  251. package/dist/lib/output/themes/default/partials/typeAndParent.js +28 -0
  252. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
  253. package/dist/lib/output/themes/default/partials/typeDetails.js +284 -0
  254. package/dist/lib/output/themes/default/partials/typeParameters.d.ts +4 -0
  255. package/dist/lib/output/themes/default/partials/typeParameters.js +26 -0
  256. package/dist/lib/output/themes/default/templates/document.d.ts +5 -0
  257. package/dist/lib/output/themes/default/templates/document.js +3 -0
  258. package/dist/lib/output/themes/default/templates/hierarchy.d.ts +5 -0
  259. package/dist/lib/output/themes/default/templates/hierarchy.js +31 -0
  260. package/dist/lib/output/themes/default/templates/index.d.ts +5 -0
  261. package/dist/lib/output/themes/default/templates/index.js +3 -0
  262. package/dist/lib/output/themes/default/templates/reflection.d.ts +5 -0
  263. package/dist/lib/output/themes/default/templates/reflection.js +53 -0
  264. package/dist/lib/output/themes/lib.d.ts +44 -0
  265. package/dist/lib/output/themes/lib.js +218 -0
  266. package/dist/lib/serialization/components.d.ts +22 -0
  267. package/dist/lib/serialization/components.js +1 -0
  268. package/dist/lib/serialization/deserializer.d.ts +70 -0
  269. package/dist/lib/serialization/deserializer.js +235 -0
  270. package/dist/lib/serialization/events.d.ts +17 -0
  271. package/dist/lib/serialization/events.js +18 -0
  272. package/dist/lib/serialization/index.d.ts +5 -0
  273. package/dist/lib/serialization/index.js +4 -0
  274. package/dist/lib/serialization/schema.d.ts +283 -0
  275. package/dist/lib/serialization/schema.js +32 -0
  276. package/dist/lib/serialization/serializer.d.ts +52 -0
  277. package/dist/lib/serialization/serializer.js +65 -0
  278. package/dist/lib/utils/ValidatingFileRegistry.d.ts +12 -0
  279. package/dist/lib/utils/ValidatingFileRegistry.js +52 -0
  280. package/dist/lib/utils/component.d.ts +38 -0
  281. package/dist/lib/utils/component.js +41 -0
  282. package/dist/lib/utils/compress.d.ts +7 -0
  283. package/dist/lib/utils/compress.js +13 -0
  284. package/dist/lib/utils/declaration-maps.d.ts +3 -0
  285. package/dist/lib/utils/declaration-maps.js +51 -0
  286. package/dist/lib/utils/entry-point.d.ts +50 -0
  287. package/dist/lib/utils/entry-point.js +330 -0
  288. package/dist/lib/utils/fs.d.ts +65 -0
  289. package/dist/lib/utils/fs.js +372 -0
  290. package/dist/lib/utils/general.d.ts +4 -0
  291. package/dist/lib/utils/general.js +25 -0
  292. package/dist/lib/utils/highlighter.d.ts +9 -0
  293. package/dist/lib/utils/highlighter.js +150 -0
  294. package/dist/lib/utils/html-entities.d.ts +8926 -0
  295. package/dist/lib/utils/html-entities.js +2329 -0
  296. package/dist/lib/utils/html.d.ts +67 -0
  297. package/dist/lib/utils/html.js +635 -0
  298. package/dist/lib/utils/index.d.ts +17 -0
  299. package/dist/lib/utils/index.js +15 -0
  300. package/dist/lib/utils/loggers.d.ts +10 -0
  301. package/dist/lib/utils/loggers.js +71 -0
  302. package/dist/lib/utils/options/declaration.d.ts +514 -0
  303. package/dist/lib/utils/options/declaration.js +443 -0
  304. package/dist/lib/utils/options/defaults.d.ts +20 -0
  305. package/dist/lib/utils/options/defaults.js +104 -0
  306. package/dist/lib/utils/options/help.d.ts +7 -0
  307. package/dist/lib/utils/options/help.js +63 -0
  308. package/dist/lib/utils/options/index.d.ts +6 -0
  309. package/dist/lib/utils/options/index.js +4 -0
  310. package/dist/lib/utils/options/options.d.ts +199 -0
  311. package/dist/lib/utils/options/options.js +273 -0
  312. package/dist/lib/utils/options/readers/arguments.d.ts +15 -0
  313. package/dist/lib/utils/options/readers/arguments.js +109 -0
  314. package/dist/lib/utils/options/readers/index.d.ts +4 -0
  315. package/dist/lib/utils/options/readers/index.js +4 -0
  316. package/dist/lib/utils/options/readers/package-json.d.ts +9 -0
  317. package/dist/lib/utils/options/readers/package-json.js +40 -0
  318. package/dist/lib/utils/options/readers/tsconfig.d.ts +14 -0
  319. package/dist/lib/utils/options/readers/tsconfig.js +172 -0
  320. package/dist/lib/utils/options/readers/typedoc.d.ts +33 -0
  321. package/dist/lib/utils/options/readers/typedoc.js +136 -0
  322. package/dist/lib/utils/options/sources/index.d.ts +1 -0
  323. package/dist/lib/utils/options/sources/index.js +1 -0
  324. package/dist/lib/utils/options/sources/typedoc.d.ts +2 -0
  325. package/dist/lib/utils/options/sources/typedoc.js +876 -0
  326. package/dist/lib/utils/options/tsdoc-defaults.d.ts +6 -0
  327. package/dist/lib/utils/options/tsdoc-defaults.js +94 -0
  328. package/dist/lib/utils/package-manifest.d.ts +11 -0
  329. package/dist/lib/utils/package-manifest.js +84 -0
  330. package/dist/lib/utils/paths.d.ts +27 -0
  331. package/dist/lib/utils/paths.js +127 -0
  332. package/dist/lib/utils/perf.d.ts +6 -0
  333. package/dist/lib/utils/perf.js +86 -0
  334. package/dist/lib/utils/plugins.d.ts +3 -0
  335. package/dist/lib/utils/plugins.js +61 -0
  336. package/dist/lib/utils/reflections.d.ts +5 -0
  337. package/dist/lib/utils/reflections.js +64 -0
  338. package/dist/lib/utils/sort.d.ts +11 -0
  339. package/dist/lib/utils/sort.js +153 -0
  340. package/dist/lib/utils/tsconfig.d.ts +5 -0
  341. package/dist/lib/utils/tsconfig.js +60 -0
  342. package/dist/lib/utils/tsutils.d.ts +3 -0
  343. package/dist/lib/utils/tsutils.js +23 -0
  344. package/dist/lib/utils-common/array.d.ts +57 -0
  345. package/dist/lib/utils-common/array.js +152 -0
  346. package/dist/lib/utils-common/declarationReference.d.ts +42 -0
  347. package/dist/lib/utils-common/declarationReference.js +341 -0
  348. package/dist/lib/utils-common/enum.d.ts +9 -0
  349. package/dist/lib/utils-common/enum.js +27 -0
  350. package/dist/lib/utils-common/events.d.ts +29 -0
  351. package/dist/lib/utils-common/events.js +49 -0
  352. package/dist/lib/utils-common/general.d.ts +40 -0
  353. package/dist/lib/utils-common/general.js +22 -0
  354. package/dist/lib/utils-common/hooks.d.ts +51 -0
  355. package/dist/lib/utils-common/hooks.js +90 -0
  356. package/dist/lib/utils-common/i18n.d.ts +18 -0
  357. package/dist/lib/utils-common/i18n.js +39 -0
  358. package/dist/lib/utils-common/index.d.ts +16 -0
  359. package/dist/lib/utils-common/index.js +17 -0
  360. package/dist/lib/utils-common/jsx.d.ts +53 -0
  361. package/dist/lib/utils-common/jsx.elements.d.ts +949 -0
  362. package/dist/lib/utils-common/jsx.elements.js +3 -0
  363. package/dist/lib/utils-common/jsx.js +187 -0
  364. package/dist/lib/utils-common/logger.d.ts +97 -0
  365. package/dist/lib/utils-common/logger.js +129 -0
  366. package/dist/lib/utils-common/map.d.ts +23 -0
  367. package/dist/lib/utils-common/map.js +63 -0
  368. package/dist/lib/utils-common/minimalSourceFile.d.ts +12 -0
  369. package/dist/lib/utils-common/minimalSourceFile.js +43 -0
  370. package/dist/lib/utils-common/path.d.ts +42 -0
  371. package/dist/lib/utils-common/path.js +130 -0
  372. package/dist/lib/utils-common/set.d.ts +3 -0
  373. package/dist/lib/utils-common/set.js +23 -0
  374. package/dist/lib/utils-common/string.d.ts +11 -0
  375. package/dist/lib/utils-common/string.js +84 -0
  376. package/dist/lib/utils-common/validation.d.ts +33 -0
  377. package/dist/lib/utils-common/validation.js +50 -0
  378. package/dist/lib/validation/documentation.d.ts +3 -0
  379. package/dist/lib/validation/documentation.js +91 -0
  380. package/dist/lib/validation/exports.d.ts +3 -0
  381. package/dist/lib/validation/exports.js +65 -0
  382. package/dist/lib/validation/links.d.ts +3 -0
  383. package/dist/lib/validation/links.js +78 -0
  384. package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
  385. package/dist/lib/validation/unusedMergeModuleWith.js +12 -0
  386. package/package.json +161 -0
  387. package/static/main.js +58 -0
  388. package/static/style.css +1633 -0
  389. package/tsdoc.json +247 -0
  390. package/typedoc-config.schema.json +941 -0
@@ -0,0 +1,770 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { Comment, CommentTag, DeclarationReflection, ParameterReflection, ReflectionFlag, ReflectionKind, ReflectionType, SignatureReflection, } from "../../models/index.js";
36
+ import { Option } from "../../utils/index.js";
37
+ import { filterMap, i18n, partition, removeIf, removeIfPresent, setIntersection, unique, } from "#utils";
38
+ import { ConverterComponent } from "../components.js";
39
+ import { ConverterEvents } from "../converter-events.js";
40
+ import { CategoryPlugin } from "./CategoryPlugin.js";
41
+ /**
42
+ * These tags are not useful to display in the generated documentation.
43
+ * They should be ignored when parsing comments. Any relevant type information
44
+ * (for JS users) will be consumed by TypeScript and need not be preserved
45
+ * in the comment.
46
+ *
47
+ * Note that param/arg/argument/return/returns/this are not present.
48
+ * These tags will have their type information stripped when parsing, but still
49
+ * may provide useful information for documentation.
50
+ */
51
+ const NEVER_RENDERED = [
52
+ "@augments",
53
+ "@callback",
54
+ "@class",
55
+ "@constructor",
56
+ "@enum",
57
+ "@extends",
58
+ "@type",
59
+ "@typedef",
60
+ "@jsx",
61
+ ];
62
+ // We might make this user configurable at some point, but for now,
63
+ // this set is configured here.
64
+ const MUTUALLY_EXCLUSIVE_MODIFIERS = [
65
+ new Set([
66
+ "@alpha",
67
+ "@beta",
68
+ "@experimental",
69
+ "@internal",
70
+ "@public",
71
+ ]),
72
+ ];
73
+ /**
74
+ * Handles most behavior triggered by comments. `@group` and `@category` are handled by their respective plugins, but everything else is here.
75
+ *
76
+ * How it works today
77
+ * ==================
78
+ * During conversion:
79
+ * - Handle visibility flags (`@private`, `@protected`. `@public`)
80
+ * - Handle module renames (`@module`)
81
+ * - Remove excluded tags & comment discovery tags (`@module`, `@packageDocumentation`)
82
+ * - Copy comments for type parameters from the parent container (for classes/interfaces)
83
+ *
84
+ * Resolve begin:
85
+ * - Remove hidden reflections
86
+ *
87
+ * Resolve:
88
+ * - Apply `@label` tag
89
+ * - Copy comments on signature containers to the signature if signatures don't already have a comment
90
+ * and then remove the comment on the container.
91
+ * - Copy comments to parameters and type parameters (for signatures)
92
+ * - Apply `@group` and `@category` tags
93
+ *
94
+ * Resolve end:
95
+ * - Copy auto inherited comments from heritage clauses
96
+ * - Handle `@inheritDoc`
97
+ * - Resolve `@link` tags to point to target reflections
98
+ *
99
+ * How it should work
100
+ * ==================
101
+ * During conversion:
102
+ * - Handle visibility flags (`@private`, `@protected`. `@public`)
103
+ * - Handle module renames (`@module`)
104
+ * - Remove excluded tags & comment discovery tags (`@module`, `@packageDocumentation`)
105
+ *
106
+ * Resolve begin (100):
107
+ * - Copy auto inherited comments from heritage clauses
108
+ * - Apply `@label` tag
109
+ *
110
+ * Resolve begin (75)
111
+ * - Handle `@inheritDoc`
112
+ *
113
+ * Resolve begin (50)
114
+ * - Copy comments on signature containers to the signature if signatures don't already have a comment
115
+ * and then remove the comment on the container.
116
+ * - Copy comments for type parameters from the parent container (for classes/interfaces)
117
+ *
118
+ * Resolve begin (25)
119
+ * - Remove hidden reflections
120
+ *
121
+ * Resolve:
122
+ * - Copy comments to parameters and type parameters (for signatures)
123
+ * - Apply `@group` and `@category` tags
124
+ *
125
+ * Resolve end:
126
+ * - Resolve `@link` tags to point to target reflections
127
+ */
128
+ let CommentPlugin = (() => {
129
+ let _classSuper = ConverterComponent;
130
+ let _excludeTags_decorators;
131
+ let _excludeTags_initializers = [];
132
+ let _excludeTags_extraInitializers = [];
133
+ let _cascadedModifierTags_decorators;
134
+ let _cascadedModifierTags_initializers = [];
135
+ let _cascadedModifierTags_extraInitializers = [];
136
+ let _excludeInternal_decorators;
137
+ let _excludeInternal_initializers = [];
138
+ let _excludeInternal_extraInitializers = [];
139
+ let _excludePrivate_decorators;
140
+ let _excludePrivate_initializers = [];
141
+ let _excludePrivate_extraInitializers = [];
142
+ let _excludePrivateClassFields_decorators;
143
+ let _excludePrivateClassFields_initializers = [];
144
+ let _excludePrivateClassFields_extraInitializers = [];
145
+ let _excludeProtected_decorators;
146
+ let _excludeProtected_initializers = [];
147
+ let _excludeProtected_extraInitializers = [];
148
+ let _excludeNotDocumented_decorators;
149
+ let _excludeNotDocumented_initializers = [];
150
+ let _excludeNotDocumented_extraInitializers = [];
151
+ let _excludeCategories_decorators;
152
+ let _excludeCategories_initializers = [];
153
+ let _excludeCategories_extraInitializers = [];
154
+ let _defaultCategory_decorators;
155
+ let _defaultCategory_initializers = [];
156
+ let _defaultCategory_extraInitializers = [];
157
+ let _suppressCommentWarningsInDeclarationFiles_decorators;
158
+ let _suppressCommentWarningsInDeclarationFiles_initializers = [];
159
+ let _suppressCommentWarningsInDeclarationFiles_extraInitializers = [];
160
+ return class CommentPlugin extends _classSuper {
161
+ static {
162
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
163
+ _excludeTags_decorators = [Option("excludeTags")];
164
+ _cascadedModifierTags_decorators = [Option("cascadedModifierTags")];
165
+ _excludeInternal_decorators = [Option("excludeInternal")];
166
+ _excludePrivate_decorators = [Option("excludePrivate")];
167
+ _excludePrivateClassFields_decorators = [Option("excludePrivateClassFields")];
168
+ _excludeProtected_decorators = [Option("excludeProtected")];
169
+ _excludeNotDocumented_decorators = [Option("excludeNotDocumented")];
170
+ _excludeCategories_decorators = [Option("excludeCategories")];
171
+ _defaultCategory_decorators = [Option("defaultCategory")];
172
+ _suppressCommentWarningsInDeclarationFiles_decorators = [Option("suppressCommentWarningsInDeclarationFiles")];
173
+ __esDecorate(this, null, _excludeTags_decorators, { kind: "accessor", name: "excludeTags", static: false, private: false, access: { has: obj => "excludeTags" in obj, get: obj => obj.excludeTags, set: (obj, value) => { obj.excludeTags = value; } }, metadata: _metadata }, _excludeTags_initializers, _excludeTags_extraInitializers);
174
+ __esDecorate(this, null, _cascadedModifierTags_decorators, { kind: "accessor", name: "cascadedModifierTags", static: false, private: false, access: { has: obj => "cascadedModifierTags" in obj, get: obj => obj.cascadedModifierTags, set: (obj, value) => { obj.cascadedModifierTags = value; } }, metadata: _metadata }, _cascadedModifierTags_initializers, _cascadedModifierTags_extraInitializers);
175
+ __esDecorate(this, null, _excludeInternal_decorators, { kind: "accessor", name: "excludeInternal", static: false, private: false, access: { has: obj => "excludeInternal" in obj, get: obj => obj.excludeInternal, set: (obj, value) => { obj.excludeInternal = value; } }, metadata: _metadata }, _excludeInternal_initializers, _excludeInternal_extraInitializers);
176
+ __esDecorate(this, null, _excludePrivate_decorators, { kind: "accessor", name: "excludePrivate", static: false, private: false, access: { has: obj => "excludePrivate" in obj, get: obj => obj.excludePrivate, set: (obj, value) => { obj.excludePrivate = value; } }, metadata: _metadata }, _excludePrivate_initializers, _excludePrivate_extraInitializers);
177
+ __esDecorate(this, null, _excludePrivateClassFields_decorators, { kind: "accessor", name: "excludePrivateClassFields", static: false, private: false, access: { has: obj => "excludePrivateClassFields" in obj, get: obj => obj.excludePrivateClassFields, set: (obj, value) => { obj.excludePrivateClassFields = value; } }, metadata: _metadata }, _excludePrivateClassFields_initializers, _excludePrivateClassFields_extraInitializers);
178
+ __esDecorate(this, null, _excludeProtected_decorators, { kind: "accessor", name: "excludeProtected", static: false, private: false, access: { has: obj => "excludeProtected" in obj, get: obj => obj.excludeProtected, set: (obj, value) => { obj.excludeProtected = value; } }, metadata: _metadata }, _excludeProtected_initializers, _excludeProtected_extraInitializers);
179
+ __esDecorate(this, null, _excludeNotDocumented_decorators, { kind: "accessor", name: "excludeNotDocumented", static: false, private: false, access: { has: obj => "excludeNotDocumented" in obj, get: obj => obj.excludeNotDocumented, set: (obj, value) => { obj.excludeNotDocumented = value; } }, metadata: _metadata }, _excludeNotDocumented_initializers, _excludeNotDocumented_extraInitializers);
180
+ __esDecorate(this, null, _excludeCategories_decorators, { kind: "accessor", name: "excludeCategories", static: false, private: false, access: { has: obj => "excludeCategories" in obj, get: obj => obj.excludeCategories, set: (obj, value) => { obj.excludeCategories = value; } }, metadata: _metadata }, _excludeCategories_initializers, _excludeCategories_extraInitializers);
181
+ __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);
182
+ __esDecorate(this, null, _suppressCommentWarningsInDeclarationFiles_decorators, { kind: "accessor", name: "suppressCommentWarningsInDeclarationFiles", static: false, private: false, access: { has: obj => "suppressCommentWarningsInDeclarationFiles" in obj, get: obj => obj.suppressCommentWarningsInDeclarationFiles, set: (obj, value) => { obj.suppressCommentWarningsInDeclarationFiles = value; } }, metadata: _metadata }, _suppressCommentWarningsInDeclarationFiles_initializers, _suppressCommentWarningsInDeclarationFiles_extraInitializers);
183
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
184
+ }
185
+ #excludeTags_accessor_storage = __runInitializers(this, _excludeTags_initializers, void 0);
186
+ get excludeTags() { return this.#excludeTags_accessor_storage; }
187
+ set excludeTags(value) { this.#excludeTags_accessor_storage = value; }
188
+ #cascadedModifierTags_accessor_storage = (__runInitializers(this, _excludeTags_extraInitializers), __runInitializers(this, _cascadedModifierTags_initializers, void 0));
189
+ get cascadedModifierTags() { return this.#cascadedModifierTags_accessor_storage; }
190
+ set cascadedModifierTags(value) { this.#cascadedModifierTags_accessor_storage = value; }
191
+ #excludeInternal_accessor_storage = (__runInitializers(this, _cascadedModifierTags_extraInitializers), __runInitializers(this, _excludeInternal_initializers, void 0));
192
+ get excludeInternal() { return this.#excludeInternal_accessor_storage; }
193
+ set excludeInternal(value) { this.#excludeInternal_accessor_storage = value; }
194
+ #excludePrivate_accessor_storage = (__runInitializers(this, _excludeInternal_extraInitializers), __runInitializers(this, _excludePrivate_initializers, void 0));
195
+ get excludePrivate() { return this.#excludePrivate_accessor_storage; }
196
+ set excludePrivate(value) { this.#excludePrivate_accessor_storage = value; }
197
+ #excludePrivateClassFields_accessor_storage = (__runInitializers(this, _excludePrivate_extraInitializers), __runInitializers(this, _excludePrivateClassFields_initializers, void 0));
198
+ get excludePrivateClassFields() { return this.#excludePrivateClassFields_accessor_storage; }
199
+ set excludePrivateClassFields(value) { this.#excludePrivateClassFields_accessor_storage = value; }
200
+ #excludeProtected_accessor_storage = (__runInitializers(this, _excludePrivateClassFields_extraInitializers), __runInitializers(this, _excludeProtected_initializers, void 0));
201
+ get excludeProtected() { return this.#excludeProtected_accessor_storage; }
202
+ set excludeProtected(value) { this.#excludeProtected_accessor_storage = value; }
203
+ #excludeNotDocumented_accessor_storage = (__runInitializers(this, _excludeProtected_extraInitializers), __runInitializers(this, _excludeNotDocumented_initializers, void 0));
204
+ get excludeNotDocumented() { return this.#excludeNotDocumented_accessor_storage; }
205
+ set excludeNotDocumented(value) { this.#excludeNotDocumented_accessor_storage = value; }
206
+ #excludeCategories_accessor_storage = (__runInitializers(this, _excludeNotDocumented_extraInitializers), __runInitializers(this, _excludeCategories_initializers, void 0));
207
+ get excludeCategories() { return this.#excludeCategories_accessor_storage; }
208
+ set excludeCategories(value) { this.#excludeCategories_accessor_storage = value; }
209
+ #defaultCategory_accessor_storage = (__runInitializers(this, _excludeCategories_extraInitializers), __runInitializers(this, _defaultCategory_initializers, void 0));
210
+ get defaultCategory() { return this.#defaultCategory_accessor_storage; }
211
+ set defaultCategory(value) { this.#defaultCategory_accessor_storage = value; }
212
+ #suppressCommentWarningsInDeclarationFiles_accessor_storage = (__runInitializers(this, _defaultCategory_extraInitializers), __runInitializers(this, _suppressCommentWarningsInDeclarationFiles_initializers, void 0));
213
+ get suppressCommentWarningsInDeclarationFiles() { return this.#suppressCommentWarningsInDeclarationFiles_accessor_storage; }
214
+ set suppressCommentWarningsInDeclarationFiles(value) { this.#suppressCommentWarningsInDeclarationFiles_accessor_storage = value; }
215
+ _excludeKinds = __runInitializers(this, _suppressCommentWarningsInDeclarationFiles_extraInitializers);
216
+ get excludeNotDocumentedKinds() {
217
+ this._excludeKinds ??= this.application.options
218
+ .getValue("excludeNotDocumentedKinds")
219
+ .reduce((a, b) => a | ReflectionKind[b], 0);
220
+ return this._excludeKinds;
221
+ }
222
+ constructor(owner) {
223
+ super(owner);
224
+ this.owner.on(ConverterEvents.CREATE_DECLARATION, this.onDeclaration.bind(this));
225
+ this.owner.on(ConverterEvents.CREATE_SIGNATURE, this.onDeclaration.bind(this));
226
+ this.owner.on(ConverterEvents.CREATE_TYPE_PARAMETER, this.onCreateTypeParameter.bind(this));
227
+ this.owner.on(ConverterEvents.RESOLVE_BEGIN, this.onBeginResolve.bind(this));
228
+ this.owner.on(ConverterEvents.RESOLVE, this.onResolve.bind(this));
229
+ this.owner.on(ConverterEvents.END, () => {
230
+ this._excludeKinds = undefined;
231
+ });
232
+ }
233
+ /**
234
+ * Apply all comment tag modifiers to the given reflection.
235
+ *
236
+ * @param reflection The reflection the modifiers should be applied to.
237
+ * @param comment The comment that should be searched for modifiers.
238
+ */
239
+ applyModifiers(reflection, comment) {
240
+ if (reflection.kindOf(ReflectionKind.SomeModule)) {
241
+ comment.removeModifier("@namespace");
242
+ }
243
+ if (reflection.kindOf(ReflectionKind.Interface)) {
244
+ comment.removeModifier("@interface");
245
+ }
246
+ if (comment.hasModifier("@abstract")) {
247
+ if (reflection.kindOf(ReflectionKind.SomeSignature)) {
248
+ reflection.parent.setFlag(ReflectionFlag.Abstract);
249
+ }
250
+ else {
251
+ reflection.setFlag(ReflectionFlag.Abstract);
252
+ }
253
+ comment.removeModifier("@abstract");
254
+ }
255
+ if (comment.hasModifier("@private")) {
256
+ reflection.setFlag(ReflectionFlag.Private);
257
+ if (reflection.kindOf(ReflectionKind.CallSignature)) {
258
+ reflection.parent?.setFlag(ReflectionFlag.Private);
259
+ }
260
+ comment.removeModifier("@private");
261
+ }
262
+ if (comment.hasModifier("@protected")) {
263
+ reflection.setFlag(ReflectionFlag.Protected);
264
+ if (reflection.kindOf(ReflectionKind.CallSignature)) {
265
+ reflection.parent?.setFlag(ReflectionFlag.Protected);
266
+ }
267
+ comment.removeModifier("@protected");
268
+ }
269
+ if (comment.hasModifier("@public")) {
270
+ reflection.setFlag(ReflectionFlag.Public);
271
+ if (reflection.kindOf(ReflectionKind.CallSignature)) {
272
+ reflection.parent?.setFlag(ReflectionFlag.Public);
273
+ }
274
+ comment.removeModifier("@public");
275
+ }
276
+ if (comment.hasModifier("@readonly")) {
277
+ const target = reflection.kindOf(ReflectionKind.GetSignature)
278
+ ? reflection.parent
279
+ : reflection;
280
+ target.setFlag(ReflectionFlag.Readonly);
281
+ comment.removeModifier("@readonly");
282
+ }
283
+ if (comment.hasModifier("@event") ||
284
+ comment.hasModifier("@eventProperty")) {
285
+ comment.blockTags.push(new CommentTag("@group", [{ kind: "text", text: "Events" }]));
286
+ comment.removeModifier("@event");
287
+ comment.removeModifier("@eventProperty");
288
+ }
289
+ if (reflection.kindOf(ReflectionKind.Project | ReflectionKind.SomeModule)) {
290
+ comment.removeTags("@module");
291
+ comment.removeModifier("@packageDocumentation");
292
+ }
293
+ }
294
+ /**
295
+ * Triggered when the converter has created a type parameter reflection.
296
+ *
297
+ * @param context The context object describing the current state the converter is in.
298
+ * @param reflection The reflection that is currently processed.
299
+ */
300
+ onCreateTypeParameter(_context, reflection) {
301
+ if (reflection.comment)
302
+ return;
303
+ const comment = reflection.parent?.comment;
304
+ if (comment) {
305
+ let tag = comment.getIdentifiedTag(reflection.name, "@typeParam");
306
+ if (!tag) {
307
+ tag = comment.getIdentifiedTag(reflection.name, "@template");
308
+ }
309
+ if (!tag) {
310
+ tag = comment.getIdentifiedTag(`<${reflection.name}>`, "@param");
311
+ }
312
+ if (!tag) {
313
+ tag = comment.getIdentifiedTag(reflection.name, "@param");
314
+ }
315
+ if (tag) {
316
+ reflection.comment = new Comment(tag.content);
317
+ reflection.comment.sourcePath = comment.sourcePath;
318
+ removeIfPresent(comment.blockTags, tag);
319
+ return;
320
+ }
321
+ }
322
+ // #3031 if this is a class constructor, also check for type parameters
323
+ // that live on the class itself and potentially copy their comment.
324
+ if (reflection.parent?.kindOf(ReflectionKind.ConstructorSignature) &&
325
+ reflection.parent.parent?.kindOf(ReflectionKind.Constructor)) {
326
+ const cls = reflection.parent.parent.parent;
327
+ const typeParam = cls.typeParameters?.find(param => param.name === reflection.name);
328
+ if (typeParam?.comment) {
329
+ reflection.comment = typeParam.comment.clone();
330
+ }
331
+ }
332
+ }
333
+ /**
334
+ * Triggered when the converter has created a declaration or signature reflection.
335
+ *
336
+ * Invokes the comment parser.
337
+ *
338
+ * @param context The context object describing the current state the converter is in.
339
+ * @param reflection The reflection that is currently processed.
340
+ * @param node The node that is currently processed if available.
341
+ */
342
+ onDeclaration(_context, reflection) {
343
+ this.cascadeModifiers(reflection);
344
+ const comment = reflection.comment;
345
+ if (!comment)
346
+ return;
347
+ if (reflection.kindOf(ReflectionKind.SomeModule)) {
348
+ const tag = comment.getTag("@module");
349
+ if (tag) {
350
+ // If no name is specified, this is a flag to mark a comment as a module comment
351
+ // and should not result in a reflection rename.
352
+ const newName = Comment.combineDisplayParts(tag.content).trim();
353
+ if (newName.length && !newName.includes("\n")) {
354
+ reflection.name = newName;
355
+ }
356
+ removeIfPresent(comment.blockTags, tag);
357
+ }
358
+ }
359
+ this.applyModifiers(reflection, comment);
360
+ this.removeExcludedTags(comment);
361
+ }
362
+ /**
363
+ * Triggered when the converter begins resolving a project.
364
+ *
365
+ * @param context The context object describing the current state the converter is in.
366
+ */
367
+ onBeginResolve(context) {
368
+ if (context.project.comment) {
369
+ this.applyModifiers(context.project, context.project.comment);
370
+ this.removeExcludedTags(context.project.comment);
371
+ }
372
+ const project = context.project;
373
+ const reflections = Object.values(project.reflections);
374
+ // Remove hidden reflections
375
+ const hidden = new Set();
376
+ for (const ref of reflections) {
377
+ if (ref.kindOf(ReflectionKind.Accessor) && ref.flags.isReadonly) {
378
+ const decl = ref;
379
+ if (decl.setSignature) {
380
+ hidden.add(decl.setSignature);
381
+ }
382
+ // Clear flag set by @readonly since it shouldn't be rendered.
383
+ ref.setFlag(ReflectionFlag.Readonly, false);
384
+ }
385
+ if (this.isHidden(ref)) {
386
+ hidden.add(ref);
387
+ }
388
+ }
389
+ hidden.forEach((reflection) => project.removeReflection(reflection));
390
+ // remove functions with empty signatures after their signatures have been removed
391
+ const [allRemoved, someRemoved] = partition(unique(filterMap(hidden, (reflection) => reflection.parent?.kindOf(ReflectionKind.SignatureContainer)
392
+ ? reflection.parent
393
+ : void 0)), (method) => method.getNonIndexSignatures().length === 0);
394
+ allRemoved.forEach((reflection) => {
395
+ project.removeReflection(reflection);
396
+ });
397
+ someRemoved.forEach((reflection) => {
398
+ reflection.sources = reflection
399
+ .getNonIndexSignatures()
400
+ .flatMap((s) => s.sources ?? []);
401
+ });
402
+ }
403
+ /**
404
+ * Triggered when the converter resolves a reflection.
405
+ *
406
+ * Cleans up comment tags related to signatures like `@param` or `@returns`
407
+ * and moves their data to the corresponding parameter reflections.
408
+ *
409
+ * This hook also copies over the comment of function implementations to their
410
+ * signatures.
411
+ *
412
+ * @param context The context object describing the current state the converter is in.
413
+ * @param reflection The reflection that is currently resolved.
414
+ */
415
+ onResolve(context, reflection) {
416
+ if (reflection.comment) {
417
+ if (reflection.comment.label &&
418
+ !/[A-Z_][A-Z0-9_]/.test(reflection.comment.label) &&
419
+ !this.suppressCommentWarnings(reflection.comment)) {
420
+ context.logger.warn(i18n.label_0_for_1_cannot_be_referenced(reflection.comment.label, reflection.getFriendlyFullName()));
421
+ }
422
+ for (const group of MUTUALLY_EXCLUSIVE_MODIFIERS) {
423
+ const intersect = setIntersection(group, reflection.comment.modifierTags);
424
+ if (intersect.size > 1 && !this.suppressCommentWarnings(reflection.comment)) {
425
+ const [a, b] = intersect;
426
+ context.logger.warn(i18n.modifier_tag_0_is_mutually_exclusive_with_1_in_comment_for_2(a, b, reflection.getFriendlyFullName()));
427
+ }
428
+ }
429
+ mergeSeeTags(reflection.comment);
430
+ movePropertyTags(reflection.comment, reflection);
431
+ // Unlike other modifiers, this one has to wait until resolution to be removed
432
+ // as it needs to remain present so that it can be checked when `@hidden` tags are
433
+ // being processed.
434
+ if (reflection.kindOf(ReflectionKind.Class)) {
435
+ reflection.comment.removeModifier("@hideconstructor");
436
+ }
437
+ // Similar story for this one, if a namespace is merged the tag should
438
+ // still apply when merging the second declaration of the namespace
439
+ reflection.comment.removeModifier("@primaryExport");
440
+ }
441
+ if ((reflection instanceof DeclarationReflection ||
442
+ reflection instanceof ParameterReflection) &&
443
+ reflection.comment) {
444
+ let sigs = [];
445
+ if (reflection.type instanceof ReflectionType) {
446
+ sigs = reflection.type.declaration.getNonIndexSignatures();
447
+ }
448
+ else if (reflection instanceof DeclarationReflection) {
449
+ sigs = reflection.getNonIndexSignatures();
450
+ }
451
+ // For variables and properties, the symbol might own the comment but we might also
452
+ // have @param and @returns comments for an owned signature. Only do this if there is
453
+ // exactly one signature as otherwise we have no hope of doing validation right.
454
+ if (sigs.length === 1 && !sigs[0].comment) {
455
+ this.moveSignatureParamComments(sigs[0], reflection.comment);
456
+ const returnsTag = reflection.comment.getTag("@returns");
457
+ if (returnsTag) {
458
+ sigs[0].comment = new Comment();
459
+ sigs[0].comment.sourcePath = reflection.comment.sourcePath;
460
+ sigs[0].comment.blockTags.push(returnsTag);
461
+ reflection.comment.removeTags("@returns");
462
+ }
463
+ }
464
+ // Any cascaded tags will show up twice, once on this and once on our signatures
465
+ // This is completely redundant, so remove them from the wrapping function.
466
+ if (sigs.length && reflection.type?.type !== "reflection") {
467
+ for (const mod of this.cascadedModifierTags) {
468
+ reflection.comment.modifierTags.delete(mod);
469
+ }
470
+ }
471
+ }
472
+ if (reflection instanceof SignatureReflection) {
473
+ this.moveSignatureParamComments(reflection);
474
+ }
475
+ }
476
+ moveSignatureParamComments(signature, comment = signature.comment) {
477
+ if (!comment)
478
+ return;
479
+ const unusedCommentParams = comment.blockTags.filter((tag) => tag.tag === "@param" && tag.name && !tag.name.includes(".") &&
480
+ !signature.parameters?.some(p => p.name === tag.name));
481
+ signature.parameters?.forEach((parameter) => {
482
+ if (parameter.name === "__namedParameters" && unusedCommentParams.length) {
483
+ parameter.name = unusedCommentParams[0].name;
484
+ unusedCommentParams.splice(0, 1);
485
+ }
486
+ const tag = comment.getIdentifiedTag(parameter.name, "@param");
487
+ if (tag) {
488
+ parameter.comment = new Comment(Comment.cloneDisplayParts(tag.content));
489
+ parameter.comment.sourcePath = comment.sourcePath;
490
+ }
491
+ else if (parameter.name === "this") {
492
+ const thisTag = comment.getTag("@this");
493
+ if (thisTag) {
494
+ parameter.comment = new Comment(Comment.cloneDisplayParts(thisTag.content));
495
+ parameter.comment.sourcePath = comment.sourcePath;
496
+ }
497
+ }
498
+ });
499
+ for (const parameter of signature.typeParameters || []) {
500
+ const tag = comment.getIdentifiedTag(parameter.name, "@typeParam") ||
501
+ comment.getIdentifiedTag(parameter.name, "@template") ||
502
+ comment.getIdentifiedTag(`<${parameter.name}>`, "@param");
503
+ if (tag) {
504
+ parameter.comment = new Comment(Comment.cloneDisplayParts(tag.content));
505
+ parameter.comment.sourcePath = comment.sourcePath;
506
+ }
507
+ }
508
+ this.validateParamTags(signature, comment, signature.parameters || []);
509
+ comment.removeTags("@this");
510
+ comment.removeTags("@param");
511
+ comment.removeTags("@typeParam");
512
+ comment.removeTags("@template");
513
+ }
514
+ removeExcludedTags(comment) {
515
+ for (const tag of NEVER_RENDERED) {
516
+ comment.removeTags(tag);
517
+ comment.removeModifier(tag);
518
+ }
519
+ for (const tag of this.excludeTags) {
520
+ comment.removeTags(tag);
521
+ comment.removeModifier(tag);
522
+ }
523
+ }
524
+ cascadeModifiers(reflection) {
525
+ const parentComment = reflection.parent?.comment;
526
+ if (!parentComment || reflection.kindOf(ReflectionKind.TypeLiteral)) {
527
+ return;
528
+ }
529
+ const childMods = reflection.comment?.modifierTags ?? new Set();
530
+ for (const mod of this.cascadedModifierTags) {
531
+ if (parentComment.hasModifier(mod)) {
532
+ const exclusiveSet = MUTUALLY_EXCLUSIVE_MODIFIERS.find((tags) => tags.has(mod));
533
+ if (!exclusiveSet ||
534
+ Array.from(exclusiveSet).every((tag) => !childMods.has(tag))) {
535
+ reflection.comment ||= new Comment();
536
+ reflection.comment.modifierTags.add(mod);
537
+ }
538
+ }
539
+ }
540
+ }
541
+ /**
542
+ * Determines whether or not a reflection has been hidden
543
+ *
544
+ * @param reflection Reflection to check if hidden
545
+ */
546
+ isHidden(reflection) {
547
+ const comment = reflection.comment;
548
+ if (reflection.flags.hasFlag(ReflectionFlag.Private) &&
549
+ this.excludePrivate) {
550
+ return true;
551
+ }
552
+ // #3017 this isn't quite right as it may incorrectly detect
553
+ // private members named with a hash which aren't actually private
554
+ // class fields (e.g. class Foo { "#hash" = 1 })
555
+ // We can't fix this without storing more information about the name,
556
+ // which I'm going to put off until #3015 is done.
557
+ if (reflection.flags.hasFlag(ReflectionFlag.Private) &&
558
+ reflection.name.startsWith("#") &&
559
+ this.excludePrivateClassFields) {
560
+ return true;
561
+ }
562
+ if (reflection.flags.hasFlag(ReflectionFlag.Protected) &&
563
+ this.excludeProtected) {
564
+ return true;
565
+ }
566
+ if (this.excludedByCategory(reflection)) {
567
+ return true;
568
+ }
569
+ if (reflection.kindOf(ReflectionKind.ConstructorSignature |
570
+ ReflectionKind.Constructor)) {
571
+ if (comment?.hasModifier("@hideconstructor"))
572
+ return true;
573
+ const cls = reflection.parent?.kindOf(ReflectionKind.Class)
574
+ ? reflection.parent
575
+ : reflection.parent?.parent?.kindOf(ReflectionKind.Class)
576
+ ? reflection.parent.parent
577
+ : undefined;
578
+ if (cls?.comment?.hasModifier("@hideconstructor")) {
579
+ return true;
580
+ }
581
+ }
582
+ if (!comment) {
583
+ // We haven't moved comments from the parent for signatures without a direct
584
+ // comment, so don't exclude those due to not being documented.
585
+ if (reflection.kindOf(ReflectionKind.CallSignature |
586
+ ReflectionKind.ConstructorSignature) &&
587
+ reflection.parent?.comment) {
588
+ return false;
589
+ }
590
+ if (this.excludeNotDocumented) {
591
+ // Don't let excludeNotDocumented remove parameters.
592
+ if (!(reflection instanceof DeclarationReflection) &&
593
+ !(reflection instanceof SignatureReflection)) {
594
+ return false;
595
+ }
596
+ if (!reflection.kindOf(this.excludeNotDocumentedKinds)) {
597
+ return false;
598
+ }
599
+ // excludeNotDocumented should hide a module only if it has no visible children
600
+ if (reflection.kindOf(ReflectionKind.SomeModule)) {
601
+ if (!reflection.children) {
602
+ return true;
603
+ }
604
+ return reflection.children.every((child) => this.isHidden(child));
605
+ }
606
+ // signature containers should only be hidden if all their signatures are hidden
607
+ if (reflection.kindOf(ReflectionKind.SignatureContainer)) {
608
+ return reflection
609
+ .getAllSignatures()
610
+ .every((child) => this.isHidden(child));
611
+ }
612
+ // excludeNotDocumented should never hide parts of "type" reflections
613
+ return inTypeLiteral(reflection) === false;
614
+ }
615
+ return false;
616
+ }
617
+ const isHidden = comment.hasModifier("@hidden") ||
618
+ comment.hasModifier("@ignore") ||
619
+ (comment.hasModifier("@internal") && this.excludeInternal);
620
+ if (!isHidden &&
621
+ reflection.kindOf(ReflectionKind.ContainsCallSignatures)) {
622
+ return reflection
623
+ .getNonIndexSignatures()
624
+ .every((sig) => this.isHidden(sig));
625
+ }
626
+ return isHidden;
627
+ }
628
+ excludedByCategory(reflection) {
629
+ const excludeCategories = this.excludeCategories;
630
+ let target;
631
+ if (reflection instanceof DeclarationReflection) {
632
+ target = reflection;
633
+ }
634
+ else if (reflection instanceof SignatureReflection) {
635
+ target = reflection.parent;
636
+ }
637
+ if (!target || !excludeCategories.length)
638
+ return false;
639
+ const categories = CategoryPlugin.getCategories(target);
640
+ if (categories.size === 0) {
641
+ categories.add(this.defaultCategory);
642
+ }
643
+ return excludeCategories.some((cat) => categories.has(cat));
644
+ }
645
+ validateParamTags(signature, comment, params) {
646
+ const paramTags = comment.blockTags.filter((tag) => tag.tag === "@param");
647
+ removeIf(paramTags, (tag) => params.some((param) => param.name === tag.name));
648
+ moveNestedParamTags(/* in-out */ paramTags, params, comment.sourcePath);
649
+ if (!comment.inheritedFromParentDeclaration && !this.suppressCommentWarnings(comment)) {
650
+ for (const tag of paramTags) {
651
+ this.application.logger.warn(i18n.signature_0_has_unused_param_with_name_1(signature.getFriendlyFullName(), tag.name ?? "(missing)"));
652
+ }
653
+ }
654
+ }
655
+ suppressCommentWarnings(comment) {
656
+ return this.suppressCommentWarningsInDeclarationFiles &&
657
+ /\.d\.(ts|mts|cts)$/.test(comment.sourcePath || "");
658
+ }
659
+ };
660
+ })();
661
+ export { CommentPlugin };
662
+ function inTypeLiteral(refl) {
663
+ while (refl) {
664
+ if (refl.kind === ReflectionKind.TypeLiteral) {
665
+ return true;
666
+ }
667
+ refl = refl.parent;
668
+ }
669
+ return false;
670
+ }
671
+ function validHighlightedName(ref, name) {
672
+ const refl = ref.reflection;
673
+ // Assume external types are documented properly
674
+ if (!refl)
675
+ return true;
676
+ // If it is a direct child, it is valid.
677
+ if (refl.getChildByName([name]))
678
+ return true;
679
+ // Or if it is the child of the referenced reflection's type
680
+ if (refl.isDeclaration() && refl.type?.type === "reflection") {
681
+ if (refl.type.declaration.getChildByName([name])) {
682
+ return true;
683
+ }
684
+ }
685
+ return false;
686
+ }
687
+ // Moves tags like `@param foo.bar docs for bar` into the `bar` property of the `foo` parameter.
688
+ function moveNestedParamTags(
689
+ /* in-out */ paramTags, parameters, sourcePath) {
690
+ const used = new Set();
691
+ for (const param of parameters) {
692
+ const visitor = {
693
+ reflection(target) {
694
+ const tags = paramTags.filter((t) => t.name?.startsWith(`${param.name}.`));
695
+ for (const tag of tags) {
696
+ const path = tag.name.split(".");
697
+ path.shift();
698
+ const child = target.declaration.getChildOrTypePropertyByName(path);
699
+ if (child && !child.comment) {
700
+ child.comment = new Comment(Comment.cloneDisplayParts(tag.content));
701
+ child.comment.sourcePath = sourcePath;
702
+ used.add(paramTags.indexOf(tag));
703
+ }
704
+ }
705
+ },
706
+ // #1876, also do this for unions/intersections.
707
+ union(u) {
708
+ u.types.forEach((t) => t.visit(visitor));
709
+ },
710
+ intersection(i) {
711
+ i.types.forEach((t) => t.visit(visitor));
712
+ },
713
+ // #2147, support highlighting parts of a referenced type
714
+ reference(ref) {
715
+ for (let i = 0; i < paramTags.length; ++i) {
716
+ const tag = paramTags[i];
717
+ if (tag.name?.startsWith(`${param.name}.`)) {
718
+ const childName = tag.name.substring(param.name.length + 1);
719
+ if (!validHighlightedName(ref, childName)) {
720
+ continue;
721
+ }
722
+ ref.highlightedProperties ??= new Map();
723
+ ref.highlightedProperties.set(childName, paramTags[i].content);
724
+ used.add(i);
725
+ }
726
+ }
727
+ },
728
+ };
729
+ param.type?.visit(visitor);
730
+ }
731
+ const toRemove = Array.from(used)
732
+ .sort((a, b) => a - b)
733
+ .reverse();
734
+ for (const index of toRemove) {
735
+ paramTags.splice(index, 1);
736
+ }
737
+ }
738
+ function movePropertyTags(comment, container) {
739
+ const propTags = comment.blockTags.filter((tag) => tag.tag === "@prop" || tag.tag === "@property");
740
+ comment.removeTags("@prop");
741
+ comment.removeTags("@property");
742
+ for (const prop of propTags) {
743
+ if (!prop.name)
744
+ continue;
745
+ const child = container.getChildByName(prop.name);
746
+ if (child) {
747
+ child.comment = new Comment(Comment.cloneDisplayParts(prop.content));
748
+ child.comment.sourcePath = comment.sourcePath;
749
+ if (child instanceof DeclarationReflection && child.signatures) {
750
+ for (const sig of child.signatures) {
751
+ sig.comment = new Comment(Comment.cloneDisplayParts(prop.content));
752
+ sig.comment.sourcePath = comment.sourcePath;
753
+ }
754
+ }
755
+ }
756
+ }
757
+ }
758
+ function mergeSeeTags(comment) {
759
+ const see = comment.getTags("@see");
760
+ if (see.length < 2)
761
+ return;
762
+ const index = comment.blockTags.indexOf(see[0]);
763
+ comment.removeTags("@see");
764
+ see[0].content = see.flatMap((part) => [
765
+ { kind: "text", text: " - " },
766
+ ...part.content,
767
+ { kind: "text", text: "\n" },
768
+ ]);
769
+ comment.blockTags.splice(index, 0, see[0]);
770
+ }