typedoc 0.27.9 → 0.28.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 (324) hide show
  1. package/README.md +26 -26
  2. package/bin/package.json +1 -1
  3. package/dist/browser-locales/en.d.ts +2 -0
  4. package/dist/browser-locales/en.js +62 -0
  5. package/dist/browser-locales/ja.d.ts +2 -0
  6. package/dist/browser-locales/ja.js +62 -0
  7. package/dist/browser-locales/ko.d.ts +2 -0
  8. package/dist/browser-locales/ko.js +62 -0
  9. package/dist/browser-locales/zh.d.ts +2 -0
  10. package/dist/browser-locales/zh.js +62 -0
  11. package/dist/browser-utils.d.ts +3 -0
  12. package/dist/browser-utils.js +3 -0
  13. package/dist/index.d.ts +15 -9
  14. package/dist/index.js +13 -7
  15. package/dist/lib/application.d.ts +9 -10
  16. package/dist/lib/application.js +75 -56
  17. package/dist/lib/cli.js +4 -3
  18. package/dist/lib/converter/comments/blockLexer.js +2 -2
  19. package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +1 -1
  20. package/dist/lib/converter/comments/declarationReferenceResolver.js +8 -10
  21. package/dist/lib/converter/comments/discovery.d.ts +1 -1
  22. package/dist/lib/converter/comments/discovery.js +3 -4
  23. package/dist/lib/converter/comments/index.d.ts +1 -1
  24. package/dist/lib/converter/comments/index.js +5 -7
  25. package/dist/lib/converter/comments/linkResolver.d.ts +1 -1
  26. package/dist/lib/converter/comments/linkResolver.js +10 -16
  27. package/dist/lib/converter/comments/parser.d.ts +2 -2
  28. package/dist/lib/converter/comments/parser.js +8 -8
  29. package/dist/lib/converter/comments/textParser.d.ts +3 -2
  30. package/dist/lib/converter/comments/textParser.js +1 -2
  31. package/dist/lib/converter/context.d.ts +13 -14
  32. package/dist/lib/converter/context.js +49 -13
  33. package/dist/lib/converter/converter.d.ts +10 -5
  34. package/dist/lib/converter/converter.js +59 -42
  35. package/dist/lib/converter/factories/index-signature.js +3 -2
  36. package/dist/lib/converter/factories/signature.js +5 -6
  37. package/dist/lib/converter/factories/symbol-id.d.ts +4 -0
  38. package/dist/lib/converter/factories/symbol-id.js +92 -0
  39. package/dist/lib/converter/factories/types.d.ts +4 -0
  40. package/dist/lib/converter/factories/types.js +13 -0
  41. package/dist/lib/converter/index.d.ts +3 -4
  42. package/dist/lib/converter/index.js +2 -2
  43. package/dist/lib/converter/jsdoc.js +5 -4
  44. package/dist/lib/converter/plugins/CategoryPlugin.js +4 -2
  45. package/dist/lib/converter/plugins/CommentPlugin.d.ts +0 -1
  46. package/dist/lib/converter/plugins/CommentPlugin.js +8 -6
  47. package/dist/lib/converter/plugins/GroupPlugin.d.ts +2 -3
  48. package/dist/lib/converter/plugins/GroupPlugin.js +8 -7
  49. package/dist/lib/converter/plugins/ImplementsPlugin.js +6 -8
  50. package/dist/lib/converter/plugins/IncludePlugin.d.ts +1 -1
  51. package/dist/lib/converter/plugins/IncludePlugin.js +19 -16
  52. package/dist/lib/converter/plugins/InheritDocPlugin.js +7 -9
  53. package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +3 -2
  54. package/dist/lib/converter/plugins/PackagePlugin.d.ts +3 -2
  55. package/dist/lib/converter/plugins/PackagePlugin.js +23 -19
  56. package/dist/lib/converter/plugins/SourcePlugin.d.ts +2 -1
  57. package/dist/lib/converter/plugins/SourcePlugin.js +10 -9
  58. package/dist/lib/converter/plugins/TypePlugin.d.ts +1 -1
  59. package/dist/lib/converter/plugins/TypePlugin.js +1 -1
  60. package/dist/lib/converter/plugins/index.d.ts +1 -1
  61. package/dist/lib/converter/plugins/index.js +1 -1
  62. package/dist/lib/converter/symbols.js +103 -32
  63. package/dist/lib/converter/types.js +14 -13
  64. package/dist/lib/converter/utils/repository.d.ts +1 -1
  65. package/dist/lib/converter/utils/repository.js +2 -2
  66. package/dist/lib/debug/index.d.ts +2 -2
  67. package/dist/lib/debug/index.js +2 -2
  68. package/dist/lib/debug/{debugReflectionLifetimes.d.ts → reflectionLifetimes.d.ts} +2 -1
  69. package/dist/lib/debug/{debugReflectionLifetimes.js → reflectionLifetimes.js} +12 -4
  70. package/dist/lib/debug/{debugRendererUrls.d.ts → rendererUrls.d.ts} +1 -0
  71. package/dist/lib/debug/rendererUrls.js +68 -0
  72. package/dist/lib/internationalization/index.d.ts +2 -1
  73. package/dist/lib/internationalization/index.js +2 -1
  74. package/dist/lib/internationalization/internationalization.d.ts +16 -46
  75. package/dist/lib/internationalization/internationalization.js +44 -213
  76. package/dist/lib/internationalization/locales/en.cjs +9 -1
  77. package/dist/lib/internationalization/locales/en.d.cts +9 -1
  78. package/dist/lib/internationalization/locales/ja.cjs +1 -0
  79. package/dist/lib/internationalization/locales/zh.cjs +61 -5
  80. package/dist/lib/internationalization/locales/zh.d.cts +26 -2
  81. package/dist/lib/internationalization/translatable.d.ts +2 -1
  82. package/dist/lib/models/{comments/comment.d.ts → Comment.d.ts} +9 -8
  83. package/dist/lib/models/{comments/comment.js → Comment.js} +15 -18
  84. package/dist/lib/models/{reflections/container.d.ts → ContainerReflection.d.ts} +6 -6
  85. package/dist/lib/models/{reflections/container.js → ContainerReflection.js} +4 -5
  86. package/dist/lib/models/{reflections/declaration.d.ts → DeclarationReflection.d.ts} +11 -19
  87. package/dist/lib/models/{reflections/declaration.js → DeclarationReflection.js} +11 -29
  88. package/dist/lib/models/{reflections/document.d.ts → DocumentReflection.d.ts} +3 -3
  89. package/dist/lib/models/{reflections/document.js → DocumentReflection.js} +3 -3
  90. package/dist/lib/models/FileRegistry.d.ts +12 -20
  91. package/dist/lib/models/FileRegistry.js +8 -44
  92. package/dist/lib/models/{reflections/parameter.d.ts → ParameterReflection.d.ts} +4 -4
  93. package/dist/lib/models/{reflections/parameter.js → ParameterReflection.js} +2 -2
  94. package/dist/lib/models/{reflections/project.d.ts → ProjectReflection.d.ts} +12 -21
  95. package/dist/lib/models/{reflections/project.js → ProjectReflection.js} +16 -48
  96. package/dist/lib/models/{reflections/reference.d.ts → ReferenceReflection.d.ts} +3 -3
  97. package/dist/lib/models/{reflections/reference.js → ReferenceReflection.js} +3 -4
  98. package/dist/lib/models/{reflections/abstract.d.ts → Reflection.d.ts} +15 -28
  99. package/dist/lib/models/{reflections/abstract.js → Reflection.js} +38 -21
  100. package/dist/lib/models/ReflectionCategory.d.ts +2 -6
  101. package/dist/lib/models/ReflectionCategory.js +3 -9
  102. package/dist/lib/models/ReflectionGroup.d.ts +1 -5
  103. package/dist/lib/models/ReflectionGroup.js +2 -8
  104. package/dist/lib/models/{reflections/ReflectionSymbolId.d.ts → ReflectionSymbolId.d.ts} +23 -10
  105. package/dist/lib/models/ReflectionSymbolId.js +75 -0
  106. package/dist/lib/models/{reflections/signature.d.ts → SignatureReflection.d.ts} +8 -7
  107. package/dist/lib/models/{reflections/signature.js → SignatureReflection.js} +7 -11
  108. package/dist/lib/models/{sources/file.d.ts → SourceReference.d.ts} +3 -4
  109. package/dist/lib/models/{reflections/type-parameter.d.ts → TypeParameterReflection.d.ts} +6 -5
  110. package/dist/lib/models/{reflections/type-parameter.js → TypeParameterReflection.js} +4 -1
  111. package/dist/lib/models/index.d.ts +18 -6
  112. package/dist/lib/models/index.js +18 -6
  113. package/dist/lib/models/{reflections/kind.d.ts → kind.d.ts} +2 -8
  114. package/dist/lib/models/{reflections/kind.js → kind.js} +99 -30
  115. package/dist/lib/models/types.d.ts +8 -10
  116. package/dist/lib/models/types.js +11 -22
  117. package/dist/lib/models/{reflections/variant.d.ts → variant.d.ts} +7 -7
  118. package/dist/lib/output/components.d.ts +2 -2
  119. package/dist/lib/output/components.js +1 -1
  120. package/dist/lib/output/events.d.ts +10 -18
  121. package/dist/lib/output/events.js +10 -27
  122. package/dist/lib/output/formatter.d.ts +8 -5
  123. package/dist/lib/output/formatter.js +45 -18
  124. package/dist/lib/output/index.d.ts +4 -5
  125. package/dist/lib/output/index.js +4 -4
  126. package/dist/lib/output/output.js +5 -4
  127. package/dist/lib/output/plugins/AssetsPlugin.js +7 -6
  128. package/dist/lib/output/plugins/HierarchyPlugin.js +4 -3
  129. package/dist/lib/output/plugins/IconsPlugin.js +3 -3
  130. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +12 -17
  131. package/dist/lib/output/plugins/SitemapPlugin.js +6 -7
  132. package/dist/lib/output/renderer.d.ts +22 -14
  133. package/dist/lib/output/renderer.js +76 -36
  134. package/dist/lib/output/router.d.ts +175 -0
  135. package/dist/lib/output/router.js +478 -0
  136. package/dist/lib/output/theme.d.ts +3 -28
  137. package/dist/lib/output/theme.js +2 -15
  138. package/dist/lib/output/themes/MarkedPlugin.d.ts +2 -2
  139. package/dist/lib/output/themes/MarkedPlugin.js +32 -30
  140. package/dist/lib/output/themes/default/DefaultTheme.d.ts +11 -40
  141. package/dist/lib/output/themes/default/DefaultTheme.js +207 -406
  142. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +49 -47
  143. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +17 -14
  144. package/dist/lib/output/themes/default/Slugger.js +1 -1
  145. package/dist/lib/output/themes/default/layouts/default.d.ts +1 -1
  146. package/dist/lib/output/themes/default/layouts/default.js +6 -6
  147. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +4 -1
  148. package/dist/lib/output/themes/default/partials/anchor-icon.js +12 -2
  149. package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +2 -2
  150. package/dist/lib/output/themes/default/partials/breadcrumb.js +11 -5
  151. package/dist/lib/output/themes/default/partials/comment.d.ts +1 -1
  152. package/dist/lib/output/themes/default/partials/comment.js +9 -9
  153. package/dist/lib/output/themes/default/partials/footer.d.ts +1 -1
  154. package/dist/lib/output/themes/default/partials/footer.js +2 -2
  155. package/dist/lib/output/themes/default/partials/header.d.ts +2 -2
  156. package/dist/lib/output/themes/default/partials/header.js +4 -3
  157. package/dist/lib/output/themes/default/partials/hierarchy.d.ts +1 -1
  158. package/dist/lib/output/themes/default/partials/hierarchy.js +10 -8
  159. package/dist/lib/output/themes/default/partials/icon.d.ts +2 -3
  160. package/dist/lib/output/themes/default/partials/icon.js +3 -3
  161. package/dist/lib/output/themes/default/partials/index.d.ts +1 -1
  162. package/dist/lib/output/themes/default/partials/index.js +10 -18
  163. package/dist/lib/output/themes/default/partials/member.d.ts +1 -1
  164. package/dist/lib/output/themes/default/partials/member.declaration.d.ts +1 -1
  165. package/dist/lib/output/themes/default/partials/member.declaration.js +2 -2
  166. package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +1 -1
  167. package/dist/lib/output/themes/default/partials/member.getterSetter.js +5 -5
  168. package/dist/lib/output/themes/default/partials/member.js +10 -9
  169. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +1 -1
  170. package/dist/lib/output/themes/default/partials/member.signature.body.js +4 -4
  171. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +1 -1
  172. package/dist/lib/output/themes/default/partials/member.signature.title.js +1 -1
  173. package/dist/lib/output/themes/default/partials/member.signatures.d.ts +1 -1
  174. package/dist/lib/output/themes/default/partials/member.signatures.js +4 -4
  175. package/dist/lib/output/themes/default/partials/member.sources.d.ts +1 -1
  176. package/dist/lib/output/themes/default/partials/member.sources.js +7 -7
  177. package/dist/lib/output/themes/default/partials/members.d.ts +1 -1
  178. package/dist/lib/output/themes/default/partials/members.js +2 -2
  179. package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +2 -2
  180. package/dist/lib/output/themes/default/partials/moduleReflection.js +5 -5
  181. package/dist/lib/output/themes/default/partials/navigation.d.ts +1 -1
  182. package/dist/lib/output/themes/default/partials/navigation.js +17 -15
  183. package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +1 -1
  184. package/dist/lib/output/themes/default/partials/reflectionPreview.js +2 -2
  185. package/dist/lib/output/themes/default/partials/toolbar.d.ts +1 -1
  186. package/dist/lib/output/themes/default/partials/toolbar.js +10 -13
  187. package/dist/lib/output/themes/default/partials/type.d.ts +1 -1
  188. package/dist/lib/output/themes/default/partials/type.js +1 -1
  189. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +1 -1
  190. package/dist/lib/output/themes/default/partials/typeAndParent.js +3 -3
  191. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +1 -1
  192. package/dist/lib/output/themes/default/partials/typeDetails.js +23 -19
  193. package/dist/lib/output/themes/default/partials/typeParameters.d.ts +1 -1
  194. package/dist/lib/output/themes/default/partials/typeParameters.js +12 -7
  195. package/dist/lib/output/themes/default/templates/document.d.ts +1 -1
  196. package/dist/lib/output/themes/default/templates/document.js +2 -2
  197. package/dist/lib/output/themes/default/templates/hierarchy.d.ts +1 -1
  198. package/dist/lib/output/themes/default/templates/hierarchy.js +4 -3
  199. package/dist/lib/output/themes/default/templates/index.d.ts +1 -1
  200. package/dist/lib/output/themes/default/templates/index.js +2 -2
  201. package/dist/lib/output/themes/default/templates/reflection.d.ts +1 -1
  202. package/dist/lib/output/themes/default/templates/reflection.js +9 -12
  203. package/dist/lib/output/themes/lib.d.ts +1 -1
  204. package/dist/lib/output/themes/lib.js +3 -3
  205. package/dist/lib/serialization/components.d.ts +1 -1
  206. package/dist/lib/serialization/deserializer.d.ts +9 -13
  207. package/dist/lib/serialization/deserializer.js +22 -24
  208. package/dist/lib/serialization/events.d.ts +1 -1
  209. package/dist/lib/serialization/index.d.ts +1 -1
  210. package/dist/lib/serialization/index.js +1 -1
  211. package/dist/lib/serialization/schema.d.ts +15 -10
  212. package/dist/lib/serialization/schema.js +1 -1
  213. package/dist/lib/serialization/serializer.d.ts +4 -4
  214. package/dist/lib/serialization/serializer.js +1 -2
  215. package/dist/lib/utils/ValidatingFileRegistry.d.ts +10 -0
  216. package/dist/lib/utils/ValidatingFileRegistry.js +34 -0
  217. package/dist/lib/utils/component.d.ts +1 -1
  218. package/dist/lib/utils/component.js +1 -1
  219. package/dist/lib/utils/entry-point.d.ts +3 -3
  220. package/dist/lib/utils/entry-point.js +29 -26
  221. package/dist/lib/utils/fs.d.ts +5 -13
  222. package/dist/lib/utils/fs.js +11 -67
  223. package/dist/lib/utils/general.d.ts +1 -47
  224. package/dist/lib/utils/general.js +4 -74
  225. package/dist/lib/utils/highlighter.js +1 -2
  226. package/dist/lib/utils/html.d.ts +0 -1
  227. package/dist/lib/utils/html.js +4 -13
  228. package/dist/lib/utils/index.d.ts +9 -17
  229. package/dist/lib/utils/index.js +8 -15
  230. package/dist/lib/utils/loggers.d.ts +5 -108
  231. package/dist/lib/utils/loggers.js +24 -168
  232. package/dist/lib/utils/options/declaration.d.ts +63 -38
  233. package/dist/lib/utils/options/declaration.js +124 -66
  234. package/dist/lib/utils/options/defaults.d.ts +1 -1
  235. package/dist/lib/utils/options/help.d.ts +1 -2
  236. package/dist/lib/utils/options/help.js +5 -5
  237. package/dist/lib/utils/options/index.d.ts +4 -4
  238. package/dist/lib/utils/options/index.js +3 -3
  239. package/dist/lib/utils/options/options.d.ts +3 -6
  240. package/dist/lib/utils/options/options.js +10 -12
  241. package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
  242. package/dist/lib/utils/options/readers/arguments.js +4 -3
  243. package/dist/lib/utils/options/readers/package-json.d.ts +1 -1
  244. package/dist/lib/utils/options/readers/package-json.js +3 -2
  245. package/dist/lib/utils/options/readers/tsconfig.d.ts +1 -1
  246. package/dist/lib/utils/options/readers/tsconfig.js +27 -27
  247. package/dist/lib/utils/options/readers/typedoc.d.ts +1 -1
  248. package/dist/lib/utils/options/readers/typedoc.js +8 -9
  249. package/dist/lib/utils/options/sources/typedoc.js +143 -135
  250. package/dist/lib/utils/options/tsdoc-defaults.d.ts +1 -1
  251. package/dist/lib/utils/options/tsdoc-defaults.js +3 -1
  252. package/dist/lib/utils/package-manifest.d.ts +3 -3
  253. package/dist/lib/utils/package-manifest.js +9 -8
  254. package/dist/lib/utils/paths.d.ts +17 -6
  255. package/dist/lib/utils/paths.js +94 -11
  256. package/dist/lib/utils/perf.d.ts +4 -1
  257. package/dist/lib/utils/perf.js +32 -13
  258. package/dist/lib/utils/plugins.js +4 -3
  259. package/dist/lib/utils/sort.d.ts +1 -1
  260. package/dist/lib/utils/sort.js +8 -3
  261. package/dist/lib/utils/tsconfig.d.ts +1 -1
  262. package/dist/lib/utils/tsconfig.js +4 -3
  263. package/dist/lib/utils-common/general.d.ts +40 -0
  264. package/dist/lib/utils-common/general.js +20 -0
  265. package/dist/lib/utils-common/i18n.d.ts +17 -0
  266. package/dist/lib/utils-common/i18n.js +39 -0
  267. package/dist/lib/utils-common/index.d.ts +16 -0
  268. package/dist/lib/utils-common/index.js +18 -0
  269. package/dist/lib/{utils → utils-common}/jsx.d.ts +3 -3
  270. package/dist/lib/{utils → utils-common}/jsx.js +1 -1
  271. package/dist/lib/utils-common/logger.d.ts +86 -0
  272. package/dist/lib/utils-common/logger.js +120 -0
  273. package/dist/lib/{utils → utils-common}/minimalSourceFile.d.ts +7 -2
  274. package/dist/lib/{utils → utils-common}/minimalSourceFile.js +3 -2
  275. package/dist/lib/utils-common/path.d.ts +35 -0
  276. package/dist/lib/utils-common/path.js +123 -0
  277. package/dist/lib/utils-common/string.d.ts +11 -0
  278. package/dist/lib/utils-common/string.js +84 -0
  279. package/dist/lib/validation/documentation.d.ts +2 -2
  280. package/dist/lib/validation/documentation.js +5 -6
  281. package/dist/lib/validation/exports.d.ts +1 -1
  282. package/dist/lib/validation/exports.js +4 -4
  283. package/dist/lib/validation/links.d.ts +1 -1
  284. package/dist/lib/validation/links.js +9 -8
  285. package/dist/lib/validation/unusedMergeModuleWith.d.ts +1 -1
  286. package/dist/lib/validation/unusedMergeModuleWith.js +3 -2
  287. package/package.json +57 -36
  288. package/static/main.js +4 -4
  289. package/static/style.css +232 -209
  290. package/tsdoc.json +8 -0
  291. package/dist/lib/debug/debugRendererUrls.js +0 -59
  292. package/dist/lib/internationalization/locales/jp.cjs +0 -3
  293. package/dist/lib/internationalization/locales/jp.d.cts +0 -2
  294. package/dist/lib/models/comments/index.d.ts +0 -2
  295. package/dist/lib/models/comments/index.js +0 -1
  296. package/dist/lib/models/reflections/ReflectionSymbolId.js +0 -133
  297. package/dist/lib/models/reflections/index.d.ts +0 -15
  298. package/dist/lib/models/reflections/index.js +0 -12
  299. package/dist/lib/models/sources/index.d.ts +0 -1
  300. package/dist/lib/models/sources/index.js +0 -1
  301. package/dist/lib/output/models/UrlMapping.d.ts +0 -13
  302. package/dist/lib/output/models/UrlMapping.js +0 -10
  303. /package/dist/lib/models/{sources/file.js → SourceReference.js} +0 -0
  304. /package/dist/lib/models/{reflections/utils.d.ts → utils.d.ts} +0 -0
  305. /package/dist/lib/models/{reflections/utils.js → utils.js} +0 -0
  306. /package/dist/lib/models/{reflections/variant.js → variant.js} +0 -0
  307. /package/dist/lib/{utils → utils-common}/array.d.ts +0 -0
  308. /package/dist/lib/{utils → utils-common}/array.js +0 -0
  309. /package/dist/lib/{converter/comments → utils-common}/declarationReference.d.ts +0 -0
  310. /package/dist/lib/{converter/comments → utils-common}/declarationReference.js +0 -0
  311. /package/dist/lib/{utils → utils-common}/enum.d.ts +0 -0
  312. /package/dist/lib/{utils → utils-common}/enum.js +0 -0
  313. /package/dist/lib/{utils → utils-common}/events.d.ts +0 -0
  314. /package/dist/lib/{utils → utils-common}/events.js +0 -0
  315. /package/dist/lib/{utils → utils-common}/hooks.d.ts +0 -0
  316. /package/dist/lib/{utils → utils-common}/hooks.js +0 -0
  317. /package/dist/lib/{utils → utils-common}/jsx.elements.d.ts +0 -0
  318. /package/dist/lib/{utils → utils-common}/jsx.elements.js +0 -0
  319. /package/dist/lib/{utils → utils-common}/map.d.ts +0 -0
  320. /package/dist/lib/{utils → utils-common}/map.js +0 -0
  321. /package/dist/lib/{utils → utils-common}/set.d.ts +0 -0
  322. /package/dist/lib/{utils → utils-common}/set.js +0 -0
  323. /package/dist/lib/{utils → utils-common}/validation.d.ts +0 -0
  324. /package/dist/lib/{utils → utils-common}/validation.js +0 -0
@@ -1,12 +1,10 @@
1
- import ts from "typescript";
2
- import type { Context } from "../converter/index.js";
3
- import type { Reflection } from "./reflections/abstract.js";
4
- import type { DeclarationReflection } from "./reflections/declaration.js";
5
- import type { ProjectReflection } from "./reflections/project.js";
6
- import type { Serializer, JSONOutput, Deserializer } from "../serialization/index.js";
7
- import { ReflectionSymbolId } from "./reflections/ReflectionSymbolId.js";
8
- import type { DeclarationReference } from "../converter/comments/declarationReference.js";
9
- import { type CommentDisplayPart } from "./comments/index.js";
1
+ import type { Reflection } from "./Reflection.js";
2
+ import type { DeclarationReflection } from "./DeclarationReflection.js";
3
+ import type { ProjectReflection } from "./ProjectReflection.js";
4
+ import type { Deserializer, JSONOutput, Serializer } from "#serialization";
5
+ import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
6
+ import type { DeclarationReference } from "#utils";
7
+ import { type CommentDisplayPart } from "./Comment.js";
10
8
  /**
11
9
  * Base class of all type definitions.
12
10
  * @category Types
@@ -387,8 +385,8 @@ export declare class ReferenceType extends Type {
387
385
  private _target;
388
386
  private _project;
389
387
  private constructor();
388
+ static createUnresolvedReference(name: string, target: ReflectionSymbolId, project: ProjectReflection, qualifiedName: string): ReferenceType;
390
389
  static createResolvedReference(name: string, target: Reflection | number, project: ProjectReflection | null): ReferenceType;
391
- static createSymbolReference(symbol: ts.Symbol, context: Context, name?: string): ReferenceType;
392
390
  /**
393
391
  * This is used for type parameters, which don't actually point to something,
394
392
  * and also for temporary references which will be cleaned up with real references
@@ -1,10 +1,7 @@
1
- import ts from "typescript";
2
- import { getQualifiedName } from "../utils/tsutils.js";
3
- import { ReflectionSymbolId } from "./reflections/ReflectionSymbolId.js";
4
- import { findPackageForPath } from "../utils/fs.js";
5
- import { ReflectionKind } from "./reflections/kind.js";
6
- import { Comment } from "./comments/index.js";
7
- import { joinArray } from "../utils/array.js";
1
+ import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
2
+ import { ReflectionKind } from "./kind.js";
3
+ import { Comment } from "./Comment.js";
4
+ import { i18n, joinArray } from "#utils";
8
5
  /**
9
6
  * Base class of all type definitions.
10
7
  * @category Types
@@ -778,20 +775,12 @@ export class ReferenceType extends Type {
778
775
  this._project = project;
779
776
  this.qualifiedName = qualifiedName;
780
777
  }
778
+ static createUnresolvedReference(name, target, project, qualifiedName) {
779
+ return new ReferenceType(name, target, project, qualifiedName);
780
+ }
781
781
  static createResolvedReference(name, target, project) {
782
782
  return new ReferenceType(name, target, project, name);
783
783
  }
784
- static createSymbolReference(symbol, context, name) {
785
- const ref = new ReferenceType(name ?? symbol.name, new ReflectionSymbolId(symbol), context.project, getQualifiedName(symbol, name ?? symbol.name));
786
- ref.refersToTypeParameter = !!(symbol.flags & ts.SymbolFlags.TypeParameter);
787
- const symbolPath = symbol.declarations?.[0]
788
- ?.getSourceFile()
789
- .fileName.replace(/\\/g, "/");
790
- if (!symbolPath)
791
- return ref;
792
- ref.package = findPackageForPath(symbolPath);
793
- return ref;
794
- }
795
784
  /**
796
785
  * This is used for type parameters, which don't actually point to something,
797
786
  * and also for temporary references which will be cleaned up with real references
@@ -828,7 +817,7 @@ export class ReferenceType extends Type {
828
817
  target = this.reflection.id;
829
818
  }
830
819
  else {
831
- target = this._target.toObject(serializer);
820
+ target = this._target.toObject();
832
821
  }
833
822
  const result = {
834
823
  type: this.type,
@@ -851,7 +840,7 @@ export class ReferenceType extends Type {
851
840
  result.highlightedProperties = Object.fromEntries(Array.from(this.highlightedProperties.entries(), ([key, parts]) => {
852
841
  return [
853
842
  key,
854
- Comment.serializeDisplayParts(serializer, parts),
843
+ Comment.serializeDisplayParts(parts),
855
844
  ];
856
845
  }));
857
846
  }
@@ -867,7 +856,7 @@ export class ReferenceType extends Type {
867
856
  this._target = target.id;
868
857
  }
869
858
  else {
870
- de.logger.warn(de.application.i18n.serialized_project_referenced_0_not_part_of_project(JSON.stringify(obj.target)));
859
+ de.logger.warn(i18n.serialized_project_referenced_0_not_part_of_project(JSON.stringify(obj.target)));
871
860
  }
872
861
  });
873
862
  }
@@ -1202,7 +1191,7 @@ export class UnionType extends Type {
1202
1191
  return {
1203
1192
  type: this.type,
1204
1193
  types: this.types.map((t) => serializer.toObject(t)),
1205
- elementSummaries: this.elementSummaries?.map((parts) => Comment.serializeDisplayParts(serializer, parts)),
1194
+ elementSummaries: this.elementSummaries?.map((parts) => Comment.serializeDisplayParts(parts)),
1206
1195
  };
1207
1196
  }
1208
1197
  }
@@ -1,10 +1,10 @@
1
- import type { DeclarationReflection } from "./declaration.js";
2
- import type { DocumentReflection } from "./document.js";
3
- import type { ParameterReflection } from "./parameter.js";
4
- import type { ProjectReflection } from "./project.js";
5
- import type { ReferenceReflection } from "./reference.js";
6
- import type { SignatureReflection } from "./signature.js";
7
- import type { TypeParameterReflection } from "./type-parameter.js";
1
+ import type { DeclarationReflection } from "./DeclarationReflection.js";
2
+ import type { DocumentReflection } from "./DocumentReflection.js";
3
+ import type { ParameterReflection } from "./ParameterReflection.js";
4
+ import type { ProjectReflection } from "./ProjectReflection.js";
5
+ import type { ReferenceReflection } from "./ReferenceReflection.js";
6
+ import type { SignatureReflection } from "./SignatureReflection.js";
7
+ import type { TypeParameterReflection } from "./TypeParameterReflection.js";
8
8
  /**
9
9
  * A map of known {@link Reflection} concrete subclasses.
10
10
  * This is used during deserialization to reconstruct serialized objects.
@@ -1,7 +1,7 @@
1
1
  import { AbstractComponent } from "../utils/component.js";
2
- import type { ProjectReflection, Reflection } from "../models/reflections/index.js";
2
+ import type { ProjectReflection, Reflection } from "../models/index.js";
3
3
  import type { Renderer } from "./renderer.js";
4
- import { RendererEvent, PageEvent } from "./events.js";
4
+ import { PageEvent, RendererEvent } from "./events.js";
5
5
  export declare abstract class RendererComponent extends AbstractComponent<Renderer, {}> {
6
6
  }
7
7
  /**
@@ -34,7 +34,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
34
34
  };
35
35
  import * as Path from "path";
36
36
  import { AbstractComponent } from "../utils/component.js";
37
- import { RendererEvent, PageEvent } from "./events.js";
37
+ import { PageEvent, RendererEvent } from "./events.js";
38
38
  import { Option } from "../utils/index.js";
39
39
  export class RendererComponent extends AbstractComponent {
40
40
  }
@@ -1,6 +1,6 @@
1
- import type { ProjectReflection } from "../models/reflections/project.js";
2
- import type { RenderTemplate, UrlMapping } from "./models/UrlMapping.js";
3
- import type { DeclarationReflection, DocumentReflection, Reflection, ReflectionKind } from "../models/index.js";
1
+ import type { ProjectReflection } from "../models/ProjectReflection.js";
2
+ import type { DeclarationReflection, DocumentReflection, ReflectionKind } from "../models/index.js";
3
+ import type { PageDefinition, PageKind } from "./router.js";
4
4
  /**
5
5
  * An event emitted by the {@link Renderer} class at the very beginning and
6
6
  * ending of the entire rendering process.
@@ -18,11 +18,9 @@ export declare class RendererEvent {
18
18
  */
19
19
  readonly outputDirectory: string;
20
20
  /**
21
- * A list of all pages that should be generated.
22
- *
23
- * This list can be altered during the {@link Renderer.EVENT_BEGIN} event.
21
+ * A list of all pages that will be generated.
24
22
  */
25
- urls?: UrlMapping<Reflection>[];
23
+ pages: PageDefinition[];
26
24
  /**
27
25
  * Triggered before the renderer starts rendering a project.
28
26
  * @event
@@ -33,15 +31,7 @@ export declare class RendererEvent {
33
31
  * @event
34
32
  */
35
33
  static readonly END = "endRender";
36
- constructor(outputDirectory: string, project: ProjectReflection);
37
- /**
38
- * Create an {@link PageEvent} event based on this event and the given url mapping.
39
- *
40
- * @internal
41
- * @param mapping The mapping that defines the generated {@link PageEvent} state.
42
- * @returns A newly created {@link PageEvent} instance.
43
- */
44
- createPageEvent<Model>(mapping: UrlMapping<Model>): [RenderTemplate<PageEvent<Model>>, PageEvent<Model>];
34
+ constructor(outputDirectory: string, project: ProjectReflection, pages: PageDefinition[]);
45
35
  }
46
36
  export interface PageHeading {
47
37
  link: string;
@@ -70,6 +60,10 @@ export declare class PageEvent<out Model = unknown> {
70
60
  * The url this page will be located at.
71
61
  */
72
62
  url: string;
63
+ /**
64
+ * The type of page this is.
65
+ */
66
+ pageKind: PageKind;
73
67
  /**
74
68
  * The model that should be rendered on this page.
75
69
  */
@@ -108,8 +102,6 @@ export declare class PageEvent<out Model = unknown> {
108
102
  */
109
103
  static readonly END = "endPage";
110
104
  constructor(model: Model);
111
- /** @deprecated use the single constructor arg instead, will be removed in 0.27 */
112
- constructor(name: string, model: Model);
113
105
  }
114
106
  /**
115
107
  * An event emitted when markdown is being parsed. Allows other plugins to manipulate the result.
@@ -1,4 +1,3 @@
1
- import * as Path from "path";
2
1
  /**
3
2
  * An event emitted by the {@link Renderer} class at the very beginning and
4
3
  * ending of the entire rendering process.
@@ -16,11 +15,9 @@ export class RendererEvent {
16
15
  */
17
16
  outputDirectory;
18
17
  /**
19
- * A list of all pages that should be generated.
20
- *
21
- * This list can be altered during the {@link Renderer.EVENT_BEGIN} event.
18
+ * A list of all pages that will be generated.
22
19
  */
23
- urls;
20
+ pages;
24
21
  /**
25
22
  * Triggered before the renderer starts rendering a project.
26
23
  * @event
@@ -31,23 +28,10 @@ export class RendererEvent {
31
28
  * @event
32
29
  */
33
30
  static END = "endRender";
34
- constructor(outputDirectory, project) {
31
+ constructor(outputDirectory, project, pages) {
35
32
  this.outputDirectory = outputDirectory;
36
33
  this.project = project;
37
- }
38
- /**
39
- * Create an {@link PageEvent} event based on this event and the given url mapping.
40
- *
41
- * @internal
42
- * @param mapping The mapping that defines the generated {@link PageEvent} state.
43
- * @returns A newly created {@link PageEvent} instance.
44
- */
45
- createPageEvent(mapping) {
46
- const event = new PageEvent(mapping.model);
47
- event.project = this.project;
48
- event.url = mapping.url;
49
- event.filename = Path.join(this.outputDirectory, mapping.url);
50
- return [mapping.template, event];
34
+ this.pages = pages;
51
35
  }
52
36
  }
53
37
  /**
@@ -70,6 +54,10 @@ export class PageEvent {
70
54
  * The url this page will be located at.
71
55
  */
72
56
  url;
57
+ /**
58
+ * The type of page this is.
59
+ */
60
+ pageKind;
73
61
  /**
74
62
  * The model that should be rendered on this page.
75
63
  */
@@ -115,13 +103,8 @@ export class PageEvent {
115
103
  * @event
116
104
  */
117
105
  static END = "endPage";
118
- constructor(nameOrModel, model) {
119
- if (typeof nameOrModel === "string") {
120
- this.model = model;
121
- }
122
- else {
123
- this.model = nameOrModel;
124
- }
106
+ constructor(model) {
107
+ this.model = model;
125
108
  }
126
109
  }
127
110
  /**
@@ -1,6 +1,7 @@
1
- import { TypeContext, type SomeType } from "../models/types.js";
2
- import { JSX } from "../utils/index.js";
3
- import { type Reflection, type DeclarationReflection, type SignatureReflection } from "../models/index.js";
1
+ import { type SomeType, TypeContext } from "../models/types.js";
2
+ import { JSX } from "#utils";
3
+ import { type DeclarationReflection, type Reflection, type SignatureReflection } from "../models/index.js";
4
+ import type { Router } from "./index.js";
4
5
  export type FormatterNode = {
5
6
  type: "text";
6
7
  content: string;
@@ -56,10 +57,12 @@ export declare class FormattedCodeGenerator {
56
57
  * Responsible for generating Nodes from a type tree.
57
58
  */
58
59
  export declare class FormattedCodeBuilder {
59
- readonly urlTo: (refl: Reflection) => string;
60
+ readonly router: Router;
61
+ readonly relativeReflection: Reflection;
60
62
  forceWrap: Set<number>;
61
63
  id: number;
62
- constructor(urlTo: (refl: Reflection) => string);
64
+ constructor(router: Router, relativeReflection: Reflection);
65
+ urlTo(refl: Reflection): string;
63
66
  newId(): number;
64
67
  type(type: SomeType | undefined, where: TypeContext, options?: {
65
68
  topLevelLinks: boolean;
@@ -1,9 +1,8 @@
1
1
  // Heavily based on https://yorickpeterse.com/articles/how-to-write-a-code-formatter/
2
2
  // Implements roughly the same algorithm as Prettier
3
3
  import { ok } from "assert";
4
- import { LiteralType, ReferenceType, TypeContext, } from "../models/types.js";
5
- import { aggregate } from "../utils/array.js";
6
- import { assertNever, JSX } from "../utils/index.js";
4
+ import { LiteralType, ReferenceType, TypeContext } from "../models/types.js";
5
+ import { aggregate, assertNever, JSX } from "#utils";
7
6
  import { getKindClass, getUniquePath, stringify } from "./themes/lib.js";
8
7
  import { ReflectionKind, } from "../models/index.js";
9
8
  // Non breaking space
@@ -227,12 +226,21 @@ const typeBuilder = {
227
226
  ]);
228
227
  if (childReflection) {
229
228
  const displayed = stringify(type.indexType.value);
230
- indexType = {
231
- type: "element",
232
- content: (JSX.createElement("a", { href: builder.urlTo(childReflection) },
233
- JSX.createElement("span", { class: "tsd-signature-type" }, displayed))),
234
- length: displayed.length,
235
- };
229
+ if (builder.router.hasUrl(childReflection)) {
230
+ indexType = {
231
+ type: "element",
232
+ content: (JSX.createElement("a", { href: builder.urlTo(childReflection) },
233
+ JSX.createElement("span", { class: "tsd-signature-type" }, displayed))),
234
+ length: displayed.length,
235
+ };
236
+ }
237
+ else {
238
+ indexType = {
239
+ type: "element",
240
+ content: JSX.createElement("span", { class: "tsd-signature-type" }, displayed),
241
+ length: displayed.length,
242
+ };
243
+ }
236
244
  }
237
245
  }
238
246
  return nodes(builder.type(type.objectType, TypeContext.indexedObject), simpleElement(JSX.createElement("span", { class: "tsd-signature-symbol" }, "[")), indexType, simpleElement(JSX.createElement("span", { class: "tsd-signature-symbol" }, "]")));
@@ -325,10 +333,21 @@ const typeBuilder = {
325
333
  let name;
326
334
  if (reflection) {
327
335
  if (reflection.kindOf(ReflectionKind.TypeParameter)) {
328
- name = simpleElement(JSX.createElement("a", { class: "tsd-signature-type tsd-kind-type-parameter", href: builder.urlTo(reflection) }, reflection.name));
336
+ if (builder.router.hasUrl(reflection)) {
337
+ name = simpleElement(JSX.createElement("a", { class: "tsd-signature-type tsd-kind-type-parameter", href: builder.urlTo(reflection) }, reflection.name));
338
+ }
339
+ else {
340
+ name = simpleElement(JSX.createElement("span", { class: "tsd-signature-type tsd-kind-type-parameter" }, reflection.name));
341
+ }
329
342
  }
330
343
  else {
331
- name = join(simpleElement(JSX.createElement("span", { class: "tsd-signature-symbol" }, ".")), getUniquePath(reflection), (item) => simpleElement(JSX.createElement("a", { href: builder.urlTo(item), class: "tsd-signature-type " + getKindClass(item) }, item.name)));
344
+ name = join(simpleElement(JSX.createElement("span", { class: "tsd-signature-symbol" }, ".")), getUniquePath(reflection), (item) => {
345
+ if (builder.router.hasUrl(item)) {
346
+ return simpleElement(JSX.createElement("a", { href: builder.urlTo(item), class: "tsd-signature-type " +
347
+ getKindClass(item) }, item.name));
348
+ }
349
+ return simpleElement(JSX.createElement("span", { class: "tsd-signature-type " + getKindClass(item) }, item.name));
350
+ });
332
351
  }
333
352
  }
334
353
  else if (type.externalUrl) {
@@ -423,11 +442,16 @@ const typeBuilder = {
423
442
  * Responsible for generating Nodes from a type tree.
424
443
  */
425
444
  export class FormattedCodeBuilder {
426
- urlTo;
445
+ router;
446
+ relativeReflection;
427
447
  forceWrap = new Set();
428
448
  id = 0;
429
- constructor(urlTo) {
430
- this.urlTo = urlTo;
449
+ constructor(router, relativeReflection) {
450
+ this.router = router;
451
+ this.relativeReflection = relativeReflection;
452
+ }
453
+ urlTo(refl) {
454
+ return this.router.relativeUrl(this.relativeReflection, refl);
431
455
  }
432
456
  newId() {
433
457
  return ++this.id;
@@ -568,10 +592,13 @@ export class FormattedCodeBuilder {
568
592
  if (param.varianceModifier) {
569
593
  prefix = nodes(prefix, simpleElement(JSX.createElement("span", { class: "tsd-signature-keyword" }, param.varianceModifier)), space());
570
594
  }
571
- const content = [
572
- prefix,
573
- simpleElement(JSX.createElement("a", { class: "tsd-signature-type tsd-kind-type-parameter", href: this.urlTo(param) }, param.name)),
574
- ];
595
+ const content = [prefix];
596
+ if (this.router.hasUrl(param)) {
597
+ content.push(simpleElement(JSX.createElement("a", { class: "tsd-signature-type tsd-kind-type-parameter", href: this.urlTo(param) }, param.name)));
598
+ }
599
+ else {
600
+ content.push(simpleElement(JSX.createElement("span", { class: "tsd-signature-type tsd-kind-type-parameter" }, param.name)));
601
+ }
575
602
  if (param.type) {
576
603
  content.push(space(), simpleElement(JSX.createElement("span", { class: "tsd-signature-keyword" }, "extends")), spaceOrLine(), indent([this.type(param.type, TypeContext.none)]));
577
604
  }
@@ -1,10 +1,9 @@
1
- export { PageEvent, RendererEvent, MarkdownEvent, IndexEvent, type PageHeading, } from "./events.js";
2
- export { UrlMapping } from "./models/UrlMapping.js";
3
- export type { RenderTemplate } from "./models/UrlMapping.js";
1
+ export { IndexEvent, MarkdownEvent, PageEvent, type PageHeading, RendererEvent } from "./events.js";
4
2
  export { Renderer, type RendererEvents } from "./renderer.js";
5
3
  export type { RendererHooks } from "./renderer.js";
6
4
  export { Theme } from "./theme.js";
7
- export { DefaultTheme, type NavigationElement, } from "./themes/default/DefaultTheme.js";
8
- export { Slugger } from "./themes/default/Slugger.js";
5
+ export { DefaultTheme, type NavigationElement, type RenderTemplate } from "./themes/default/DefaultTheme.js";
9
6
  export { DefaultThemeRenderContext } from "./themes/default/DefaultThemeRenderContext.js";
10
7
  export type { Icons } from "./themes/default/partials/icon.js";
8
+ export { Slugger } from "./themes/default/Slugger.js";
9
+ export { BaseRouter, CategoryRouter, GroupRouter, KindDirRouter, KindRouter, type PageDefinition, PageKind, type Router, StructureDirRouter, StructureRouter, } from "./router.js";
@@ -1,7 +1,7 @@
1
- export { PageEvent, RendererEvent, MarkdownEvent, IndexEvent, } from "./events.js";
2
- export { UrlMapping } from "./models/UrlMapping.js";
1
+ export { IndexEvent, MarkdownEvent, PageEvent, RendererEvent } from "./events.js";
3
2
  export { Renderer } from "./renderer.js";
4
3
  export { Theme } from "./theme.js";
5
- export { DefaultTheme, } from "./themes/default/DefaultTheme.js";
6
- export { Slugger } from "./themes/default/Slugger.js";
4
+ export { DefaultTheme } from "./themes/default/DefaultTheme.js";
7
5
  export { DefaultThemeRenderContext } from "./themes/default/DefaultThemeRenderContext.js";
6
+ export { Slugger } from "./themes/default/Slugger.js";
7
+ export { BaseRouter, CategoryRouter, GroupRouter, KindDirRouter, KindRouter, PageKind, StructureDirRouter, StructureRouter, } from "./router.js";
@@ -1,4 +1,5 @@
1
- import { ParameterType, } from "../utils/options/declaration.js";
1
+ import { i18n } from "#utils";
2
+ import { ParameterType } from "../utils/options/declaration.js";
2
3
  import { nicePath } from "../utils/paths.js";
3
4
  export class Outputs {
4
5
  application;
@@ -63,7 +64,7 @@ export class Outputs {
63
64
  const snap = options.snapshot();
64
65
  const writer = this.outputs.get(output.name);
65
66
  if (!writer) {
66
- this.application.logger.error(this.application.i18n.specified_output_0_has_not_been_defined(output.name));
67
+ this.application.logger.error(i18n.specified_output_0_has_not_been_defined(output.name));
67
68
  return;
68
69
  }
69
70
  if (!this.application.setOptions(output.options || {}, true)) {
@@ -80,10 +81,10 @@ export class Outputs {
80
81
  this.application.logger.error(message);
81
82
  }
82
83
  if (this.application.logger.errorCount === preErrors) {
83
- this.application.logger.info(this.application.i18n.output_0_generated_at_1(output.name, nicePath(output.path)));
84
+ this.application.logger.info(i18n.output_0_generated_at_1(output.name, nicePath(output.path)));
84
85
  }
85
86
  else {
86
- this.application.logger.error(this.application.i18n.output_0_could_not_be_generated(output.name));
87
+ this.application.logger.error(i18n.output_0_could_not_be_generated(output.name));
87
88
  }
88
89
  this.application.logger.verbose(`${output.name} took ${Date.now() - start}ms`);
89
90
  options.restore(snap);
@@ -37,11 +37,12 @@ import { RendererEvent } from "../events.js";
37
37
  import { copySync, readFile, writeFileSync } from "../../utils/fs.js";
38
38
  import { DefaultTheme } from "../themes/default/DefaultTheme.js";
39
39
  import { getStyles } from "../../utils/highlighter.js";
40
- import { getEnumKeys, Option } from "../../utils/index.js";
40
+ import { getEnumKeys, i18n } from "#utils";
41
41
  import { existsSync } from "fs";
42
42
  import { extname, join } from "path";
43
43
  import { fileURLToPath } from "url";
44
44
  import { ReflectionKind } from "../../models/index.js";
45
+ import { Option } from "../../utils/index.js";
45
46
  /**
46
47
  * A plugin that copies the subdirectory ´assets´ from the current themes
47
48
  * source folder to the output directory.
@@ -84,8 +85,6 @@ let AssetsPlugin = (() => {
84
85
  this.owner.on(RendererEvent.END, this.onRenderEnd.bind(this));
85
86
  }
86
87
  getTranslatedStrings() {
87
- const inter = this.application.internationalization;
88
- const i18n = this.application.i18n;
89
88
  const translations = {
90
89
  copy: i18n.theme_copy(),
91
90
  copied: i18n.theme_copied(),
@@ -93,10 +92,12 @@ let AssetsPlugin = (() => {
93
92
  hierarchy_expand: i18n.theme_hierarchy_expand(),
94
93
  hierarchy_collapse: i18n.theme_hierarchy_collapse(),
95
94
  folder: i18n.theme_folder(),
95
+ search_index_not_available: i18n.theme_search_index_not_available(),
96
+ search_no_results_found_for_0: i18n.theme_search_no_results_found_for_0("{0}"),
96
97
  };
97
98
  for (const key of getEnumKeys(ReflectionKind)) {
98
99
  const kind = ReflectionKind[key];
99
- translations[`kind_${kind}`] = inter.kindSingularString(kind);
100
+ translations[`kind_${kind}`] = ReflectionKind.singularString(kind);
100
101
  }
101
102
  return translations;
102
103
  }
@@ -112,7 +113,7 @@ let AssetsPlugin = (() => {
112
113
  copySync(this.customCss, join(dest, "custom.css"));
113
114
  }
114
115
  else {
115
- this.application.logger.error(this.application.i18n.custom_css_file_0_does_not_exist(this.customCss));
116
+ this.application.logger.error(i18n.custom_css_file_0_does_not_exist(this.customCss));
116
117
  }
117
118
  }
118
119
  if (this.customJs) {
@@ -121,7 +122,7 @@ let AssetsPlugin = (() => {
121
122
  copySync(this.customJs, join(dest, "custom.js"));
122
123
  }
123
124
  else {
124
- this.application.logger.error(this.application.i18n.custom_js_file_0_does_not_exist(this.customJs));
125
+ this.application.logger.error(i18n.custom_js_file_0_does_not_exist(this.customJs));
125
126
  }
126
127
  }
127
128
  }
@@ -3,7 +3,7 @@ import { RendererComponent } from "../components.js";
3
3
  import { RendererEvent } from "../events.js";
4
4
  import { writeFile } from "../../utils/index.js";
5
5
  import { DefaultTheme } from "../themes/default/DefaultTheme.js";
6
- import { getHierarchyRoots, getKindClass, getUniquePath, } from "../themes/lib.js";
6
+ import { getHierarchyRoots, getKindClass, getUniquePath } from "../themes/lib.js";
7
7
  import { compressJson } from "../../utils/compress.js";
8
8
  export class HierarchyPlugin extends RendererComponent {
9
9
  constructor(renderer) {
@@ -28,12 +28,13 @@ export class HierarchyPlugin extends RendererComponent {
28
28
  const refl = project.getReflectionById(id);
29
29
  if (id in hierarchy.reflections)
30
30
  continue;
31
- if (!refl.url)
31
+ const url = this.owner.router.getFullUrl(refl);
32
+ if (!url)
32
33
  continue;
33
34
  const jsonRecord = {
34
35
  name: refl.name,
35
36
  kind: refl.kind,
36
- url: refl.url,
37
+ url,
37
38
  class: getKindClass(refl),
38
39
  };
39
40
  const path = getUniquePath(refl);
@@ -3,7 +3,7 @@ import { RendererEvent } from "../events.js";
3
3
  import { writeFile } from "../../utils/fs.js";
4
4
  import { DefaultTheme } from "../themes/default/DefaultTheme.js";
5
5
  import { join } from "path";
6
- import { JSX, renderElement } from "../../utils/index.js";
6
+ import { JSX } from "#utils";
7
7
  const ICONS_JS = `
8
8
  (function() {
9
9
  addIcons();
@@ -45,8 +45,8 @@ export class IconsPlugin extends RendererComponent {
45
45
  for (const [name, icon] of Object.entries(icons)) {
46
46
  children.push(JSX.createElement("g", { id: `icon-${name}`, class: "tsd-no-select" }, icon.call(icons).children));
47
47
  }
48
- const svg = renderElement(JSX.createElement("svg", { xmlns: "http://www.w3.org/2000/svg" }, children));
49
- const js = ICONS_JS.replace("SVG_HTML", renderElement(JSX.createElement(JSX.Fragment, null, children)).replaceAll("`", "\\`"));
48
+ const svg = JSX.renderElement(JSX.createElement("svg", { xmlns: "http://www.w3.org/2000/svg" }, children));
49
+ const js = ICONS_JS.replace("SVG_HTML", JSX.renderElement(JSX.createElement(JSX.Fragment, null, children)).replaceAll("`", "\\`"));
50
50
  const svgPath = join(event.outputDirectory, "assets/icons.svg");
51
51
  const jsPath = join(event.outputDirectory, "assets/icons.js");
52
52
  await Promise.all([writeFile(svgPath, svg), writeFile(jsPath, js)]);
@@ -34,7 +34,6 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
34
34
  };
35
35
  import * as Path from "path";
36
36
  import lunr from "lunr";
37
- import { DeclarationReflection, DocumentReflection, ProjectReflection, } from "../../models/index.js";
38
37
  import { RendererComponent } from "../components.js";
39
38
  import { IndexEvent, RendererEvent } from "../events.js";
40
39
  import { Option, writeFile } from "../../utils/index.js";
@@ -42,6 +41,7 @@ import { DefaultTheme } from "../themes/default/DefaultTheme.js";
42
41
  import { GroupPlugin } from "../../converter/plugins/GroupPlugin.js";
43
42
  import { CategoryPlugin } from "../../converter/plugins/CategoryPlugin.js";
44
43
  import { compressJson } from "../../utils/compress.js";
44
+ import { i18n } from "#utils";
45
45
  /**
46
46
  * A plugin that exports an index of the project to a javascript file.
47
47
  *
@@ -111,13 +111,11 @@ let JavascriptIndexPlugin = (() => {
111
111
  async buildSearchIndex(event) {
112
112
  const theme = this.owner.theme;
113
113
  const rows = [];
114
- const initialSearchResults = Object.values(event.project.reflections).filter((refl) => {
115
- return ((refl instanceof DeclarationReflection ||
116
- refl instanceof DocumentReflection) &&
117
- refl.url &&
118
- refl.name &&
119
- !refl.flags.isExternal);
120
- });
114
+ const initialSearchResults = this.owner
115
+ .router.getLinkableReflections()
116
+ .filter((refl) => (refl.isDeclaration() || refl.isDocument()) &&
117
+ refl.name &&
118
+ !refl.flags.isExternal);
121
119
  const indexEvent = new IndexEvent(initialSearchResults);
122
120
  this.owner.trigger(IndexEvent.PREPARE_INDEX, indexEvent);
123
121
  const builder = new lunr.Builder();
@@ -127,21 +125,18 @@ let JavascriptIndexPlugin = (() => {
127
125
  builder.field(key, { boost });
128
126
  }
129
127
  for (const reflection of indexEvent.searchResults) {
130
- if (!reflection.url) {
131
- continue;
132
- }
133
128
  const boost = this.getBoost(reflection);
134
129
  if (boost <= 0) {
135
130
  continue;
136
131
  }
137
132
  let parent = reflection.parent;
138
- if (parent instanceof ProjectReflection) {
133
+ if (parent?.isProject()) {
139
134
  parent = undefined;
140
135
  }
141
136
  const row = {
142
137
  kind: reflection.kind,
143
138
  name: reflection.name,
144
- url: reflection.url,
139
+ url: theme.router.getFullUrl(reflection),
145
140
  classes: theme.getReflectionClasses(reflection),
146
141
  };
147
142
  if (parent) {
@@ -165,16 +160,16 @@ let JavascriptIndexPlugin = (() => {
165
160
  await writeFile(jsonFileName, `window.searchData = "${await compressJson(data)}";`);
166
161
  if (this.unusedGroupBoosts.size &&
167
162
  this.application.options.isSet("searchGroupBoosts")) {
168
- this.application.logger.warn(this.application.i18n.not_all_search_group_boosts_used_0(Array.from(this.unusedGroupBoosts).join("\n\t")));
163
+ this.application.logger.warn(i18n.not_all_search_group_boosts_used_0(Array.from(this.unusedGroupBoosts).join("\n\t")));
169
164
  }
170
165
  if (this.unusedCatBoosts.size &&
171
166
  this.application.options.isSet("searchCategoryBoosts")) {
172
- this.application.logger.warn(this.application.i18n.not_all_search_category_boosts_used_0(Array.from(this.unusedCatBoosts).join("\n\t")));
167
+ this.application.logger.warn(i18n.not_all_search_category_boosts_used_0(Array.from(this.unusedCatBoosts).join("\n\t")));
173
168
  }
174
169
  }
175
170
  getBoost(refl) {
176
- let boost = refl.relevanceBoost ?? 1;
177
- for (const group of GroupPlugin.getGroups(refl, this.groupReferencesByType, this.application.internationalization)) {
171
+ let boost = 1;
172
+ for (const group of GroupPlugin.getGroups(refl, this.groupReferencesByType)) {
178
173
  boost *= this.searchGroupBoosts[group] ?? 1;
179
174
  this.unusedGroupBoosts.delete(group);
180
175
  }