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,20 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
1
  var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
19
2
  function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
20
3
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
@@ -49,73 +32,48 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
49
32
  }
50
33
  return useValue ? value : void 0;
51
34
  };
52
- var __importStar = (this && this.__importStar) || function (mod) {
53
- if (mod && mod.__esModule) return mod;
54
- var result = {};
55
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
56
- __setModuleDefault(result, mod);
57
- return result;
58
- };
59
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
60
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
61
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
62
- };
63
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
64
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
65
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
66
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
67
- };
68
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
69
- if (kind === "m") throw new TypeError("Private method is not writable");
70
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
71
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
72
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
73
- };
74
- var __importDefault = (this && this.__importDefault) || function (mod) {
75
- return (mod && mod.__esModule) ? mod : { "default": mod };
76
- };
77
- Object.defineProperty(exports, "__esModule", { value: true });
78
- exports.Application = void 0;
79
- exports.createAppForTesting = createAppForTesting;
80
- const Path = __importStar(require("path"));
81
- const typescript_1 = __importDefault(require("typescript"));
82
- const index_1 = require("./converter/index");
83
- const renderer_1 = require("./output/renderer");
84
- const serialization_1 = require("./serialization");
85
- const index_2 = require("./utils/index");
86
- const component_1 = require("./utils/component");
87
- const utils_1 = require("./utils");
88
- const array_1 = require("./utils/array");
89
- const assert_1 = require("assert");
90
- const entry_point_1 = require("./utils/entry-point");
91
- const paths_1 = require("./utils/paths");
92
- const general_1 = require("./utils/general");
93
- const exports_1 = require("./validation/exports");
94
- const documentation_1 = require("./validation/documentation");
95
- const links_1 = require("./validation/links");
96
- const application_events_1 = require("./application-events");
97
- const tsconfig_1 = require("./utils/tsconfig");
98
- const fs_1 = require("./utils/fs");
99
- const ReflectionSymbolId_1 = require("./models/reflections/ReflectionSymbolId");
100
- const internationalization_1 = require("./internationalization/internationalization");
101
- const highlighter_1 = require("./utils/highlighter");
102
- const FileRegistry_1 = require("./models/FileRegistry");
103
- // eslint-disable-next-line @typescript-eslint/no-require-imports
104
- const packageInfo = require("../../package.json");
35
+ import * as Path from "path";
36
+ import ts from "typescript";
37
+ import { Deserializer, Serializer, } from "./serialization/index.js";
38
+ import { Converter } from "./converter/index.js";
39
+ import { Renderer } from "./output/renderer.js";
40
+ import { Logger, ConsoleLogger, loadPlugins, writeFile, TSConfigReader, TypeDocReader, PackageJsonReader, AbstractComponent, } from "./utils/index.js";
41
+ import { Options, Option } from "./utils/index.js";
42
+ import { unique } from "./utils/array.js";
43
+ import { ok } from "assert";
44
+ import { EntryPointStrategy, getEntryPoints, getPackageDirectories, getWatchEntryPoints, inferEntryPoints, } from "./utils/entry-point.js";
45
+ import { nicePath } from "./utils/paths.js";
46
+ import { getLoadedPaths, hasBeenLoadedMultipleTimes } from "./utils/general.js";
47
+ import { validateExports } from "./validation/exports.js";
48
+ import { validateDocumentation } from "./validation/documentation.js";
49
+ import { validateLinks } from "./validation/links.js";
50
+ import { ApplicationEvents } from "./application-events.js";
51
+ import { findTsConfigFile } from "./utils/tsconfig.js";
52
+ import { deriveRootDir, glob, readFile } from "./utils/fs.js";
53
+ import { addInferredDeclarationMapPaths } from "./models/reflections/ReflectionSymbolId.js";
54
+ import { Internationalization, } from "./internationalization/internationalization.js";
55
+ import { loadShikiMetadata } from "./utils/highlighter.js";
56
+ import { ValidatingFileRegistry, FileRegistry } from "./models/FileRegistry.js";
57
+ import { readFileSync } from "fs";
58
+ import { fileURLToPath } from "url";
59
+ import { createRequire } from "module";
60
+ import { Outputs } from "./output/output.js";
61
+ import { validateMergeModuleWith } from "./validation/unusedMergeModuleWith.js";
62
+ const packageInfo = JSON.parse(readFileSync(Path.join(fileURLToPath(import.meta.url), "../../../package.json"), "utf8"));
105
63
  const supportedVersionMajorMinor = packageInfo.peerDependencies.typescript
106
64
  .split("||")
107
65
  .map((version) => version.replace(/^\s*|\.x\s*$/g, ""));
108
66
  const DETECTOR = Symbol();
109
- function createAppForTesting() {
67
+ export function createAppForTesting() {
110
68
  // @ts-expect-error private constructor
111
69
  const app = new Application(DETECTOR);
112
- app.files = new FileRegistry_1.FileRegistry();
70
+ app.files = new FileRegistry();
113
71
  return app;
114
72
  }
115
73
  const DEFAULT_READERS = [
116
- new index_2.TypeDocReader(),
117
- new index_2.PackageJsonReader(),
118
- new index_2.TSConfigReader(),
74
+ new TypeDocReader(),
75
+ new PackageJsonReader(),
76
+ new TSConfigReader(),
119
77
  ];
120
78
  /**
121
79
  * The default TypeDoc main application class.
@@ -134,14 +92,12 @@ const DEFAULT_READERS = [
134
92
  *
135
93
  * Access to an Application instance can be retrieved with {@link Application.bootstrap} or
136
94
  * {@link Application.bootstrapWithPlugins}. It can not be constructed manually.
95
+ *
96
+ * @group Common
97
+ * @summary Root level class which contains most useful behavior.
137
98
  */
138
99
  let Application = (() => {
139
- var _Application_lang_accessor_storage, _Application_skipErrorChecking_accessor_storage, _Application_entryPointStrategy_accessor_storage, _Application_entryPoints_accessor_storage;
140
- let _classDecorators = [(0, component_1.Component)({ name: "application", internal: true })];
141
- let _classDescriptor;
142
- let _classExtraInitializers = [];
143
- let _classThis;
144
- let _classSuper = component_1.ChildableComponent;
100
+ let _classSuper = AbstractComponent;
145
101
  let _lang_decorators;
146
102
  let _lang_initializers = [];
147
103
  let _lang_extraInitializers = [];
@@ -154,19 +110,86 @@ let Application = (() => {
154
110
  let _entryPoints_decorators;
155
111
  let _entryPoints_initializers = [];
156
112
  let _entryPoints_extraInitializers = [];
157
- var Application = _classThis = class extends _classSuper {
113
+ return class Application extends _classSuper {
114
+ static {
115
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
116
+ _lang_decorators = [Option("lang")];
117
+ _skipErrorChecking_decorators = [Option("skipErrorChecking")];
118
+ _entryPointStrategy_decorators = [Option("entryPointStrategy")];
119
+ _entryPoints_decorators = [Option("entryPoints")];
120
+ __esDecorate(this, null, _lang_decorators, { kind: "accessor", name: "lang", static: false, private: false, access: { has: obj => "lang" in obj, get: obj => obj.lang, set: (obj, value) => { obj.lang = value; } }, metadata: _metadata }, _lang_initializers, _lang_extraInitializers);
121
+ __esDecorate(this, null, _skipErrorChecking_decorators, { kind: "accessor", name: "skipErrorChecking", static: false, private: false, access: { has: obj => "skipErrorChecking" in obj, get: obj => obj.skipErrorChecking, set: (obj, value) => { obj.skipErrorChecking = value; } }, metadata: _metadata }, _skipErrorChecking_initializers, _skipErrorChecking_extraInitializers);
122
+ __esDecorate(this, null, _entryPointStrategy_decorators, { kind: "accessor", name: "entryPointStrategy", static: false, private: false, access: { has: obj => "entryPointStrategy" in obj, get: obj => obj.entryPointStrategy, set: (obj, value) => { obj.entryPointStrategy = value; } }, metadata: _metadata }, _entryPointStrategy_initializers, _entryPointStrategy_extraInitializers);
123
+ __esDecorate(this, null, _entryPoints_decorators, { kind: "accessor", name: "entryPoints", static: false, private: false, access: { has: obj => "entryPoints" in obj, get: obj => obj.entryPoints, set: (obj, value) => { obj.entryPoints = value; } }, metadata: _metadata }, _entryPoints_initializers, _entryPoints_extraInitializers);
124
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
125
+ }
126
+ /**
127
+ * The converter used to create the declaration reflections.
128
+ */
129
+ converter;
130
+ outputs = new Outputs(this);
131
+ /**
132
+ * The renderer used to generate the HTML documentation output.
133
+ */
134
+ renderer;
135
+ /**
136
+ * The serializer used to generate JSON output.
137
+ */
138
+ serializer = new Serializer();
139
+ /**
140
+ * The deserializer used to restore previously serialized JSON output.
141
+ */
142
+ deserializer = new Deserializer(this);
143
+ /**
144
+ * The logger that should be used to output messages.
145
+ */
146
+ logger = new ConsoleLogger();
147
+ /**
148
+ * Internationalization module which supports translating according to
149
+ * the `lang` option.
150
+ */
151
+ internationalization = new Internationalization(this);
152
+ /**
153
+ * Proxy based shortcuts for internationalization keys.
154
+ */
155
+ i18n = this.internationalization.proxy;
156
+ options = new Options(this.i18n);
157
+ files = new ValidatingFileRegistry();
158
+ #lang_accessor_storage = __runInitializers(this, _lang_initializers, void 0);
158
159
  /** @internal */
159
- get lang() { return __classPrivateFieldGet(this, _Application_lang_accessor_storage, "f"); }
160
- set lang(value) { __classPrivateFieldSet(this, _Application_lang_accessor_storage, value, "f"); }
160
+ get lang() { return this.#lang_accessor_storage; }
161
+ set lang(value) { this.#lang_accessor_storage = value; }
162
+ #skipErrorChecking_accessor_storage = (__runInitializers(this, _lang_extraInitializers), __runInitializers(this, _skipErrorChecking_initializers, void 0));
161
163
  /** @internal */
162
- get skipErrorChecking() { return __classPrivateFieldGet(this, _Application_skipErrorChecking_accessor_storage, "f"); }
163
- set skipErrorChecking(value) { __classPrivateFieldSet(this, _Application_skipErrorChecking_accessor_storage, value, "f"); }
164
+ get skipErrorChecking() { return this.#skipErrorChecking_accessor_storage; }
165
+ set skipErrorChecking(value) { this.#skipErrorChecking_accessor_storage = value; }
166
+ #entryPointStrategy_accessor_storage = (__runInitializers(this, _skipErrorChecking_extraInitializers), __runInitializers(this, _entryPointStrategy_initializers, void 0));
164
167
  /** @internal */
165
- get entryPointStrategy() { return __classPrivateFieldGet(this, _Application_entryPointStrategy_accessor_storage, "f"); }
166
- set entryPointStrategy(value) { __classPrivateFieldSet(this, _Application_entryPointStrategy_accessor_storage, value, "f"); }
168
+ get entryPointStrategy() { return this.#entryPointStrategy_accessor_storage; }
169
+ set entryPointStrategy(value) { this.#entryPointStrategy_accessor_storage = value; }
170
+ #entryPoints_accessor_storage = (__runInitializers(this, _entryPointStrategy_extraInitializers), __runInitializers(this, _entryPoints_initializers, void 0));
167
171
  /** @internal */
168
- get entryPoints() { return __classPrivateFieldGet(this, _Application_entryPoints_accessor_storage, "f"); }
169
- set entryPoints(value) { __classPrivateFieldSet(this, _Application_entryPoints_accessor_storage, value, "f"); }
172
+ get entryPoints() { return this.#entryPoints_accessor_storage; }
173
+ set entryPoints(value) { this.#entryPoints_accessor_storage = value; }
174
+ /**
175
+ * The version number of TypeDoc.
176
+ */
177
+ static VERSION = packageInfo.version;
178
+ /**
179
+ * Emitted after plugins have been loaded and options have been read, but before they have been frozen.
180
+ * The listener will be given an instance of {@link Application}.
181
+ */
182
+ static EVENT_BOOTSTRAP_END = ApplicationEvents.BOOTSTRAP_END;
183
+ /**
184
+ * Emitted after a project has been deserialized from JSON.
185
+ * The listener will be given an instance of {@link ProjectReflection}.
186
+ */
187
+ static EVENT_PROJECT_REVIVE = ApplicationEvents.REVIVE;
188
+ /**
189
+ * Emitted when validation is being run.
190
+ * The listener will be given an instance of {@link ProjectReflection}.
191
+ */
192
+ static EVENT_VALIDATE_PROJECT = ApplicationEvents.VALIDATE_PROJECT;
170
193
  /**
171
194
  * Create a new TypeDoc application instance.
172
195
  */
@@ -175,50 +198,31 @@ let Application = (() => {
175
198
  throw new Error("An application handle must be retrieved with Application.bootstrap or Application.bootstrapWithPlugins");
176
199
  }
177
200
  super(null); // We own ourselves
178
- /**
179
- * The serializer used to generate JSON output.
180
- */
181
- this.serializer = new serialization_1.Serializer();
182
- /**
183
- * The deserializer used to restore previously serialized JSON output.
184
- */
185
- this.deserializer = new serialization_1.Deserializer(this);
186
- /**
187
- * The logger that should be used to output messages.
188
- */
189
- this.logger = new index_2.ConsoleLogger();
190
- /**
191
- * Internationalization module which supports translating according to
192
- * the `lang` option.
193
- */
194
- this.internationalization = new internationalization_1.Internationalization(this);
195
- /**
196
- * Proxy based shortcuts for internationalization keys.
197
- */
198
- this.i18n = this.internationalization.proxy;
199
- this.options = new utils_1.Options(this.i18n);
200
- this.files = new FileRegistry_1.ValidatingFileRegistry();
201
- _Application_lang_accessor_storage.set(this, __runInitializers(this, _lang_initializers, void 0));
202
- _Application_skipErrorChecking_accessor_storage.set(this, (__runInitializers(this, _lang_extraInitializers), __runInitializers(this, _skipErrorChecking_initializers, void 0)));
203
- _Application_entryPointStrategy_accessor_storage.set(this, (__runInitializers(this, _skipErrorChecking_extraInitializers), __runInitializers(this, _entryPointStrategy_initializers, void 0)));
204
- _Application_entryPoints_accessor_storage.set(this, (__runInitializers(this, _entryPointStrategy_extraInitializers), __runInitializers(this, _entryPoints_initializers, void 0)));
205
201
  __runInitializers(this, _entryPoints_extraInitializers);
206
- this.converter = new index_1.Converter(this);
207
- this.renderer = new renderer_1.Renderer(this);
202
+ this.converter = new Converter(this);
203
+ this.renderer = new Renderer(this);
208
204
  this.logger.i18n = this.i18n;
205
+ this.outputs.addOutput("json", async (out, project) => {
206
+ const ser = this.serializer.projectToObject(project, process.cwd());
207
+ const space = this.options.getValue("pretty") ? "\t" : "";
208
+ await writeFile(out, JSON.stringify(ser, null, space) + "\n");
209
+ });
210
+ this.outputs.addOutput("html", async (out, project) => {
211
+ await this.renderer.render(project, out);
212
+ });
209
213
  }
210
214
  /**
211
215
  * Initialize TypeDoc, loading plugins if applicable.
212
216
  */
213
217
  static async bootstrapWithPlugins(options = {}, readers = DEFAULT_READERS) {
214
- await (0, highlighter_1.loadShikiMetadata)();
218
+ await loadShikiMetadata();
215
219
  const app = new Application(DETECTOR);
216
220
  readers.forEach((r) => app.options.addReader(r));
217
221
  app.options.reset();
218
222
  app.setOptions(options, /* reportErrors */ false);
219
- await app.options.read(new index_2.Logger());
223
+ await app.options.read(new Logger());
220
224
  app.logger.level = app.options.getValue("logLevel");
221
- await (0, index_2.loadPlugins)(app, app.options.getValue("plugin"));
225
+ await loadPlugins(app, app.options.getValue("plugin"));
222
226
  await app._bootstrap(options);
223
227
  return app;
224
228
  }
@@ -235,7 +239,7 @@ let Application = (() => {
235
239
  * @param readers Option readers to use to discover options from config files.
236
240
  */
237
241
  static async bootstrap(options = {}, readers = DEFAULT_READERS) {
238
- await (0, highlighter_1.loadShikiMetadata)();
242
+ await loadShikiMetadata();
239
243
  const app = new Application(DETECTOR);
240
244
  readers.forEach((r) => app.options.addReader(r));
241
245
  await app._bootstrap(options);
@@ -250,10 +254,10 @@ let Application = (() => {
250
254
  for (const [lang, locales] of Object.entries(this.options.getValue("locales"))) {
251
255
  this.internationalization.addTranslations(lang, locales);
252
256
  }
253
- if ((0, general_1.hasBeenLoadedMultipleTimes)()) {
254
- this.logger.warn(this.i18n.loaded_multiple_times_0((0, general_1.getLoadedPaths)().join("\n\t")));
257
+ if (hasBeenLoadedMultipleTimes()) {
258
+ this.logger.warn(this.i18n.loaded_multiple_times_0(getLoadedPaths().join("\n\t")));
255
259
  }
256
- this.trigger(application_events_1.ApplicationEvents.BOOTSTRAP_END, this);
260
+ this.trigger(ApplicationEvents.BOOTSTRAP_END, this);
257
261
  if (!this.internationalization.hasTranslations(this.lang)) {
258
262
  // Not internationalized as by definition we don't know what to include here.
259
263
  this.logger.warn(`Options specified "${this.lang}" as the language to use, but TypeDoc does not support it.`);
@@ -269,34 +273,45 @@ let Application = (() => {
269
273
  this.options.setValue("useHostedBaseUrlForAbsoluteLinks", false);
270
274
  }
271
275
  }
276
+ /** @internal */
272
277
  setOptions(options, reportErrors = true) {
278
+ let success = true;
273
279
  for (const [key, val] of Object.entries(options)) {
274
280
  try {
275
281
  this.options.setValue(key, val);
276
282
  }
277
283
  catch (error) {
278
- (0, assert_1.ok)(error instanceof Error);
284
+ success = false;
285
+ ok(error instanceof Error);
279
286
  if (reportErrors) {
280
287
  this.logger.error(error.message);
281
288
  }
282
289
  }
283
290
  }
291
+ return success;
284
292
  }
285
293
  /**
286
294
  * Return the path to the TypeScript compiler.
287
295
  */
288
296
  getTypeScriptPath() {
289
- return (0, paths_1.nicePath)(Path.dirname(require.resolve("typescript")));
297
+ const req = createRequire(import.meta.url);
298
+ return nicePath(Path.dirname(req.resolve("typescript")));
290
299
  }
291
300
  getTypeScriptVersion() {
292
- return typescript_1.default.version;
301
+ return ts.version;
302
+ }
303
+ async getEntryPoints() {
304
+ if (this.options.isSet("entryPoints")) {
305
+ return this.getDefinedEntryPoints();
306
+ }
307
+ return inferEntryPoints(this.logger, this.options);
293
308
  }
294
309
  /**
295
310
  * Gets the entry points to be documented according to the current `entryPoints` and `entryPointStrategy` options.
296
311
  * May return undefined if entry points fail to be expanded.
297
312
  */
298
- getEntryPoints() {
299
- return (0, entry_point_1.getEntryPoints)(this.logger, this.options);
313
+ getDefinedEntryPoints() {
314
+ return getEntryPoints(this.logger, this.options);
300
315
  }
301
316
  /**
302
317
  * Run the converter for the given set of files and return the generated reflections.
@@ -309,24 +324,24 @@ let Application = (() => {
309
324
  // with a few different settings.
310
325
  this.options.freeze();
311
326
  this.logger.verbose(`Using TypeScript ${this.getTypeScriptVersion()} from ${this.getTypeScriptPath()}`);
312
- if (this.entryPointStrategy === entry_point_1.EntryPointStrategy.Merge) {
327
+ if (this.entryPointStrategy === EntryPointStrategy.Merge) {
313
328
  return this._merge();
314
329
  }
315
- if (this.entryPointStrategy === entry_point_1.EntryPointStrategy.Packages) {
330
+ if (this.entryPointStrategy === EntryPointStrategy.Packages) {
316
331
  return this._convertPackages();
317
332
  }
318
- if (!supportedVersionMajorMinor.some((version) => version == typescript_1.default.versionMajorMinor)) {
333
+ if (!supportedVersionMajorMinor.some((version) => version == ts.versionMajorMinor)) {
319
334
  this.logger.warn(this.i18n.unsupported_ts_version_0(supportedVersionMajorMinor.join(", ")));
320
335
  }
321
- const entryPoints = this.getEntryPoints();
336
+ const entryPoints = await this.getEntryPoints();
322
337
  if (!entryPoints) {
323
338
  // Fatal error already reported.
324
339
  return;
325
340
  }
326
- const programs = (0, array_1.unique)(entryPoints.map((e) => e.program));
341
+ const programs = unique(entryPoints.map((e) => e.program));
327
342
  this.logger.verbose(`Converting with ${programs.length} programs ${entryPoints.length} entry points`);
328
343
  if (this.skipErrorChecking === false) {
329
- const errors = programs.flatMap((program) => typescript_1.default.getPreEmitDiagnostics(program));
344
+ const errors = programs.flatMap((program) => ts.getPreEmitDiagnostics(program));
330
345
  if (errors.length) {
331
346
  this.logger.diagnostics(errors);
332
347
  return;
@@ -346,11 +361,11 @@ let Application = (() => {
346
361
  convertAndWatch(success) {
347
362
  this.options.freeze();
348
363
  if (!this.options.getValue("preserveWatchOutput") &&
349
- this.logger instanceof index_2.ConsoleLogger) {
350
- typescript_1.default.sys.clearScreen?.();
364
+ this.logger instanceof ConsoleLogger) {
365
+ ts.sys.clearScreen?.();
351
366
  }
352
367
  this.logger.verbose(`Using TypeScript ${this.getTypeScriptVersion()} from ${this.getTypeScriptPath()}`);
353
- if (!supportedVersionMajorMinor.some((version) => version == typescript_1.default.versionMajorMinor)) {
368
+ if (!supportedVersionMajorMinor.some((version) => version == ts.versionMajorMinor)) {
354
369
  this.logger.warn(this.i18n.unsupported_ts_version_0(supportedVersionMajorMinor.join(", ")));
355
370
  }
356
371
  if (Object.keys(this.options.getCompilerOptions()).length === 0) {
@@ -363,25 +378,25 @@ let Application = (() => {
363
378
  return;
364
379
  }
365
380
  // Support for packages mode is currently unimplemented
366
- if (this.entryPointStrategy !== entry_point_1.EntryPointStrategy.Resolve &&
367
- this.entryPointStrategy !== entry_point_1.EntryPointStrategy.Expand) {
381
+ if (this.entryPointStrategy !== EntryPointStrategy.Resolve &&
382
+ this.entryPointStrategy !== EntryPointStrategy.Expand) {
368
383
  this.logger.error(this.i18n.strategy_not_supported_in_watch_mode());
369
384
  return;
370
385
  }
371
- const tsconfigFile = (0, tsconfig_1.findTsConfigFile)(this.options.getValue("tsconfig")) ??
386
+ const tsconfigFile = findTsConfigFile(this.options.getValue("tsconfig")) ??
372
387
  "tsconfig.json";
373
388
  // We don't want to do it the first time to preserve initial debug status messages. They'll be lost
374
389
  // after the user saves a file, but better than nothing...
375
390
  let firstStatusReport = true;
376
- const host = typescript_1.default.createWatchCompilerHost(tsconfigFile, {}, typescript_1.default.sys, typescript_1.default.createEmitAndSemanticDiagnosticsBuilderProgram, (diagnostic) => this.logger.diagnostic(diagnostic), (status, newLine, _options, errorCount) => {
391
+ const host = ts.createWatchCompilerHost(tsconfigFile, {}, ts.sys, ts.createEmitAndSemanticDiagnosticsBuilderProgram, (diagnostic) => this.logger.diagnostic(diagnostic), (status, newLine, _options, errorCount) => {
377
392
  if (!firstStatusReport &&
378
393
  errorCount === void 0 &&
379
394
  !this.options.getValue("preserveWatchOutput") &&
380
- this.logger instanceof index_2.ConsoleLogger) {
381
- typescript_1.default.sys.clearScreen?.();
395
+ this.logger instanceof ConsoleLogger) {
396
+ ts.sys.clearScreen?.();
382
397
  }
383
398
  firstStatusReport = false;
384
- this.logger.info(typescript_1.default.flattenDiagnosticMessageText(status.messageText, newLine));
399
+ this.logger.info(ts.flattenDiagnosticMessageText(status.messageText, newLine));
385
400
  });
386
401
  let successFinished = true;
387
402
  let currentProgram;
@@ -395,7 +410,7 @@ let Application = (() => {
395
410
  }
396
411
  this.logger.resetErrors();
397
412
  this.logger.resetWarnings();
398
- const entryPoints = (0, entry_point_1.getWatchEntryPoints)(this.logger, this.options, currentProgram);
413
+ const entryPoints = getWatchEntryPoints(this.logger, this.options, currentProgram);
399
414
  if (!entryPoints) {
400
415
  return;
401
416
  }
@@ -418,13 +433,13 @@ let Application = (() => {
418
433
  };
419
434
  const origAfterProgramCreate = host.afterProgramCreate;
420
435
  host.afterProgramCreate = (program) => {
421
- if (typescript_1.default.getPreEmitDiagnostics(program.getProgram()).length === 0) {
436
+ if (ts.getPreEmitDiagnostics(program.getProgram()).length === 0) {
422
437
  currentProgram = program.getProgram();
423
438
  runSuccess();
424
439
  }
425
440
  origAfterProgramCreate?.(program);
426
441
  };
427
- typescript_1.default.createWatchProgram(host);
442
+ ts.createWatchProgram(host);
428
443
  }
429
444
  validate(project) {
430
445
  const checks = this.options.getValue("validation");
@@ -432,32 +447,35 @@ let Application = (() => {
432
447
  // No point in validating exports when merging. Warnings will have already been emitted when
433
448
  // creating the project jsons that this run merges together.
434
449
  if (checks.notExported &&
435
- this.entryPointStrategy !== entry_point_1.EntryPointStrategy.Merge) {
436
- (0, exports_1.validateExports)(project, this.logger, this.options.getValue("intentionallyNotExported"));
450
+ this.entryPointStrategy !== EntryPointStrategy.Merge) {
451
+ validateExports(project, this.logger, this.options.getValue("intentionallyNotExported"));
437
452
  }
438
453
  if (checks.notDocumented) {
439
- (0, documentation_1.validateDocumentation)(project, this.logger, this.options.getValue("requiredToBeDocumented"));
454
+ validateDocumentation(project, this.logger, this.options.getValue("requiredToBeDocumented"));
440
455
  }
441
456
  if (checks.invalidLink) {
442
- (0, links_1.validateLinks)(project, this.logger);
457
+ validateLinks(project, this.logger);
458
+ }
459
+ if (checks.unusedMergeModuleWith) {
460
+ validateMergeModuleWith(project, this.logger);
443
461
  }
444
462
  this.trigger(Application.EVENT_VALIDATE_PROJECT, project);
445
463
  this.logger.verbose(`Validation took ${Date.now() - start}ms`);
446
464
  }
465
+ /**
466
+ * Render outputs selected with options for the specified project
467
+ */
468
+ async generateOutputs(project) {
469
+ await this.outputs.writeOutputs(project);
470
+ }
447
471
  /**
448
472
  * Render HTML for the given project
449
473
  */
450
474
  async generateDocs(project, out) {
451
- const start = Date.now();
452
- out = Path.resolve(out);
453
- await this.renderer.render(project, out);
454
- if (this.logger.hasErrors()) {
455
- this.logger.error(this.i18n.docs_could_not_be_generated());
456
- }
457
- else {
458
- this.logger.info(this.i18n.docs_generated_at_0((0, paths_1.nicePath)(out)));
459
- this.logger.verbose(`HTML rendering took ${Date.now() - start}ms`);
460
- }
475
+ await this.outputs.writeOutput({
476
+ name: "html",
477
+ path: out,
478
+ }, project);
461
479
  }
462
480
  /**
463
481
  * Write the reflections to a json file.
@@ -466,13 +484,10 @@ let Application = (() => {
466
484
  * @returns Whether the JSON file could be written successfully.
467
485
  */
468
486
  async generateJson(project, out) {
469
- const start = Date.now();
470
- out = Path.resolve(out);
471
- const ser = this.serializer.projectToObject(project, process.cwd());
472
- const space = this.options.getValue("pretty") ? "\t" : "";
473
- await (0, index_2.writeFile)(out, JSON.stringify(ser, null, space) + "\n");
474
- this.logger.info(this.i18n.json_written_to_0((0, paths_1.nicePath)(out)));
475
- this.logger.verbose(`JSON rendering took ${Date.now() - start}ms`);
487
+ await this.outputs.writeOutput({
488
+ name: "json",
489
+ path: out,
490
+ }, project);
476
491
  }
477
492
  /**
478
493
  * Print the version number.
@@ -490,7 +505,7 @@ let Application = (() => {
490
505
  this.logger.error(this.i18n.no_entry_points_for_packages());
491
506
  return;
492
507
  }
493
- const packageDirs = (0, entry_point_1.getPackageDirectories)(this.logger, this.options, this.options.getValue("entryPoints"));
508
+ const packageDirs = getPackageDirectories(this.logger, this.options, this.options.getValue("entryPoints"));
494
509
  if (packageDirs.length === 0) {
495
510
  this.logger.error(this.i18n.failed_to_find_packages());
496
511
  return;
@@ -501,32 +516,37 @@ let Application = (() => {
501
516
  const projectsToConvert = [];
502
517
  // Generate a json file for each package
503
518
  for (const dir of packageDirs) {
504
- this.logger.verbose(`Reading project at ${(0, paths_1.nicePath)(dir)}`);
519
+ this.logger.verbose(`Reading project at ${nicePath(dir)}`);
505
520
  let opts;
506
521
  try {
507
522
  opts = origOptions.copyForPackage(dir);
508
523
  }
509
524
  catch (error) {
510
- (0, assert_1.ok)(error instanceof Error);
525
+ ok(error instanceof Error);
511
526
  this.logger.error(error.message);
512
- this.logger.info(this.i18n.previous_error_occurred_when_reading_options_for_0((0, paths_1.nicePath)(dir)));
527
+ this.logger.info(this.i18n.previous_error_occurred_when_reading_options_for_0(nicePath(dir)));
513
528
  continue;
514
529
  }
515
530
  await opts.read(this.logger, dir);
516
531
  // Invalid links should only be reported after everything has been merged.
517
- opts.setValue("validation", { invalidLink: false });
532
+ // Same goes for @mergeModuleWith, should only be validated after merging
533
+ // everything together.
534
+ opts.setValue("validation", {
535
+ invalidLink: false,
536
+ unusedMergeModuleWith: false,
537
+ });
518
538
  if (opts.getValue("entryPointStrategy") ===
519
- entry_point_1.EntryPointStrategy.Packages) {
520
- this.logger.error(this.i18n.nested_packages_unsupported_0((0, paths_1.nicePath)(dir)));
539
+ EntryPointStrategy.Packages) {
540
+ this.logger.error(this.i18n.nested_packages_unsupported_0(nicePath(dir)));
521
541
  continue;
522
542
  }
523
- (0, ReflectionSymbolId_1.addInferredDeclarationMapPaths)(opts.getCompilerOptions(), opts.getFileNames());
543
+ addInferredDeclarationMapPaths(opts.getCompilerOptions(), opts.getFileNames());
524
544
  projectsToConvert.push({ dir, options: opts });
525
545
  }
526
546
  for (const { dir, options } of projectsToConvert) {
527
- this.logger.info(this.i18n.converting_project_at_0((0, paths_1.nicePath)(dir)));
547
+ this.logger.info(this.i18n.converting_project_at_0(nicePath(dir)));
528
548
  this.options = options;
529
- this.files = new FileRegistry_1.ValidatingFileRegistry();
549
+ this.files = new ValidatingFileRegistry();
530
550
  let project = await this.convert();
531
551
  if (project) {
532
552
  this.validate(project);
@@ -548,8 +568,12 @@ let Application = (() => {
548
568
  return;
549
569
  }
550
570
  this.logger.info(this.i18n.merging_converted_projects());
551
- const result = this.deserializer.reviveProjects(this.options.getValue("name") || "Documentation", projects, process.cwd(), this.files);
552
- this.trigger(application_events_1.ApplicationEvents.REVIVE, result);
571
+ const result = this.deserializer.reviveProjects(this.options.getValue("name") || "Documentation", projects, {
572
+ projectRoot: process.cwd(),
573
+ registry: this.files,
574
+ addProjectDocuments: true,
575
+ });
576
+ this.trigger(ApplicationEvents.REVIVE, result);
553
577
  return result;
554
578
  }
555
579
  _merge() {
@@ -558,83 +582,39 @@ let Application = (() => {
558
582
  this.logger.error(this.i18n.no_entry_points_to_merge());
559
583
  return;
560
584
  }
561
- const rootDir = (0, fs_1.deriveRootDir)(this.entryPoints);
585
+ const rootDir = deriveRootDir(this.entryPoints);
562
586
  const entryPoints = this.entryPoints.flatMap((entry) => {
563
- const result = (0, fs_1.glob)(entry, rootDir);
587
+ const result = glob(entry, rootDir);
564
588
  if (result.length === 0) {
565
- this.logger.warn(this.i18n.entrypoint_did_not_match_files_0((0, paths_1.nicePath)(entry)));
589
+ this.logger.warn(this.i18n.entrypoint_did_not_match_files_0(nicePath(entry)));
566
590
  }
567
- else {
568
- this.logger.verbose(`Expanded ${(0, paths_1.nicePath)(entry)} to:\n\t${result
569
- .map(paths_1.nicePath)
591
+ else if (result.length !== 1) {
592
+ this.logger.verbose(`Expanded ${nicePath(entry)} to:\n\t${result
593
+ .map(nicePath)
570
594
  .join("\n\t")}`);
571
595
  }
572
596
  return result;
573
597
  });
574
598
  const jsonProjects = entryPoints.map((path) => {
575
599
  try {
576
- return JSON.parse((0, fs_1.readFile)(path));
600
+ return JSON.parse(readFile(path));
577
601
  }
578
602
  catch {
579
- this.logger.error(this.i18n.failed_to_parse_json_0((0, paths_1.nicePath)(path)));
603
+ this.logger.error(this.i18n.failed_to_parse_json_0(nicePath(path)));
580
604
  return null;
581
605
  }
582
606
  });
583
607
  if (this.logger.hasErrors())
584
608
  return;
585
- const result = this.deserializer.reviveProjects(this.options.getValue("name"), jsonProjects, process.cwd(), this.files);
609
+ const result = this.deserializer.reviveProjects(this.options.getValue("name"), jsonProjects, {
610
+ projectRoot: process.cwd(),
611
+ registry: this.files,
612
+ addProjectDocuments: true,
613
+ });
586
614
  this.logger.verbose(`Reviving projects took ${Date.now() - start}ms`);
587
- // If we only revived one project, the project documents were set for
588
- // it when it was created. If we revived more than one project then
589
- // it's convenient to be able to add more documents now.
590
- if (jsonProjects.length > 1) {
591
- this.converter.addProjectDocuments(result);
592
- }
593
- this.trigger(application_events_1.ApplicationEvents.REVIVE, result);
615
+ this.trigger(ApplicationEvents.REVIVE, result);
594
616
  return result;
595
617
  }
596
618
  };
597
- _Application_lang_accessor_storage = new WeakMap();
598
- _Application_skipErrorChecking_accessor_storage = new WeakMap();
599
- _Application_entryPointStrategy_accessor_storage = new WeakMap();
600
- _Application_entryPoints_accessor_storage = new WeakMap();
601
- __setFunctionName(_classThis, "Application");
602
- (() => {
603
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
604
- _lang_decorators = [(0, utils_1.Option)("lang")];
605
- _skipErrorChecking_decorators = [(0, utils_1.Option)("skipErrorChecking")];
606
- _entryPointStrategy_decorators = [(0, utils_1.Option)("entryPointStrategy")];
607
- _entryPoints_decorators = [(0, utils_1.Option)("entryPoints")];
608
- __esDecorate(_classThis, null, _lang_decorators, { kind: "accessor", name: "lang", static: false, private: false, access: { has: obj => "lang" in obj, get: obj => obj.lang, set: (obj, value) => { obj.lang = value; } }, metadata: _metadata }, _lang_initializers, _lang_extraInitializers);
609
- __esDecorate(_classThis, null, _skipErrorChecking_decorators, { kind: "accessor", name: "skipErrorChecking", static: false, private: false, access: { has: obj => "skipErrorChecking" in obj, get: obj => obj.skipErrorChecking, set: (obj, value) => { obj.skipErrorChecking = value; } }, metadata: _metadata }, _skipErrorChecking_initializers, _skipErrorChecking_extraInitializers);
610
- __esDecorate(_classThis, null, _entryPointStrategy_decorators, { kind: "accessor", name: "entryPointStrategy", static: false, private: false, access: { has: obj => "entryPointStrategy" in obj, get: obj => obj.entryPointStrategy, set: (obj, value) => { obj.entryPointStrategy = value; } }, metadata: _metadata }, _entryPointStrategy_initializers, _entryPointStrategy_extraInitializers);
611
- __esDecorate(_classThis, null, _entryPoints_decorators, { kind: "accessor", name: "entryPoints", static: false, private: false, access: { has: obj => "entryPoints" in obj, get: obj => obj.entryPoints, set: (obj, value) => { obj.entryPoints = value; } }, metadata: _metadata }, _entryPoints_initializers, _entryPoints_extraInitializers);
612
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
613
- Application = _classThis = _classDescriptor.value;
614
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
615
- })();
616
- /**
617
- * The version number of TypeDoc.
618
- */
619
- _classThis.VERSION = packageInfo.version;
620
- /**
621
- * Emitted after plugins have been loaded and options have been read, but before they have been frozen.
622
- * The listener will be given an instance of {@link Application}.
623
- */
624
- _classThis.EVENT_BOOTSTRAP_END = application_events_1.ApplicationEvents.BOOTSTRAP_END;
625
- /**
626
- * Emitted after a project has been deserialized from JSON.
627
- * The listener will be given an instance of {@link ProjectReflection}.
628
- */
629
- _classThis.EVENT_PROJECT_REVIVE = application_events_1.ApplicationEvents.REVIVE;
630
- /**
631
- * Emitted when validation is being run.
632
- * The listener will be given an instance of {@link ProjectReflection}.
633
- */
634
- _classThis.EVENT_VALIDATE_PROJECT = application_events_1.ApplicationEvents.VALIDATE_PROJECT;
635
- (() => {
636
- __runInitializers(_classThis, _classExtraInitializers);
637
- })();
638
- return Application = _classThis;
639
619
  })();
640
- exports.Application = Application;
620
+ export { Application };