typedoc 0.26.11 → 0.27.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/bin/package.json +3 -0
  2. package/bin/typedoc +1 -1
  3. package/dist/index.d.ts +23 -13
  4. package/dist/index.js +22 -81
  5. package/dist/lib/application-events.js +1 -4
  6. package/dist/lib/application.d.ts +26 -16
  7. package/dist/lib/application.js +222 -242
  8. package/dist/lib/cli.js +3 -40
  9. package/dist/lib/converter/comments/blockLexer.d.ts +1 -1
  10. package/dist/lib/converter/comments/blockLexer.js +24 -30
  11. package/dist/lib/converter/comments/declarationReference.js +10 -21
  12. package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +2 -2
  13. package/dist/lib/converter/comments/declarationReferenceResolver.js +40 -36
  14. package/dist/lib/converter/comments/discovery.d.ts +4 -4
  15. package/dist/lib/converter/comments/discovery.js +154 -172
  16. package/dist/lib/converter/comments/index.d.ts +4 -4
  17. package/dist/lib/converter/comments/index.js +39 -50
  18. package/dist/lib/converter/comments/lexer.d.ts +1 -1
  19. package/dist/lib/converter/comments/lexer.js +2 -5
  20. package/dist/lib/converter/comments/lineLexer.d.ts +1 -1
  21. package/dist/lib/converter/comments/lineLexer.js +12 -15
  22. package/dist/lib/converter/comments/linkResolver.d.ts +2 -2
  23. package/dist/lib/converter/comments/linkResolver.js +14 -21
  24. package/dist/lib/converter/comments/parser.d.ts +6 -6
  25. package/dist/lib/converter/comments/parser.js +69 -96
  26. package/dist/lib/converter/comments/rawLexer.d.ts +1 -1
  27. package/dist/lib/converter/comments/rawLexer.js +13 -16
  28. package/dist/lib/converter/comments/tagName.js +1 -4
  29. package/dist/lib/converter/comments/textParser.d.ts +4 -4
  30. package/dist/lib/converter/comments/textParser.js +28 -30
  31. package/dist/lib/converter/components.d.ts +2 -3
  32. package/dist/lib/converter/components.js +2 -7
  33. package/dist/lib/converter/context.d.ts +9 -9
  34. package/dist/lib/converter/context.js +54 -44
  35. package/dist/lib/converter/convert-expression.js +16 -23
  36. package/dist/lib/converter/converter-events.d.ts +1 -0
  37. package/dist/lib/converter/converter-events.js +2 -4
  38. package/dist/lib/converter/converter.d.ts +16 -13
  39. package/dist/lib/converter/converter.js +212 -239
  40. package/dist/lib/converter/factories/index-signature.d.ts +3 -3
  41. package/dist/lib/converter/factories/index-signature.js +43 -26
  42. package/dist/lib/converter/factories/signature.d.ts +2 -2
  43. package/dist/lib/converter/factories/signature.js +95 -106
  44. package/dist/lib/converter/index.d.ts +6 -7
  45. package/dist/lib/converter/index.js +3 -11
  46. package/dist/lib/converter/jsdoc.d.ts +1 -1
  47. package/dist/lib/converter/jsdoc.js +34 -41
  48. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +6 -21
  49. package/dist/lib/converter/plugins/CategoryPlugin.js +57 -139
  50. package/dist/lib/converter/plugins/CommentPlugin.d.ts +3 -5
  51. package/dist/lib/converter/plugins/CommentPlugin.js +153 -163
  52. package/dist/lib/converter/plugins/GroupPlugin.d.ts +10 -9
  53. package/dist/lib/converter/plugins/GroupPlugin.js +87 -124
  54. package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +3 -5
  55. package/dist/lib/converter/plugins/ImplementsPlugin.js +255 -321
  56. package/dist/lib/converter/plugins/IncludePlugin.d.ts +11 -0
  57. package/dist/lib/converter/plugins/IncludePlugin.js +72 -0
  58. package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +4 -3
  59. package/dist/lib/converter/plugins/InheritDocPlugin.js +41 -72
  60. package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +5 -5
  61. package/dist/lib/converter/plugins/LinkResolverPlugin.js +37 -58
  62. package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
  63. package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +49 -0
  64. package/dist/lib/converter/plugins/PackagePlugin.d.ts +4 -3
  65. package/dist/lib/converter/plugins/PackagePlugin.js +62 -111
  66. package/dist/lib/converter/plugins/SourcePlugin.d.ts +3 -5
  67. package/dist/lib/converter/plugins/SourcePlugin.js +69 -110
  68. package/dist/lib/converter/plugins/TypePlugin.d.ts +4 -6
  69. package/dist/lib/converter/plugins/TypePlugin.js +95 -158
  70. package/dist/lib/converter/plugins/index.d.ts +10 -9
  71. package/dist/lib/converter/plugins/index.js +10 -21
  72. package/dist/lib/converter/symbols.d.ts +1 -1
  73. package/dist/lib/converter/symbols.js +234 -227
  74. package/dist/lib/converter/types.d.ts +2 -2
  75. package/dist/lib/converter/types.js +252 -237
  76. package/dist/lib/converter/utils/nodes.js +5 -13
  77. package/dist/lib/converter/utils/reflections.d.ts +1 -1
  78. package/dist/lib/converter/utils/reflections.js +4 -7
  79. package/dist/lib/converter/utils/repository.d.ts +1 -1
  80. package/dist/lib/converter/utils/repository.js +103 -97
  81. package/dist/lib/converter/utils/symbols.js +3 -9
  82. package/dist/lib/internationalization/index.d.ts +3 -4
  83. package/dist/lib/internationalization/index.js +3 -8
  84. package/dist/lib/internationalization/internationalization.d.ts +5 -4
  85. package/dist/lib/internationalization/internationalization.js +97 -103
  86. package/dist/lib/internationalization/locale-utils.cjs +8 -0
  87. package/dist/lib/internationalization/locale-utils.d.cts +8 -0
  88. package/dist/lib/internationalization/locales/en.cjs +372 -2
  89. package/dist/lib/internationalization/locales/en.d.cts +343 -2
  90. package/dist/lib/internationalization/locales/jp.cjs +13 -14
  91. package/dist/lib/internationalization/locales/jp.d.cts +307 -1
  92. package/dist/lib/internationalization/locales/ko.cjs +12 -11
  93. package/dist/lib/internationalization/locales/ko.d.cts +221 -1
  94. package/dist/lib/internationalization/locales/zh.cjs +43 -19
  95. package/dist/lib/internationalization/locales/zh.d.cts +409 -1
  96. package/dist/lib/internationalization/translatable.d.ts +4 -327
  97. package/dist/lib/internationalization/translatable.js +2 -360
  98. package/dist/lib/models/FileRegistry.d.ts +20 -9
  99. package/dist/lib/models/FileRegistry.js +54 -45
  100. package/dist/lib/models/ReflectionCategory.d.ts +2 -2
  101. package/dist/lib/models/ReflectionCategory.js +16 -12
  102. package/dist/lib/models/ReflectionGroup.d.ts +3 -3
  103. package/dist/lib/models/ReflectionGroup.js +23 -14
  104. package/dist/lib/models/comments/comment.d.ts +23 -37
  105. package/dist/lib/models/comments/comment.js +388 -325
  106. package/dist/lib/models/comments/index.d.ts +2 -2
  107. package/dist/lib/models/comments/index.js +1 -6
  108. package/dist/lib/models/index.d.ts +7 -7
  109. package/dist/lib/models/index.js +7 -23
  110. package/dist/lib/models/reflections/ReflectionSymbolId.d.ts +2 -2
  111. package/dist/lib/models/reflections/ReflectionSymbolId.js +42 -34
  112. package/dist/lib/models/reflections/abstract.d.ts +17 -20
  113. package/dist/lib/models/reflections/abstract.js +249 -256
  114. package/dist/lib/models/reflections/container.d.ts +7 -7
  115. package/dist/lib/models/reflections/container.js +43 -16
  116. package/dist/lib/models/reflections/declaration.d.ts +15 -12
  117. package/dist/lib/models/reflections/declaration.js +150 -29
  118. package/dist/lib/models/reflections/document.d.ts +3 -3
  119. package/dist/lib/models/reflections/document.js +26 -13
  120. package/dist/lib/models/reflections/index.d.ts +15 -15
  121. package/dist/lib/models/reflections/index.js +12 -31
  122. package/dist/lib/models/reflections/kind.d.ts +1 -1
  123. package/dist/lib/models/reflections/kind.js +3 -6
  124. package/dist/lib/models/reflections/parameter.d.ts +5 -4
  125. package/dist/lib/models/reflections/parameter.js +11 -13
  126. package/dist/lib/models/reflections/project.d.ts +14 -9
  127. package/dist/lib/models/reflections/project.js +104 -56
  128. package/dist/lib/models/reflections/reference.d.ts +3 -3
  129. package/dist/lib/models/reflections/reference.js +6 -9
  130. package/dist/lib/models/reflections/signature.d.ts +8 -8
  131. package/dist/lib/models/reflections/signature.js +35 -14
  132. package/dist/lib/models/reflections/type-parameter.d.ts +5 -5
  133. package/dist/lib/models/reflections/type-parameter.js +9 -10
  134. package/dist/lib/models/reflections/utils.js +1 -4
  135. package/dist/lib/models/reflections/variant.d.ts +8 -7
  136. package/dist/lib/models/reflections/variant.js +1 -2
  137. package/dist/lib/models/sources/file.d.ts +2 -2
  138. package/dist/lib/models/sources/file.js +22 -5
  139. package/dist/lib/models/sources/index.d.ts +1 -1
  140. package/dist/lib/models/sources/index.js +1 -5
  141. package/dist/lib/models/types.d.ts +29 -16
  142. package/dist/lib/models/types.js +236 -151
  143. package/dist/lib/output/components.d.ts +5 -11
  144. package/dist/lib/output/components.js +84 -125
  145. package/dist/lib/output/events.d.ts +3 -3
  146. package/dist/lib/output/events.js +128 -94
  147. package/dist/lib/output/formatter.d.ts +84 -0
  148. package/dist/lib/output/formatter.js +624 -0
  149. package/dist/lib/output/index.d.ts +9 -8
  150. package/dist/lib/output/index.js +7 -19
  151. package/dist/lib/output/models/UrlMapping.d.ts +2 -2
  152. package/dist/lib/output/models/UrlMapping.js +4 -5
  153. package/dist/lib/output/output.d.ts +14 -0
  154. package/dist/lib/output/output.js +91 -0
  155. package/dist/lib/output/plugins/AssetsPlugin.d.ts +9 -8
  156. package/dist/lib/output/plugins/AssetsPlugin.js +64 -80
  157. package/dist/lib/output/plugins/HierarchyPlugin.d.ts +7 -0
  158. package/dist/lib/output/plugins/HierarchyPlugin.js +67 -0
  159. package/dist/lib/output/plugins/IconsPlugin.d.ts +3 -2
  160. package/dist/lib/output/plugins/IconsPlugin.js +28 -84
  161. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +9 -2
  162. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +90 -96
  163. package/dist/lib/output/plugins/NavigationPlugin.d.ts +3 -2
  164. package/dist/lib/output/plugins/NavigationPlugin.js +22 -102
  165. package/dist/lib/output/plugins/SitemapPlugin.d.ts +3 -2
  166. package/dist/lib/output/plugins/SitemapPlugin.js +60 -120
  167. package/dist/lib/output/plugins/index.d.ts +7 -6
  168. package/dist/lib/output/plugins/index.js +7 -15
  169. package/dist/lib/output/renderer.d.ts +14 -13
  170. package/dist/lib/output/renderer.js +130 -185
  171. package/dist/lib/output/theme.d.ts +9 -5
  172. package/dist/lib/output/theme.js +14 -62
  173. package/dist/lib/output/themes/MarkedPlugin.d.ts +8 -9
  174. package/dist/lib/output/themes/MarkedPlugin.js +152 -117
  175. package/dist/lib/output/themes/default/DefaultTheme.d.ts +17 -29
  176. package/dist/lib/output/themes/default/DefaultTheme.js +334 -310
  177. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +63 -48
  178. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +119 -95
  179. package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
  180. package/dist/lib/output/themes/default/Slugger.js +46 -0
  181. package/dist/lib/output/themes/default/layouts/default.d.ts +5 -5
  182. package/dist/lib/output/themes/default/layouts/default.js +48 -36
  183. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +2 -2
  184. package/dist/lib/output/themes/default/partials/anchor-icon.js +4 -7
  185. package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +3 -3
  186. package/dist/lib/output/themes/default/partials/breadcrumb.js +4 -8
  187. package/dist/lib/output/themes/default/partials/comment.d.ts +6 -4
  188. package/dist/lib/output/themes/default/partials/comment.js +52 -29
  189. package/dist/lib/output/themes/default/partials/footer.d.ts +2 -2
  190. package/dist/lib/output/themes/default/partials/footer.js +11 -14
  191. package/dist/lib/output/themes/default/partials/header.d.ts +4 -4
  192. package/dist/lib/output/themes/default/partials/header.js +9 -13
  193. package/dist/lib/output/themes/default/partials/hierarchy.d.ts +4 -4
  194. package/dist/lib/output/themes/default/partials/hierarchy.js +12 -15
  195. package/dist/lib/output/themes/default/partials/icon.d.ts +4 -4
  196. package/dist/lib/output/themes/default/partials/icon.js +78 -73
  197. package/dist/lib/output/themes/default/partials/index.d.ts +3 -3
  198. package/dist/lib/output/themes/default/partials/index.js +19 -22
  199. package/dist/lib/output/themes/default/partials/member.d.ts +3 -3
  200. package/dist/lib/output/themes/default/partials/member.declaration.d.ts +3 -3
  201. package/dist/lib/output/themes/default/partials/member.declaration.js +18 -61
  202. package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +3 -3
  203. package/dist/lib/output/themes/default/partials/member.getterSetter.js +10 -26
  204. package/dist/lib/output/themes/default/partials/member.js +19 -24
  205. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +3 -3
  206. package/dist/lib/output/themes/default/partials/member.signature.body.js +17 -21
  207. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +4 -7
  208. package/dist/lib/output/themes/default/partials/member.signature.title.js +8 -35
  209. package/dist/lib/output/themes/default/partials/member.signatures.d.ts +3 -3
  210. package/dist/lib/output/themes/default/partials/member.signatures.js +9 -13
  211. package/dist/lib/output/themes/default/partials/member.sources.d.ts +3 -3
  212. package/dist/lib/output/themes/default/partials/member.sources.js +13 -17
  213. package/dist/lib/output/themes/default/partials/members.d.ts +3 -3
  214. package/dist/lib/output/themes/default/partials/members.js +10 -42
  215. package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
  216. package/dist/lib/output/themes/default/partials/moduleReflection.js +62 -0
  217. package/dist/lib/output/themes/default/partials/navigation.d.ts +4 -4
  218. package/dist/lib/output/themes/default/partials/navigation.js +51 -62
  219. package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +3 -3
  220. package/dist/lib/output/themes/default/partials/reflectionPreview.js +12 -15
  221. package/dist/lib/output/themes/default/partials/toolbar.d.ts +4 -4
  222. package/dist/lib/output/themes/default/partials/toolbar.js +16 -20
  223. package/dist/lib/output/themes/default/partials/type.d.ts +4 -6
  224. package/dist/lib/output/themes/default/partials/type.js +8 -388
  225. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +3 -3
  226. package/dist/lib/output/themes/default/partials/typeAndParent.js +11 -15
  227. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
  228. package/dist/lib/output/themes/default/partials/typeDetails.js +222 -0
  229. package/dist/lib/output/themes/default/partials/typeParameters.d.ts +3 -3
  230. package/dist/lib/output/themes/default/partials/typeParameters.js +14 -17
  231. package/dist/lib/output/themes/default/templates/document.d.ts +4 -4
  232. package/dist/lib/output/themes/default/templates/document.js +3 -7
  233. package/dist/lib/output/themes/default/templates/hierarchy.d.ts +4 -4
  234. package/dist/lib/output/themes/default/templates/hierarchy.js +24 -22
  235. package/dist/lib/output/themes/default/templates/index.d.ts +4 -4
  236. package/dist/lib/output/themes/default/templates/index.js +3 -7
  237. package/dist/lib/output/themes/default/templates/reflection.d.ts +4 -4
  238. package/dist/lib/output/themes/default/templates/reflection.js +32 -34
  239. package/dist/lib/output/themes/lib.d.ts +17 -3
  240. package/dist/lib/output/themes/lib.js +118 -50
  241. package/dist/lib/serialization/components.d.ts +2 -5
  242. package/dist/lib/serialization/components.js +1 -2
  243. package/dist/lib/serialization/deserializer.d.ts +21 -7
  244. package/dist/lib/serialization/deserializer.js +138 -123
  245. package/dist/lib/serialization/events.d.ts +2 -2
  246. package/dist/lib/serialization/events.js +6 -5
  247. package/dist/lib/serialization/index.d.ts +5 -5
  248. package/dist/lib/serialization/index.js +4 -33
  249. package/dist/lib/serialization/schema.d.ts +8 -2
  250. package/dist/lib/serialization/schema.js +2 -2
  251. package/dist/lib/serialization/serializer.d.ts +11 -5
  252. package/dist/lib/serialization/serializer.js +32 -25
  253. package/dist/lib/utils/array.d.ts +3 -0
  254. package/dist/lib/utils/array.js +26 -27
  255. package/dist/lib/utils/component.d.ts +2 -44
  256. package/dist/lib/utils/component.js +10 -102
  257. package/dist/lib/utils/entry-point.d.ts +3 -4
  258. package/dist/lib/utils/entry-point.js +114 -85
  259. package/dist/lib/utils/enum.js +6 -14
  260. package/dist/lib/utils/events.js +6 -12
  261. package/dist/lib/utils/fs.js +50 -91
  262. package/dist/lib/utils/general.d.ts +2 -1
  263. package/dist/lib/utils/general.js +50 -40
  264. package/dist/lib/utils/highlighter.js +30 -57
  265. package/dist/lib/utils/hooks.js +7 -13
  266. package/dist/lib/utils/html-entities.d.ts +8926 -0
  267. package/dist/lib/utils/html-entities.js +2329 -0
  268. package/dist/lib/utils/html.d.ts +8 -0
  269. package/dist/lib/utils/html.js +81 -34
  270. package/dist/lib/utils/index.d.ts +22 -22
  271. package/dist/lib/utils/index.js +20 -91
  272. package/dist/lib/utils/jsx.d.ts +12 -6
  273. package/dist/lib/utils/jsx.elements.d.ts +1 -1
  274. package/dist/lib/utils/jsx.elements.js +3 -4
  275. package/dist/lib/utils/jsx.js +82 -52
  276. package/dist/lib/utils/loggers.d.ts +3 -3
  277. package/dist/lib/utils/loggers.js +36 -46
  278. package/dist/lib/utils/map.js +6 -13
  279. package/dist/lib/utils/minimalSourceFile.js +5 -7
  280. package/dist/lib/utils/options/declaration.d.ts +35 -7
  281. package/dist/lib/utils/options/declaration.js +20 -22
  282. package/dist/lib/utils/options/defaults.d.ts +3 -2
  283. package/dist/lib/utils/options/defaults.js +18 -38
  284. package/dist/lib/utils/options/help.d.ts +2 -2
  285. package/dist/lib/utils/options/help.js +7 -10
  286. package/dist/lib/utils/options/index.d.ts +6 -6
  287. package/dist/lib/utils/options/index.js +4 -18
  288. package/dist/lib/utils/options/options.d.ts +8 -5
  289. package/dist/lib/utils/options/options.js +47 -71
  290. package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
  291. package/dist/lib/utils/options/readers/arguments.js +15 -17
  292. package/dist/lib/utils/options/readers/index.d.ts +4 -4
  293. package/dist/lib/utils/options/readers/index.js +4 -11
  294. package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
  295. package/dist/lib/utils/options/readers/package-json.js +15 -21
  296. package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
  297. package/dist/lib/utils/options/readers/tsconfig.js +54 -63
  298. package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
  299. package/dist/lib/utils/options/readers/typedoc.js +44 -76
  300. package/dist/lib/utils/options/sources/index.d.ts +1 -1
  301. package/dist/lib/utils/options/sources/index.js +1 -5
  302. package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
  303. package/dist/lib/utils/options/sources/typedoc.js +232 -196
  304. package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
  305. package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
  306. package/dist/lib/utils/package-manifest.d.ts +1 -1
  307. package/dist/lib/utils/package-manifest.js +15 -19
  308. package/dist/lib/utils/paths.js +9 -15
  309. package/dist/lib/utils/perf.js +6 -11
  310. package/dist/lib/utils/plugins.d.ts +1 -1
  311. package/dist/lib/utils/plugins.js +7 -10
  312. package/dist/lib/utils/reflections.d.ts +1 -1
  313. package/dist/lib/utils/reflections.js +9 -12
  314. package/dist/lib/utils/set.js +2 -6
  315. package/dist/lib/utils/sort.d.ts +3 -3
  316. package/dist/lib/utils/sort.js +20 -24
  317. package/dist/lib/utils/tsconfig.d.ts +1 -1
  318. package/dist/lib/utils/tsconfig.js +13 -21
  319. package/dist/lib/utils/tsutils.d.ts +1 -1
  320. package/dist/lib/utils/tsutils.js +3 -30
  321. package/dist/lib/utils/validation.js +6 -12
  322. package/dist/lib/validation/documentation.d.ts +2 -2
  323. package/dist/lib/validation/documentation.js +26 -29
  324. package/dist/lib/validation/exports.d.ts +2 -2
  325. package/dist/lib/validation/exports.js +9 -11
  326. package/dist/lib/validation/links.d.ts +2 -2
  327. package/dist/lib/validation/links.js +4 -7
  328. package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
  329. package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
  330. package/package.json +17 -14
  331. package/static/main.js +4 -4
  332. package/static/style.css +109 -17
  333. package/tsdoc.json +30 -0
  334. package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
  335. package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
  336. package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
  337. package/dist/lib/output/themes/default/partials/parameter.js +0 -79
  338. package/dist/lib/utils/html-entities.json +0 -2326
@@ -1,20 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
1
  var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
19
2
  function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
20
3
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
@@ -49,50 +32,21 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
49
32
  }
50
33
  return useValue ? value : void 0;
51
34
  };
52
- var __importStar = (this && this.__importStar) || function (mod) {
53
- if (mod && mod.__esModule) return mod;
54
- var result = {};
55
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
56
- __setModuleDefault(result, mod);
57
- return result;
58
- };
59
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
60
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
61
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
62
- };
63
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
64
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
65
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
66
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
67
- };
68
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
69
- if (kind === "m") throw new TypeError("Private method is not writable");
70
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
71
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
72
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
73
- };
74
- Object.defineProperty(exports, "__esModule", { value: true });
75
- exports.PackagePlugin = void 0;
76
- const Path = __importStar(require("path"));
77
- const components_1 = require("../components");
78
- const converter_1 = require("../converter");
79
- const utils_1 = require("../../utils");
80
- const fs_1 = require("../../utils/fs");
81
- const paths_1 = require("../../utils/paths");
82
- const minimalSourceFile_1 = require("../../utils/minimalSourceFile");
83
- const application_events_1 = require("../../application-events");
84
- const path_1 = require("path");
35
+ import * as Path from "path";
36
+ import { ConverterComponent } from "../components.js";
37
+ import { Option, EntryPointStrategy, readFile } from "../../utils/index.js";
38
+ import { deriveRootDir, discoverInParentDir, discoverPackageJson, } from "../../utils/fs.js";
39
+ import { nicePath } from "../../utils/paths.js";
40
+ import { MinimalSourceFile } from "../../utils/minimalSourceFile.js";
41
+ import { ApplicationEvents } from "../../application-events.js";
42
+ import { join } from "path";
43
+ import { ConverterEvents } from "../converter-events.js";
85
44
  /**
86
45
  * A handler that tries to find the package.json and readme.md files of the
87
46
  * current project.
88
47
  */
89
48
  let PackagePlugin = (() => {
90
- var _PackagePlugin_readme_accessor_storage, _PackagePlugin_entryPointStrategy_accessor_storage, _PackagePlugin_entryPoints_accessor_storage, _PackagePlugin_includeVersion_accessor_storage;
91
- let _classDecorators = [(0, components_1.Component)({ name: "package" })];
92
- let _classDescriptor;
93
- let _classExtraInitializers = [];
94
- let _classThis;
95
- let _classSuper = components_1.ConverterComponent;
49
+ let _classSuper = ConverterComponent;
96
50
  let _readme_decorators;
97
51
  let _readme_initializers = [];
98
52
  let _readme_extraInitializers = [];
@@ -105,35 +59,53 @@ let PackagePlugin = (() => {
105
59
  let _includeVersion_decorators;
106
60
  let _includeVersion_initializers = [];
107
61
  let _includeVersion_extraInitializers = [];
108
- var PackagePlugin = _classThis = class extends _classSuper {
109
- constructor() {
110
- super(...arguments);
111
- _PackagePlugin_readme_accessor_storage.set(this, __runInitializers(this, _readme_initializers, void 0));
112
- _PackagePlugin_entryPointStrategy_accessor_storage.set(this, (__runInitializers(this, _readme_extraInitializers), __runInitializers(this, _entryPointStrategy_initializers, void 0)));
113
- _PackagePlugin_entryPoints_accessor_storage.set(this, (__runInitializers(this, _entryPointStrategy_extraInitializers), __runInitializers(this, _entryPoints_initializers, void 0)));
114
- _PackagePlugin_includeVersion_accessor_storage.set(this, (__runInitializers(this, _entryPoints_extraInitializers), __runInitializers(this, _includeVersion_initializers, void 0)));
115
- /**
116
- * The file name of the found readme.md file.
117
- */
118
- this.readmeFile = __runInitializers(this, _includeVersion_extraInitializers);
62
+ return class PackagePlugin extends _classSuper {
63
+ static {
64
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
65
+ _readme_decorators = [Option("readme")];
66
+ _entryPointStrategy_decorators = [Option("entryPointStrategy")];
67
+ _entryPoints_decorators = [Option("entryPoints")];
68
+ _includeVersion_decorators = [Option("includeVersion")];
69
+ __esDecorate(this, null, _readme_decorators, { kind: "accessor", name: "readme", static: false, private: false, access: { has: obj => "readme" in obj, get: obj => obj.readme, set: (obj, value) => { obj.readme = value; } }, metadata: _metadata }, _readme_initializers, _readme_extraInitializers);
70
+ __esDecorate(this, null, _entryPointStrategy_decorators, { kind: "accessor", name: "entryPointStrategy", static: false, private: false, access: { has: obj => "entryPointStrategy" in obj, get: obj => obj.entryPointStrategy, set: (obj, value) => { obj.entryPointStrategy = value; } }, metadata: _metadata }, _entryPointStrategy_initializers, _entryPointStrategy_extraInitializers);
71
+ __esDecorate(this, null, _entryPoints_decorators, { kind: "accessor", name: "entryPoints", static: false, private: false, access: { has: obj => "entryPoints" in obj, get: obj => obj.entryPoints, set: (obj, value) => { obj.entryPoints = value; } }, metadata: _metadata }, _entryPoints_initializers, _entryPoints_extraInitializers);
72
+ __esDecorate(this, null, _includeVersion_decorators, { kind: "accessor", name: "includeVersion", static: false, private: false, access: { has: obj => "includeVersion" in obj, get: obj => obj.includeVersion, set: (obj, value) => { obj.includeVersion = value; } }, metadata: _metadata }, _includeVersion_initializers, _includeVersion_extraInitializers);
73
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
119
74
  }
120
- get readme() { return __classPrivateFieldGet(this, _PackagePlugin_readme_accessor_storage, "f"); }
121
- set readme(value) { __classPrivateFieldSet(this, _PackagePlugin_readme_accessor_storage, value, "f"); }
122
- get entryPointStrategy() { return __classPrivateFieldGet(this, _PackagePlugin_entryPointStrategy_accessor_storage, "f"); }
123
- set entryPointStrategy(value) { __classPrivateFieldSet(this, _PackagePlugin_entryPointStrategy_accessor_storage, value, "f"); }
124
- get entryPoints() { return __classPrivateFieldGet(this, _PackagePlugin_entryPoints_accessor_storage, "f"); }
125
- set entryPoints(value) { __classPrivateFieldSet(this, _PackagePlugin_entryPoints_accessor_storage, value, "f"); }
126
- get includeVersion() { return __classPrivateFieldGet(this, _PackagePlugin_includeVersion_accessor_storage, "f"); }
127
- set includeVersion(value) { __classPrivateFieldSet(this, _PackagePlugin_includeVersion_accessor_storage, value, "f"); }
128
- initialize() {
129
- this.owner.on(converter_1.Converter.EVENT_BEGIN, this.onBegin.bind(this));
130
- this.owner.on(converter_1.Converter.EVENT_RESOLVE_BEGIN, this.onBeginResolve.bind(this));
131
- this.owner.on(converter_1.Converter.EVENT_END, () => {
75
+ #readme_accessor_storage = __runInitializers(this, _readme_initializers, void 0);
76
+ get readme() { return this.#readme_accessor_storage; }
77
+ set readme(value) { this.#readme_accessor_storage = value; }
78
+ #entryPointStrategy_accessor_storage = (__runInitializers(this, _readme_extraInitializers), __runInitializers(this, _entryPointStrategy_initializers, void 0));
79
+ get entryPointStrategy() { return this.#entryPointStrategy_accessor_storage; }
80
+ set entryPointStrategy(value) { this.#entryPointStrategy_accessor_storage = value; }
81
+ #entryPoints_accessor_storage = (__runInitializers(this, _entryPointStrategy_extraInitializers), __runInitializers(this, _entryPoints_initializers, void 0));
82
+ get entryPoints() { return this.#entryPoints_accessor_storage; }
83
+ set entryPoints(value) { this.#entryPoints_accessor_storage = value; }
84
+ #includeVersion_accessor_storage = (__runInitializers(this, _entryPoints_extraInitializers), __runInitializers(this, _includeVersion_initializers, void 0));
85
+ get includeVersion() { return this.#includeVersion_accessor_storage; }
86
+ set includeVersion(value) { this.#includeVersion_accessor_storage = value; }
87
+ /**
88
+ * The file name of the found readme.md file.
89
+ */
90
+ readmeFile = __runInitializers(this, _includeVersion_extraInitializers);
91
+ /**
92
+ * Contents of the readme.md file discovered, if any
93
+ */
94
+ readmeContents;
95
+ /**
96
+ * Contents of package.json for the active project
97
+ */
98
+ packageJson;
99
+ constructor(owner) {
100
+ super(owner);
101
+ this.owner.on(ConverterEvents.BEGIN, this.onBegin.bind(this));
102
+ this.owner.on(ConverterEvents.RESOLVE_BEGIN, this.onBeginResolve.bind(this));
103
+ this.owner.on(ConverterEvents.END, () => {
132
104
  delete this.readmeFile;
133
105
  delete this.readmeContents;
134
106
  delete this.packageJson;
135
107
  });
136
- this.application.on(application_events_1.ApplicationEvents.REVIVE, this.onRevive.bind(this));
108
+ this.application.on(ApplicationEvents.REVIVE, this.onRevive.bind(this));
137
109
  }
138
110
  onRevive(project) {
139
111
  this.onBegin();
@@ -146,13 +118,13 @@ let PackagePlugin = (() => {
146
118
  this.readmeFile = undefined;
147
119
  this.readmeContents = undefined;
148
120
  this.packageJson = undefined;
149
- const entryFiles = this.entryPointStrategy === utils_1.EntryPointStrategy.Packages
150
- ? this.entryPoints.map((d) => (0, path_1.join)(d, "package.json"))
121
+ const entryFiles = this.entryPointStrategy === EntryPointStrategy.Packages
122
+ ? this.entryPoints.map((d) => join(d, "package.json"))
151
123
  : this.entryPoints;
152
124
  const dirName = this.application.options.packageDir ??
153
- Path.resolve((0, fs_1.deriveRootDir)(entryFiles));
154
- this.application.logger.verbose(`Begin readme.md/package.json search at ${(0, paths_1.nicePath)(dirName)}`);
155
- this.packageJson = (0, fs_1.discoverPackageJson)(dirName)?.content;
125
+ Path.resolve(deriveRootDir(entryFiles));
126
+ this.application.logger.verbose(`Begin readme.md/package.json search at ${nicePath(dirName)}`);
127
+ this.packageJson = discoverPackageJson(dirName)?.content;
156
128
  // Path will be resolved already. This is kind of ugly, but...
157
129
  if (this.readme.endsWith("none")) {
158
130
  return; // No readme, we're done
@@ -160,16 +132,16 @@ let PackagePlugin = (() => {
160
132
  if (this.readme) {
161
133
  // Readme path provided, read only that file.
162
134
  try {
163
- this.readmeContents = (0, utils_1.readFile)(this.readme);
135
+ this.readmeContents = readFile(this.readme);
164
136
  this.readmeFile = this.readme;
165
137
  }
166
138
  catch {
167
- this.application.logger.error(this.application.i18n.provided_readme_at_0_could_not_be_read((0, paths_1.nicePath)(this.readme)));
139
+ this.application.logger.error(this.application.i18n.provided_readme_at_0_could_not_be_read(nicePath(this.readme)));
168
140
  }
169
141
  }
170
142
  else {
171
143
  // No readme provided, automatically find the readme
172
- const result = (0, fs_1.discoverInParentDir)("readme.md", dirName, (content) => content);
144
+ const result = discoverInParentDir("readme.md", dirName, (content) => content);
173
145
  if (result) {
174
146
  this.readmeFile = result.file;
175
147
  this.readmeContents = result.content;
@@ -181,7 +153,7 @@ let PackagePlugin = (() => {
181
153
  }
182
154
  addEntries(project) {
183
155
  if (this.readmeFile && this.readmeContents) {
184
- const { content } = this.application.converter.parseRawComment(new minimalSourceFile_1.MinimalSourceFile(this.readmeContents, this.readmeFile), project.files);
156
+ const { content } = this.application.converter.parseRawComment(new MinimalSourceFile(this.readmeContents, this.readmeFile), project.files);
185
157
  project.readme = content;
186
158
  }
187
159
  if (this.packageJson) {
@@ -199,26 +171,5 @@ let PackagePlugin = (() => {
199
171
  }
200
172
  }
201
173
  };
202
- _PackagePlugin_readme_accessor_storage = new WeakMap();
203
- _PackagePlugin_entryPointStrategy_accessor_storage = new WeakMap();
204
- _PackagePlugin_entryPoints_accessor_storage = new WeakMap();
205
- _PackagePlugin_includeVersion_accessor_storage = new WeakMap();
206
- __setFunctionName(_classThis, "PackagePlugin");
207
- (() => {
208
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
209
- _readme_decorators = [(0, utils_1.Option)("readme")];
210
- _entryPointStrategy_decorators = [(0, utils_1.Option)("entryPointStrategy")];
211
- _entryPoints_decorators = [(0, utils_1.Option)("entryPoints")];
212
- _includeVersion_decorators = [(0, utils_1.Option)("includeVersion")];
213
- __esDecorate(_classThis, null, _readme_decorators, { kind: "accessor", name: "readme", static: false, private: false, access: { has: obj => "readme" in obj, get: obj => obj.readme, set: (obj, value) => { obj.readme = value; } }, metadata: _metadata }, _readme_initializers, _readme_extraInitializers);
214
- __esDecorate(_classThis, null, _entryPointStrategy_decorators, { kind: "accessor", name: "entryPointStrategy", static: false, private: false, access: { has: obj => "entryPointStrategy" in obj, get: obj => obj.entryPointStrategy, set: (obj, value) => { obj.entryPointStrategy = value; } }, metadata: _metadata }, _entryPointStrategy_initializers, _entryPointStrategy_extraInitializers);
215
- __esDecorate(_classThis, null, _entryPoints_decorators, { kind: "accessor", name: "entryPoints", static: false, private: false, access: { has: obj => "entryPoints" in obj, get: obj => obj.entryPoints, set: (obj, value) => { obj.entryPoints = value; } }, metadata: _metadata }, _entryPoints_initializers, _entryPoints_extraInitializers);
216
- __esDecorate(_classThis, null, _includeVersion_decorators, { kind: "accessor", name: "includeVersion", static: false, private: false, access: { has: obj => "includeVersion" in obj, get: obj => obj.includeVersion, set: (obj, value) => { obj.includeVersion = value; } }, metadata: _metadata }, _includeVersion_initializers, _includeVersion_extraInitializers);
217
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
218
- PackagePlugin = _classThis = _classDescriptor.value;
219
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
220
- __runInitializers(_classThis, _classExtraInitializers);
221
- })();
222
- return PackagePlugin = _classThis;
223
174
  })();
224
- exports.PackagePlugin = PackagePlugin;
175
+ export { PackagePlugin };
@@ -1,4 +1,5 @@
1
- import { ConverterComponent } from "../components";
1
+ import { ConverterComponent } from "../components.js";
2
+ import type { Converter } from "../converter.js";
2
3
  /**
3
4
  * A handler that attaches source file information to reflections.
4
5
  */
@@ -14,10 +15,7 @@ export declare class SourcePlugin extends ConverterComponent {
14
15
  */
15
16
  private fileNames;
16
17
  private repositories?;
17
- /**
18
- * Create a new SourceHandler instance.
19
- */
20
- initialize(): void;
18
+ constructor(owner: Converter);
21
19
  private onEnd;
22
20
  /**
23
21
  * Triggered when the converter has created a declaration reflection.
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
2
  function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
3
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
@@ -33,45 +32,20 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
32
  }
34
33
  return useValue ? value : void 0;
35
34
  };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
41
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
42
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
43
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
44
- };
45
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
46
- if (kind === "m") throw new TypeError("Private method is not writable");
47
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
48
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
49
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
50
- };
51
- var __importDefault = (this && this.__importDefault) || function (mod) {
52
- return (mod && mod.__esModule) ? mod : { "default": mod };
53
- };
54
- Object.defineProperty(exports, "__esModule", { value: true });
55
- exports.SourcePlugin = void 0;
56
- const typescript_1 = __importDefault(require("typescript"));
57
- const index_1 = require("../../models/reflections/index");
58
- const components_1 = require("../components");
59
- const converter_1 = require("../converter");
60
- const utils_1 = require("../../utils");
61
- const nodes_1 = require("../utils/nodes");
62
- const path_1 = require("path");
63
- const models_1 = require("../../models");
64
- const repository_1 = require("../utils/repository");
35
+ import ts from "typescript";
36
+ import { DeclarationReflection, SignatureReflection, } from "../../models/reflections/index.js";
37
+ import { ConverterComponent } from "../components.js";
38
+ import { Option, normalizePath, getCommonDirectory, } from "../../utils/index.js";
39
+ import { isNamedNode } from "../utils/nodes.js";
40
+ import { relative } from "path";
41
+ import { SourceReference } from "../../models/index.js";
42
+ import { gitIsInstalled, RepositoryManager } from "../utils/repository.js";
43
+ import { ConverterEvents } from "../converter-events.js";
65
44
  /**
66
45
  * A handler that attaches source file information to reflections.
67
46
  */
68
47
  let SourcePlugin = (() => {
69
- var _SourcePlugin_disableSources_accessor_storage, _SourcePlugin_gitRevision_accessor_storage, _SourcePlugin_gitRemote_accessor_storage, _SourcePlugin_disableGit_accessor_storage, _SourcePlugin_sourceLinkTemplate_accessor_storage, _SourcePlugin_basePath_accessor_storage;
70
- let _classDecorators = [(0, components_1.Component)({ name: "source" })];
71
- let _classDescriptor;
72
- let _classExtraInitializers = [];
73
- let _classThis;
74
- let _classSuper = components_1.ConverterComponent;
48
+ let _classSuper = ConverterComponent;
75
49
  let _disableSources_decorators;
76
50
  let _disableSources_initializers = [];
77
51
  let _disableSources_extraInitializers = [];
@@ -90,40 +64,52 @@ let SourcePlugin = (() => {
90
64
  let _basePath_decorators;
91
65
  let _basePath_initializers = [];
92
66
  let _basePath_extraInitializers = [];
93
- var SourcePlugin = _classThis = class extends _classSuper {
94
- constructor() {
95
- super(...arguments);
96
- _SourcePlugin_disableSources_accessor_storage.set(this, __runInitializers(this, _disableSources_initializers, void 0));
97
- _SourcePlugin_gitRevision_accessor_storage.set(this, (__runInitializers(this, _disableSources_extraInitializers), __runInitializers(this, _gitRevision_initializers, void 0)));
98
- _SourcePlugin_gitRemote_accessor_storage.set(this, (__runInitializers(this, _gitRevision_extraInitializers), __runInitializers(this, _gitRemote_initializers, void 0)));
99
- _SourcePlugin_disableGit_accessor_storage.set(this, (__runInitializers(this, _gitRemote_extraInitializers), __runInitializers(this, _disableGit_initializers, void 0)));
100
- _SourcePlugin_sourceLinkTemplate_accessor_storage.set(this, (__runInitializers(this, _disableGit_extraInitializers), __runInitializers(this, _sourceLinkTemplate_initializers, void 0)));
101
- _SourcePlugin_basePath_accessor_storage.set(this, (__runInitializers(this, _sourceLinkTemplate_extraInitializers), __runInitializers(this, _basePath_initializers, void 0)));
102
- /**
103
- * All file names to find the base path from.
104
- */
105
- this.fileNames = (__runInitializers(this, _basePath_extraInitializers), new Set());
67
+ return class SourcePlugin extends _classSuper {
68
+ static {
69
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
70
+ _disableSources_decorators = [Option("disableSources")];
71
+ _gitRevision_decorators = [Option("gitRevision")];
72
+ _gitRemote_decorators = [Option("gitRemote")];
73
+ _disableGit_decorators = [Option("disableGit")];
74
+ _sourceLinkTemplate_decorators = [Option("sourceLinkTemplate")];
75
+ _basePath_decorators = [Option("basePath")];
76
+ __esDecorate(this, null, _disableSources_decorators, { kind: "accessor", name: "disableSources", static: false, private: false, access: { has: obj => "disableSources" in obj, get: obj => obj.disableSources, set: (obj, value) => { obj.disableSources = value; } }, metadata: _metadata }, _disableSources_initializers, _disableSources_extraInitializers);
77
+ __esDecorate(this, null, _gitRevision_decorators, { kind: "accessor", name: "gitRevision", static: false, private: false, access: { has: obj => "gitRevision" in obj, get: obj => obj.gitRevision, set: (obj, value) => { obj.gitRevision = value; } }, metadata: _metadata }, _gitRevision_initializers, _gitRevision_extraInitializers);
78
+ __esDecorate(this, null, _gitRemote_decorators, { kind: "accessor", name: "gitRemote", static: false, private: false, access: { has: obj => "gitRemote" in obj, get: obj => obj.gitRemote, set: (obj, value) => { obj.gitRemote = value; } }, metadata: _metadata }, _gitRemote_initializers, _gitRemote_extraInitializers);
79
+ __esDecorate(this, null, _disableGit_decorators, { kind: "accessor", name: "disableGit", static: false, private: false, access: { has: obj => "disableGit" in obj, get: obj => obj.disableGit, set: (obj, value) => { obj.disableGit = value; } }, metadata: _metadata }, _disableGit_initializers, _disableGit_extraInitializers);
80
+ __esDecorate(this, null, _sourceLinkTemplate_decorators, { kind: "accessor", name: "sourceLinkTemplate", static: false, private: false, access: { has: obj => "sourceLinkTemplate" in obj, get: obj => obj.sourceLinkTemplate, set: (obj, value) => { obj.sourceLinkTemplate = value; } }, metadata: _metadata }, _sourceLinkTemplate_initializers, _sourceLinkTemplate_extraInitializers);
81
+ __esDecorate(this, null, _basePath_decorators, { kind: "accessor", name: "basePath", static: false, private: false, access: { has: obj => "basePath" in obj, get: obj => obj.basePath, set: (obj, value) => { obj.basePath = value; } }, metadata: _metadata }, _basePath_initializers, _basePath_extraInitializers);
82
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
106
83
  }
107
- get disableSources() { return __classPrivateFieldGet(this, _SourcePlugin_disableSources_accessor_storage, "f"); }
108
- set disableSources(value) { __classPrivateFieldSet(this, _SourcePlugin_disableSources_accessor_storage, value, "f"); }
109
- get gitRevision() { return __classPrivateFieldGet(this, _SourcePlugin_gitRevision_accessor_storage, "f"); }
110
- set gitRevision(value) { __classPrivateFieldSet(this, _SourcePlugin_gitRevision_accessor_storage, value, "f"); }
111
- get gitRemote() { return __classPrivateFieldGet(this, _SourcePlugin_gitRemote_accessor_storage, "f"); }
112
- set gitRemote(value) { __classPrivateFieldSet(this, _SourcePlugin_gitRemote_accessor_storage, value, "f"); }
113
- get disableGit() { return __classPrivateFieldGet(this, _SourcePlugin_disableGit_accessor_storage, "f"); }
114
- set disableGit(value) { __classPrivateFieldSet(this, _SourcePlugin_disableGit_accessor_storage, value, "f"); }
115
- get sourceLinkTemplate() { return __classPrivateFieldGet(this, _SourcePlugin_sourceLinkTemplate_accessor_storage, "f"); }
116
- set sourceLinkTemplate(value) { __classPrivateFieldSet(this, _SourcePlugin_sourceLinkTemplate_accessor_storage, value, "f"); }
117
- get basePath() { return __classPrivateFieldGet(this, _SourcePlugin_basePath_accessor_storage, "f"); }
118
- set basePath(value) { __classPrivateFieldSet(this, _SourcePlugin_basePath_accessor_storage, value, "f"); }
84
+ #disableSources_accessor_storage = __runInitializers(this, _disableSources_initializers, void 0);
85
+ get disableSources() { return this.#disableSources_accessor_storage; }
86
+ set disableSources(value) { this.#disableSources_accessor_storage = value; }
87
+ #gitRevision_accessor_storage = (__runInitializers(this, _disableSources_extraInitializers), __runInitializers(this, _gitRevision_initializers, void 0));
88
+ get gitRevision() { return this.#gitRevision_accessor_storage; }
89
+ set gitRevision(value) { this.#gitRevision_accessor_storage = value; }
90
+ #gitRemote_accessor_storage = (__runInitializers(this, _gitRevision_extraInitializers), __runInitializers(this, _gitRemote_initializers, void 0));
91
+ get gitRemote() { return this.#gitRemote_accessor_storage; }
92
+ set gitRemote(value) { this.#gitRemote_accessor_storage = value; }
93
+ #disableGit_accessor_storage = (__runInitializers(this, _gitRemote_extraInitializers), __runInitializers(this, _disableGit_initializers, void 0));
94
+ get disableGit() { return this.#disableGit_accessor_storage; }
95
+ set disableGit(value) { this.#disableGit_accessor_storage = value; }
96
+ #sourceLinkTemplate_accessor_storage = (__runInitializers(this, _disableGit_extraInitializers), __runInitializers(this, _sourceLinkTemplate_initializers, void 0));
97
+ get sourceLinkTemplate() { return this.#sourceLinkTemplate_accessor_storage; }
98
+ set sourceLinkTemplate(value) { this.#sourceLinkTemplate_accessor_storage = value; }
99
+ #basePath_accessor_storage = (__runInitializers(this, _sourceLinkTemplate_extraInitializers), __runInitializers(this, _basePath_initializers, void 0));
100
+ get basePath() { return this.#basePath_accessor_storage; }
101
+ set basePath(value) { this.#basePath_accessor_storage = value; }
119
102
  /**
120
- * Create a new SourceHandler instance.
103
+ * All file names to find the base path from.
121
104
  */
122
- initialize() {
123
- this.owner.on(converter_1.Converter.EVENT_END, this.onEnd.bind(this));
124
- this.owner.on(converter_1.Converter.EVENT_CREATE_DECLARATION, this.onDeclaration.bind(this));
125
- this.owner.on(converter_1.Converter.EVENT_CREATE_SIGNATURE, this.onSignature.bind(this));
126
- this.owner.on(converter_1.Converter.EVENT_RESOLVE_BEGIN, this.onBeginResolve.bind(this));
105
+ fileNames = (__runInitializers(this, _basePath_extraInitializers), new Set());
106
+ repositories;
107
+ constructor(owner) {
108
+ super(owner);
109
+ this.owner.on(ConverterEvents.END, this.onEnd.bind(this));
110
+ this.owner.on(ConverterEvents.CREATE_DECLARATION, this.onDeclaration.bind(this));
111
+ this.owner.on(ConverterEvents.CREATE_SIGNATURE, this.onSignature.bind(this));
112
+ this.owner.on(ConverterEvents.RESOLVE_BEGIN, this.onBeginResolve.bind(this));
127
113
  }
128
114
  onEnd() {
129
115
  // Should probably clear repositories/ignoredPaths here, but these aren't likely to change between runs...
@@ -143,28 +129,28 @@ let SourcePlugin = (() => {
143
129
  const symbol = reflection.project.getSymbolFromReflection(reflection);
144
130
  for (const node of symbol?.declarations || []) {
145
131
  const sourceFile = node.getSourceFile();
146
- const fileName = (0, utils_1.normalizePath)(sourceFile.fileName);
132
+ const fileName = normalizePath(sourceFile.fileName);
147
133
  this.fileNames.add(fileName);
148
134
  let position;
149
- if (typescript_1.default.isSourceFile(node)) {
135
+ if (ts.isSourceFile(node)) {
150
136
  position = { character: 0, line: 0 };
151
137
  }
152
138
  else {
153
- position = typescript_1.default.getLineAndCharacterOfPosition(sourceFile, getLocationNode(node).getStart());
139
+ position = ts.getLineAndCharacterOfPosition(sourceFile, getLocationNode(node).getStart());
154
140
  }
155
141
  reflection.sources ||= [];
156
- reflection.sources.push(new models_1.SourceReference(fileName, position.line + 1, position.character));
142
+ reflection.sources.push(new SourceReference(fileName, position.line + 1, position.character));
157
143
  }
158
144
  }
159
145
  onSignature(_context, reflection, sig) {
160
146
  if (this.disableSources || !sig)
161
147
  return;
162
148
  const sourceFile = sig.getSourceFile();
163
- const fileName = (0, utils_1.normalizePath)(sourceFile.fileName);
149
+ const fileName = normalizePath(sourceFile.fileName);
164
150
  this.fileNames.add(fileName);
165
- const position = typescript_1.default.getLineAndCharacterOfPosition(sourceFile, getLocationNode(sig).getStart());
151
+ const position = ts.getLineAndCharacterOfPosition(sourceFile, getLocationNode(sig).getStart());
166
152
  reflection.sources ||= [];
167
- reflection.sources.push(new models_1.SourceReference(fileName, position.line + 1, position.character));
153
+ reflection.sources.push(new SourceReference(fileName, position.line + 1, position.character));
168
154
  }
169
155
  /**
170
156
  * Triggered when the converter begins resolving a project.
@@ -183,63 +169,36 @@ let SourcePlugin = (() => {
183
169
  !this.gitRevision) {
184
170
  this.application.logger.warn(context.i18n.disable_git_set_and_git_revision_used());
185
171
  }
186
- const basePath = this.basePath || (0, utils_1.getCommonDirectory)([...this.fileNames]);
187
- this.repositories ||= new repository_1.RepositoryManager(basePath, this.gitRevision, this.gitRemote, this.sourceLinkTemplate, this.disableGit, this.application.logger);
172
+ const basePath = this.basePath || getCommonDirectory([...this.fileNames]);
173
+ this.repositories ||= new RepositoryManager(basePath, this.gitRevision, this.gitRemote, this.sourceLinkTemplate, this.disableGit, this.application.logger);
188
174
  for (const id in context.project.reflections) {
189
175
  const refl = context.project.reflections[id];
190
- if (!(refl instanceof index_1.DeclarationReflection ||
191
- refl instanceof index_1.SignatureReflection)) {
176
+ if (!(refl instanceof DeclarationReflection ||
177
+ refl instanceof SignatureReflection)) {
192
178
  continue;
193
179
  }
194
180
  if (replaceSourcesWithParentSources(refl)) {
195
181
  refl.sources = refl.parent.sources;
196
182
  }
197
183
  for (const source of refl.sources || []) {
198
- if (this.disableGit || (0, repository_1.gitIsInstalled)()) {
184
+ if (this.disableGit || gitIsInstalled()) {
199
185
  const repo = this.repositories.getRepository(source.fullFileName);
200
186
  source.url = repo?.getURL(source.fullFileName, source.line);
201
187
  }
202
- source.fileName = (0, utils_1.normalizePath)((0, path_1.relative)(basePath, source.fullFileName));
188
+ source.fileName = normalizePath(relative(basePath, source.fullFileName));
203
189
  }
204
190
  }
205
191
  }
206
192
  };
207
- _SourcePlugin_disableSources_accessor_storage = new WeakMap();
208
- _SourcePlugin_gitRevision_accessor_storage = new WeakMap();
209
- _SourcePlugin_gitRemote_accessor_storage = new WeakMap();
210
- _SourcePlugin_disableGit_accessor_storage = new WeakMap();
211
- _SourcePlugin_sourceLinkTemplate_accessor_storage = new WeakMap();
212
- _SourcePlugin_basePath_accessor_storage = new WeakMap();
213
- __setFunctionName(_classThis, "SourcePlugin");
214
- (() => {
215
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
216
- _disableSources_decorators = [(0, utils_1.Option)("disableSources")];
217
- _gitRevision_decorators = [(0, utils_1.Option)("gitRevision")];
218
- _gitRemote_decorators = [(0, utils_1.Option)("gitRemote")];
219
- _disableGit_decorators = [(0, utils_1.Option)("disableGit")];
220
- _sourceLinkTemplate_decorators = [(0, utils_1.Option)("sourceLinkTemplate")];
221
- _basePath_decorators = [(0, utils_1.Option)("basePath")];
222
- __esDecorate(_classThis, null, _disableSources_decorators, { kind: "accessor", name: "disableSources", static: false, private: false, access: { has: obj => "disableSources" in obj, get: obj => obj.disableSources, set: (obj, value) => { obj.disableSources = value; } }, metadata: _metadata }, _disableSources_initializers, _disableSources_extraInitializers);
223
- __esDecorate(_classThis, null, _gitRevision_decorators, { kind: "accessor", name: "gitRevision", static: false, private: false, access: { has: obj => "gitRevision" in obj, get: obj => obj.gitRevision, set: (obj, value) => { obj.gitRevision = value; } }, metadata: _metadata }, _gitRevision_initializers, _gitRevision_extraInitializers);
224
- __esDecorate(_classThis, null, _gitRemote_decorators, { kind: "accessor", name: "gitRemote", static: false, private: false, access: { has: obj => "gitRemote" in obj, get: obj => obj.gitRemote, set: (obj, value) => { obj.gitRemote = value; } }, metadata: _metadata }, _gitRemote_initializers, _gitRemote_extraInitializers);
225
- __esDecorate(_classThis, null, _disableGit_decorators, { kind: "accessor", name: "disableGit", static: false, private: false, access: { has: obj => "disableGit" in obj, get: obj => obj.disableGit, set: (obj, value) => { obj.disableGit = value; } }, metadata: _metadata }, _disableGit_initializers, _disableGit_extraInitializers);
226
- __esDecorate(_classThis, null, _sourceLinkTemplate_decorators, { kind: "accessor", name: "sourceLinkTemplate", static: false, private: false, access: { has: obj => "sourceLinkTemplate" in obj, get: obj => obj.sourceLinkTemplate, set: (obj, value) => { obj.sourceLinkTemplate = value; } }, metadata: _metadata }, _sourceLinkTemplate_initializers, _sourceLinkTemplate_extraInitializers);
227
- __esDecorate(_classThis, null, _basePath_decorators, { kind: "accessor", name: "basePath", static: false, private: false, access: { has: obj => "basePath" in obj, get: obj => obj.basePath, set: (obj, value) => { obj.basePath = value; } }, metadata: _metadata }, _basePath_initializers, _basePath_extraInitializers);
228
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
229
- SourcePlugin = _classThis = _classDescriptor.value;
230
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
231
- __runInitializers(_classThis, _classExtraInitializers);
232
- })();
233
- return SourcePlugin = _classThis;
234
193
  })();
235
- exports.SourcePlugin = SourcePlugin;
194
+ export { SourcePlugin };
236
195
  function getLocationNode(node) {
237
- if ((0, nodes_1.isNamedNode)(node))
196
+ if (isNamedNode(node))
238
197
  return node.name;
239
198
  return node;
240
199
  }
241
200
  function replaceSourcesWithParentSources(refl) {
242
- if (refl instanceof index_1.DeclarationReflection || !refl.sources) {
201
+ if (refl instanceof DeclarationReflection || !refl.sources) {
243
202
  return false;
244
203
  }
245
204
  const symbol = refl.project.getSymbolFromReflection(refl.parent);
@@ -1,14 +1,12 @@
1
- import { DeclarationReflection } from "../../models/reflections/index";
2
- import { ConverterComponent } from "../components";
1
+ import { DeclarationReflection } from "../../models/reflections/index.js";
2
+ import { ConverterComponent } from "../components.js";
3
+ import type { Converter } from "../converter.js";
3
4
  /**
4
5
  * Responsible for adding `implementedBy` / `implementedFrom`
5
6
  */
6
7
  export declare class TypePlugin extends ConverterComponent {
7
8
  reflections: Set<DeclarationReflection>;
8
- /**
9
- * Create a new TypeHandler instance.
10
- */
11
- initialize(): void;
9
+ constructor(owner: Converter);
12
10
  private onRevive;
13
11
  private onResolve;
14
12
  private resolve;