@depup/typedoc 0.28.17-depup.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 (390) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +34 -0
  3. package/bin/package.json +3 -0
  4. package/bin/typedoc +24 -0
  5. package/changes.json +22 -0
  6. package/dist/browser-locales/de.d.ts +2 -0
  7. package/dist/browser-locales/de.js +62 -0
  8. package/dist/browser-locales/en.d.ts +2 -0
  9. package/dist/browser-locales/en.js +62 -0
  10. package/dist/browser-locales/ja.d.ts +2 -0
  11. package/dist/browser-locales/ja.js +62 -0
  12. package/dist/browser-locales/ko.d.ts +2 -0
  13. package/dist/browser-locales/ko.js +62 -0
  14. package/dist/browser-locales/zh.d.ts +2 -0
  15. package/dist/browser-locales/zh.js +62 -0
  16. package/dist/browser-utils.d.ts +3 -0
  17. package/dist/browser-utils.js +3 -0
  18. package/dist/index.d.ts +49 -0
  19. package/dist/index.js +46 -0
  20. package/dist/lib/application-events.d.ts +5 -0
  21. package/dist/lib/application-events.js +5 -0
  22. package/dist/lib/application.d.ts +195 -0
  23. package/dist/lib/application.js +715 -0
  24. package/dist/lib/cli.d.ts +1 -0
  25. package/dist/lib/cli.js +111 -0
  26. package/dist/lib/converter/comments/blockLexer.d.ts +4 -0
  27. package/dist/lib/converter/comments/blockLexer.js +391 -0
  28. package/dist/lib/converter/comments/declarationReferenceResolver.d.ts +3 -0
  29. package/dist/lib/converter/comments/declarationReferenceResolver.js +218 -0
  30. package/dist/lib/converter/comments/discovery.d.ts +14 -0
  31. package/dist/lib/converter/comments/discovery.js +563 -0
  32. package/dist/lib/converter/comments/index.d.ts +37 -0
  33. package/dist/lib/converter/comments/index.js +241 -0
  34. package/dist/lib/converter/comments/lexer.d.ts +17 -0
  35. package/dist/lib/converter/comments/lexer.js +10 -0
  36. package/dist/lib/converter/comments/lineLexer.d.ts +3 -0
  37. package/dist/lib/converter/comments/lineLexer.js +279 -0
  38. package/dist/lib/converter/comments/linkResolver.d.ts +20 -0
  39. package/dist/lib/converter/comments/linkResolver.js +186 -0
  40. package/dist/lib/converter/comments/parser.d.ts +18 -0
  41. package/dist/lib/converter/comments/parser.js +538 -0
  42. package/dist/lib/converter/comments/rawLexer.d.ts +8 -0
  43. package/dist/lib/converter/comments/rawLexer.js +218 -0
  44. package/dist/lib/converter/comments/tagName.d.ts +8 -0
  45. package/dist/lib/converter/comments/tagName.js +58 -0
  46. package/dist/lib/converter/comments/textParser.d.ts +33 -0
  47. package/dist/lib/converter/comments/textParser.js +372 -0
  48. package/dist/lib/converter/components.d.ts +4 -0
  49. package/dist/lib/converter/components.js +3 -0
  50. package/dist/lib/converter/context.d.ts +101 -0
  51. package/dist/lib/converter/context.js +311 -0
  52. package/dist/lib/converter/convert-expression.d.ts +9 -0
  53. package/dist/lib/converter/convert-expression.js +58 -0
  54. package/dist/lib/converter/converter-events.d.ts +13 -0
  55. package/dist/lib/converter/converter-events.js +13 -0
  56. package/dist/lib/converter/converter.d.ts +238 -0
  57. package/dist/lib/converter/converter.js +705 -0
  58. package/dist/lib/converter/factories/index-signature.d.ts +3 -0
  59. package/dist/lib/converter/factories/index-signature.js +50 -0
  60. package/dist/lib/converter/factories/signature.d.ts +14 -0
  61. package/dist/lib/converter/factories/signature.js +353 -0
  62. package/dist/lib/converter/factories/symbol-id.d.ts +3 -0
  63. package/dist/lib/converter/factories/symbol-id.js +47 -0
  64. package/dist/lib/converter/index.d.ts +5 -0
  65. package/dist/lib/converter/index.js +3 -0
  66. package/dist/lib/converter/jsdoc.d.ts +4 -0
  67. package/dist/lib/converter/jsdoc.js +135 -0
  68. package/dist/lib/converter/plugins/CategoryPlugin.d.ts +48 -0
  69. package/dist/lib/converter/plugins/CategoryPlugin.js +278 -0
  70. package/dist/lib/converter/plugins/CommentPlugin.d.ts +128 -0
  71. package/dist/lib/converter/plugins/CommentPlugin.js +770 -0
  72. package/dist/lib/converter/plugins/GroupPlugin.d.ts +48 -0
  73. package/dist/lib/converter/plugins/GroupPlugin.js +281 -0
  74. package/dist/lib/converter/plugins/ImplementsPlugin.d.ts +42 -0
  75. package/dist/lib/converter/plugins/ImplementsPlugin.js +438 -0
  76. package/dist/lib/converter/plugins/IncludePlugin.d.ts +14 -0
  77. package/dist/lib/converter/plugins/IncludePlugin.js +254 -0
  78. package/dist/lib/converter/plugins/InheritDocPlugin.d.ts +32 -0
  79. package/dist/lib/converter/plugins/InheritDocPlugin.js +220 -0
  80. package/dist/lib/converter/plugins/LinkResolverPlugin.d.ts +13 -0
  81. package/dist/lib/converter/plugins/LinkResolverPlugin.js +88 -0
  82. package/dist/lib/converter/plugins/MergeModuleWithPlugin.d.ts +12 -0
  83. package/dist/lib/converter/plugins/MergeModuleWithPlugin.js +50 -0
  84. package/dist/lib/converter/plugins/PackagePlugin.d.ts +31 -0
  85. package/dist/lib/converter/plugins/PackagePlugin.js +188 -0
  86. package/dist/lib/converter/plugins/SourcePlugin.d.ts +36 -0
  87. package/dist/lib/converter/plugins/SourcePlugin.js +215 -0
  88. package/dist/lib/converter/plugins/TypePlugin.d.ts +16 -0
  89. package/dist/lib/converter/plugins/TypePlugin.js +108 -0
  90. package/dist/lib/converter/plugins/index.d.ts +10 -0
  91. package/dist/lib/converter/plugins/index.js +10 -0
  92. package/dist/lib/converter/symbols.d.ts +3 -0
  93. package/dist/lib/converter/symbols.js +861 -0
  94. package/dist/lib/converter/types.d.ts +10 -0
  95. package/dist/lib/converter/types.js +833 -0
  96. package/dist/lib/converter/utils/nodes.d.ts +7 -0
  97. package/dist/lib/converter/utils/nodes.js +26 -0
  98. package/dist/lib/converter/utils/reflections.d.ts +2 -0
  99. package/dist/lib/converter/utils/reflections.js +17 -0
  100. package/dist/lib/converter/utils/repository.d.ts +96 -0
  101. package/dist/lib/converter/utils/repository.js +295 -0
  102. package/dist/lib/converter/utils/symbols.d.ts +2 -0
  103. package/dist/lib/converter/utils/symbols.js +12 -0
  104. package/dist/lib/debug/index.d.ts +2 -0
  105. package/dist/lib/debug/index.js +2 -0
  106. package/dist/lib/debug/reflectionLifetimes.d.ts +3 -0
  107. package/dist/lib/debug/reflectionLifetimes.js +27 -0
  108. package/dist/lib/debug/rendererUrls.d.ts +6 -0
  109. package/dist/lib/debug/rendererUrls.js +68 -0
  110. package/dist/lib/internationalization/index.d.ts +7 -0
  111. package/dist/lib/internationalization/index.js +7 -0
  112. package/dist/lib/internationalization/internationalization.d.ts +65 -0
  113. package/dist/lib/internationalization/internationalization.js +64 -0
  114. package/dist/lib/internationalization/locale-utils.cjs +8 -0
  115. package/dist/lib/internationalization/locale-utils.d.cts +8 -0
  116. package/dist/lib/internationalization/locales/de.cjs +401 -0
  117. package/dist/lib/internationalization/locales/de.d.cts +368 -0
  118. package/dist/lib/internationalization/locales/en.cjs +411 -0
  119. package/dist/lib/internationalization/locales/en.d.cts +380 -0
  120. package/dist/lib/internationalization/locales/ja.cjs +320 -0
  121. package/dist/lib/internationalization/locales/ja.d.cts +307 -0
  122. package/dist/lib/internationalization/locales/ko.cjs +233 -0
  123. package/dist/lib/internationalization/locales/ko.d.cts +221 -0
  124. package/dist/lib/internationalization/locales/zh.cjs +488 -0
  125. package/dist/lib/internationalization/locales/zh.d.cts +452 -0
  126. package/dist/lib/internationalization/translatable.d.ts +21 -0
  127. package/dist/lib/internationalization/translatable.js +8 -0
  128. package/dist/lib/models/Comment.d.ts +241 -0
  129. package/dist/lib/models/Comment.js +534 -0
  130. package/dist/lib/models/ContainerReflection.d.ts +56 -0
  131. package/dist/lib/models/ContainerReflection.js +159 -0
  132. package/dist/lib/models/DeclarationReflection.d.ts +149 -0
  133. package/dist/lib/models/DeclarationReflection.js +287 -0
  134. package/dist/lib/models/DocumentReflection.d.ts +32 -0
  135. package/dist/lib/models/DocumentReflection.js +66 -0
  136. package/dist/lib/models/FileRegistry.d.ts +46 -0
  137. package/dist/lib/models/FileRegistry.js +133 -0
  138. package/dist/lib/models/ParameterReflection.d.ts +21 -0
  139. package/dist/lib/models/ParameterReflection.js +39 -0
  140. package/dist/lib/models/ProjectReflection.d.ts +112 -0
  141. package/dist/lib/models/ProjectReflection.js +417 -0
  142. package/dist/lib/models/ReferenceReflection.d.ts +49 -0
  143. package/dist/lib/models/ReferenceReflection.js +85 -0
  144. package/dist/lib/models/Reflection.d.ts +229 -0
  145. package/dist/lib/models/Reflection.js +495 -0
  146. package/dist/lib/models/ReflectionCategory.d.ts +31 -0
  147. package/dist/lib/models/ReflectionCategory.js +56 -0
  148. package/dist/lib/models/ReflectionGroup.d.ts +38 -0
  149. package/dist/lib/models/ReflectionGroup.js +72 -0
  150. package/dist/lib/models/ReflectionSymbolId.d.ts +63 -0
  151. package/dist/lib/models/ReflectionSymbolId.js +85 -0
  152. package/dist/lib/models/SignatureReflection.d.ts +50 -0
  153. package/dist/lib/models/SignatureReflection.js +96 -0
  154. package/dist/lib/models/SourceReference.d.ts +33 -0
  155. package/dist/lib/models/SourceReference.js +50 -0
  156. package/dist/lib/models/TypeParameterReflection.d.ts +30 -0
  157. package/dist/lib/models/TypeParameterReflection.js +45 -0
  158. package/dist/lib/models/index.d.ts +19 -0
  159. package/dist/lib/models/index.js +19 -0
  160. package/dist/lib/models/kind.d.ts +84 -0
  161. package/dist/lib/models/kind.js +231 -0
  162. package/dist/lib/models/types.d.ts +553 -0
  163. package/dist/lib/models/types.js +1296 -0
  164. package/dist/lib/models/utils.d.ts +1 -0
  165. package/dist/lib/models/utils.js +26 -0
  166. package/dist/lib/models/variant.d.ts +21 -0
  167. package/dist/lib/models/variant.js +1 -0
  168. package/dist/lib/output/components.d.ts +53 -0
  169. package/dist/lib/output/components.js +133 -0
  170. package/dist/lib/output/events.d.ts +175 -0
  171. package/dist/lib/output/events.js +195 -0
  172. package/dist/lib/output/formatter.d.ts +88 -0
  173. package/dist/lib/output/formatter.js +660 -0
  174. package/dist/lib/output/index.d.ts +9 -0
  175. package/dist/lib/output/index.js +7 -0
  176. package/dist/lib/output/output.d.ts +14 -0
  177. package/dist/lib/output/output.js +92 -0
  178. package/dist/lib/output/plugins/AssetsPlugin.d.ts +20 -0
  179. package/dist/lib/output/plugins/AssetsPlugin.js +160 -0
  180. package/dist/lib/output/plugins/HierarchyPlugin.d.ts +7 -0
  181. package/dist/lib/output/plugins/HierarchyPlugin.js +65 -0
  182. package/dist/lib/output/plugins/IconsPlugin.d.ts +12 -0
  183. package/dist/lib/output/plugins/IconsPlugin.js +54 -0
  184. package/dist/lib/output/plugins/JavascriptIndexPlugin.d.ts +22 -0
  185. package/dist/lib/output/plugins/JavascriptIndexPlugin.js +222 -0
  186. package/dist/lib/output/plugins/NavigationPlugin.d.ts +7 -0
  187. package/dist/lib/output/plugins/NavigationPlugin.js +23 -0
  188. package/dist/lib/output/plugins/SitemapPlugin.d.ts +8 -0
  189. package/dist/lib/output/plugins/SitemapPlugin.js +82 -0
  190. package/dist/lib/output/plugins/index.d.ts +7 -0
  191. package/dist/lib/output/plugins/index.js +7 -0
  192. package/dist/lib/output/renderer.d.ts +227 -0
  193. package/dist/lib/output/renderer.js +387 -0
  194. package/dist/lib/output/router.d.ts +187 -0
  195. package/dist/lib/output/router.js +520 -0
  196. package/dist/lib/output/theme.d.ts +22 -0
  197. package/dist/lib/output/theme.js +17 -0
  198. package/dist/lib/output/themes/MarkedPlugin.d.ts +62 -0
  199. package/dist/lib/output/themes/MarkedPlugin.js +461 -0
  200. package/dist/lib/output/themes/default/DefaultTheme.d.ts +72 -0
  201. package/dist/lib/output/themes/default/DefaultTheme.js +367 -0
  202. package/dist/lib/output/themes/default/DefaultThemeRenderContext.d.ts +105 -0
  203. package/dist/lib/output/themes/default/DefaultThemeRenderContext.js +151 -0
  204. package/dist/lib/output/themes/default/Slugger.d.ts +13 -0
  205. package/dist/lib/output/themes/default/Slugger.js +60 -0
  206. package/dist/lib/output/themes/default/layouts/default.d.ts +6 -0
  207. package/dist/lib/output/themes/default/layouts/default.js +89 -0
  208. package/dist/lib/output/themes/default/partials/anchor-icon.d.ts +5 -0
  209. package/dist/lib/output/themes/default/partials/anchor-icon.js +9 -0
  210. package/dist/lib/output/themes/default/partials/breadcrumb.d.ts +4 -0
  211. package/dist/lib/output/themes/default/partials/breadcrumb.js +11 -0
  212. package/dist/lib/output/themes/default/partials/comment.d.ts +8 -0
  213. package/dist/lib/output/themes/default/partials/comment.js +80 -0
  214. package/dist/lib/output/themes/default/partials/footer.d.ts +3 -0
  215. package/dist/lib/output/themes/default/partials/footer.js +37 -0
  216. package/dist/lib/output/themes/default/partials/header.d.ts +5 -0
  217. package/dist/lib/output/themes/default/partials/header.js +39 -0
  218. package/dist/lib/output/themes/default/partials/hierarchy.d.ts +4 -0
  219. package/dist/lib/output/themes/default/partials/hierarchy.js +32 -0
  220. package/dist/lib/output/themes/default/partials/icon.d.ts +20 -0
  221. package/dist/lib/output/themes/default/partials/icon.js +101 -0
  222. package/dist/lib/output/themes/default/partials/index.d.ts +4 -0
  223. package/dist/lib/output/themes/default/partials/index.js +24 -0
  224. package/dist/lib/output/themes/default/partials/member.d.ts +4 -0
  225. package/dist/lib/output/themes/default/partials/member.declaration.d.ts +4 -0
  226. package/dist/lib/output/themes/default/partials/member.declaration.js +35 -0
  227. package/dist/lib/output/themes/default/partials/member.getterSetter.d.ts +4 -0
  228. package/dist/lib/output/themes/default/partials/member.getterSetter.js +12 -0
  229. package/dist/lib/output/themes/default/partials/member.js +36 -0
  230. package/dist/lib/output/themes/default/partials/member.signature.body.d.ts +6 -0
  231. package/dist/lib/output/themes/default/partials/member.signature.body.js +33 -0
  232. package/dist/lib/output/themes/default/partials/member.signature.title.d.ts +5 -0
  233. package/dist/lib/output/themes/default/partials/member.signature.title.js +9 -0
  234. package/dist/lib/output/themes/default/partials/member.signatures.d.ts +4 -0
  235. package/dist/lib/output/themes/default/partials/member.signatures.js +9 -0
  236. package/dist/lib/output/themes/default/partials/member.sources.d.ts +4 -0
  237. package/dist/lib/output/themes/default/partials/member.sources.js +55 -0
  238. package/dist/lib/output/themes/default/partials/members.d.ts +4 -0
  239. package/dist/lib/output/themes/default/partials/members.js +17 -0
  240. package/dist/lib/output/themes/default/partials/moduleReflection.d.ts +5 -0
  241. package/dist/lib/output/themes/default/partials/moduleReflection.js +68 -0
  242. package/dist/lib/output/themes/default/partials/navigation.d.ts +10 -0
  243. package/dist/lib/output/themes/default/partials/navigation.js +144 -0
  244. package/dist/lib/output/themes/default/partials/reflectionPreview.d.ts +4 -0
  245. package/dist/lib/output/themes/default/partials/reflectionPreview.js +26 -0
  246. package/dist/lib/output/themes/default/partials/toolbar.d.ts +5 -0
  247. package/dist/lib/output/themes/default/partials/toolbar.js +13 -0
  248. package/dist/lib/output/themes/default/partials/type.d.ts +5 -0
  249. package/dist/lib/output/themes/default/partials/type.js +9 -0
  250. package/dist/lib/output/themes/default/partials/typeAndParent.d.ts +4 -0
  251. package/dist/lib/output/themes/default/partials/typeAndParent.js +28 -0
  252. package/dist/lib/output/themes/default/partials/typeDetails.d.ts +8 -0
  253. package/dist/lib/output/themes/default/partials/typeDetails.js +284 -0
  254. package/dist/lib/output/themes/default/partials/typeParameters.d.ts +4 -0
  255. package/dist/lib/output/themes/default/partials/typeParameters.js +26 -0
  256. package/dist/lib/output/themes/default/templates/document.d.ts +5 -0
  257. package/dist/lib/output/themes/default/templates/document.js +3 -0
  258. package/dist/lib/output/themes/default/templates/hierarchy.d.ts +5 -0
  259. package/dist/lib/output/themes/default/templates/hierarchy.js +31 -0
  260. package/dist/lib/output/themes/default/templates/index.d.ts +5 -0
  261. package/dist/lib/output/themes/default/templates/index.js +3 -0
  262. package/dist/lib/output/themes/default/templates/reflection.d.ts +5 -0
  263. package/dist/lib/output/themes/default/templates/reflection.js +53 -0
  264. package/dist/lib/output/themes/lib.d.ts +44 -0
  265. package/dist/lib/output/themes/lib.js +218 -0
  266. package/dist/lib/serialization/components.d.ts +22 -0
  267. package/dist/lib/serialization/components.js +1 -0
  268. package/dist/lib/serialization/deserializer.d.ts +70 -0
  269. package/dist/lib/serialization/deserializer.js +235 -0
  270. package/dist/lib/serialization/events.d.ts +17 -0
  271. package/dist/lib/serialization/events.js +18 -0
  272. package/dist/lib/serialization/index.d.ts +5 -0
  273. package/dist/lib/serialization/index.js +4 -0
  274. package/dist/lib/serialization/schema.d.ts +283 -0
  275. package/dist/lib/serialization/schema.js +32 -0
  276. package/dist/lib/serialization/serializer.d.ts +52 -0
  277. package/dist/lib/serialization/serializer.js +65 -0
  278. package/dist/lib/utils/ValidatingFileRegistry.d.ts +12 -0
  279. package/dist/lib/utils/ValidatingFileRegistry.js +52 -0
  280. package/dist/lib/utils/component.d.ts +38 -0
  281. package/dist/lib/utils/component.js +41 -0
  282. package/dist/lib/utils/compress.d.ts +7 -0
  283. package/dist/lib/utils/compress.js +13 -0
  284. package/dist/lib/utils/declaration-maps.d.ts +3 -0
  285. package/dist/lib/utils/declaration-maps.js +51 -0
  286. package/dist/lib/utils/entry-point.d.ts +50 -0
  287. package/dist/lib/utils/entry-point.js +330 -0
  288. package/dist/lib/utils/fs.d.ts +65 -0
  289. package/dist/lib/utils/fs.js +372 -0
  290. package/dist/lib/utils/general.d.ts +4 -0
  291. package/dist/lib/utils/general.js +25 -0
  292. package/dist/lib/utils/highlighter.d.ts +9 -0
  293. package/dist/lib/utils/highlighter.js +150 -0
  294. package/dist/lib/utils/html-entities.d.ts +8926 -0
  295. package/dist/lib/utils/html-entities.js +2329 -0
  296. package/dist/lib/utils/html.d.ts +67 -0
  297. package/dist/lib/utils/html.js +635 -0
  298. package/dist/lib/utils/index.d.ts +17 -0
  299. package/dist/lib/utils/index.js +15 -0
  300. package/dist/lib/utils/loggers.d.ts +10 -0
  301. package/dist/lib/utils/loggers.js +71 -0
  302. package/dist/lib/utils/options/declaration.d.ts +514 -0
  303. package/dist/lib/utils/options/declaration.js +443 -0
  304. package/dist/lib/utils/options/defaults.d.ts +20 -0
  305. package/dist/lib/utils/options/defaults.js +104 -0
  306. package/dist/lib/utils/options/help.d.ts +7 -0
  307. package/dist/lib/utils/options/help.js +63 -0
  308. package/dist/lib/utils/options/index.d.ts +6 -0
  309. package/dist/lib/utils/options/index.js +4 -0
  310. package/dist/lib/utils/options/options.d.ts +199 -0
  311. package/dist/lib/utils/options/options.js +273 -0
  312. package/dist/lib/utils/options/readers/arguments.d.ts +15 -0
  313. package/dist/lib/utils/options/readers/arguments.js +109 -0
  314. package/dist/lib/utils/options/readers/index.d.ts +4 -0
  315. package/dist/lib/utils/options/readers/index.js +4 -0
  316. package/dist/lib/utils/options/readers/package-json.d.ts +9 -0
  317. package/dist/lib/utils/options/readers/package-json.js +40 -0
  318. package/dist/lib/utils/options/readers/tsconfig.d.ts +14 -0
  319. package/dist/lib/utils/options/readers/tsconfig.js +172 -0
  320. package/dist/lib/utils/options/readers/typedoc.d.ts +33 -0
  321. package/dist/lib/utils/options/readers/typedoc.js +136 -0
  322. package/dist/lib/utils/options/sources/index.d.ts +1 -0
  323. package/dist/lib/utils/options/sources/index.js +1 -0
  324. package/dist/lib/utils/options/sources/typedoc.d.ts +2 -0
  325. package/dist/lib/utils/options/sources/typedoc.js +876 -0
  326. package/dist/lib/utils/options/tsdoc-defaults.d.ts +6 -0
  327. package/dist/lib/utils/options/tsdoc-defaults.js +94 -0
  328. package/dist/lib/utils/package-manifest.d.ts +11 -0
  329. package/dist/lib/utils/package-manifest.js +84 -0
  330. package/dist/lib/utils/paths.d.ts +27 -0
  331. package/dist/lib/utils/paths.js +127 -0
  332. package/dist/lib/utils/perf.d.ts +6 -0
  333. package/dist/lib/utils/perf.js +86 -0
  334. package/dist/lib/utils/plugins.d.ts +3 -0
  335. package/dist/lib/utils/plugins.js +61 -0
  336. package/dist/lib/utils/reflections.d.ts +5 -0
  337. package/dist/lib/utils/reflections.js +64 -0
  338. package/dist/lib/utils/sort.d.ts +11 -0
  339. package/dist/lib/utils/sort.js +153 -0
  340. package/dist/lib/utils/tsconfig.d.ts +5 -0
  341. package/dist/lib/utils/tsconfig.js +60 -0
  342. package/dist/lib/utils/tsutils.d.ts +3 -0
  343. package/dist/lib/utils/tsutils.js +23 -0
  344. package/dist/lib/utils-common/array.d.ts +57 -0
  345. package/dist/lib/utils-common/array.js +152 -0
  346. package/dist/lib/utils-common/declarationReference.d.ts +42 -0
  347. package/dist/lib/utils-common/declarationReference.js +341 -0
  348. package/dist/lib/utils-common/enum.d.ts +9 -0
  349. package/dist/lib/utils-common/enum.js +27 -0
  350. package/dist/lib/utils-common/events.d.ts +29 -0
  351. package/dist/lib/utils-common/events.js +49 -0
  352. package/dist/lib/utils-common/general.d.ts +40 -0
  353. package/dist/lib/utils-common/general.js +22 -0
  354. package/dist/lib/utils-common/hooks.d.ts +51 -0
  355. package/dist/lib/utils-common/hooks.js +90 -0
  356. package/dist/lib/utils-common/i18n.d.ts +18 -0
  357. package/dist/lib/utils-common/i18n.js +39 -0
  358. package/dist/lib/utils-common/index.d.ts +16 -0
  359. package/dist/lib/utils-common/index.js +17 -0
  360. package/dist/lib/utils-common/jsx.d.ts +53 -0
  361. package/dist/lib/utils-common/jsx.elements.d.ts +949 -0
  362. package/dist/lib/utils-common/jsx.elements.js +3 -0
  363. package/dist/lib/utils-common/jsx.js +187 -0
  364. package/dist/lib/utils-common/logger.d.ts +97 -0
  365. package/dist/lib/utils-common/logger.js +129 -0
  366. package/dist/lib/utils-common/map.d.ts +23 -0
  367. package/dist/lib/utils-common/map.js +63 -0
  368. package/dist/lib/utils-common/minimalSourceFile.d.ts +12 -0
  369. package/dist/lib/utils-common/minimalSourceFile.js +43 -0
  370. package/dist/lib/utils-common/path.d.ts +42 -0
  371. package/dist/lib/utils-common/path.js +130 -0
  372. package/dist/lib/utils-common/set.d.ts +3 -0
  373. package/dist/lib/utils-common/set.js +23 -0
  374. package/dist/lib/utils-common/string.d.ts +11 -0
  375. package/dist/lib/utils-common/string.js +84 -0
  376. package/dist/lib/utils-common/validation.d.ts +33 -0
  377. package/dist/lib/utils-common/validation.js +50 -0
  378. package/dist/lib/validation/documentation.d.ts +3 -0
  379. package/dist/lib/validation/documentation.js +91 -0
  380. package/dist/lib/validation/exports.d.ts +3 -0
  381. package/dist/lib/validation/exports.js +65 -0
  382. package/dist/lib/validation/links.d.ts +3 -0
  383. package/dist/lib/validation/links.js +78 -0
  384. package/dist/lib/validation/unusedMergeModuleWith.d.ts +3 -0
  385. package/dist/lib/validation/unusedMergeModuleWith.js +12 -0
  386. package/package.json +161 -0
  387. package/static/main.js +58 -0
  388. package/static/style.css +1633 -0
  389. package/tsdoc.json +247 -0
  390. package/typedoc-config.schema.json +941 -0
@@ -0,0 +1,1296 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ import { ReflectionSymbolId } from "./ReflectionSymbolId.js";
36
+ import { ReflectionKind } from "./kind.js";
37
+ import { Comment } from "./Comment.js";
38
+ import { i18n, joinArray, NonEnumerable } from "#utils";
39
+ /**
40
+ * Base class of all type definitions.
41
+ * @category Types
42
+ */
43
+ export class Type {
44
+ /**
45
+ * Return a string representation of this type.
46
+ */
47
+ toString() {
48
+ return this.stringify(TypeContext.none);
49
+ }
50
+ visit(visitor, ...args) {
51
+ return visitor[this.type]?.(this, ...args);
52
+ }
53
+ stringify(context) {
54
+ if (this.needsParenthesis(context)) {
55
+ return `(${this.getTypeString()})`;
56
+ }
57
+ return this.getTypeString();
58
+ }
59
+ // Nothing to do for the majority of types.
60
+ fromObject(_de, _obj) { }
61
+ /**
62
+ * Return the estimated size of the type if it was all printed on one line.
63
+ */
64
+ estimatePrintWidth() {
65
+ return this.getTypeString().length;
66
+ }
67
+ }
68
+ export function makeRecursiveVisitor(visitor) {
69
+ const recursiveVisitor = {
70
+ namedTupleMember(type) {
71
+ visitor.namedTupleMember?.(type);
72
+ type.element.visit(recursiveVisitor);
73
+ },
74
+ templateLiteral(type) {
75
+ visitor.templateLiteral?.(type);
76
+ for (const [h] of type.tail) {
77
+ h.visit(recursiveVisitor);
78
+ }
79
+ },
80
+ array(type) {
81
+ visitor.array?.(type);
82
+ type.elementType.visit(recursiveVisitor);
83
+ },
84
+ conditional(type) {
85
+ visitor.conditional?.(type);
86
+ type.checkType.visit(recursiveVisitor);
87
+ type.extendsType.visit(recursiveVisitor);
88
+ type.trueType.visit(recursiveVisitor);
89
+ type.falseType.visit(recursiveVisitor);
90
+ },
91
+ indexedAccess(type) {
92
+ visitor.indexedAccess?.(type);
93
+ type.indexType.visit(recursiveVisitor);
94
+ type.objectType.visit(recursiveVisitor);
95
+ },
96
+ inferred(type) {
97
+ visitor.inferred?.(type);
98
+ type.constraint?.visit(recursiveVisitor);
99
+ },
100
+ intersection(type) {
101
+ visitor.intersection?.(type);
102
+ type.types.forEach((t) => t.visit(recursiveVisitor));
103
+ },
104
+ intrinsic(type) {
105
+ visitor.intrinsic?.(type);
106
+ },
107
+ literal(type) {
108
+ visitor.literal?.(type);
109
+ },
110
+ mapped(type) {
111
+ visitor.mapped?.(type);
112
+ type.nameType?.visit(recursiveVisitor);
113
+ type.parameterType.visit(recursiveVisitor);
114
+ type.templateType.visit(recursiveVisitor);
115
+ },
116
+ optional(type) {
117
+ visitor.optional?.(type);
118
+ type.elementType.visit(recursiveVisitor);
119
+ },
120
+ predicate(type) {
121
+ visitor.predicate?.(type);
122
+ type.targetType?.visit(recursiveVisitor);
123
+ },
124
+ query(type) {
125
+ visitor.query?.(type);
126
+ type.queryType.visit(recursiveVisitor);
127
+ },
128
+ reference(type) {
129
+ visitor.reference?.(type);
130
+ type.typeArguments?.forEach((t) => t.visit(recursiveVisitor));
131
+ },
132
+ reflection(type) {
133
+ visitor.reflection?.(type);
134
+ // Future: This should maybe recurse too?
135
+ // See the validator in exports.ts for how to do it.
136
+ },
137
+ rest(type) {
138
+ visitor.rest?.(type);
139
+ type.elementType.visit(recursiveVisitor);
140
+ },
141
+ tuple(type) {
142
+ visitor.tuple?.(type);
143
+ type.elements.forEach((t) => t.visit(recursiveVisitor));
144
+ },
145
+ typeOperator(type) {
146
+ visitor.typeOperator?.(type);
147
+ type.target.visit(recursiveVisitor);
148
+ },
149
+ union(type) {
150
+ visitor.union?.(type);
151
+ type.types.forEach((t) => t.visit(recursiveVisitor));
152
+ },
153
+ unknown(type) {
154
+ visitor.unknown?.(type);
155
+ },
156
+ };
157
+ return recursiveVisitor;
158
+ }
159
+ /**
160
+ * Enumeration that can be used when traversing types to track the location of recursion.
161
+ * Used by TypeDoc internally to track when to output parenthesis when rendering.
162
+ * @enum
163
+ */
164
+ export const TypeContext = {
165
+ none: "none",
166
+ templateLiteralElement: "templateLiteralElement", // `${here}`
167
+ arrayElement: "arrayElement", // here[]
168
+ indexedAccessElement: "indexedAccessElement", // {}[here]
169
+ conditionalCheck: "conditionalCheck", // here extends 1 ? 2 : 3
170
+ conditionalExtends: "conditionalExtends", // 1 extends here ? 2 : 3
171
+ conditionalTrue: "conditionalTrue", // 1 extends 2 ? here : 3
172
+ conditionalFalse: "conditionalFalse", // 1 extends 2 ? 3 : here
173
+ indexedIndex: "indexedIndex", // {}[here]
174
+ indexedObject: "indexedObject", // here[1]
175
+ inferredConstraint: "inferredConstraint", // 1 extends infer X extends here ? 1 : 2
176
+ intersectionElement: "intersectionElement", // here & 1
177
+ mappedName: "mappedName", // { [k in string as here]: 1 }
178
+ mappedParameter: "mappedParameter", // { [k in here]: 1 }
179
+ mappedTemplate: "mappedTemplate", // { [k in string]: here }
180
+ optionalElement: "optionalElement", // [here?]
181
+ predicateTarget: "predicateTarget", // (): X is here
182
+ queryTypeTarget: "queryTypeTarget", // typeof here, can only ever be a ReferenceType
183
+ typeOperatorTarget: "typeOperatorTarget", // keyof here
184
+ referenceTypeArgument: "referenceTypeArgument", // X<here>
185
+ restElement: "restElement", // [...here]
186
+ tupleElement: "tupleElement", // [here]
187
+ unionElement: "unionElement", // here | 1
188
+ };
189
+ /**
190
+ * Represents an array type.
191
+ *
192
+ * ```ts
193
+ * let value: string[];
194
+ * ```
195
+ * @category Types
196
+ */
197
+ export class ArrayType extends Type {
198
+ elementType;
199
+ type = "array";
200
+ /**
201
+ * @param elementType The type of the elements in the array.
202
+ */
203
+ constructor(elementType) {
204
+ super();
205
+ this.elementType = elementType;
206
+ }
207
+ getTypeString() {
208
+ return this.elementType.stringify(TypeContext.arrayElement) + "[]";
209
+ }
210
+ needsParenthesis() {
211
+ return false;
212
+ }
213
+ toObject(serializer) {
214
+ return {
215
+ type: this.type,
216
+ elementType: serializer.toObject(this.elementType),
217
+ };
218
+ }
219
+ }
220
+ /**
221
+ * Represents a conditional type.
222
+ *
223
+ * ```ts
224
+ * let value: Check extends Extends ? True : False;
225
+ * ```
226
+ * @category Types
227
+ */
228
+ export class ConditionalType extends Type {
229
+ checkType;
230
+ extendsType;
231
+ trueType;
232
+ falseType;
233
+ type = "conditional";
234
+ constructor(checkType, extendsType, trueType, falseType) {
235
+ super();
236
+ this.checkType = checkType;
237
+ this.extendsType = extendsType;
238
+ this.trueType = trueType;
239
+ this.falseType = falseType;
240
+ }
241
+ getTypeString() {
242
+ return [
243
+ this.checkType.stringify(TypeContext.conditionalCheck),
244
+ "extends",
245
+ this.extendsType.stringify(TypeContext.conditionalExtends),
246
+ "?",
247
+ this.trueType.stringify(TypeContext.conditionalTrue),
248
+ ":",
249
+ this.falseType.stringify(TypeContext.conditionalFalse),
250
+ ].join(" ");
251
+ }
252
+ needsParenthesis(context) {
253
+ const map = {
254
+ none: false,
255
+ templateLiteralElement: false,
256
+ arrayElement: true,
257
+ indexedAccessElement: false,
258
+ conditionalCheck: true,
259
+ conditionalExtends: true,
260
+ conditionalTrue: false,
261
+ conditionalFalse: false,
262
+ indexedIndex: false,
263
+ indexedObject: true,
264
+ inferredConstraint: true,
265
+ intersectionElement: true,
266
+ mappedName: false,
267
+ mappedParameter: false,
268
+ mappedTemplate: false,
269
+ optionalElement: true,
270
+ predicateTarget: false,
271
+ queryTypeTarget: false,
272
+ typeOperatorTarget: true,
273
+ referenceTypeArgument: false,
274
+ restElement: true,
275
+ tupleElement: false,
276
+ unionElement: true,
277
+ };
278
+ return map[context];
279
+ }
280
+ toObject(serializer) {
281
+ return {
282
+ type: this.type,
283
+ checkType: serializer.toObject(this.checkType),
284
+ extendsType: serializer.toObject(this.extendsType),
285
+ trueType: serializer.toObject(this.trueType),
286
+ falseType: serializer.toObject(this.falseType),
287
+ };
288
+ }
289
+ }
290
+ /**
291
+ * Represents an indexed access type.
292
+ * @category Types
293
+ */
294
+ export class IndexedAccessType extends Type {
295
+ objectType;
296
+ indexType;
297
+ type = "indexedAccess";
298
+ constructor(objectType, indexType) {
299
+ super();
300
+ this.objectType = objectType;
301
+ this.indexType = indexType;
302
+ }
303
+ getTypeString() {
304
+ return [
305
+ this.objectType.stringify(TypeContext.indexedObject),
306
+ "[",
307
+ this.indexType.stringify(TypeContext.indexedIndex),
308
+ "]",
309
+ ].join("");
310
+ }
311
+ needsParenthesis() {
312
+ return false;
313
+ }
314
+ toObject(serializer) {
315
+ return {
316
+ type: this.type,
317
+ indexType: serializer.toObject(this.indexType),
318
+ objectType: serializer.toObject(this.objectType),
319
+ };
320
+ }
321
+ }
322
+ /**
323
+ * Represents an inferred type, U in the example below.
324
+ *
325
+ * ```ts
326
+ * type Z = Promise<string> extends Promise<infer U> : never
327
+ * ```
328
+ * @category Types
329
+ */
330
+ export class InferredType extends Type {
331
+ name;
332
+ constraint;
333
+ type = "inferred";
334
+ constructor(name, constraint) {
335
+ super();
336
+ this.name = name;
337
+ this.constraint = constraint;
338
+ }
339
+ getTypeString() {
340
+ if (this.constraint) {
341
+ return `infer ${this.name} extends ${this.constraint.stringify(TypeContext.inferredConstraint)}`;
342
+ }
343
+ return `infer ${this.name}`;
344
+ }
345
+ needsParenthesis(context) {
346
+ const map = {
347
+ none: false,
348
+ templateLiteralElement: false,
349
+ arrayElement: true,
350
+ indexedAccessElement: false,
351
+ conditionalCheck: false,
352
+ conditionalExtends: false,
353
+ conditionalTrue: false,
354
+ conditionalFalse: false,
355
+ indexedIndex: false,
356
+ indexedObject: true,
357
+ inferredConstraint: false,
358
+ intersectionElement: false,
359
+ mappedName: false,
360
+ mappedParameter: false,
361
+ mappedTemplate: false,
362
+ optionalElement: true,
363
+ predicateTarget: false,
364
+ queryTypeTarget: false,
365
+ typeOperatorTarget: false,
366
+ referenceTypeArgument: false,
367
+ restElement: true,
368
+ tupleElement: false,
369
+ unionElement: false,
370
+ };
371
+ return map[context];
372
+ }
373
+ toObject(serializer) {
374
+ return {
375
+ type: this.type,
376
+ name: this.name,
377
+ constraint: serializer.toObject(this.constraint),
378
+ };
379
+ }
380
+ }
381
+ /**
382
+ * Represents an intersection type.
383
+ *
384
+ * ```ts
385
+ * let value: A & B;
386
+ * ```
387
+ * @category Types
388
+ */
389
+ export class IntersectionType extends Type {
390
+ types;
391
+ type = "intersection";
392
+ constructor(types) {
393
+ super();
394
+ this.types = types;
395
+ }
396
+ getTypeString() {
397
+ return this.types
398
+ .map((t) => t.stringify(TypeContext.intersectionElement))
399
+ .join(" & ");
400
+ }
401
+ needsParenthesis(context) {
402
+ const map = {
403
+ none: false,
404
+ templateLiteralElement: false,
405
+ arrayElement: true,
406
+ indexedAccessElement: false,
407
+ conditionalCheck: true,
408
+ conditionalExtends: false,
409
+ conditionalTrue: false,
410
+ conditionalFalse: false,
411
+ indexedIndex: false,
412
+ indexedObject: true,
413
+ inferredConstraint: false,
414
+ intersectionElement: false,
415
+ mappedName: false,
416
+ mappedParameter: false,
417
+ mappedTemplate: false,
418
+ optionalElement: true,
419
+ predicateTarget: false,
420
+ queryTypeTarget: false,
421
+ typeOperatorTarget: true,
422
+ referenceTypeArgument: false,
423
+ restElement: true,
424
+ tupleElement: false,
425
+ unionElement: false,
426
+ };
427
+ return map[context];
428
+ }
429
+ toObject(serializer) {
430
+ return {
431
+ type: this.type,
432
+ types: this.types.map((t) => serializer.toObject(t)),
433
+ };
434
+ }
435
+ }
436
+ /**
437
+ * Represents an intrinsic type like `string` or `boolean`.
438
+ *
439
+ * ```ts
440
+ * let value: number;
441
+ * ```
442
+ * @category Types
443
+ */
444
+ export class IntrinsicType extends Type {
445
+ name;
446
+ type = "intrinsic";
447
+ constructor(name) {
448
+ super();
449
+ this.name = name;
450
+ }
451
+ getTypeString() {
452
+ return this.name;
453
+ }
454
+ toObject() {
455
+ return {
456
+ type: this.type,
457
+ name: this.name,
458
+ };
459
+ }
460
+ needsParenthesis() {
461
+ return false;
462
+ }
463
+ }
464
+ /**
465
+ * Represents a literal type.
466
+ *
467
+ * ```ts
468
+ * type A = "A"
469
+ * type B = 1
470
+ * ```
471
+ * @category Types
472
+ */
473
+ export class LiteralType extends Type {
474
+ value;
475
+ type = "literal";
476
+ constructor(value) {
477
+ super();
478
+ this.value = value;
479
+ }
480
+ /**
481
+ * Return a string representation of this type.
482
+ */
483
+ getTypeString() {
484
+ if (typeof this.value === "bigint") {
485
+ return this.value.toString() + "n";
486
+ }
487
+ return JSON.stringify(this.value);
488
+ }
489
+ needsParenthesis() {
490
+ return false;
491
+ }
492
+ toObject() {
493
+ if (typeof this.value === "bigint") {
494
+ return {
495
+ type: this.type,
496
+ value: {
497
+ value: this.value.toString().replace("-", ""),
498
+ negative: this.value < BigInt("0"),
499
+ },
500
+ };
501
+ }
502
+ return {
503
+ type: this.type,
504
+ value: this.value,
505
+ };
506
+ }
507
+ }
508
+ /**
509
+ * Represents a mapped type.
510
+ *
511
+ * ```ts
512
+ * { -readonly [K in Parameter as Name]?: Template }
513
+ * ```
514
+ * @category Types
515
+ */
516
+ export class MappedType extends Type {
517
+ parameter;
518
+ parameterType;
519
+ templateType;
520
+ readonlyModifier;
521
+ optionalModifier;
522
+ nameType;
523
+ type = "mapped";
524
+ constructor(parameter, parameterType, templateType, readonlyModifier, optionalModifier, nameType) {
525
+ super();
526
+ this.parameter = parameter;
527
+ this.parameterType = parameterType;
528
+ this.templateType = templateType;
529
+ this.readonlyModifier = readonlyModifier;
530
+ this.optionalModifier = optionalModifier;
531
+ this.nameType = nameType;
532
+ }
533
+ getTypeString() {
534
+ const read = {
535
+ "+": "readonly ",
536
+ "-": "-readonly ",
537
+ "": "",
538
+ }[this.readonlyModifier ?? ""];
539
+ const opt = {
540
+ "+": "?",
541
+ "-": "-?",
542
+ "": "",
543
+ }[this.optionalModifier ?? ""];
544
+ const parts = [
545
+ "{ ",
546
+ read,
547
+ "[",
548
+ this.parameter,
549
+ " in ",
550
+ this.parameterType.stringify(TypeContext.mappedParameter),
551
+ ];
552
+ if (this.nameType) {
553
+ parts.push(" as ", this.nameType.stringify(TypeContext.mappedName));
554
+ }
555
+ parts.push("]", opt, ": ", this.templateType.stringify(TypeContext.mappedTemplate), " }");
556
+ return parts.join("");
557
+ }
558
+ needsParenthesis() {
559
+ return false;
560
+ }
561
+ toObject(serializer) {
562
+ return {
563
+ type: this.type,
564
+ parameter: this.parameter,
565
+ parameterType: serializer.toObject(this.parameterType),
566
+ templateType: serializer.toObject(this.templateType),
567
+ readonlyModifier: this.readonlyModifier,
568
+ optionalModifier: this.optionalModifier,
569
+ nameType: serializer.toObject(this.nameType),
570
+ };
571
+ }
572
+ }
573
+ /**
574
+ * Represents an optional type
575
+ * ```ts
576
+ * type Z = [1, 2?]
577
+ * // ^^
578
+ * ```
579
+ * @category Types
580
+ */
581
+ export class OptionalType extends Type {
582
+ elementType;
583
+ type = "optional";
584
+ constructor(elementType) {
585
+ super();
586
+ this.elementType = elementType;
587
+ }
588
+ getTypeString() {
589
+ return this.elementType.stringify(TypeContext.optionalElement) + "?";
590
+ }
591
+ needsParenthesis() {
592
+ return false;
593
+ }
594
+ toObject(serializer) {
595
+ return {
596
+ type: this.type,
597
+ elementType: serializer.toObject(this.elementType),
598
+ };
599
+ }
600
+ }
601
+ /**
602
+ * Represents a type predicate.
603
+ *
604
+ * ```ts
605
+ * function isString(x: unknown): x is string {}
606
+ * function assert(condition: boolean): asserts condition {}
607
+ * ```
608
+ * @category Types
609
+ */
610
+ export class PredicateType extends Type {
611
+ name;
612
+ asserts;
613
+ targetType;
614
+ type = "predicate";
615
+ /**
616
+ * Create a new PredicateType instance.
617
+ *
618
+ * @param name The identifier name which is tested by the predicate.
619
+ * @param asserts True if the type is of the form `asserts val is string`,
620
+ * false if the type is of the form `val is string`
621
+ * @param targetType The type that the identifier is tested to be.
622
+ * May be undefined if the type is of the form `asserts val`.
623
+ * Will be defined if the type is of the form `asserts val is string` or `val is string`.
624
+ */
625
+ constructor(name, asserts, targetType) {
626
+ super();
627
+ this.name = name;
628
+ this.asserts = asserts;
629
+ this.targetType = targetType;
630
+ }
631
+ /**
632
+ * Return a string representation of this type.
633
+ */
634
+ getTypeString() {
635
+ const out = this.asserts ? ["asserts", this.name] : [this.name];
636
+ if (this.targetType) {
637
+ out.push("is", this.targetType.stringify(TypeContext.predicateTarget));
638
+ }
639
+ return out.join(" ");
640
+ }
641
+ needsParenthesis() {
642
+ return false;
643
+ }
644
+ toObject(serializer) {
645
+ return {
646
+ type: this.type,
647
+ name: this.name,
648
+ asserts: this.asserts,
649
+ targetType: serializer.toObject(this.targetType),
650
+ };
651
+ }
652
+ }
653
+ /**
654
+ * Represents a type that is constructed by querying the type of a reflection.
655
+ * ```ts
656
+ * const x = 1
657
+ * type Z = typeof x // query on reflection for x
658
+ * ```
659
+ * @category Types
660
+ */
661
+ export class QueryType extends Type {
662
+ queryType;
663
+ type = "query";
664
+ constructor(queryType) {
665
+ super();
666
+ this.queryType = queryType;
667
+ }
668
+ getTypeString() {
669
+ return `typeof ${this.queryType.stringify(TypeContext.queryTypeTarget)}`;
670
+ }
671
+ /**
672
+ * @privateRemarks
673
+ * An argument could be made that this ought to return true for indexedObject
674
+ * since precedence is different than on the value side... if someone really cares
675
+ * they can easily use a custom theme to change this.
676
+ */
677
+ needsParenthesis() {
678
+ return false;
679
+ }
680
+ toObject(serializer) {
681
+ return {
682
+ type: this.type,
683
+ queryType: serializer.toObject(this.queryType),
684
+ };
685
+ }
686
+ }
687
+ /**
688
+ * Represents a type that refers to another reflection like a class, interface or enum.
689
+ *
690
+ * ```ts
691
+ * let value: MyClass<T>;
692
+ * ```
693
+ * @category Types
694
+ */
695
+ let ReferenceType = (() => {
696
+ let _classSuper = Type;
697
+ let __project_decorators;
698
+ let __project_initializers = [];
699
+ let __project_extraInitializers = [];
700
+ return class ReferenceType extends _classSuper {
701
+ static {
702
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
703
+ __project_decorators = [NonEnumerable];
704
+ __esDecorate(null, null, __project_decorators, { kind: "field", name: "_project", static: false, private: false, access: { has: obj => "_project" in obj, get: obj => obj._project, set: (obj, value) => { obj._project = value; } }, metadata: _metadata }, __project_initializers, __project_extraInitializers);
705
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
706
+ }
707
+ type = "reference";
708
+ /**
709
+ * The name of the referenced type.
710
+ *
711
+ * If the symbol cannot be found because it's not part of the documentation this
712
+ * can be used to represent the type.
713
+ */
714
+ name;
715
+ /**
716
+ * The type arguments of this reference.
717
+ */
718
+ typeArguments;
719
+ /**
720
+ * The resolved reflection.
721
+ */
722
+ get reflection() {
723
+ if (typeof this._target === "number") {
724
+ return this._project?.getReflectionById(this._target);
725
+ }
726
+ const resolvePotential = this._project?.getReflectionsFromSymbolId(this._target);
727
+ if (!resolvePotential?.length) {
728
+ return;
729
+ }
730
+ const kind = this.preferValues
731
+ ? ReflectionKind.ValueReferenceTarget
732
+ : ReflectionKind.TypeReferenceTarget;
733
+ const resolved = resolvePotential.find((refl) => refl.kindOf(kind)) ||
734
+ resolvePotential.find((refl) => refl.kindOf(~kind));
735
+ // Do not mark the type as resolved at this point so that if it
736
+ // points to a member which is removed (e.g. by typedoc-plugin-zod)
737
+ // and then replaced it still ends up pointing at the right reflection.
738
+ // We will lock type reference resolution when serializing to JSON.
739
+ // this._target = resolved.id;
740
+ return resolved;
741
+ }
742
+ /**
743
+ * Sometimes a few properties are more important than the rest
744
+ * of the properties within a type. This occurs most often with
745
+ * object parameters, where users want to specify `@param foo.bar`
746
+ * to highlight something about the `bar` property.
747
+ *
748
+ * Does NOT support nested properties.
749
+ */
750
+ highlightedProperties;
751
+ /**
752
+ * If not resolved, the symbol id of the reflection, otherwise undefined.
753
+ */
754
+ get symbolId() {
755
+ if (!this.reflection && typeof this._target === "object") {
756
+ return this._target;
757
+ }
758
+ }
759
+ /**
760
+ * Checks if this type is a reference type because it uses a name, but is intentionally not pointing
761
+ * to a reflection. This happens for type parameters and when representing a mapped type.
762
+ */
763
+ isIntentionallyBroken() {
764
+ if (typeof this._target === "object" &&
765
+ this._project?.symbolIdHasBeenRemoved(this._target)) {
766
+ return true;
767
+ }
768
+ return this._target === -1 || this.refersToTypeParameter;
769
+ }
770
+ /**
771
+ * Convert this reference type to a declaration reference used for resolution of external types.
772
+ */
773
+ toDeclarationReference() {
774
+ return {
775
+ resolutionStart: "global",
776
+ moduleSource: this.package,
777
+ symbolReference: {
778
+ path: this.qualifiedName
779
+ .split(".")
780
+ .map((p) => ({ path: p, navigation: "." })),
781
+ },
782
+ };
783
+ }
784
+ /**
785
+ * The fully qualified name of the referenced type, relative to the file it is defined in.
786
+ * This will usually be the same as `name`, unless namespaces are used.
787
+ */
788
+ qualifiedName;
789
+ /**
790
+ * The package that this type is referencing.
791
+ */
792
+ package;
793
+ /**
794
+ * If this reference type refers to a reflection defined by a project not being rendered,
795
+ * points to the url that this type should be linked to.
796
+ */
797
+ externalUrl;
798
+ /**
799
+ * If set, no warnings about something not being exported should be created
800
+ * since this may be referring to a type created with `infer X` which will not
801
+ * be registered on the project.
802
+ */
803
+ refersToTypeParameter = false;
804
+ /**
805
+ * If set, will prefer reflections with {@link ReflectionKind | ReflectionKinds} which represent
806
+ * values rather than those which represent types.
807
+ */
808
+ preferValues = false;
809
+ _target;
810
+ _project = __runInitializers(this, __project_initializers, void 0);
811
+ constructor(name, target, project, qualifiedName) {
812
+ super();
813
+ __runInitializers(this, __project_extraInitializers);
814
+ this.name = name;
815
+ if (typeof target === "number") {
816
+ this._target = target;
817
+ }
818
+ else {
819
+ this._target = "variant" in target ? target.id : target;
820
+ }
821
+ this._project = project;
822
+ this.qualifiedName = qualifiedName;
823
+ }
824
+ static createUnresolvedReference(name, target, project, qualifiedName) {
825
+ return new ReferenceType(name, target, project, qualifiedName);
826
+ }
827
+ static createResolvedReference(name, target, project) {
828
+ return new ReferenceType(name, target, project, name);
829
+ }
830
+ /**
831
+ * This is used for type parameters, which don't actually point to something,
832
+ * and also for temporary references which will be cleaned up with real references
833
+ * later during conversion.
834
+ * @internal
835
+ */
836
+ static createBrokenReference(name, project, packageName) {
837
+ const ref = new ReferenceType(name, -1, project, name);
838
+ ref.package = packageName;
839
+ return ref;
840
+ }
841
+ getTypeString() {
842
+ const name = this.reflection ? this.reflection.name : this.name;
843
+ let typeArgs = "";
844
+ if (this.typeArguments && this.typeArguments.length > 0) {
845
+ typeArgs += "<";
846
+ typeArgs += this.typeArguments
847
+ .map((arg) => arg.stringify(TypeContext.referenceTypeArgument))
848
+ .join(", ");
849
+ typeArgs += ">";
850
+ }
851
+ return name + typeArgs;
852
+ }
853
+ needsParenthesis() {
854
+ return false;
855
+ }
856
+ toObject(serializer) {
857
+ let target;
858
+ if (typeof this._target === "number") {
859
+ target = this._target;
860
+ }
861
+ else if (this._project?.symbolIdHasBeenRemoved(this._target)) {
862
+ target = -1;
863
+ }
864
+ else if (this.reflection) {
865
+ target = this.reflection.id;
866
+ }
867
+ else {
868
+ target = this._target.toObject();
869
+ }
870
+ const result = {
871
+ type: this.type,
872
+ target,
873
+ typeArguments: serializer.toObjectsOptional(this.typeArguments),
874
+ name: this.name,
875
+ package: this.package,
876
+ externalUrl: this.externalUrl,
877
+ };
878
+ if (this.name !== this.qualifiedName) {
879
+ result.qualifiedName = this.qualifiedName;
880
+ }
881
+ if (this.refersToTypeParameter) {
882
+ result.refersToTypeParameter = true;
883
+ }
884
+ if (typeof target !== "number" && this.preferValues) {
885
+ result.preferValues = true;
886
+ }
887
+ if (this.highlightedProperties) {
888
+ result.highlightedProperties = Object.fromEntries(Array.from(this.highlightedProperties.entries(), ([key, parts]) => {
889
+ return [
890
+ key,
891
+ Comment.serializeDisplayParts(parts),
892
+ ];
893
+ }));
894
+ }
895
+ return result;
896
+ }
897
+ fromObject(de, obj) {
898
+ this.typeArguments = de.reviveMany(obj.typeArguments, (t) => de.constructType(t));
899
+ if (typeof obj.target === "number") {
900
+ if (obj.target === -1) {
901
+ this._target = -1;
902
+ }
903
+ else {
904
+ de.defer((project) => {
905
+ const target = project.getReflectionById(de.oldIdToNewId[obj.target] ?? -1);
906
+ if (target) {
907
+ this._project = project;
908
+ this._target = target.id;
909
+ }
910
+ else {
911
+ de.logger.warn(i18n.serialized_project_referenced_0_not_part_of_project(JSON.stringify(obj.target)));
912
+ }
913
+ });
914
+ }
915
+ }
916
+ else {
917
+ this._project = de.project;
918
+ this._target = new ReflectionSymbolId(obj.target);
919
+ }
920
+ this.qualifiedName = obj.qualifiedName ?? obj.name;
921
+ this.package = obj.package;
922
+ this.refersToTypeParameter = !!obj.refersToTypeParameter;
923
+ this.preferValues = !!obj.preferValues;
924
+ if (obj.highlightedProperties) {
925
+ this.highlightedProperties = new Map();
926
+ for (const [key, parts] of Object.entries(obj.highlightedProperties)) {
927
+ this.highlightedProperties.set(key, Comment.deserializeDisplayParts(de, parts));
928
+ }
929
+ }
930
+ }
931
+ };
932
+ })();
933
+ export { ReferenceType };
934
+ /**
935
+ * Represents a type which has it's own reflection like literal types.
936
+ * This type will likely go away at some point and be replaced by a dedicated
937
+ * `ObjectType`. Allowing reflections to be nested within types causes much
938
+ * pain in the rendering code.
939
+ *
940
+ * ```ts
941
+ * let value: { a: string, b: number };
942
+ * ```
943
+ * @category Types
944
+ */
945
+ export class ReflectionType extends Type {
946
+ declaration;
947
+ type = "reflection";
948
+ constructor(declaration) {
949
+ super();
950
+ this.declaration = declaration;
951
+ }
952
+ getTypeString() {
953
+ const parts = [];
954
+ const sigs = this.declaration.getNonIndexSignatures();
955
+ for (const sig of sigs) {
956
+ parts.push(sigStr(sig, ": "));
957
+ }
958
+ for (const p of this.declaration.children || []) {
959
+ parts.push(`${p.name}${propertySep(p)} ${typeStr(p.type)}`);
960
+ }
961
+ for (const s of this.declaration.indexSignatures || []) {
962
+ parts.push(sigStr(s, ": ", "[]"));
963
+ }
964
+ if (sigs.length === 1 && parts.length === 1) {
965
+ return sigStr(sigs[0], " => ");
966
+ }
967
+ if (parts.length === 0) {
968
+ return "{}";
969
+ }
970
+ return `{ ${parts.join("; ")} }`;
971
+ }
972
+ needsParenthesis(where) {
973
+ if (this.declaration.children || this.declaration.indexSignatures) {
974
+ return false;
975
+ }
976
+ if (this.declaration.signatures?.length === 1) {
977
+ return where === TypeContext.arrayElement || where === TypeContext.unionElement;
978
+ }
979
+ return false;
980
+ }
981
+ toObject(serializer) {
982
+ return {
983
+ type: this.type,
984
+ declaration: serializer.toObject(this.declaration),
985
+ };
986
+ }
987
+ }
988
+ /**
989
+ * Represents a rest type
990
+ * ```ts
991
+ * type Z = [1, ...2[]]
992
+ * // ^^^^^^
993
+ * ```
994
+ * @category Types
995
+ */
996
+ export class RestType extends Type {
997
+ elementType;
998
+ type = "rest";
999
+ constructor(elementType) {
1000
+ super();
1001
+ this.elementType = elementType;
1002
+ }
1003
+ getTypeString() {
1004
+ return `...${this.elementType.stringify(TypeContext.restElement)}`;
1005
+ }
1006
+ needsParenthesis() {
1007
+ return false;
1008
+ }
1009
+ toObject(serializer) {
1010
+ return {
1011
+ type: this.type,
1012
+ elementType: serializer.toObject(this.elementType),
1013
+ };
1014
+ }
1015
+ }
1016
+ /**
1017
+ * TS 4.1 template literal types
1018
+ * ```ts
1019
+ * type Z = `${'a' | 'b'}${'a' | 'b'}`
1020
+ * ```
1021
+ * @category Types
1022
+ */
1023
+ export class TemplateLiteralType extends Type {
1024
+ head;
1025
+ tail;
1026
+ type = "templateLiteral";
1027
+ constructor(head, tail) {
1028
+ super();
1029
+ this.head = head;
1030
+ this.tail = tail;
1031
+ }
1032
+ getTypeString() {
1033
+ return [
1034
+ "`",
1035
+ this.head,
1036
+ ...this.tail.map(([type, text]) => {
1037
+ return ("${" +
1038
+ type.stringify(TypeContext.templateLiteralElement) +
1039
+ "}" +
1040
+ text);
1041
+ }),
1042
+ "`",
1043
+ ].join("");
1044
+ }
1045
+ needsParenthesis() {
1046
+ return false;
1047
+ }
1048
+ toObject(serializer) {
1049
+ return {
1050
+ type: this.type,
1051
+ head: this.head,
1052
+ tail: this.tail.map(([type, text]) => [
1053
+ serializer.toObject(type),
1054
+ text,
1055
+ ]),
1056
+ };
1057
+ }
1058
+ }
1059
+ /**
1060
+ * Represents a tuple type.
1061
+ *
1062
+ * ```ts
1063
+ * let value: [string, boolean];
1064
+ * ```
1065
+ * @category Types
1066
+ */
1067
+ export class TupleType extends Type {
1068
+ elements;
1069
+ type = "tuple";
1070
+ /**
1071
+ * @param elements The ordered type elements of the tuple type.
1072
+ */
1073
+ constructor(elements) {
1074
+ super();
1075
+ this.elements = elements;
1076
+ }
1077
+ getTypeString() {
1078
+ return ("[" +
1079
+ this.elements
1080
+ .map((t) => t.stringify(TypeContext.tupleElement))
1081
+ .join(", ") +
1082
+ "]");
1083
+ }
1084
+ needsParenthesis() {
1085
+ return false;
1086
+ }
1087
+ toObject(serializer) {
1088
+ return {
1089
+ type: this.type,
1090
+ elements: serializer.toObjectsOptional(this.elements),
1091
+ };
1092
+ }
1093
+ }
1094
+ /**
1095
+ * Represents a named member of a tuple type.
1096
+ *
1097
+ * ```ts
1098
+ * let value: [name: string];
1099
+ * ```
1100
+ * @category Types
1101
+ */
1102
+ export class NamedTupleMember extends Type {
1103
+ name;
1104
+ isOptional;
1105
+ element;
1106
+ type = "namedTupleMember";
1107
+ constructor(name, isOptional, element) {
1108
+ super();
1109
+ this.name = name;
1110
+ this.isOptional = isOptional;
1111
+ this.element = element;
1112
+ }
1113
+ /**
1114
+ * Return a string representation of this type.
1115
+ */
1116
+ getTypeString() {
1117
+ return `${this.name}${this.isOptional ? "?" : ""}: ${this.element.stringify(TypeContext.tupleElement)}`;
1118
+ }
1119
+ needsParenthesis() {
1120
+ return false;
1121
+ }
1122
+ toObject(serializer) {
1123
+ return {
1124
+ type: this.type,
1125
+ name: this.name,
1126
+ isOptional: this.isOptional,
1127
+ element: serializer.toObject(this.element),
1128
+ };
1129
+ }
1130
+ }
1131
+ /**
1132
+ * Represents a type operator type.
1133
+ *
1134
+ * ```ts
1135
+ * class A {}
1136
+ * class B<T extends keyof A> {}
1137
+ * ```
1138
+ * @category Types
1139
+ */
1140
+ export class TypeOperatorType extends Type {
1141
+ target;
1142
+ operator;
1143
+ type = "typeOperator";
1144
+ constructor(target, operator) {
1145
+ super();
1146
+ this.target = target;
1147
+ this.operator = operator;
1148
+ }
1149
+ getTypeString() {
1150
+ return `${this.operator} ${this.target.stringify(TypeContext.typeOperatorTarget)}`;
1151
+ }
1152
+ needsParenthesis(context) {
1153
+ const map = {
1154
+ none: false,
1155
+ templateLiteralElement: false,
1156
+ arrayElement: true,
1157
+ indexedAccessElement: false,
1158
+ conditionalCheck: false,
1159
+ conditionalExtends: false,
1160
+ conditionalTrue: false,
1161
+ conditionalFalse: false,
1162
+ indexedIndex: false,
1163
+ indexedObject: true,
1164
+ inferredConstraint: false,
1165
+ intersectionElement: false,
1166
+ mappedName: false,
1167
+ mappedParameter: false,
1168
+ mappedTemplate: false,
1169
+ optionalElement: true,
1170
+ predicateTarget: false,
1171
+ queryTypeTarget: false,
1172
+ typeOperatorTarget: false,
1173
+ referenceTypeArgument: false,
1174
+ restElement: false,
1175
+ tupleElement: false,
1176
+ unionElement: false,
1177
+ };
1178
+ return map[context];
1179
+ }
1180
+ toObject(serializer) {
1181
+ return {
1182
+ type: this.type,
1183
+ operator: this.operator,
1184
+ target: serializer.toObject(this.target),
1185
+ };
1186
+ }
1187
+ }
1188
+ /**
1189
+ * Represents an union type.
1190
+ *
1191
+ * ```ts
1192
+ * let value: string | string[];
1193
+ * ```
1194
+ * @category Types
1195
+ */
1196
+ export class UnionType extends Type {
1197
+ types;
1198
+ type = "union";
1199
+ /**
1200
+ * If present, there should be as many items in this array as there are items in the {@link types} array.
1201
+ *
1202
+ * This member is only valid on unions which are on {@link DeclarationReflection.type | DeclarationReflection.type} with a
1203
+ * {@link ReflectionKind} `kind` of `TypeAlias`. Specifying it on any other union is undefined behavior.
1204
+ */
1205
+ elementSummaries;
1206
+ constructor(types) {
1207
+ super();
1208
+ this.types = types;
1209
+ }
1210
+ getTypeString() {
1211
+ return this.types
1212
+ .map((t) => t.stringify(TypeContext.unionElement))
1213
+ .join(" | ");
1214
+ }
1215
+ needsParenthesis(context) {
1216
+ const map = {
1217
+ none: false,
1218
+ templateLiteralElement: false,
1219
+ arrayElement: true,
1220
+ indexedAccessElement: false,
1221
+ conditionalCheck: true,
1222
+ conditionalExtends: false,
1223
+ conditionalTrue: false,
1224
+ conditionalFalse: false,
1225
+ indexedIndex: false,
1226
+ indexedObject: true,
1227
+ inferredConstraint: false,
1228
+ intersectionElement: true,
1229
+ mappedName: false,
1230
+ mappedParameter: false,
1231
+ mappedTemplate: false,
1232
+ optionalElement: true,
1233
+ predicateTarget: false,
1234
+ queryTypeTarget: false,
1235
+ typeOperatorTarget: true,
1236
+ referenceTypeArgument: false,
1237
+ restElement: false,
1238
+ tupleElement: false,
1239
+ unionElement: false,
1240
+ };
1241
+ return map[context];
1242
+ }
1243
+ fromObject(de, obj) {
1244
+ if (obj.elementSummaries) {
1245
+ this.elementSummaries = obj.elementSummaries.map((parts) => Comment.deserializeDisplayParts(de, parts));
1246
+ }
1247
+ }
1248
+ toObject(serializer) {
1249
+ return {
1250
+ type: this.type,
1251
+ types: this.types.map((t) => serializer.toObject(t)),
1252
+ elementSummaries: this.elementSummaries?.map((parts) => Comment.serializeDisplayParts(parts)),
1253
+ };
1254
+ }
1255
+ }
1256
+ /**
1257
+ * Represents all unknown types that cannot be converted by TypeDoc.
1258
+ * @category Types
1259
+ */
1260
+ export class UnknownType extends Type {
1261
+ type = "unknown";
1262
+ /**
1263
+ * A string representation of the type as returned from TypeScript compiler.
1264
+ */
1265
+ name;
1266
+ constructor(name) {
1267
+ super();
1268
+ this.name = name;
1269
+ }
1270
+ getTypeString() {
1271
+ return this.name;
1272
+ }
1273
+ /**
1274
+ * Always returns true if not at the root level, we have no idea what's in here, so wrap it in parenthesis
1275
+ * to be extra safe.
1276
+ */
1277
+ needsParenthesis(context) {
1278
+ return context !== TypeContext.none;
1279
+ }
1280
+ toObject() {
1281
+ return {
1282
+ type: this.type,
1283
+ name: this.name,
1284
+ };
1285
+ }
1286
+ }
1287
+ function propertySep(refl) {
1288
+ return refl.flags.isOptional ? "?:" : ":";
1289
+ }
1290
+ function typeStr(type) {
1291
+ return type?.toString() ?? "any";
1292
+ }
1293
+ function sigStr(sig, sep, brackets = "()") {
1294
+ const params = joinArray(sig.parameters, ", ", (p) => `${p.name}${propertySep(p)} ${typeStr(p.type)}`);
1295
+ return `${brackets[0]}${params}${brackets[1]}${sep}${typeStr(sig.type)}`;
1296
+ }