typedoc 0.26.10 → 0.27.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) 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 +172 -148
  16. package/dist/lib/converter/comments/index.d.ts +4 -4
  17. package/dist/lib/converter/comments/index.js +39 -50
  18. package/dist/lib/converter/comments/lexer.d.ts +1 -1
  19. package/dist/lib/converter/comments/lexer.js +2 -5
  20. package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
  21. package/dist/lib/converter/comments/lineLexer.js +12 -15
  22. package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
  23. package/dist/lib/converter/comments/linkResolver.js +14 -21
  24. package/dist/lib/converter/comments/parser.d.ts +6 -6
  25. package/dist/lib/converter/comments/parser.js +69 -96
  26. package/dist/lib/converter/comments/rawLexer.d.ts +1 -1
  27. package/dist/lib/converter/comments/rawLexer.js +13 -16
  28. package/dist/lib/converter/comments/tagName.js +1 -4
  29. package/dist/lib/converter/comments/textParser.d.ts +4 -4
  30. package/dist/lib/converter/comments/textParser.js +28 -30
  31. package/dist/lib/converter/components.d.ts +2 -3
  32. package/dist/lib/converter/components.js +2 -7
  33. package/dist/lib/converter/context.d.ts +9 -9
  34. package/dist/lib/converter/context.js +54 -44
  35. package/dist/lib/converter/convert-expression.js +16 -23
  36. package/dist/lib/converter/converter-events.d.ts +1 -0
  37. package/dist/lib/converter/converter-events.js +2 -4
  38. package/dist/lib/converter/converter.d.ts +16 -13
  39. package/dist/lib/converter/converter.js +210 -238
  40. package/dist/lib/converter/factories/index-signature.d.ts +1 -1
  41. package/dist/lib/converter/factories/index-signature.js +11 -17
  42. package/dist/lib/converter/factories/signature.d.ts +2 -2
  43. package/dist/lib/converter/factories/signature.js +95 -106
  44. package/dist/lib/converter/index.d.ts +6 -7
  45. package/dist/lib/converter/index.js +3 -11
  46. package/dist/lib/converter/jsdoc.d.ts +1 -1
  47. package/dist/lib/converter/jsdoc.js +34 -41
  48. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +6 -21
  49. package/dist/lib/converter/plugins/CategoryPlugin.js +57 -139
  50. package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -5
  51. package/dist/lib/converter/plugins/CommentPlugin.js +153 -163
  52. package/dist/lib/converter/plugins/GroupPlugin.d.ts +10 -9
  53. package/dist/lib/converter/plugins/GroupPlugin.js +87 -124
  54. package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +3 -5
  55. package/dist/lib/converter/plugins/ImplementsPlugin.js +255 -321
  56. package/dist/lib/converter/plugins/IncludePlugin.d.ts +11 -0
  57. package/dist/lib/converter/plugins/IncludePlugin.js +72 -0
  58. package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +4 -3
  59. package/dist/lib/converter/plugins/InheritDocPlugin.js +41 -72
  60. package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +5 -5
  61. package/dist/lib/converter/plugins/LinkResolverPlugin.js +37 -58
  62. package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
  63. package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +49 -0
  64. package/dist/lib/converter/plugins/PackagePlugin.d.ts +4 -3
  65. package/dist/lib/converter/plugins/PackagePlugin.js +62 -111
  66. package/dist/lib/converter/plugins/SourcePlugin.d.ts +3 -5
  67. package/dist/lib/converter/plugins/SourcePlugin.js +69 -110
  68. package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -6
  69. package/dist/lib/converter/plugins/TypePlugin.js +95 -158
  70. package/dist/lib/converter/plugins/index.d.ts +10 -9
  71. package/dist/lib/converter/plugins/index.js +10 -21
  72. package/dist/lib/converter/symbols.d.ts +1 -1
  73. package/dist/lib/converter/symbols.js +234 -227
  74. package/dist/lib/converter/types.d.ts +2 -2
  75. package/dist/lib/converter/types.js +252 -237
  76. package/dist/lib/converter/utils/nodes.js +5 -13
  77. package/dist/lib/converter/utils/reflections.d.ts +1 -1
  78. package/dist/lib/converter/utils/reflections.js +4 -7
  79. package/dist/lib/converter/utils/repository.d.ts +1 -1
  80. package/dist/lib/converter/utils/repository.js +103 -97
  81. package/dist/lib/converter/utils/symbols.js +3 -9
  82. package/dist/lib/internationalization/index.d.ts +3 -4
  83. package/dist/lib/internationalization/index.js +3 -8
  84. package/dist/lib/internationalization/internationalization.d.ts +5 -4
  85. package/dist/lib/internationalization/internationalization.js +97 -103
  86. package/dist/lib/internationalization/locale-utils.cjs +8 -0
  87. package/dist/lib/internationalization/locale-utils.d.cts +8 -0
  88. package/dist/lib/internationalization/locales/en.cjs +366 -2
  89. package/dist/lib/internationalization/locales/en.d.cts +339 -2
  90. package/dist/lib/internationalization/locales/jp.cjs +8 -11
  91. package/dist/lib/internationalization/locales/jp.d.cts +310 -1
  92. package/dist/lib/internationalization/locales/ko.cjs +7 -9
  93. package/dist/lib/internationalization/locales/ko.d.cts +223 -1
  94. package/dist/lib/internationalization/locales/zh.cjs +7 -10
  95. package/dist/lib/internationalization/locales/zh.d.cts +381 -1
  96. package/dist/lib/internationalization/translatable.d.ts +4 -327
  97. package/dist/lib/internationalization/translatable.js +2 -360
  98. package/dist/lib/models/FileRegistry.d.ts +20 -9
  99. package/dist/lib/models/FileRegistry.js +54 -45
  100. package/dist/lib/models/ReflectionCategory.d.ts +2 -2
  101. package/dist/lib/models/ReflectionCategory.js +16 -12
  102. package/dist/lib/models/ReflectionGroup.d.ts +3 -3
  103. package/dist/lib/models/ReflectionGroup.js +23 -14
  104. package/dist/lib/models/comments/comment.d.ts +23 -37
  105. package/dist/lib/models/comments/comment.js +388 -325
  106. package/dist/lib/models/comments/index.d.ts +2 -2
  107. package/dist/lib/models/comments/index.js +1 -6
  108. package/dist/lib/models/index.d.ts +7 -7
  109. package/dist/lib/models/index.js +7 -23
  110. package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +2 -2
  111. package/dist/lib/models/reflections/ReflectionSymbolId.js +42 -34
  112. package/dist/lib/models/reflections/abstract.d.ts +17 -20
  113. package/dist/lib/models/reflections/abstract.js +249 -256
  114. package/dist/lib/models/reflections/container.d.ts +7 -7
  115. package/dist/lib/models/reflections/container.js +43 -16
  116. package/dist/lib/models/reflections/declaration.d.ts +15 -12
  117. package/dist/lib/models/reflections/declaration.js +150 -29
  118. package/dist/lib/models/reflections/document.d.ts +3 -3
  119. package/dist/lib/models/reflections/document.js +26 -13
  120. package/dist/lib/models/reflections/index.d.ts +15 -15
  121. package/dist/lib/models/reflections/index.js +12 -31
  122. package/dist/lib/models/reflections/kind.d.ts +1 -1
  123. package/dist/lib/models/reflections/kind.js +3 -6
  124. package/dist/lib/models/reflections/parameter.d.ts +5 -4
  125. package/dist/lib/models/reflections/parameter.js +11 -13
  126. package/dist/lib/models/reflections/project.d.ts +14 -9
  127. package/dist/lib/models/reflections/project.js +104 -56
  128. package/dist/lib/models/reflections/reference.d.ts +3 -3
  129. package/dist/lib/models/reflections/reference.js +6 -9
  130. package/dist/lib/models/reflections/signature.d.ts +8 -8
  131. package/dist/lib/models/reflections/signature.js +35 -14
  132. package/dist/lib/models/reflections/type-parameter.d.ts +5 -5
  133. package/dist/lib/models/reflections/type-parameter.js +9 -10
  134. package/dist/lib/models/reflections/utils.js +1 -4
  135. package/dist/lib/models/reflections/variant.d.ts +8 -7
  136. package/dist/lib/models/reflections/variant.js +1 -2
  137. package/dist/lib/models/sources/file.d.ts +2 -2
  138. package/dist/lib/models/sources/file.js +22 -5
  139. package/dist/lib/models/sources/index.d.ts +1 -1
  140. package/dist/lib/models/sources/index.js +1 -5
  141. package/dist/lib/models/types.d.ts +26 -13
  142. package/dist/lib/models/types.js +236 -151
  143. package/dist/lib/output/components.d.ts +5 -11
  144. package/dist/lib/output/components.js +84 -125
  145. package/dist/lib/output/events.d.ts +3 -3
  146. package/dist/lib/output/events.js +128 -94
  147. package/dist/lib/output/formatter.d.ts +84 -0
  148. package/dist/lib/output/formatter.js +619 -0
  149. package/dist/lib/output/index.d.ts +9 -8
  150. package/dist/lib/output/index.js +7 -19
  151. package/dist/lib/output/models/UrlMapping.d.ts +2 -2
  152. package/dist/lib/output/models/UrlMapping.js +4 -5
  153. package/dist/lib/output/output.d.ts +13 -0
  154. package/dist/lib/output/output.js +72 -0
  155. package/dist/lib/output/plugins/AssetsPlugin.d.ts +7 -8
  156. package/dist/lib/output/plugins/AssetsPlugin.js +62 -80
  157. package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
  158. package/dist/lib/output/plugins/IconsPlugin.js +28 -84
  159. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
  160. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
  161. package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
  162. package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
  163. package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
  164. package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
  165. package/dist/lib/output/plugins/index.d.ts +6 -6
  166. package/dist/lib/output/plugins/index.js +6 -15
  167. package/dist/lib/output/renderer.d.ts +14 -13
  168. package/dist/lib/output/renderer.js +129 -185
  169. package/dist/lib/output/theme.d.ts +9 -5
  170. package/dist/lib/output/theme.js +14 -62
  171. package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
  172. package/dist/lib/output/themes/MarkedPlugin.js +152 -117
  173. package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
  174. package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
  175. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
  176. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
  177. package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
  178. package/dist/lib/output/themes/default/Slugger.js +46 -0
  179. package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
  180. package/dist/lib/output/themes/default/layouts/default.js +67 -34
  181. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
  182. package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
  183. package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
  184. package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
  185. package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
  186. package/dist/lib/output/themes/default/partials/comment.js +52 -29
  187. package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
  188. package/dist/lib/output/themes/default/partials/footer.js +11 -14
  189. package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
  190. package/dist/lib/output/themes/default/partials/header.js +9 -13
  191. package/dist/lib/output/themes/default/partials/hierarchy.d.ts +3 -3
  192. package/dist/lib/output/themes/default/partials/hierarchy.js +9 -12
  193. package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
  194. package/dist/lib/output/themes/default/partials/icon.js +78 -73
  195. package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
  196. package/dist/lib/output/themes/default/partials/index.js +19 -22
  197. package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
  198. package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
  199. package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
  200. package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
  201. package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
  202. package/dist/lib/output/themes/default/partials/member.js +19 -24
  203. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
  204. package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
  205. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
  206. package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
  207. package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
  208. package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
  209. package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
  210. package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
  211. package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
  212. package/dist/lib/output/themes/default/partials/members.js +10 -42
  213. package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
  214. package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
  215. package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
  216. package/dist/lib/output/themes/default/partials/navigation.js +51 -62
  217. package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
  218. package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
  219. package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
  220. package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
  221. package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
  222. package/dist/lib/output/themes/default/partials/type.js +8 -388
  223. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
  224. package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
  225. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
  226. package/dist/lib/output/themes/default/partials/typeDetails.js +221 -0
  227. package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
  228. package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
  229. package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
  230. package/dist/lib/output/themes/default/templates/document.js +3 -7
  231. package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
  232. package/dist/lib/output/themes/default/templates/hierarchy.js +10 -13
  233. package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
  234. package/dist/lib/output/themes/default/templates/index.js +3 -7
  235. package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
  236. package/dist/lib/output/themes/default/templates/reflection.js +31 -34
  237. package/dist/lib/output/themes/lib.d.ts +17 -3
  238. package/dist/lib/output/themes/lib.js +110 -49
  239. package/dist/lib/serialization/components.d.ts +2 -5
  240. package/dist/lib/serialization/components.js +1 -2
  241. package/dist/lib/serialization/deserializer.d.ts +21 -7
  242. package/dist/lib/serialization/deserializer.js +138 -123
  243. package/dist/lib/serialization/events.d.ts +2 -2
  244. package/dist/lib/serialization/events.js +6 -5
  245. package/dist/lib/serialization/index.d.ts +5 -5
  246. package/dist/lib/serialization/index.js +4 -33
  247. package/dist/lib/serialization/schema.d.ts +8 -2
  248. package/dist/lib/serialization/schema.js +2 -2
  249. package/dist/lib/serialization/serializer.d.ts +11 -5
  250. package/dist/lib/serialization/serializer.js +32 -25
  251. package/dist/lib/utils/array.d.ts +3 -0
  252. package/dist/lib/utils/array.js +26 -27
  253. package/dist/lib/utils/component.d.ts +2 -44
  254. package/dist/lib/utils/component.js +10 -102
  255. package/dist/lib/utils/entry-point.d.ts +3 -4
  256. package/dist/lib/utils/entry-point.js +114 -85
  257. package/dist/lib/utils/enum.js +6 -14
  258. package/dist/lib/utils/events.js +6 -12
  259. package/dist/lib/utils/fs.js +50 -91
  260. package/dist/lib/utils/general.d.ts +2 -1
  261. package/dist/lib/utils/general.js +50 -40
  262. package/dist/lib/utils/highlighter.js +30 -57
  263. package/dist/lib/utils/hooks.js +7 -13
  264. package/dist/lib/utils/html-entities.d.ts +8926 -0
  265. package/dist/lib/utils/html-entities.js +2329 -0
  266. package/dist/lib/utils/html.d.ts +8 -0
  267. package/dist/lib/utils/html.js +81 -34
  268. package/dist/lib/utils/index.d.ts +22 -22
  269. package/dist/lib/utils/index.js +20 -91
  270. package/dist/lib/utils/jsx.d.ts +12 -5
  271. package/dist/lib/utils/jsx.elements.js +1 -4
  272. package/dist/lib/utils/jsx.js +53 -20
  273. package/dist/lib/utils/loggers.d.ts +3 -3
  274. package/dist/lib/utils/loggers.js +36 -46
  275. package/dist/lib/utils/map.d.ts +1 -1
  276. package/dist/lib/utils/map.js +6 -13
  277. package/dist/lib/utils/minimalSourceFile.js +5 -7
  278. package/dist/lib/utils/options/declaration.d.ts +33 -7
  279. package/dist/lib/utils/options/declaration.js +20 -22
  280. package/dist/lib/utils/options/defaults.d.ts +3 -2
  281. package/dist/lib/utils/options/defaults.js +18 -38
  282. package/dist/lib/utils/options/help.d.ts +2 -2
  283. package/dist/lib/utils/options/help.js +7 -10
  284. package/dist/lib/utils/options/index.d.ts +6 -6
  285. package/dist/lib/utils/options/index.js +4 -18
  286. package/dist/lib/utils/options/options.d.ts +8 -5
  287. package/dist/lib/utils/options/options.js +47 -71
  288. package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
  289. package/dist/lib/utils/options/readers/arguments.js +15 -17
  290. package/dist/lib/utils/options/readers/index.d.ts +4 -4
  291. package/dist/lib/utils/options/readers/index.js +4 -11
  292. package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
  293. package/dist/lib/utils/options/readers/package-json.js +15 -21
  294. package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
  295. package/dist/lib/utils/options/readers/tsconfig.js +54 -63
  296. package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
  297. package/dist/lib/utils/options/readers/typedoc.js +47 -90
  298. package/dist/lib/utils/options/sources/index.d.ts +1 -1
  299. package/dist/lib/utils/options/sources/index.js +1 -5
  300. package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
  301. package/dist/lib/utils/options/sources/typedoc.js +220 -196
  302. package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
  303. package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
  304. package/dist/lib/utils/package-manifest.d.ts +1 -1
  305. package/dist/lib/utils/package-manifest.js +15 -19
  306. package/dist/lib/utils/paths.js +9 -15
  307. package/dist/lib/utils/perf.js +6 -11
  308. package/dist/lib/utils/plugins.d.ts +1 -1
  309. package/dist/lib/utils/plugins.js +16 -17
  310. package/dist/lib/utils/reflections.d.ts +1 -1
  311. package/dist/lib/utils/reflections.js +9 -12
  312. package/dist/lib/utils/set.js +2 -6
  313. package/dist/lib/utils/sort.d.ts +3 -3
  314. package/dist/lib/utils/sort.js +20 -24
  315. package/dist/lib/utils/tsconfig.d.ts +1 -1
  316. package/dist/lib/utils/tsconfig.js +13 -21
  317. package/dist/lib/utils/tsutils.d.ts +1 -1
  318. package/dist/lib/utils/tsutils.js +3 -30
  319. package/dist/lib/utils/validation.js +6 -12
  320. package/dist/lib/validation/documentation.d.ts +2 -2
  321. package/dist/lib/validation/documentation.js +26 -29
  322. package/dist/lib/validation/exports.d.ts +2 -2
  323. package/dist/lib/validation/exports.js +9 -11
  324. package/dist/lib/validation/links.d.ts +2 -2
  325. package/dist/lib/validation/links.js +4 -7
  326. package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
  327. package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
  328. package/package.json +14 -11
  329. package/static/main.js +4 -4
  330. package/static/style.css +91 -2
  331. package/tsdoc.json +30 -0
  332. package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
  333. package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
  334. package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
  335. package/dist/lib/output/themes/default/partials/parameter.js +0 -79
  336. package/dist/lib/utils/html-entities.json +0 -2326
@@ -1,9 +1,9 @@
1
- import type { PageEvent, Renderer } from "../..";
2
- import type { Internationalization, TranslationProxy } from "../../../internationalization/internationalization";
3
- import type { DocumentReflection, CommentDisplayPart, DeclarationReflection, Reflection } from "../../../models";
4
- import { type NeverIfInternal, type Options } from "../../../utils";
5
- import type { DefaultTheme } from "./DefaultTheme";
6
- import { type icons } from "./partials/icon";
1
+ import type { PageEvent, Renderer } from "../../index.js";
2
+ import type { Internationalization, TranslationProxy } from "../../../internationalization/internationalization.js";
3
+ import type { DocumentReflection, CommentDisplayPart, DeclarationReflection, Reflection } from "../../../models/index.js";
4
+ import { type NeverIfInternal, type Options } from "../../../utils/index.js";
5
+ import type { DefaultTheme } from "./DefaultTheme.js";
6
+ import { type icons } from "./partials/icon.js";
7
7
  export declare class DefaultThemeRenderContext {
8
8
  readonly theme: DefaultTheme;
9
9
  page: PageEvent<Reflection>;
@@ -19,18 +19,21 @@ export declare class DefaultThemeRenderContext {
19
19
  * to customize icons, that object must be modified instead.
20
20
  */
21
21
  get icons(): Readonly<typeof icons>;
22
+ get slugger(): import("./Slugger.js").Slugger;
22
23
  hook: Renderer["hooks"]["emit"];
23
24
  /** Avoid this in favor of urlTo if possible */
24
25
  relativeURL: (url: string, cacheBust?: boolean) => string;
25
26
  urlTo: (reflection: Reflection) => string;
26
27
  markdown: (md: readonly CommentDisplayPart[] | NeverIfInternal<string | undefined>) => string;
27
- getNavigation: () => import("./DefaultTheme").NavigationElement[];
28
+ /** Renders user comment markdown wrapped in a tsd-comment div */
29
+ displayParts: (parts: readonly CommentDisplayPart[] | undefined) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
30
+ getNavigation: () => import("./DefaultTheme.js").NavigationElement[];
28
31
  getReflectionClasses: (refl: DeclarationReflection | DocumentReflection) => string;
29
- documentTemplate: (props: PageEvent<DocumentReflection>) => import("../../../utils/jsx.elements").JsxElement;
30
- reflectionTemplate: (props: PageEvent<import("../../../models").ContainerReflection>) => import("../../../utils/jsx.elements").JsxElement;
31
- indexTemplate: (props: PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
32
- hierarchyTemplate: (props: PageEvent<import("../../../models").ProjectReflection>) => import("../../../utils/jsx.elements").JsxElement;
33
- defaultLayout: (template: import("../..").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
32
+ documentTemplate: (props: PageEvent<DocumentReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
33
+ reflectionTemplate: (props: PageEvent<import("../../../models/index.js").ContainerReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
34
+ indexTemplate: (props: PageEvent<import("../../../models/index.js").ProjectReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
35
+ hierarchyTemplate: (props: PageEvent<import("../../../models/index.js").ProjectReflection>) => import("../../../utils/jsx.elements.js").JsxElement;
36
+ defaultLayout: (template: import("../../index.js").RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
34
37
  /**
35
38
  * Rendered just after the description for a reflection.
36
39
  * This can be used to render a shortened type display of a reflection that the
@@ -39,43 +42,55 @@ export declare class DefaultThemeRenderContext {
39
42
  * Note: Will not be called for variables/type aliases, as they are summarized
40
43
  * by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
41
44
  */
42
- reflectionPreview: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
43
- breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
44
- commentSummary: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
45
- commentTags: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement | undefined;
46
- reflectionFlags: (props: Reflection) => import("../../../utils/jsx.elements").JsxElement;
47
- footer: () => import("../../../utils/jsx.elements").JsxElement;
48
- header: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
49
- hierarchy: (props: import("../../../models").DeclarationHierarchy | undefined) => import("../../../utils/jsx.elements").JsxElement | undefined;
50
- index: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement;
51
- member: (props: DeclarationReflection | DocumentReflection) => import("../../../utils/jsx.elements").JsxElement;
52
- memberDeclaration: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
53
- memberGetterSetter: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
54
- memberReference: (props: import("../../../models").ReferenceReflection) => import("../../../utils/jsx.elements").JsxElement;
55
- memberSignatureBody: (props: import("../../../models").SignatureReflection, r_1?: {
45
+ reflectionPreview: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
46
+ /**
47
+ * Used to render additional details about a type. This is used to implement
48
+ * the `@expand` tag, comments on union members, comments on object type members...
49
+ */
50
+ typeDetails: (type: import("../../../models/types.js").SomeType, renderAnchors: boolean) => import("../../../utils/jsx.elements.js").JsxChildren;
51
+ /**
52
+ * Should call the {@link typeDetails} helper if rendering additional details
53
+ * about the type will provide the user with more information about the type.
54
+ */
55
+ typeDetailsIfUseful: (type: import("../../../models/types.js").SomeType | undefined) => import("../../../utils/jsx.elements.js").JsxChildren;
56
+ /**
57
+ * Wrapper around {@link typeDetails} which checks if it is useful
58
+ * and includes a "Type Declaration" header.
59
+ */
60
+ typeDeclaration: (type: import("../../../models/types.js").SomeType) => import("../../../utils/jsx.elements.js").JsxChildren;
61
+ breadcrumb: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
62
+ commentShortSummary: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
63
+ commentSummary: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
64
+ commentTags: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
65
+ reflectionFlags: (props: Reflection) => import("../../../utils/jsx.elements.js").JsxElement;
66
+ footer: () => import("../../../utils/jsx.elements.js").JsxElement;
67
+ header: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
68
+ hierarchy: (props: import("../../../models/index.js").DeclarationHierarchy | undefined) => import("../../../utils/jsx.elements.js").JsxElement | undefined;
69
+ index: (props: import("../../../models/index.js").ContainerReflection) => import("../../../utils/jsx.elements.js").JsxElement;
70
+ member: (props: DeclarationReflection | DocumentReflection) => import("../../../utils/jsx.elements.js").JsxElement;
71
+ moduleReflection: (mod: DeclarationReflection | import("../../../models/index.js").ProjectReflection) => import("../../../utils/jsx.elements.js").JsxElement;
72
+ moduleMemberSummary: (member: DeclarationReflection | DocumentReflection) => import("../../../utils/jsx.elements.js").JsxElement;
73
+ memberDeclaration: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
74
+ memberGetterSetter: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
75
+ memberSignatureBody: (props: import("../../../models/index.js").SignatureReflection, r_1?: {
56
76
  hideSources?: boolean;
57
- } | undefined) => import("../../../utils/jsx.elements").JsxElement;
58
- memberSignatureTitle: (props: import("../../../models").SignatureReflection, r_1?: {
77
+ } | undefined) => import("../../../utils/jsx.elements.js").JsxElement;
78
+ memberSignatureTitle: (props: import("../../../models/index.js").SignatureReflection, options?: {
59
79
  hideName?: boolean;
60
- arrowStyle?: boolean;
61
- hideParamTypes?: boolean;
62
- } | undefined) => import("../../../utils/jsx.elements").JsxElement;
63
- memberSignatures: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
64
- memberSources: (props: DeclarationReflection | import("../../../models").SignatureReflection) => import("../../../utils/jsx.elements").JsxElement;
65
- members: (props: import("../../../models").ContainerReflection) => import("../../../utils/jsx.elements").JsxElement;
66
- /** @deprecated Since 0.26.3 members does group/category flattening internally */
67
- membersGroup?: Function;
68
- sidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
69
- pageSidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
70
- sidebarLinks: () => import("../../../utils/jsx.elements").JsxElement | null;
71
- settings: () => import("../../../utils/jsx.elements").JsxElement;
72
- navigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
73
- pageNavigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
74
- parameter: (props: DeclarationReflection) => import("../../../utils/jsx.elements").JsxElement;
75
- toolbar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements").JsxElement;
76
- type: (type: import("../../../models").Type | undefined, options?: {
80
+ } | undefined) => import("../../../utils/jsx.elements.js").JsxElement;
81
+ memberSignatures: (props: DeclarationReflection) => import("../../../utils/jsx.elements.js").JsxElement;
82
+ memberSources: (props: DeclarationReflection | import("../../../models/index.js").SignatureReflection) => import("../../../utils/jsx.elements.js").JsxElement;
83
+ members: (props: import("../../../models/index.js").ContainerReflection) => import("../../../utils/jsx.elements.js").JsxElement;
84
+ sidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
85
+ pageSidebar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
86
+ sidebarLinks: () => import("../../../utils/jsx.elements.js").JsxElement | null;
87
+ settings: () => import("../../../utils/jsx.elements.js").JsxElement;
88
+ navigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
89
+ pageNavigation: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
90
+ toolbar: (props: PageEvent<Reflection>) => import("../../../utils/jsx.elements.js").JsxElement;
91
+ type: (type: import("../../../models/types.js").SomeType | undefined, options?: {
77
92
  topLevelLinks: boolean;
78
- } | undefined) => import("../../../utils/jsx.elements").JsxElement;
79
- typeAndParent: (props: import("../../../models").Type) => import("../../../utils/jsx.elements").JsxElement;
80
- typeParameters: (typeParameters: import("../../../models").TypeParameterReflection[]) => import("../../../utils/jsx.elements").JsxElement;
93
+ } | undefined) => import("../../../utils/jsx.elements.js").JsxElement;
94
+ typeAndParent: (props: import("../../../models/types.js").Type) => import("../../../utils/jsx.elements.js").JsxElement;
95
+ typeParameters: (typeParameters: import("../../../models/index.js").TypeParameterReflection[]) => import("../../../utils/jsx.elements.js").JsxElement;
81
96
  }
@@ -1,106 +1,49 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultThemeRenderContext = void 0;
4
- const default_1 = require("./layouts/default");
5
- const partials_1 = require("./partials");
6
- const breadcrumb_1 = require("./partials/breadcrumb");
7
- const comment_1 = require("./partials/comment");
8
- const footer_1 = require("./partials/footer");
9
- const header_1 = require("./partials/header");
10
- const hierarchy_1 = require("./partials/hierarchy");
11
- const icon_1 = require("./partials/icon");
12
- const member_1 = require("./partials/member");
13
- const member_declaration_1 = require("./partials/member.declaration");
14
- const member_getterSetter_1 = require("./partials/member.getterSetter");
15
- const member_reference_1 = require("./partials/member.reference");
16
- const member_signature_body_1 = require("./partials/member.signature.body");
17
- const member_signature_title_1 = require("./partials/member.signature.title");
18
- const member_signatures_1 = require("./partials/member.signatures");
19
- const member_sources_1 = require("./partials/member.sources");
20
- const members_1 = require("./partials/members");
21
- const navigation_1 = require("./partials/navigation");
22
- const parameter_1 = require("./partials/parameter");
23
- const reflectionPreview_1 = require("./partials/reflectionPreview");
24
- const toolbar_1 = require("./partials/toolbar");
25
- const type_1 = require("./partials/type");
26
- const typeAndParent_1 = require("./partials/typeAndParent");
27
- const typeParameters_1 = require("./partials/typeParameters");
28
- const templates_1 = require("./templates");
29
- const document_1 = require("./templates/document");
30
- const hierarchy_2 = require("./templates/hierarchy");
31
- const reflection_1 = require("./templates/reflection");
1
+ import {} from "../../../utils/index.js";
2
+ import { defaultLayout } from "./layouts/default.js";
3
+ import { index } from "./partials/index.js";
4
+ import { breadcrumb } from "./partials/breadcrumb.js";
5
+ import { commentShortSummary, commentSummary, commentTags, reflectionFlags, renderDisplayParts, } from "./partials/comment.js";
6
+ import { footer } from "./partials/footer.js";
7
+ import { header } from "./partials/header.js";
8
+ import { hierarchy } from "./partials/hierarchy.js";
9
+ import { buildRefIcons } from "./partials/icon.js";
10
+ import { member } from "./partials/member.js";
11
+ import { memberDeclaration } from "./partials/member.declaration.js";
12
+ import { memberGetterSetter } from "./partials/member.getterSetter.js";
13
+ import { memberSignatureBody } from "./partials/member.signature.body.js";
14
+ import { memberSignatureTitle } from "./partials/member.signature.title.js";
15
+ import { memberSignatures } from "./partials/member.signatures.js";
16
+ import { memberSources } from "./partials/member.sources.js";
17
+ import { members } from "./partials/members.js";
18
+ import { sidebar, pageSidebar, navigation, pageNavigation, settings, sidebarLinks, } from "./partials/navigation.js";
19
+ import { reflectionPreview } from "./partials/reflectionPreview.js";
20
+ import { toolbar } from "./partials/toolbar.js";
21
+ import { type } from "./partials/type.js";
22
+ import { typeAndParent } from "./partials/typeAndParent.js";
23
+ import { typeParameters } from "./partials/typeParameters.js";
24
+ import { indexTemplate } from "./templates/index.js";
25
+ import { documentTemplate } from "./templates/document.js";
26
+ import { hierarchyTemplate } from "./templates/hierarchy.js";
27
+ import { reflectionTemplate } from "./templates/reflection.js";
28
+ import { typeDeclaration, typeDetails, typeDetailsIfUseful, } from "./partials/typeDetails.js";
29
+ import { moduleMemberSummary, moduleReflection, } from "./partials/moduleReflection.js";
32
30
  function bind(fn, first) {
33
31
  return (...r) => fn(first, ...r);
34
32
  }
35
- class DefaultThemeRenderContext {
33
+ export class DefaultThemeRenderContext {
34
+ theme;
35
+ page;
36
+ _refIcons;
37
+ options;
38
+ internationalization;
39
+ i18n;
36
40
  constructor(theme, page, options) {
37
41
  this.theme = theme;
38
42
  this.page = page;
39
- this.hook = (...params) => {
40
- return this.theme.owner.hooks.emit(...params);
41
- };
42
- /** Avoid this in favor of urlTo if possible */
43
- this.relativeURL = (url, cacheBust = false) => {
44
- const result = this.theme.markedPlugin.getRelativeUrl(url);
45
- if (cacheBust && this.theme.owner.cacheBust) {
46
- return result + `?cache=${this.theme.owner.renderStartTime}`;
47
- }
48
- return result;
49
- };
50
- this.urlTo = (reflection) => {
51
- return reflection.url ? this.relativeURL(reflection.url) : "";
52
- };
53
- this.markdown = (md) => {
54
- return this.theme.markedPlugin.parseMarkdown(md || "", this.page, this);
55
- };
56
- this.getNavigation = () => this.theme.getNavigation(this.page.project);
57
- this.getReflectionClasses = (refl) => this.theme.getReflectionClasses(refl);
58
- this.documentTemplate = bind(document_1.documentTemplate, this);
59
- this.reflectionTemplate = bind(reflection_1.reflectionTemplate, this);
60
- this.indexTemplate = bind(templates_1.indexTemplate, this);
61
- this.hierarchyTemplate = bind(hierarchy_2.hierarchyTemplate, this);
62
- this.defaultLayout = bind(default_1.defaultLayout, this);
63
- /**
64
- * Rendered just after the description for a reflection.
65
- * This can be used to render a shortened type display of a reflection that the
66
- * rest of the page expands on.
67
- *
68
- * Note: Will not be called for variables/type aliases, as they are summarized
69
- * by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
70
- */
71
- this.reflectionPreview = bind(reflectionPreview_1.reflectionPreview, this);
72
- this.breadcrumb = bind(breadcrumb_1.breadcrumb, this);
73
- this.commentSummary = bind(comment_1.commentSummary, this);
74
- this.commentTags = bind(comment_1.commentTags, this);
75
- this.reflectionFlags = bind(comment_1.reflectionFlags, this);
76
- this.footer = bind(footer_1.footer, this);
77
- this.header = bind(header_1.header, this);
78
- this.hierarchy = bind(hierarchy_1.hierarchy, this);
79
- this.index = bind(partials_1.index, this);
80
- this.member = bind(member_1.member, this);
81
- this.memberDeclaration = bind(member_declaration_1.memberDeclaration, this);
82
- this.memberGetterSetter = bind(member_getterSetter_1.memberGetterSetter, this);
83
- this.memberReference = bind(member_reference_1.memberReference, this);
84
- this.memberSignatureBody = bind(member_signature_body_1.memberSignatureBody, this);
85
- this.memberSignatureTitle = bind(member_signature_title_1.memberSignatureTitle, this);
86
- this.memberSignatures = bind(member_signatures_1.memberSignatures, this);
87
- this.memberSources = bind(member_sources_1.memberSources, this);
88
- this.members = bind(members_1.members, this);
89
- this.sidebar = bind(navigation_1.sidebar, this);
90
- this.pageSidebar = bind(navigation_1.pageSidebar, this);
91
- this.sidebarLinks = bind(navigation_1.sidebarLinks, this);
92
- this.settings = bind(navigation_1.settings, this);
93
- this.navigation = bind(navigation_1.navigation, this);
94
- this.pageNavigation = bind(navigation_1.pageNavigation, this);
95
- this.parameter = bind(parameter_1.parameter, this);
96
- this.toolbar = bind(toolbar_1.toolbar, this);
97
- this.type = bind(type_1.type, this);
98
- this.typeAndParent = bind(typeAndParent_1.typeAndParent, this);
99
- this.typeParameters = bind(typeParameters_1.typeParameters, this);
100
43
  this.options = options;
101
44
  this.internationalization = theme.application.internationalization;
102
45
  this.i18n = this.internationalization.proxy;
103
- this._refIcons = (0, icon_1.buildRefIcons)(theme.icons, this);
46
+ this._refIcons = buildRefIcons(theme.icons, this);
104
47
  }
105
48
  /**
106
49
  * Icons available for use within the page.
@@ -111,5 +54,86 @@ class DefaultThemeRenderContext {
111
54
  get icons() {
112
55
  return this._refIcons;
113
56
  }
57
+ get slugger() {
58
+ return this.theme.getSlugger(this.page.model);
59
+ }
60
+ hook = (...params) => {
61
+ return this.theme.owner.hooks.emit(...params);
62
+ };
63
+ /** Avoid this in favor of urlTo if possible */
64
+ relativeURL = (url, cacheBust = false) => {
65
+ const result = this.theme.markedPlugin.getRelativeUrl(url);
66
+ if (cacheBust && this.theme.owner.cacheBust) {
67
+ return result + `?cache=${this.theme.owner.renderStartTime}`;
68
+ }
69
+ return result;
70
+ };
71
+ urlTo = (reflection) => {
72
+ return reflection.url ? this.relativeURL(reflection.url) : "";
73
+ };
74
+ markdown = (md) => {
75
+ return this.theme.markedPlugin.parseMarkdown(md || "", this.page, this);
76
+ };
77
+ /** Renders user comment markdown wrapped in a tsd-comment div */
78
+ displayParts = bind(renderDisplayParts, this);
79
+ getNavigation = () => this.theme.getNavigation(this.page.project);
80
+ getReflectionClasses = (refl) => this.theme.getReflectionClasses(refl);
81
+ documentTemplate = bind(documentTemplate, this);
82
+ reflectionTemplate = bind(reflectionTemplate, this);
83
+ indexTemplate = bind(indexTemplate, this);
84
+ hierarchyTemplate = bind(hierarchyTemplate, this);
85
+ defaultLayout = bind(defaultLayout, this);
86
+ /**
87
+ * Rendered just after the description for a reflection.
88
+ * This can be used to render a shortened type display of a reflection that the
89
+ * rest of the page expands on.
90
+ *
91
+ * Note: Will not be called for variables/type aliases, as they are summarized
92
+ * by their type declaration, which is already rendered by {@link DefaultThemeRenderContext.memberDeclaration}
93
+ */
94
+ reflectionPreview = bind(reflectionPreview, this);
95
+ /**
96
+ * Used to render additional details about a type. This is used to implement
97
+ * the `@expand` tag, comments on union members, comments on object type members...
98
+ */
99
+ typeDetails = bind(typeDetails, this);
100
+ /**
101
+ * Should call the {@link typeDetails} helper if rendering additional details
102
+ * about the type will provide the user with more information about the type.
103
+ */
104
+ typeDetailsIfUseful = bind(typeDetailsIfUseful, this);
105
+ /**
106
+ * Wrapper around {@link typeDetails} which checks if it is useful
107
+ * and includes a "Type Declaration" header.
108
+ */
109
+ typeDeclaration = bind(typeDeclaration, this);
110
+ breadcrumb = bind(breadcrumb, this);
111
+ commentShortSummary = bind(commentShortSummary, this);
112
+ commentSummary = bind(commentSummary, this);
113
+ commentTags = bind(commentTags, this);
114
+ reflectionFlags = bind(reflectionFlags, this);
115
+ footer = bind(footer, this);
116
+ header = bind(header, this);
117
+ hierarchy = bind(hierarchy, this);
118
+ index = bind(index, this);
119
+ member = bind(member, this);
120
+ moduleReflection = bind(moduleReflection, this);
121
+ moduleMemberSummary = bind(moduleMemberSummary, this);
122
+ memberDeclaration = bind(memberDeclaration, this);
123
+ memberGetterSetter = bind(memberGetterSetter, this);
124
+ memberSignatureBody = bind(memberSignatureBody, this);
125
+ memberSignatureTitle = bind(memberSignatureTitle, this);
126
+ memberSignatures = bind(memberSignatures, this);
127
+ memberSources = bind(memberSources, this);
128
+ members = bind(members, this);
129
+ sidebar = bind(sidebar, this);
130
+ pageSidebar = bind(pageSidebar, this);
131
+ sidebarLinks = bind(sidebarLinks, this);
132
+ settings = bind(settings, this);
133
+ navigation = bind(navigation, this);
134
+ pageNavigation = bind(pageNavigation, this);
135
+ toolbar = bind(toolbar, this);
136
+ type = bind(type, this);
137
+ typeAndParent = bind(typeAndParent, this);
138
+ typeParameters = bind(typeParameters, this);
114
139
  }
115
- exports.DefaultThemeRenderContext = DefaultThemeRenderContext;
@@ -0,0 +1,13 @@
1
+ import type { TypeDocOptionMap } from "../../../utils/index.js";
2
+ /**
3
+ * Responsible for getting a unique anchor for elements within a page.
4
+ */
5
+ export declare class Slugger {
6
+ private options;
7
+ private seen;
8
+ private serialize;
9
+ constructor(options: TypeDocOptionMap["sluggerConfiguration"]);
10
+ slug(value: string): string;
11
+ hasAnchor(anchor: string): boolean;
12
+ getSimilarAnchors(anchor: string): string[];
13
+ }
@@ -0,0 +1,46 @@
1
+ import { getSimilarValues } from "../../../utils/general.js";
2
+ /**
3
+ * Responsible for getting a unique anchor for elements within a page.
4
+ */
5
+ export class Slugger {
6
+ options;
7
+ seen = new Map();
8
+ serialize(value) {
9
+ // Notes:
10
+ // There are quite a few trade-offs here.
11
+ return (value
12
+ .trim()
13
+ // remove html tags
14
+ .replace(/<[!/a-z].*?>/gi, "")
15
+ // remove unwanted chars
16
+ .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "")
17
+ .replace(/\s/g, "-"));
18
+ }
19
+ constructor(options) {
20
+ this.options = options;
21
+ }
22
+ slug(value) {
23
+ const originalSlug = this.serialize(value);
24
+ const lowerOriginalSlug = originalSlug.toLocaleLowerCase();
25
+ let count = 0;
26
+ let slug = lowerOriginalSlug;
27
+ if (this.seen.has(lowerOriginalSlug)) {
28
+ count = this.seen.get(lowerOriginalSlug);
29
+ do {
30
+ count++;
31
+ slug = `${lowerOriginalSlug}-${count}`;
32
+ } while (this.seen.has(slug));
33
+ }
34
+ this.seen.set(lowerOriginalSlug, count);
35
+ if (!this.options.lowercase) {
36
+ return count === 0 ? originalSlug : `${originalSlug}-${count}`;
37
+ }
38
+ return slug;
39
+ }
40
+ hasAnchor(anchor) {
41
+ return this.seen.has(anchor);
42
+ }
43
+ getSimilarAnchors(anchor) {
44
+ return getSimilarValues(this.seen.keys(), anchor);
45
+ }
46
+ }
@@ -1,6 +1,6 @@
1
- import type { RenderTemplate } from "../../..";
2
- import type { Reflection } from "../../../../models";
3
- import { JSX } from "../../../../utils";
4
- import type { PageEvent } from "../../../events";
5
- import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
1
+ import type { RenderTemplate } from "../../../index.js";
2
+ import type { Reflection } from "../../../../models/index.js";
3
+ import { JSX } from "../../../../utils/index.js";
4
+ import type { PageEvent } from "../../../events.js";
5
+ import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
6
6
  export declare const defaultLayout: (context: DefaultThemeRenderContext, template: RenderTemplate<PageEvent<Reflection>>, props: PageEvent<Reflection>) => JSX.Element;
@@ -1,50 +1,83 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultLayout = void 0;
4
- const utils_1 = require("../../../../utils");
5
- const lib_1 = require("../../lib");
6
- const defaultLayout = (context, template, props) => (utils_1.JSX.createElement("html", { class: "default", lang: context.options.getValue("lang") },
7
- utils_1.JSX.createElement("head", null,
8
- utils_1.JSX.createElement("meta", { charset: "utf-8" }),
1
+ import { JSX, Raw } from "../../../../utils/index.js";
2
+ import { getDisplayName } from "../../lib.js";
3
+ import { extname } from "path";
4
+ function favicon(context) {
5
+ const fav = context.options.getValue("favicon");
6
+ if (!fav)
7
+ return null;
8
+ switch (extname(fav)) {
9
+ case ".ico":
10
+ return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.ico", true) });
11
+ case ".svg":
12
+ return JSX.createElement("link", { rel: "icon", href: context.relativeURL("assets/favicon.svg", true), type: "image/svg+xml" });
13
+ default:
14
+ return null;
15
+ }
16
+ }
17
+ // See #2760
18
+ function buildSiteMetadata(context) {
19
+ try {
20
+ // We have to know where we are hosted in order to generate this block
21
+ const url = new URL(context.options.getValue("hostedBaseUrl"));
22
+ // No point in generating this if we aren't the root page on the site
23
+ if (url.pathname !== "/") {
24
+ return null;
25
+ }
26
+ return (JSX.createElement("script", { type: "application/ld+json" },
27
+ JSX.createElement(Raw, { html: JSON.stringify({
28
+ "@context": "https://schema.org",
29
+ "@type": "WebSite",
30
+ name: context.page.project.name,
31
+ url: url.toString(),
32
+ }) })));
33
+ }
34
+ catch {
35
+ return null;
36
+ }
37
+ }
38
+ export const defaultLayout = (context, template, props) => (JSX.createElement("html", { class: "default", lang: context.options.getValue("lang") },
39
+ JSX.createElement("head", null,
40
+ JSX.createElement("meta", { charset: "utf-8" }),
9
41
  context.hook("head.begin", context),
10
- utils_1.JSX.createElement("meta", { "http-equiv": "x-ua-compatible", content: "IE=edge" }),
11
- utils_1.JSX.createElement("title", null, props.model.isProject()
12
- ? (0, lib_1.getDisplayName)(props.model)
13
- : `${(0, lib_1.getDisplayName)(props.model)} | ${(0, lib_1.getDisplayName)(props.project)}`),
14
- utils_1.JSX.createElement("meta", { name: "description", content: "Documentation for " + props.project.name }),
15
- utils_1.JSX.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
16
- utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/style.css", true) }),
17
- utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/highlight.css", true) }),
18
- context.options.getValue("customCss") && (utils_1.JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/custom.css", true) })),
19
- utils_1.JSX.createElement("script", { defer: true, src: context.relativeURL("assets/main.js", true) }),
20
- context.options.getValue("customJs") && (utils_1.JSX.createElement("script", { defer: true, src: context.relativeURL("assets/custom.js", true) })),
21
- utils_1.JSX.createElement("script", { async: true, src: context.relativeURL("assets/icons.js", true), id: "tsd-icons-script" }),
22
- utils_1.JSX.createElement("script", { async: true, src: context.relativeURL("assets/search.js", true), id: "tsd-search-script" }),
23
- utils_1.JSX.createElement("script", { async: true, src: context.relativeURL("assets/navigation.js", true), id: "tsd-nav-script" }),
42
+ JSX.createElement("meta", { "http-equiv": "x-ua-compatible", content: "IE=edge" }),
43
+ JSX.createElement("title", null, props.model.isProject()
44
+ ? getDisplayName(props.model)
45
+ : `${getDisplayName(props.model)} | ${getDisplayName(props.project)}`),
46
+ favicon(context),
47
+ props.url === "index.html" && buildSiteMetadata(context),
48
+ JSX.createElement("meta", { name: "description", content: "Documentation for " + props.project.name }),
49
+ JSX.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
50
+ JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/style.css", true) }),
51
+ JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/highlight.css", true) }),
52
+ context.options.getValue("customCss") && (JSX.createElement("link", { rel: "stylesheet", href: context.relativeURL("assets/custom.css", true) })),
53
+ JSX.createElement("script", { defer: true, src: context.relativeURL("assets/main.js", true) }),
54
+ context.options.getValue("customJs") && (JSX.createElement("script", { defer: true, src: context.relativeURL("assets/custom.js", true) })),
55
+ JSX.createElement("script", { async: true, src: context.relativeURL("assets/icons.js", true), id: "tsd-icons-script" }),
56
+ JSX.createElement("script", { async: true, src: context.relativeURL("assets/search.js", true), id: "tsd-search-script" }),
57
+ JSX.createElement("script", { async: true, src: context.relativeURL("assets/navigation.js", true), id: "tsd-nav-script" }),
24
58
  context.hook("head.end", context)),
25
- utils_1.JSX.createElement("body", null,
59
+ JSX.createElement("body", null,
26
60
  context.hook("body.begin", context),
27
- utils_1.JSX.createElement("script", null,
28
- utils_1.JSX.createElement(utils_1.Raw, { html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";' }),
29
- utils_1.JSX.createElement(utils_1.Raw, { html: 'document.body.style.display="none";' }),
30
- utils_1.JSX.createElement(utils_1.Raw, { html: 'setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)' })),
61
+ JSX.createElement("script", null,
62
+ JSX.createElement(Raw, { html: 'document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";' }),
63
+ JSX.createElement(Raw, { html: 'document.body.style.display="none";' }),
64
+ JSX.createElement(Raw, { html: 'setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)' })),
31
65
  context.toolbar(props),
32
- utils_1.JSX.createElement("div", { class: "container container-main" },
33
- utils_1.JSX.createElement("div", { class: "col-content" },
66
+ JSX.createElement("div", { class: "container container-main" },
67
+ JSX.createElement("div", { class: "col-content" },
34
68
  context.hook("content.begin", context),
35
69
  context.header(props),
36
70
  template(props),
37
71
  context.hook("content.end", context)),
38
- utils_1.JSX.createElement("div", { class: "col-sidebar" },
39
- utils_1.JSX.createElement("div", { class: "page-menu" },
72
+ JSX.createElement("div", { class: "col-sidebar" },
73
+ JSX.createElement("div", { class: "page-menu" },
40
74
  context.hook("pageSidebar.begin", context),
41
75
  context.pageSidebar(props),
42
76
  context.hook("pageSidebar.end", context)),
43
- utils_1.JSX.createElement("div", { class: "site-menu" },
77
+ JSX.createElement("div", { class: "site-menu" },
44
78
  context.hook("sidebar.begin", context),
45
79
  context.sidebar(props),
46
80
  context.hook("sidebar.end", context)))),
47
81
  context.footer(),
48
- utils_1.JSX.createElement("div", { class: "overlay" }),
82
+ JSX.createElement("div", { class: "overlay" }),
49
83
  context.hook("body.end", context))));
50
- exports.defaultLayout = defaultLayout;
@@ -1,3 +1,3 @@
1
- import { JSX } from "../../../../utils";
2
- import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
1
+ import { JSX } from "../../../../utils/index.js";
2
+ import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
3
3
  export declare function anchorIcon(context: DefaultThemeRenderContext, anchor: string | undefined): JSX.Element;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.anchorIcon = anchorIcon;
4
- const utils_1 = require("../../../../utils");
5
- function anchorIcon(context, anchor) {
1
+ import { JSX } from "../../../../utils/index.js";
2
+ export function anchorIcon(context, anchor) {
6
3
  if (!anchor)
7
- return utils_1.JSX.createElement(utils_1.JSX.Fragment, null);
8
- return (utils_1.JSX.createElement("a", { href: `#${anchor}`, "aria-label": context.i18n.theme_permalink(), class: "tsd-anchor-icon" }, context.icons.anchor()));
4
+ return JSX.createElement(JSX.Fragment, null);
5
+ return (JSX.createElement("a", { href: `#${anchor}`, "aria-label": context.i18n.theme_permalink(), class: "tsd-anchor-icon" }, context.icons.anchor()));
9
6
  }
@@ -1,4 +1,4 @@
1
- import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
2
- import { JSX } from "../../../../utils";
3
- import type { Reflection } from "../../../../models";
1
+ import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext.js";
2
+ import { JSX } from "../../../../utils/index.js";
3
+ import type { Reflection } from "../../../../models/index.js";
4
4
  export declare const breadcrumb: (context: DefaultThemeRenderContext, props: Reflection) => JSX.Element | undefined;