typedoc 0.26.11 → 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 (335) 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 +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 +47 -36
  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.js +6 -13
  276. package/dist/lib/utils/minimalSourceFile.js +5 -7
  277. package/dist/lib/utils/options/declaration.d.ts +33 -7
  278. package/dist/lib/utils/options/declaration.js +20 -22
  279. package/dist/lib/utils/options/defaults.d.ts +3 -2
  280. package/dist/lib/utils/options/defaults.js +18 -38
  281. package/dist/lib/utils/options/help.d.ts +2 -2
  282. package/dist/lib/utils/options/help.js +7 -10
  283. package/dist/lib/utils/options/index.d.ts +6 -6
  284. package/dist/lib/utils/options/index.js +4 -18
  285. package/dist/lib/utils/options/options.d.ts +8 -5
  286. package/dist/lib/utils/options/options.js +47 -71
  287. package/dist/lib/utils/options/readers/arguments.d.ts +2 -2
  288. package/dist/lib/utils/options/readers/arguments.js +15 -17
  289. package/dist/lib/utils/options/readers/index.d.ts +4 -4
  290. package/dist/lib/utils/options/readers/index.js +4 -11
  291. package/dist/lib/utils/options/readers/package-json.d.ts +3 -3
  292. package/dist/lib/utils/options/readers/package-json.js +15 -21
  293. package/dist/lib/utils/options/readers/tsconfig.d.ts +2 -2
  294. package/dist/lib/utils/options/readers/tsconfig.js +54 -63
  295. package/dist/lib/utils/options/readers/typedoc.d.ts +3 -3
  296. package/dist/lib/utils/options/readers/typedoc.js +44 -76
  297. package/dist/lib/utils/options/sources/index.d.ts +1 -1
  298. package/dist/lib/utils/options/sources/index.js +1 -5
  299. package/dist/lib/utils/options/sources/typedoc.d.ts +1 -1
  300. package/dist/lib/utils/options/sources/typedoc.js +220 -196
  301. package/dist/lib/utils/options/tsdoc-defaults.d.ts +3 -3
  302. package/dist/lib/utils/options/tsdoc-defaults.js +16 -12
  303. package/dist/lib/utils/package-manifest.d.ts +1 -1
  304. package/dist/lib/utils/package-manifest.js +15 -19
  305. package/dist/lib/utils/paths.js +9 -15
  306. package/dist/lib/utils/perf.js +6 -11
  307. package/dist/lib/utils/plugins.d.ts +1 -1
  308. package/dist/lib/utils/plugins.js +7 -10
  309. package/dist/lib/utils/reflections.d.ts +1 -1
  310. package/dist/lib/utils/reflections.js +9 -12
  311. package/dist/lib/utils/set.js +2 -6
  312. package/dist/lib/utils/sort.d.ts +3 -3
  313. package/dist/lib/utils/sort.js +20 -24
  314. package/dist/lib/utils/tsconfig.d.ts +1 -1
  315. package/dist/lib/utils/tsconfig.js +13 -21
  316. package/dist/lib/utils/tsutils.d.ts +1 -1
  317. package/dist/lib/utils/tsutils.js +3 -30
  318. package/dist/lib/utils/validation.js +6 -12
  319. package/dist/lib/validation/documentation.d.ts +2 -2
  320. package/dist/lib/validation/documentation.js +26 -29
  321. package/dist/lib/validation/exports.d.ts +2 -2
  322. package/dist/lib/validation/exports.js +9 -11
  323. package/dist/lib/validation/links.d.ts +2 -2
  324. package/dist/lib/validation/links.js +4 -7
  325. package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
  326. package/dist/lib/validation/unusedMergeModuleWith.js +11 -0
  327. package/package.json +14 -11
  328. package/static/main.js +4 -4
  329. package/static/style.css +91 -2
  330. package/tsdoc.json +30 -0
  331. package/dist/lib/output/themes/default/partials/member.reference.d.ts +0 -4
  332. package/dist/lib/output/themes/default/partials/member.reference.js +0 -30
  333. package/dist/lib/output/themes/default/partials/parameter.d.ts +0 -4
  334. package/dist/lib/output/themes/default/partials/parameter.js +0 -79
  335. package/dist/lib/utils/html-entities.json +0 -2326
@@ -1,361 +1,295 @@
1
- "use strict";
2
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
- var _, done = false;
8
- for (var i = decorators.length - 1; i >= 0; i--) {
9
- var context = {};
10
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
- if (kind === "accessor") {
15
- if (result === void 0) continue;
16
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
- if (_ = accept(result.get)) descriptor.get = _;
18
- if (_ = accept(result.set)) descriptor.set = _;
19
- if (_ = accept(result.init)) initializers.unshift(_);
20
- }
21
- else if (_ = accept(result)) {
22
- if (kind === "field") initializers.unshift(_);
23
- else descriptor[key] = _;
24
- }
25
- }
26
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
- done = true;
28
- };
29
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
- var useValue = arguments.length > 2;
31
- for (var i = 0; i < initializers.length; i++) {
32
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
- }
34
- return useValue ? value : void 0;
35
- };
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 __importDefault = (this && this.__importDefault) || function (mod) {
41
- return (mod && mod.__esModule) ? mod : { "default": mod };
42
- };
43
- Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.ImplementsPlugin = void 0;
45
- const typescript_1 = __importDefault(require("typescript"));
46
- const application_events_1 = require("../../application-events");
47
- const index_1 = require("../../models/reflections/index");
48
- const types_1 = require("../../models/types");
49
- const array_1 = require("../../utils/array");
50
- const components_1 = require("../components");
51
- const converter_1 = require("../converter");
52
- const utils_1 = require("../../utils");
1
+ import ts from "typescript";
2
+ import { ApplicationEvents } from "../../application-events.js";
3
+ import { DeclarationReflection, ReflectionFlag, ReflectionKind, SignatureReflection, } from "../../models/reflections/index.js";
4
+ import { ReferenceType, ReflectionType, } from "../../models/types.js";
5
+ import { filterMap, zip } from "../../utils/array.js";
6
+ import { ConverterComponent } from "../components.js";
7
+ import { getHumanName } from "../../utils/index.js";
8
+ import { ConverterEvents } from "../converter-events.js";
53
9
  /**
54
10
  * A plugin that detects interface implementations of functions and
55
11
  * properties on classes and links them.
56
12
  */
57
- let ImplementsPlugin = (() => {
58
- let _classDecorators = [(0, components_1.Component)({ name: "implements" })];
59
- let _classDescriptor;
60
- let _classExtraInitializers = [];
61
- let _classThis;
62
- let _classSuper = components_1.ConverterComponent;
63
- var ImplementsPlugin = _classThis = class extends _classSuper {
64
- constructor() {
65
- super(...arguments);
66
- this.resolved = new WeakSet();
67
- this.postponed = new WeakMap();
68
- this.revivingSerialized = false;
69
- }
70
- /**
71
- * Create a new ImplementsPlugin instance.
72
- */
73
- initialize() {
74
- this.owner.on(converter_1.Converter.EVENT_RESOLVE_END, this.onResolveEnd.bind(this));
75
- this.owner.on(converter_1.Converter.EVENT_CREATE_DECLARATION, this.onDeclaration.bind(this), -1000);
76
- this.owner.on(converter_1.Converter.EVENT_CREATE_SIGNATURE, this.onSignature.bind(this), 1000);
77
- this.application.on(application_events_1.ApplicationEvents.REVIVE, this.onRevive.bind(this));
13
+ export class ImplementsPlugin extends ConverterComponent {
14
+ resolved = new WeakSet();
15
+ postponed = new WeakMap();
16
+ revivingSerialized = false;
17
+ constructor(owner) {
18
+ super(owner);
19
+ this.owner.on(ConverterEvents.RESOLVE_END, this.onResolveEnd.bind(this));
20
+ this.owner.on(ConverterEvents.CREATE_DECLARATION, this.onDeclaration.bind(this), -1000);
21
+ this.owner.on(ConverterEvents.CREATE_SIGNATURE, this.onSignature.bind(this), 1000);
22
+ this.application.on(ApplicationEvents.REVIVE, this.onRevive.bind(this));
23
+ }
24
+ /**
25
+ * Mark all members of the given class to be the implementation of the matching interface member.
26
+ */
27
+ analyzeImplements(project, classReflection, interfaceReflection) {
28
+ this.handleInheritedComments(classReflection, interfaceReflection);
29
+ if (!interfaceReflection.children) {
30
+ return;
78
31
  }
79
- /**
80
- * Mark all members of the given class to be the implementation of the matching interface member.
81
- */
82
- analyzeImplements(project, classReflection, interfaceReflection) {
83
- this.handleInheritedComments(classReflection, interfaceReflection);
84
- if (!interfaceReflection.children) {
32
+ interfaceReflection.children.forEach((interfaceMember) => {
33
+ const classMember = findMatchingMember(interfaceMember, classReflection);
34
+ if (!classMember) {
85
35
  return;
86
36
  }
87
- interfaceReflection.children.forEach((interfaceMember) => {
88
- const classMember = findMatchingMember(interfaceMember, classReflection);
89
- if (!classMember) {
90
- return;
91
- }
92
- const interfaceMemberName = interfaceReflection.name + "." + interfaceMember.name;
93
- classMember.implementationOf =
94
- types_1.ReferenceType.createResolvedReference(interfaceMemberName, interfaceMember, project);
95
- const intSigs = interfaceMember.signatures ||
96
- interfaceMember.type?.visit({
97
- reflection: (r) => r.declaration.signatures,
98
- });
99
- const clsSigs = classMember.signatures ||
100
- classMember.type?.visit({
101
- reflection: (r) => r.declaration.signatures,
102
- });
103
- if (intSigs && clsSigs) {
104
- for (const [clsSig, intSig] of (0, array_1.zip)(clsSigs, intSigs)) {
105
- if (clsSig.implementationOf) {
106
- const target = intSig.parent.kindOf(index_1.ReflectionKind.FunctionOrMethod)
107
- ? intSig
108
- : intSig.parent.parent;
109
- clsSig.implementationOf =
110
- types_1.ReferenceType.createResolvedReference(clsSig.implementationOf.name, target, project);
111
- }
37
+ const interfaceMemberName = interfaceReflection.name + "." + interfaceMember.name;
38
+ classMember.implementationOf =
39
+ ReferenceType.createResolvedReference(interfaceMemberName, interfaceMember, project);
40
+ const intSigs = interfaceMember.signatures ||
41
+ interfaceMember.type?.visit({
42
+ reflection: (r) => r.declaration.signatures,
43
+ });
44
+ const clsSigs = classMember.signatures ||
45
+ classMember.type?.visit({
46
+ reflection: (r) => r.declaration.signatures,
47
+ });
48
+ if (intSigs && clsSigs) {
49
+ for (const [clsSig, intSig] of zip(clsSigs, intSigs)) {
50
+ if (clsSig.implementationOf) {
51
+ const target = intSig.parent.kindOf(ReflectionKind.FunctionOrMethod)
52
+ ? intSig
53
+ : intSig.parent.parent;
54
+ clsSig.implementationOf =
55
+ ReferenceType.createResolvedReference(clsSig.implementationOf.name, target, project);
112
56
  }
113
57
  }
114
- this.handleInheritedComments(classMember, interfaceMember);
115
- });
116
- }
117
- analyzeInheritance(project, reflection) {
118
- const extendedTypes = (0, array_1.filterMap)(reflection.extendedTypes ?? [], (type) => {
119
- return type instanceof types_1.ReferenceType &&
120
- type.reflection instanceof index_1.DeclarationReflection
121
- ? type
122
- : void 0;
123
- });
124
- for (const parent of extendedTypes) {
125
- this.handleInheritedComments(reflection, parent.reflection);
126
- for (const parentMember of parent.reflection.children ?? []) {
127
- const child = findMatchingMember(parentMember, reflection);
128
- if (child) {
129
- const key = child.overwrites
130
- ? "overwrites"
131
- : "inheritedFrom";
132
- for (const [childSig, parentSig] of (0, array_1.zip)(child.signatures ?? [], parentMember.signatures ?? [])) {
133
- childSig[key] = types_1.ReferenceType.createResolvedReference(`${parent.name}.${parentMember.name}`, parentSig, project);
134
- }
135
- child[key] = types_1.ReferenceType.createResolvedReference(`${parent.name}.${parentMember.name}`, parentMember, project);
136
- this.handleInheritedComments(child, parentMember);
58
+ }
59
+ this.handleInheritedComments(classMember, interfaceMember);
60
+ });
61
+ }
62
+ analyzeInheritance(project, reflection) {
63
+ const extendedTypes = filterMap(reflection.extendedTypes ?? [], (type) => {
64
+ return type instanceof ReferenceType &&
65
+ type.reflection instanceof DeclarationReflection
66
+ ? type
67
+ : void 0;
68
+ });
69
+ for (const parent of extendedTypes) {
70
+ this.handleInheritedComments(reflection, parent.reflection);
71
+ for (const parentMember of parent.reflection.children ?? []) {
72
+ const child = findMatchingMember(parentMember, reflection);
73
+ if (child) {
74
+ const key = child.overwrites
75
+ ? "overwrites"
76
+ : "inheritedFrom";
77
+ for (const [childSig, parentSig] of zip(child.signatures ?? [], parentMember.signatures ?? [])) {
78
+ childSig[key] = ReferenceType.createResolvedReference(`${parent.name}.${parentMember.name}`, parentSig, project);
137
79
  }
80
+ child[key] = ReferenceType.createResolvedReference(`${parent.name}.${parentMember.name}`, parentMember, project);
81
+ this.handleInheritedComments(child, parentMember);
138
82
  }
139
83
  }
140
84
  }
141
- onResolveEnd(context) {
142
- this.resolve(context.project);
85
+ }
86
+ onResolveEnd(context) {
87
+ this.resolve(context.project);
88
+ }
89
+ onRevive(project) {
90
+ this.revivingSerialized = true;
91
+ this.resolve(project);
92
+ this.revivingSerialized = false;
93
+ }
94
+ resolve(project) {
95
+ for (const id in project.reflections) {
96
+ const refl = project.reflections[id];
97
+ if (refl instanceof DeclarationReflection) {
98
+ this.tryResolve(project, refl);
99
+ }
143
100
  }
144
- onRevive(project) {
145
- this.revivingSerialized = true;
146
- this.resolve(project);
147
- this.revivingSerialized = false;
101
+ }
102
+ tryResolve(project, reflection) {
103
+ const requirements = filterMap([
104
+ ...(reflection.implementedTypes ?? []),
105
+ ...(reflection.extendedTypes ?? []),
106
+ ], (type) => {
107
+ return type instanceof ReferenceType ? type.reflection : void 0;
108
+ });
109
+ if (requirements.every((req) => this.resolved.has(req))) {
110
+ this.doResolve(project, reflection);
111
+ this.resolved.add(reflection);
112
+ for (const refl of this.postponed.get(reflection) ?? []) {
113
+ this.tryResolve(project, refl);
114
+ }
115
+ this.postponed.delete(reflection);
148
116
  }
149
- resolve(project) {
150
- for (const id in project.reflections) {
151
- const refl = project.reflections[id];
152
- if (refl instanceof index_1.DeclarationReflection) {
153
- this.tryResolve(project, refl);
154
- }
117
+ else {
118
+ for (const req of requirements) {
119
+ const future = this.postponed.get(req) ?? new Set();
120
+ future.add(reflection);
121
+ this.postponed.set(req, future);
155
122
  }
156
123
  }
157
- tryResolve(project, reflection) {
158
- const requirements = (0, array_1.filterMap)([
159
- ...(reflection.implementedTypes ?? []),
160
- ...(reflection.extendedTypes ?? []),
161
- ], (type) => {
162
- return type instanceof types_1.ReferenceType ? type.reflection : void 0;
163
- });
164
- if (requirements.every((req) => this.resolved.has(req))) {
165
- this.doResolve(project, reflection);
166
- this.resolved.add(reflection);
167
- for (const refl of this.postponed.get(reflection) ?? []) {
168
- this.tryResolve(project, refl);
124
+ }
125
+ doResolve(project, reflection) {
126
+ if (reflection.kindOf(ReflectionKind.Class) &&
127
+ reflection.implementedTypes) {
128
+ reflection.implementedTypes.forEach((type) => {
129
+ if (!(type instanceof ReferenceType)) {
130
+ return;
169
131
  }
170
- this.postponed.delete(reflection);
171
- }
172
- else {
173
- for (const req of requirements) {
174
- const future = this.postponed.get(req) ?? new Set();
175
- future.add(reflection);
176
- this.postponed.set(req, future);
132
+ if (type.reflection &&
133
+ type.reflection.kindOf(ReflectionKind.ClassOrInterface)) {
134
+ this.analyzeImplements(project, reflection, type.reflection);
177
135
  }
178
- }
136
+ });
179
137
  }
180
- doResolve(project, reflection) {
181
- if (reflection.kindOf(index_1.ReflectionKind.Class) &&
182
- reflection.implementedTypes) {
183
- reflection.implementedTypes.forEach((type) => {
184
- if (!(type instanceof types_1.ReferenceType)) {
185
- return;
186
- }
187
- if (type.reflection &&
188
- type.reflection.kindOf(index_1.ReflectionKind.ClassOrInterface)) {
189
- this.analyzeImplements(project, reflection, type.reflection);
190
- }
191
- });
192
- }
193
- if (reflection.kindOf(index_1.ReflectionKind.ClassOrInterface) &&
194
- reflection.extendedTypes) {
195
- this.analyzeInheritance(project, reflection);
196
- }
138
+ if (reflection.kindOf(ReflectionKind.ClassOrInterface) &&
139
+ reflection.extendedTypes) {
140
+ this.analyzeInheritance(project, reflection);
197
141
  }
198
- getExtensionInfo(context, reflection) {
199
- if (!reflection || !reflection.kindOf(index_1.ReflectionKind.Inheritable)) {
200
- return;
201
- }
202
- // Need this because we re-use reflections for type literals.
203
- if (!reflection.parent?.kindOf(index_1.ReflectionKind.ClassOrInterface)) {
204
- return;
205
- }
206
- const symbol = context.project.getSymbolFromReflection(reflection.parent);
207
- if (!symbol) {
208
- return;
209
- }
210
- const declaration = symbol
211
- .getDeclarations()
212
- ?.find((n) => typescript_1.default.isClassDeclaration(n) || typescript_1.default.isInterfaceDeclaration(n));
213
- if (!declaration) {
214
- return;
215
- }
216
- return { symbol, declaration };
142
+ }
143
+ getExtensionInfo(context, reflection) {
144
+ if (!reflection || !reflection.kindOf(ReflectionKind.Inheritable)) {
145
+ return;
217
146
  }
218
- onSignature(context, reflection) {
219
- this.onDeclaration(context, reflection.parent);
147
+ // Need this because we re-use reflections for type literals.
148
+ if (!reflection.parent?.kindOf(ReflectionKind.ClassOrInterface)) {
149
+ return;
220
150
  }
221
- /**
222
- * Responsible for setting the {@link DeclarationReflection.inheritedFrom},
223
- * {@link DeclarationReflection.overwrites}, and {@link DeclarationReflection.implementationOf}
224
- * properties on the provided reflection temporarily, these links will be replaced
225
- * during the resolve step with links which actually point to the right place.
226
- */
227
- onDeclaration(context, reflection) {
228
- const info = this.getExtensionInfo(context, reflection);
229
- if (!info) {
230
- return;
231
- }
232
- if (reflection.kind === index_1.ReflectionKind.Constructor) {
233
- const ctor = info.declaration.members.find(typescript_1.default.isConstructorDeclaration);
234
- constructorInheritance(context, reflection, info.declaration, ctor);
235
- return;
236
- }
237
- const childType = reflection.flags.isStatic
238
- ? context.checker.getTypeOfSymbolAtLocation(info.symbol, info.declaration)
239
- : context.checker.getDeclaredTypeOfSymbol(info.symbol);
240
- const property = findProperty(reflection, childType);
241
- if (!property) {
242
- // We're probably broken... but I don't think this should be fatal.
243
- context.logger.warn(`Failed to retrieve${reflection.flags.isStatic ? " static" : ""} member "${reflection.escapedName ?? reflection.name}" of "${reflection.parent?.name}" for inheritance analysis. Please report a bug.`);
244
- return;
151
+ const symbol = context.project.getSymbolFromReflection(reflection.parent);
152
+ if (!symbol) {
153
+ return;
154
+ }
155
+ const declaration = symbol
156
+ .getDeclarations()
157
+ ?.find((n) => ts.isClassDeclaration(n) || ts.isInterfaceDeclaration(n));
158
+ if (!declaration) {
159
+ return;
160
+ }
161
+ return { symbol, declaration };
162
+ }
163
+ onSignature(context, reflection) {
164
+ this.onDeclaration(context, reflection.parent);
165
+ }
166
+ /**
167
+ * Responsible for setting the {@link DeclarationReflection.inheritedFrom},
168
+ * {@link DeclarationReflection.overwrites}, and {@link DeclarationReflection.implementationOf}
169
+ * properties on the provided reflection temporarily, these links will be replaced
170
+ * during the resolve step with links which actually point to the right place.
171
+ */
172
+ onDeclaration(context, reflection) {
173
+ const info = this.getExtensionInfo(context, reflection);
174
+ if (!info) {
175
+ return;
176
+ }
177
+ if (reflection.kind === ReflectionKind.Constructor) {
178
+ const ctor = info.declaration.members.find(ts.isConstructorDeclaration);
179
+ constructorInheritance(context, reflection, info.declaration, ctor);
180
+ return;
181
+ }
182
+ const childType = reflection.flags.isStatic
183
+ ? context.checker.getTypeOfSymbolAtLocation(info.symbol, info.declaration)
184
+ : context.checker.getDeclaredTypeOfSymbol(info.symbol);
185
+ const property = findProperty(reflection, childType);
186
+ if (!property) {
187
+ // We're probably broken... but I don't think this should be fatal.
188
+ context.logger.warn(`Failed to retrieve${reflection.flags.isStatic ? " static" : ""} member "${reflection.escapedName ?? reflection.name}" of "${reflection.parent?.name}" for inheritance analysis. Please report a bug.`);
189
+ return;
190
+ }
191
+ // Need to check both extends and implements clauses.
192
+ out: for (const clause of info.declaration.heritageClauses ?? []) {
193
+ // No point checking implemented types for static members, they won't exist.
194
+ if (reflection.flags.isStatic &&
195
+ clause.token === ts.SyntaxKind.ImplementsKeyword) {
196
+ continue;
245
197
  }
246
- // Need to check both extends and implements clauses.
247
- out: for (const clause of info.declaration.heritageClauses ?? []) {
248
- // No point checking implemented types for static members, they won't exist.
249
- if (reflection.flags.isStatic &&
250
- clause.token === typescript_1.default.SyntaxKind.ImplementsKeyword) {
251
- continue;
252
- }
253
- for (const expr of clause.types) {
254
- const parentType = context.checker.getTypeAtLocation(reflection.flags.isStatic ? expr.expression : expr);
255
- const parentProperty = findProperty(reflection, parentType);
256
- if (parentProperty) {
257
- const isInherit = property
258
- .getDeclarations()
259
- ?.some((d) => d.parent !== info.declaration) ??
260
- true;
261
- createLink(context, reflection, clause, expr, parentProperty, isInherit);
262
- // Can't always break because we need to also set `implementationOf` if we
263
- // inherit from a base class and also implement an interface.
264
- if (clause.token === typescript_1.default.SyntaxKind.ImplementsKeyword) {
265
- break out;
266
- }
198
+ for (const expr of clause.types) {
199
+ const parentType = context.checker.getTypeAtLocation(reflection.flags.isStatic ? expr.expression : expr);
200
+ const parentProperty = findProperty(reflection, parentType);
201
+ if (parentProperty) {
202
+ const isInherit = property
203
+ .getDeclarations()
204
+ ?.some((d) => d.parent !== info.declaration) ??
205
+ true;
206
+ createLink(context, reflection, clause, expr, parentProperty, isInherit);
207
+ // Can't always break because we need to also set `implementationOf` if we
208
+ // inherit from a base class and also implement an interface.
209
+ if (clause.token === ts.SyntaxKind.ImplementsKeyword) {
210
+ break out;
267
211
  }
268
212
  }
269
213
  }
270
214
  }
271
- /**
272
- * Responsible for copying comments from "parent" reflections defined
273
- * in either a base class or implemented interface to the child class.
274
- */
275
- handleInheritedComments(child, parent) {
276
- this.copyComment(child, parent);
277
- if (parent.kindOf(index_1.ReflectionKind.Property) &&
278
- child.kindOf(index_1.ReflectionKind.Accessor)) {
279
- if (child.getSignature) {
280
- this.copyComment(child.getSignature, parent);
281
- child.getSignature.implementationOf = child.implementationOf;
282
- }
283
- if (child.setSignature) {
284
- this.copyComment(child.setSignature, parent);
285
- child.setSignature.implementationOf = child.implementationOf;
286
- }
215
+ }
216
+ /**
217
+ * Responsible for copying comments from "parent" reflections defined
218
+ * in either a base class or implemented interface to the child class.
219
+ */
220
+ handleInheritedComments(child, parent) {
221
+ this.copyComment(child, parent);
222
+ if (parent.kindOf(ReflectionKind.Property) &&
223
+ child.kindOf(ReflectionKind.Accessor)) {
224
+ if (child.getSignature) {
225
+ this.copyComment(child.getSignature, parent);
226
+ child.getSignature.implementationOf = child.implementationOf;
287
227
  }
288
- if (parent.kindOf(index_1.ReflectionKind.Accessor) &&
289
- child.kindOf(index_1.ReflectionKind.Accessor)) {
290
- if (parent.getSignature && child.getSignature) {
291
- this.copyComment(child.getSignature, parent.getSignature);
292
- }
293
- if (parent.setSignature && child.setSignature) {
294
- this.copyComment(child.setSignature, parent.setSignature);
295
- }
228
+ if (child.setSignature) {
229
+ this.copyComment(child.setSignature, parent);
230
+ child.setSignature.implementationOf = child.implementationOf;
296
231
  }
297
- if (parent.kindOf(index_1.ReflectionKind.FunctionOrMethod) &&
298
- parent.signatures &&
299
- child.signatures) {
300
- for (const [cs, ps] of (0, array_1.zip)(child.signatures, parent.signatures)) {
301
- this.copyComment(cs, ps);
302
- }
232
+ }
233
+ if (parent.kindOf(ReflectionKind.Accessor) &&
234
+ child.kindOf(ReflectionKind.Accessor)) {
235
+ if (parent.getSignature && child.getSignature) {
236
+ this.copyComment(child.getSignature, parent.getSignature);
303
237
  }
304
- else if (parent.kindOf(index_1.ReflectionKind.Property) &&
305
- parent.type instanceof types_1.ReflectionType &&
306
- parent.type.declaration.signatures &&
307
- child.signatures) {
308
- for (const [cs, ps] of (0, array_1.zip)(child.signatures, parent.type.declaration.signatures)) {
309
- this.copyComment(cs, ps);
310
- }
238
+ if (parent.setSignature && child.setSignature) {
239
+ this.copyComment(child.setSignature, parent.setSignature);
311
240
  }
312
241
  }
313
- /**
314
- * Copy the comment of the source reflection to the target reflection with a JSDoc style copy
315
- * function. The TSDoc copy function is in the InheritDocPlugin.
316
- */
317
- copyComment(target, source) {
318
- if (!shouldCopyComment(target, source, this.revivingSerialized)) {
319
- return;
242
+ if (parent.kindOf(ReflectionKind.FunctionOrMethod) &&
243
+ parent.signatures &&
244
+ child.signatures) {
245
+ for (const [cs, ps] of zip(child.signatures, parent.signatures)) {
246
+ this.copyComment(cs, ps);
320
247
  }
321
- target.comment = source.comment.clone();
322
- if (target instanceof index_1.DeclarationReflection &&
323
- source instanceof index_1.DeclarationReflection) {
324
- for (const [tt, ts] of (0, array_1.zip)(target.typeParameters || [], source.typeParameters || [])) {
325
- this.copyComment(tt, ts);
326
- }
248
+ }
249
+ else if (parent.kindOf(ReflectionKind.Property) &&
250
+ parent.type instanceof ReflectionType &&
251
+ parent.type.declaration.signatures &&
252
+ child.signatures) {
253
+ for (const [cs, ps] of zip(child.signatures, parent.type.declaration.signatures)) {
254
+ this.copyComment(cs, ps);
327
255
  }
328
- if (target instanceof index_1.SignatureReflection &&
329
- source instanceof index_1.SignatureReflection) {
330
- for (const [tt, ts] of (0, array_1.zip)(target.typeParameters || [], source.typeParameters || [])) {
331
- this.copyComment(tt, ts);
332
- }
333
- for (const [pt, ps] of (0, array_1.zip)(target.parameters || [], source.parameters || [])) {
334
- this.copyComment(pt, ps);
335
- }
256
+ }
257
+ }
258
+ /**
259
+ * Copy the comment of the source reflection to the target reflection with a JSDoc style copy
260
+ * function. The TSDoc copy function is in the InheritDocPlugin.
261
+ */
262
+ copyComment(target, source) {
263
+ if (!shouldCopyComment(target, source, this.revivingSerialized)) {
264
+ return;
265
+ }
266
+ target.comment = source.comment.clone();
267
+ if (target instanceof DeclarationReflection &&
268
+ source instanceof DeclarationReflection) {
269
+ for (const [tt, ts] of zip(target.typeParameters || [], source.typeParameters || [])) {
270
+ this.copyComment(tt, ts);
336
271
  }
337
272
  }
338
- };
339
- __setFunctionName(_classThis, "ImplementsPlugin");
340
- (() => {
341
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
342
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
343
- ImplementsPlugin = _classThis = _classDescriptor.value;
344
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
345
- __runInitializers(_classThis, _classExtraInitializers);
346
- })();
347
- return ImplementsPlugin = _classThis;
348
- })();
349
- exports.ImplementsPlugin = ImplementsPlugin;
273
+ if (target instanceof SignatureReflection &&
274
+ source instanceof SignatureReflection) {
275
+ for (const [tt, ts] of zip(target.typeParameters || [], source.typeParameters || [])) {
276
+ this.copyComment(tt, ts);
277
+ }
278
+ for (const [pt, ps] of zip(target.parameters || [], source.parameters || [])) {
279
+ this.copyComment(pt, ps);
280
+ }
281
+ }
282
+ }
283
+ }
350
284
  function constructorInheritance(context, reflection, childDecl, constructorDecl) {
351
- const extendsClause = childDecl.heritageClauses?.find((cl) => cl.token === typescript_1.default.SyntaxKind.ExtendsKeyword);
285
+ const extendsClause = childDecl.heritageClauses?.find((cl) => cl.token === ts.SyntaxKind.ExtendsKeyword);
352
286
  if (!extendsClause)
353
287
  return;
354
288
  const name = `${extendsClause.types[0].getText()}.constructor`;
355
289
  const key = constructorDecl ? "overwrites" : "inheritedFrom";
356
- reflection[key] ??= types_1.ReferenceType.createBrokenReference(name, context.project);
290
+ reflection[key] ??= ReferenceType.createBrokenReference(name, context.project);
357
291
  for (const sig of reflection.signatures ?? []) {
358
- sig[key] ??= types_1.ReferenceType.createBrokenReference(name, context.project);
292
+ sig[key] ??= ReferenceType.createBrokenReference(name, context.project);
359
293
  }
360
294
  }
361
295
  function findProperty(reflection, parent) {
@@ -367,7 +301,7 @@ function findProperty(reflection, parent) {
367
301
  }
368
302
  function createLink(context, reflection, clause, expr, symbol, isInherit) {
369
303
  const project = context.project;
370
- const name = `${expr.expression.getText()}.${(0, utils_1.getHumanName)(symbol.name)}`;
304
+ const name = `${expr.expression.getText()}.${getHumanName(symbol.name)}`;
371
305
  link(reflection);
372
306
  link(reflection.getSignature);
373
307
  link(reflection.setSignature);
@@ -384,16 +318,16 @@ function createLink(context, reflection, clause, expr, symbol, isInherit) {
384
318
  function link(target) {
385
319
  if (!target)
386
320
  return;
387
- if (clause.token === typescript_1.default.SyntaxKind.ImplementsKeyword) {
388
- target.implementationOf ??= types_1.ReferenceType.createBrokenReference(name, project);
321
+ if (clause.token === ts.SyntaxKind.ImplementsKeyword) {
322
+ target.implementationOf ??= ReferenceType.createBrokenReference(name, project);
389
323
  return;
390
324
  }
391
325
  if (isInherit) {
392
- target.setFlag(index_1.ReflectionFlag.Inherited);
393
- target.inheritedFrom ??= types_1.ReferenceType.createBrokenReference(name, project);
326
+ target.setFlag(ReflectionFlag.Inherited);
327
+ target.inheritedFrom ??= ReferenceType.createBrokenReference(name, project);
394
328
  }
395
329
  else {
396
- target.overwrites ??= types_1.ReferenceType.createBrokenReference(name, project);
330
+ target.overwrites ??= ReferenceType.createBrokenReference(name, project);
397
331
  }
398
332
  }
399
333
  }