@microsoft/api-extractor-model 7.32.2 → 7.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/CHANGELOG.json +34 -0
  2. package/CHANGELOG.md +15 -1
  3. package/dist/tsdoc-metadata.json +1 -1
  4. package/lib-esm/aedoc/AedocDefinitions.js +57 -0
  5. package/lib-esm/aedoc/AedocDefinitions.js.map +1 -0
  6. package/lib-esm/aedoc/ReleaseTag.js +87 -0
  7. package/lib-esm/aedoc/ReleaseTag.js.map +1 -0
  8. package/lib-esm/index.js +58 -0
  9. package/lib-esm/index.js.map +1 -0
  10. package/lib-esm/items/ApiDeclaredItem.js +137 -0
  11. package/lib-esm/items/ApiDeclaredItem.js.map +1 -0
  12. package/lib-esm/items/ApiDocumentedItem.js +48 -0
  13. package/lib-esm/items/ApiDocumentedItem.js.map +1 -0
  14. package/lib-esm/items/ApiItem.js +270 -0
  15. package/lib-esm/items/ApiItem.js.map +1 -0
  16. package/lib-esm/items/ApiPropertyItem.js +45 -0
  17. package/lib-esm/items/ApiPropertyItem.js.map +1 -0
  18. package/lib-esm/mixins/ApiAbstractMixin.js +58 -0
  19. package/lib-esm/mixins/ApiAbstractMixin.js.map +1 -0
  20. package/lib-esm/mixins/ApiExportedMixin.js +63 -0
  21. package/lib-esm/mixins/ApiExportedMixin.js.map +1 -0
  22. package/lib-esm/mixins/ApiInitializerMixin.js +70 -0
  23. package/lib-esm/mixins/ApiInitializerMixin.js.map +1 -0
  24. package/lib-esm/mixins/ApiItemContainerMixin.js +319 -0
  25. package/lib-esm/mixins/ApiItemContainerMixin.js.map +1 -0
  26. package/lib-esm/mixins/ApiNameMixin.js +61 -0
  27. package/lib-esm/mixins/ApiNameMixin.js.map +1 -0
  28. package/lib-esm/mixins/ApiOptionalMixin.js +57 -0
  29. package/lib-esm/mixins/ApiOptionalMixin.js.map +1 -0
  30. package/lib-esm/mixins/ApiParameterListMixin.js +93 -0
  31. package/lib-esm/mixins/ApiParameterListMixin.js.map +1 -0
  32. package/lib-esm/mixins/ApiProtectedMixin.js +57 -0
  33. package/lib-esm/mixins/ApiProtectedMixin.js.map +1 -0
  34. package/lib-esm/mixins/ApiReadonlyMixin.js +58 -0
  35. package/lib-esm/mixins/ApiReadonlyMixin.js.map +1 -0
  36. package/lib-esm/mixins/ApiReleaseTagMixin.js +65 -0
  37. package/lib-esm/mixins/ApiReleaseTagMixin.js.map +1 -0
  38. package/lib-esm/mixins/ApiReturnTypeMixin.js +65 -0
  39. package/lib-esm/mixins/ApiReturnTypeMixin.js.map +1 -0
  40. package/lib-esm/mixins/ApiStaticMixin.js +57 -0
  41. package/lib-esm/mixins/ApiStaticMixin.js.map +1 -0
  42. package/lib-esm/mixins/ApiTypeParameterListMixin.js +90 -0
  43. package/lib-esm/mixins/ApiTypeParameterListMixin.js.map +1 -0
  44. package/lib-esm/mixins/Excerpt.js +101 -0
  45. package/lib-esm/mixins/Excerpt.js.map +1 -0
  46. package/lib-esm/mixins/IFindApiItemsResult.js +26 -0
  47. package/lib-esm/mixins/IFindApiItemsResult.js.map +1 -0
  48. package/lib-esm/mixins/Mixin.js +4 -0
  49. package/lib-esm/mixins/Mixin.js.map +1 -0
  50. package/lib-esm/model/ApiCallSignature.js +63 -0
  51. package/lib-esm/model/ApiCallSignature.js.map +1 -0
  52. package/lib-esm/model/ApiClass.js +84 -0
  53. package/lib-esm/model/ApiClass.js.map +1 -0
  54. package/lib-esm/model/ApiConstructSignature.js +76 -0
  55. package/lib-esm/model/ApiConstructSignature.js.map +1 -0
  56. package/lib-esm/model/ApiConstructor.js +60 -0
  57. package/lib-esm/model/ApiConstructor.js.map +1 -0
  58. package/lib-esm/model/ApiEntryPoint.js +71 -0
  59. package/lib-esm/model/ApiEntryPoint.js.map +1 -0
  60. package/lib-esm/model/ApiEnum.js +65 -0
  61. package/lib-esm/model/ApiEnum.js.map +1 -0
  62. package/lib-esm/model/ApiEnumMember.js +80 -0
  63. package/lib-esm/model/ApiEnumMember.js.map +1 -0
  64. package/lib-esm/model/ApiFunction.js +58 -0
  65. package/lib-esm/model/ApiFunction.js.map +1 -0
  66. package/lib-esm/model/ApiIndexSignature.js +56 -0
  67. package/lib-esm/model/ApiIndexSignature.js.map +1 -0
  68. package/lib-esm/model/ApiInterface.js +73 -0
  69. package/lib-esm/model/ApiInterface.js.map +1 -0
  70. package/lib-esm/model/ApiMethod.js +65 -0
  71. package/lib-esm/model/ApiMethod.js.map +1 -0
  72. package/lib-esm/model/ApiMethodSignature.js +57 -0
  73. package/lib-esm/model/ApiMethodSignature.js.map +1 -0
  74. package/lib-esm/model/ApiModel.js +170 -0
  75. package/lib-esm/model/ApiModel.js.map +1 -0
  76. package/lib-esm/model/ApiNamespace.js +56 -0
  77. package/lib-esm/model/ApiNamespace.js.map +1 -0
  78. package/lib-esm/model/ApiPackage.js +148 -0
  79. package/lib-esm/model/ApiPackage.js.map +1 -0
  80. package/lib-esm/model/ApiProperty.js +72 -0
  81. package/lib-esm/model/ApiProperty.js.map +1 -0
  82. package/lib-esm/model/ApiPropertySignature.js +51 -0
  83. package/lib-esm/model/ApiPropertySignature.js.map +1 -0
  84. package/lib-esm/model/ApiTypeAlias.js +71 -0
  85. package/lib-esm/model/ApiTypeAlias.js.map +1 -0
  86. package/lib-esm/model/ApiVariable.js +66 -0
  87. package/lib-esm/model/ApiVariable.js.map +1 -0
  88. package/lib-esm/model/Deserializer.js +88 -0
  89. package/lib-esm/model/Deserializer.js.map +1 -0
  90. package/lib-esm/model/DeserializerContext.js +111 -0
  91. package/lib-esm/model/DeserializerContext.js.map +1 -0
  92. package/lib-esm/model/HeritageType.js +25 -0
  93. package/lib-esm/model/HeritageType.js.map +1 -0
  94. package/lib-esm/model/ModelReferenceResolver.js +177 -0
  95. package/lib-esm/model/ModelReferenceResolver.js.map +1 -0
  96. package/lib-esm/model/Parameter.js +39 -0
  97. package/lib-esm/model/Parameter.js.map +1 -0
  98. package/lib-esm/model/SourceLocation.js +35 -0
  99. package/lib-esm/model/SourceLocation.js.map +1 -0
  100. package/lib-esm/model/TypeParameter.js +49 -0
  101. package/lib-esm/model/TypeParameter.js.map +1 -0
  102. package/package.json +29 -5
  103. /package/{lib → lib-commonjs}/aedoc/AedocDefinitions.js +0 -0
  104. /package/{lib → lib-commonjs}/aedoc/AedocDefinitions.js.map +0 -0
  105. /package/{lib → lib-commonjs}/aedoc/ReleaseTag.js +0 -0
  106. /package/{lib → lib-commonjs}/aedoc/ReleaseTag.js.map +0 -0
  107. /package/{lib → lib-commonjs}/index.js +0 -0
  108. /package/{lib → lib-commonjs}/index.js.map +0 -0
  109. /package/{lib → lib-commonjs}/items/ApiDeclaredItem.js +0 -0
  110. /package/{lib → lib-commonjs}/items/ApiDeclaredItem.js.map +0 -0
  111. /package/{lib → lib-commonjs}/items/ApiDocumentedItem.js +0 -0
  112. /package/{lib → lib-commonjs}/items/ApiDocumentedItem.js.map +0 -0
  113. /package/{lib → lib-commonjs}/items/ApiItem.js +0 -0
  114. /package/{lib → lib-commonjs}/items/ApiItem.js.map +0 -0
  115. /package/{lib → lib-commonjs}/items/ApiPropertyItem.js +0 -0
  116. /package/{lib → lib-commonjs}/items/ApiPropertyItem.js.map +0 -0
  117. /package/{lib → lib-commonjs}/mixins/ApiAbstractMixin.js +0 -0
  118. /package/{lib → lib-commonjs}/mixins/ApiAbstractMixin.js.map +0 -0
  119. /package/{lib → lib-commonjs}/mixins/ApiExportedMixin.js +0 -0
  120. /package/{lib → lib-commonjs}/mixins/ApiExportedMixin.js.map +0 -0
  121. /package/{lib → lib-commonjs}/mixins/ApiInitializerMixin.js +0 -0
  122. /package/{lib → lib-commonjs}/mixins/ApiInitializerMixin.js.map +0 -0
  123. /package/{lib → lib-commonjs}/mixins/ApiItemContainerMixin.js +0 -0
  124. /package/{lib → lib-commonjs}/mixins/ApiItemContainerMixin.js.map +0 -0
  125. /package/{lib → lib-commonjs}/mixins/ApiNameMixin.js +0 -0
  126. /package/{lib → lib-commonjs}/mixins/ApiNameMixin.js.map +0 -0
  127. /package/{lib → lib-commonjs}/mixins/ApiOptionalMixin.js +0 -0
  128. /package/{lib → lib-commonjs}/mixins/ApiOptionalMixin.js.map +0 -0
  129. /package/{lib → lib-commonjs}/mixins/ApiParameterListMixin.js +0 -0
  130. /package/{lib → lib-commonjs}/mixins/ApiParameterListMixin.js.map +0 -0
  131. /package/{lib → lib-commonjs}/mixins/ApiProtectedMixin.js +0 -0
  132. /package/{lib → lib-commonjs}/mixins/ApiProtectedMixin.js.map +0 -0
  133. /package/{lib → lib-commonjs}/mixins/ApiReadonlyMixin.js +0 -0
  134. /package/{lib → lib-commonjs}/mixins/ApiReadonlyMixin.js.map +0 -0
  135. /package/{lib → lib-commonjs}/mixins/ApiReleaseTagMixin.js +0 -0
  136. /package/{lib → lib-commonjs}/mixins/ApiReleaseTagMixin.js.map +0 -0
  137. /package/{lib → lib-commonjs}/mixins/ApiReturnTypeMixin.js +0 -0
  138. /package/{lib → lib-commonjs}/mixins/ApiReturnTypeMixin.js.map +0 -0
  139. /package/{lib → lib-commonjs}/mixins/ApiStaticMixin.js +0 -0
  140. /package/{lib → lib-commonjs}/mixins/ApiStaticMixin.js.map +0 -0
  141. /package/{lib → lib-commonjs}/mixins/ApiTypeParameterListMixin.js +0 -0
  142. /package/{lib → lib-commonjs}/mixins/ApiTypeParameterListMixin.js.map +0 -0
  143. /package/{lib → lib-commonjs}/mixins/Excerpt.js +0 -0
  144. /package/{lib → lib-commonjs}/mixins/Excerpt.js.map +0 -0
  145. /package/{lib → lib-commonjs}/mixins/IFindApiItemsResult.js +0 -0
  146. /package/{lib → lib-commonjs}/mixins/IFindApiItemsResult.js.map +0 -0
  147. /package/{lib → lib-commonjs}/mixins/Mixin.js +0 -0
  148. /package/{lib → lib-commonjs}/mixins/Mixin.js.map +0 -0
  149. /package/{lib → lib-commonjs}/model/ApiCallSignature.js +0 -0
  150. /package/{lib → lib-commonjs}/model/ApiCallSignature.js.map +0 -0
  151. /package/{lib → lib-commonjs}/model/ApiClass.js +0 -0
  152. /package/{lib → lib-commonjs}/model/ApiClass.js.map +0 -0
  153. /package/{lib → lib-commonjs}/model/ApiConstructSignature.js +0 -0
  154. /package/{lib → lib-commonjs}/model/ApiConstructSignature.js.map +0 -0
  155. /package/{lib → lib-commonjs}/model/ApiConstructor.js +0 -0
  156. /package/{lib → lib-commonjs}/model/ApiConstructor.js.map +0 -0
  157. /package/{lib → lib-commonjs}/model/ApiEntryPoint.js +0 -0
  158. /package/{lib → lib-commonjs}/model/ApiEntryPoint.js.map +0 -0
  159. /package/{lib → lib-commonjs}/model/ApiEnum.js +0 -0
  160. /package/{lib → lib-commonjs}/model/ApiEnum.js.map +0 -0
  161. /package/{lib → lib-commonjs}/model/ApiEnumMember.js +0 -0
  162. /package/{lib → lib-commonjs}/model/ApiEnumMember.js.map +0 -0
  163. /package/{lib → lib-commonjs}/model/ApiFunction.js +0 -0
  164. /package/{lib → lib-commonjs}/model/ApiFunction.js.map +0 -0
  165. /package/{lib → lib-commonjs}/model/ApiIndexSignature.js +0 -0
  166. /package/{lib → lib-commonjs}/model/ApiIndexSignature.js.map +0 -0
  167. /package/{lib → lib-commonjs}/model/ApiInterface.js +0 -0
  168. /package/{lib → lib-commonjs}/model/ApiInterface.js.map +0 -0
  169. /package/{lib → lib-commonjs}/model/ApiMethod.js +0 -0
  170. /package/{lib → lib-commonjs}/model/ApiMethod.js.map +0 -0
  171. /package/{lib → lib-commonjs}/model/ApiMethodSignature.js +0 -0
  172. /package/{lib → lib-commonjs}/model/ApiMethodSignature.js.map +0 -0
  173. /package/{lib → lib-commonjs}/model/ApiModel.js +0 -0
  174. /package/{lib → lib-commonjs}/model/ApiModel.js.map +0 -0
  175. /package/{lib → lib-commonjs}/model/ApiNamespace.js +0 -0
  176. /package/{lib → lib-commonjs}/model/ApiNamespace.js.map +0 -0
  177. /package/{lib → lib-commonjs}/model/ApiPackage.js +0 -0
  178. /package/{lib → lib-commonjs}/model/ApiPackage.js.map +0 -0
  179. /package/{lib → lib-commonjs}/model/ApiProperty.js +0 -0
  180. /package/{lib → lib-commonjs}/model/ApiProperty.js.map +0 -0
  181. /package/{lib → lib-commonjs}/model/ApiPropertySignature.js +0 -0
  182. /package/{lib → lib-commonjs}/model/ApiPropertySignature.js.map +0 -0
  183. /package/{lib → lib-commonjs}/model/ApiTypeAlias.js +0 -0
  184. /package/{lib → lib-commonjs}/model/ApiTypeAlias.js.map +0 -0
  185. /package/{lib → lib-commonjs}/model/ApiVariable.js +0 -0
  186. /package/{lib → lib-commonjs}/model/ApiVariable.js.map +0 -0
  187. /package/{lib → lib-commonjs}/model/Deserializer.js +0 -0
  188. /package/{lib → lib-commonjs}/model/Deserializer.js.map +0 -0
  189. /package/{lib → lib-commonjs}/model/DeserializerContext.js +0 -0
  190. /package/{lib → lib-commonjs}/model/DeserializerContext.js.map +0 -0
  191. /package/{lib → lib-commonjs}/model/HeritageType.js +0 -0
  192. /package/{lib → lib-commonjs}/model/HeritageType.js.map +0 -0
  193. /package/{lib → lib-commonjs}/model/ModelReferenceResolver.js +0 -0
  194. /package/{lib → lib-commonjs}/model/ModelReferenceResolver.js.map +0 -0
  195. /package/{lib → lib-commonjs}/model/Parameter.js +0 -0
  196. /package/{lib → lib-commonjs}/model/Parameter.js.map +0 -0
  197. /package/{lib → lib-commonjs}/model/SourceLocation.js +0 -0
  198. /package/{lib → lib-commonjs}/model/SourceLocation.js.map +0 -0
  199. /package/{lib → lib-commonjs}/model/TypeParameter.js +0 -0
  200. /package/{lib → lib-commonjs}/model/TypeParameter.js.map +0 -0
  201. /package/{lib → lib-dts}/aedoc/AedocDefinitions.d.ts +0 -0
  202. /package/{lib → lib-dts}/aedoc/AedocDefinitions.d.ts.map +0 -0
  203. /package/{lib → lib-dts}/aedoc/ReleaseTag.d.ts +0 -0
  204. /package/{lib → lib-dts}/aedoc/ReleaseTag.d.ts.map +0 -0
  205. /package/{lib → lib-dts}/index.d.ts +0 -0
  206. /package/{lib → lib-dts}/index.d.ts.map +0 -0
  207. /package/{lib → lib-dts}/items/ApiDeclaredItem.d.ts +0 -0
  208. /package/{lib → lib-dts}/items/ApiDeclaredItem.d.ts.map +0 -0
  209. /package/{lib → lib-dts}/items/ApiDocumentedItem.d.ts +0 -0
  210. /package/{lib → lib-dts}/items/ApiDocumentedItem.d.ts.map +0 -0
  211. /package/{lib → lib-dts}/items/ApiItem.d.ts +0 -0
  212. /package/{lib → lib-dts}/items/ApiItem.d.ts.map +0 -0
  213. /package/{lib → lib-dts}/items/ApiPropertyItem.d.ts +0 -0
  214. /package/{lib → lib-dts}/items/ApiPropertyItem.d.ts.map +0 -0
  215. /package/{lib → lib-dts}/mixins/ApiAbstractMixin.d.ts +0 -0
  216. /package/{lib → lib-dts}/mixins/ApiAbstractMixin.d.ts.map +0 -0
  217. /package/{lib → lib-dts}/mixins/ApiExportedMixin.d.ts +0 -0
  218. /package/{lib → lib-dts}/mixins/ApiExportedMixin.d.ts.map +0 -0
  219. /package/{lib → lib-dts}/mixins/ApiInitializerMixin.d.ts +0 -0
  220. /package/{lib → lib-dts}/mixins/ApiInitializerMixin.d.ts.map +0 -0
  221. /package/{lib → lib-dts}/mixins/ApiItemContainerMixin.d.ts +0 -0
  222. /package/{lib → lib-dts}/mixins/ApiItemContainerMixin.d.ts.map +0 -0
  223. /package/{lib → lib-dts}/mixins/ApiNameMixin.d.ts +0 -0
  224. /package/{lib → lib-dts}/mixins/ApiNameMixin.d.ts.map +0 -0
  225. /package/{lib → lib-dts}/mixins/ApiOptionalMixin.d.ts +0 -0
  226. /package/{lib → lib-dts}/mixins/ApiOptionalMixin.d.ts.map +0 -0
  227. /package/{lib → lib-dts}/mixins/ApiParameterListMixin.d.ts +0 -0
  228. /package/{lib → lib-dts}/mixins/ApiParameterListMixin.d.ts.map +0 -0
  229. /package/{lib → lib-dts}/mixins/ApiProtectedMixin.d.ts +0 -0
  230. /package/{lib → lib-dts}/mixins/ApiProtectedMixin.d.ts.map +0 -0
  231. /package/{lib → lib-dts}/mixins/ApiReadonlyMixin.d.ts +0 -0
  232. /package/{lib → lib-dts}/mixins/ApiReadonlyMixin.d.ts.map +0 -0
  233. /package/{lib → lib-dts}/mixins/ApiReleaseTagMixin.d.ts +0 -0
  234. /package/{lib → lib-dts}/mixins/ApiReleaseTagMixin.d.ts.map +0 -0
  235. /package/{lib → lib-dts}/mixins/ApiReturnTypeMixin.d.ts +0 -0
  236. /package/{lib → lib-dts}/mixins/ApiReturnTypeMixin.d.ts.map +0 -0
  237. /package/{lib → lib-dts}/mixins/ApiStaticMixin.d.ts +0 -0
  238. /package/{lib → lib-dts}/mixins/ApiStaticMixin.d.ts.map +0 -0
  239. /package/{lib → lib-dts}/mixins/ApiTypeParameterListMixin.d.ts +0 -0
  240. /package/{lib → lib-dts}/mixins/ApiTypeParameterListMixin.d.ts.map +0 -0
  241. /package/{lib → lib-dts}/mixins/Excerpt.d.ts +0 -0
  242. /package/{lib → lib-dts}/mixins/Excerpt.d.ts.map +0 -0
  243. /package/{lib → lib-dts}/mixins/IFindApiItemsResult.d.ts +0 -0
  244. /package/{lib → lib-dts}/mixins/IFindApiItemsResult.d.ts.map +0 -0
  245. /package/{lib → lib-dts}/mixins/Mixin.d.ts +0 -0
  246. /package/{lib → lib-dts}/mixins/Mixin.d.ts.map +0 -0
  247. /package/{lib → lib-dts}/model/ApiCallSignature.d.ts +0 -0
  248. /package/{lib → lib-dts}/model/ApiCallSignature.d.ts.map +0 -0
  249. /package/{lib → lib-dts}/model/ApiClass.d.ts +0 -0
  250. /package/{lib → lib-dts}/model/ApiClass.d.ts.map +0 -0
  251. /package/{lib → lib-dts}/model/ApiConstructSignature.d.ts +0 -0
  252. /package/{lib → lib-dts}/model/ApiConstructSignature.d.ts.map +0 -0
  253. /package/{lib → lib-dts}/model/ApiConstructor.d.ts +0 -0
  254. /package/{lib → lib-dts}/model/ApiConstructor.d.ts.map +0 -0
  255. /package/{lib → lib-dts}/model/ApiEntryPoint.d.ts +0 -0
  256. /package/{lib → lib-dts}/model/ApiEntryPoint.d.ts.map +0 -0
  257. /package/{lib → lib-dts}/model/ApiEnum.d.ts +0 -0
  258. /package/{lib → lib-dts}/model/ApiEnum.d.ts.map +0 -0
  259. /package/{lib → lib-dts}/model/ApiEnumMember.d.ts +0 -0
  260. /package/{lib → lib-dts}/model/ApiEnumMember.d.ts.map +0 -0
  261. /package/{lib → lib-dts}/model/ApiFunction.d.ts +0 -0
  262. /package/{lib → lib-dts}/model/ApiFunction.d.ts.map +0 -0
  263. /package/{lib → lib-dts}/model/ApiIndexSignature.d.ts +0 -0
  264. /package/{lib → lib-dts}/model/ApiIndexSignature.d.ts.map +0 -0
  265. /package/{lib → lib-dts}/model/ApiInterface.d.ts +0 -0
  266. /package/{lib → lib-dts}/model/ApiInterface.d.ts.map +0 -0
  267. /package/{lib → lib-dts}/model/ApiMethod.d.ts +0 -0
  268. /package/{lib → lib-dts}/model/ApiMethod.d.ts.map +0 -0
  269. /package/{lib → lib-dts}/model/ApiMethodSignature.d.ts +0 -0
  270. /package/{lib → lib-dts}/model/ApiMethodSignature.d.ts.map +0 -0
  271. /package/{lib → lib-dts}/model/ApiModel.d.ts +0 -0
  272. /package/{lib → lib-dts}/model/ApiModel.d.ts.map +0 -0
  273. /package/{lib → lib-dts}/model/ApiNamespace.d.ts +0 -0
  274. /package/{lib → lib-dts}/model/ApiNamespace.d.ts.map +0 -0
  275. /package/{lib → lib-dts}/model/ApiPackage.d.ts +0 -0
  276. /package/{lib → lib-dts}/model/ApiPackage.d.ts.map +0 -0
  277. /package/{lib → lib-dts}/model/ApiProperty.d.ts +0 -0
  278. /package/{lib → lib-dts}/model/ApiProperty.d.ts.map +0 -0
  279. /package/{lib → lib-dts}/model/ApiPropertySignature.d.ts +0 -0
  280. /package/{lib → lib-dts}/model/ApiPropertySignature.d.ts.map +0 -0
  281. /package/{lib → lib-dts}/model/ApiTypeAlias.d.ts +0 -0
  282. /package/{lib → lib-dts}/model/ApiTypeAlias.d.ts.map +0 -0
  283. /package/{lib → lib-dts}/model/ApiVariable.d.ts +0 -0
  284. /package/{lib → lib-dts}/model/ApiVariable.d.ts.map +0 -0
  285. /package/{lib → lib-dts}/model/Deserializer.d.ts +0 -0
  286. /package/{lib → lib-dts}/model/Deserializer.d.ts.map +0 -0
  287. /package/{lib → lib-dts}/model/DeserializerContext.d.ts +0 -0
  288. /package/{lib → lib-dts}/model/DeserializerContext.d.ts.map +0 -0
  289. /package/{lib → lib-dts}/model/HeritageType.d.ts +0 -0
  290. /package/{lib → lib-dts}/model/HeritageType.d.ts.map +0 -0
  291. /package/{lib → lib-dts}/model/ModelReferenceResolver.d.ts +0 -0
  292. /package/{lib → lib-dts}/model/ModelReferenceResolver.d.ts.map +0 -0
  293. /package/{lib → lib-dts}/model/Parameter.d.ts +0 -0
  294. /package/{lib → lib-dts}/model/Parameter.d.ts.map +0 -0
  295. /package/{lib → lib-dts}/model/SourceLocation.d.ts +0 -0
  296. /package/{lib → lib-dts}/model/SourceLocation.d.ts.map +0 -0
  297. /package/{lib → lib-dts}/model/TypeParameter.d.ts +0 -0
  298. /package/{lib → lib-dts}/model/TypeParameter.d.ts.map +0 -0
@@ -0,0 +1,58 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { DeclarationReference, Meaning, Navigation } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
4
+ import { ApiItemKind } from '../items/ApiItem';
5
+ import { ApiDeclaredItem } from '../items/ApiDeclaredItem';
6
+ import { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';
7
+ import { ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';
8
+ import { ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';
9
+ import { ApiNameMixin } from '../mixins/ApiNameMixin';
10
+ import { ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin';
11
+ import { ApiExportedMixin } from '../mixins/ApiExportedMixin';
12
+ /**
13
+ * Represents a TypeScript function declaration.
14
+ *
15
+ * @remarks
16
+ *
17
+ * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
18
+ * API declarations.
19
+ *
20
+ * `ApiFunction` represents a TypeScript declaration such as this example:
21
+ *
22
+ * ```ts
23
+ * export function getAverage(x: number, y: number): number {
24
+ * return (x + y) / 2.0;
25
+ * }
26
+ * ```
27
+ *
28
+ * Functions are exported by an entry point module or by a namespace. Compare with {@link ApiMethod}, which
29
+ * represents a function that is a member of a class.
30
+ *
31
+ * @public
32
+ */
33
+ export class ApiFunction extends ApiNameMixin(ApiTypeParameterListMixin(ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiExportedMixin(ApiDeclaredItem)))))) {
34
+ constructor(options) {
35
+ super(options);
36
+ }
37
+ static getContainerKey(name, overloadIndex) {
38
+ return `${name}|${ApiItemKind.Function}|${overloadIndex}`;
39
+ }
40
+ /** @override */
41
+ get kind() {
42
+ return ApiItemKind.Function;
43
+ }
44
+ /** @override */
45
+ get containerKey() {
46
+ return ApiFunction.getContainerKey(this.name, this.overloadIndex);
47
+ }
48
+ /** @beta @override */
49
+ buildCanonicalReference() {
50
+ const nameComponent = DeclarationReference.parseComponent(this.name);
51
+ const navigation = this.isExported ? Navigation.Exports : Navigation.Locals;
52
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
53
+ .addNavigationStep(navigation, nameComponent)
54
+ .withMeaning(Meaning.Function)
55
+ .withOverloadIndex(this.overloadIndex);
56
+ }
57
+ }
58
+ //# sourceMappingURL=ApiFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiFunction.js","sourceRoot":"","sources":["../../src/model/ApiFunction.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,UAAU,EAEX,MAAM,yDAAyD,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C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IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;aACjF,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC;aAC5C,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;aAC7B,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport {\n DeclarationReference,\n Meaning,\n Navigation,\n type Component\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport { ApiItemKind } from '../items/ApiItem';\nimport { type IApiDeclaredItemOptions, ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport { type IApiParameterListMixinOptions, ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport { type IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';\nimport { type IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport {\n type IApiTypeParameterListMixinOptions,\n ApiTypeParameterListMixin\n} from '../mixins/ApiTypeParameterListMixin';\nimport { type IApiExportedMixinOptions, ApiExportedMixin } from '../mixins/ApiExportedMixin';\n\n/**\n * Constructor options for {@link ApiFunction}.\n * @public\n */\nexport interface IApiFunctionOptions\n extends IApiNameMixinOptions,\n IApiTypeParameterListMixinOptions,\n IApiParameterListMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiReturnTypeMixinOptions,\n IApiDeclaredItemOptions,\n IApiExportedMixinOptions {}\n\n/**\n * Represents a TypeScript function declaration.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiFunction` represents a TypeScript declaration such as this example:\n *\n * ```ts\n * export function getAverage(x: number, y: number): number {\n * return (x + y) / 2.0;\n * }\n * ```\n *\n * Functions are exported by an entry point module or by a namespace. Compare with {@link ApiMethod}, which\n * represents a function that is a member of a class.\n *\n * @public\n */\nexport class ApiFunction extends ApiNameMixin(\n ApiTypeParameterListMixin(\n ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiExportedMixin(ApiDeclaredItem))))\n )\n) {\n public constructor(options: IApiFunctionOptions) {\n super(options);\n }\n\n public static getContainerKey(name: string, overloadIndex: number): string {\n return `${name}|${ApiItemKind.Function}|${overloadIndex}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Function;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiFunction.getContainerKey(this.name, this.overloadIndex);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\n const navigation: Navigation = this.isExported ? Navigation.Exports : Navigation.Locals;\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\n .addNavigationStep(navigation, nameComponent)\n .withMeaning(Meaning.Function)\n .withOverloadIndex(this.overloadIndex);\n }\n}\n"]}
@@ -0,0 +1,56 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { DeclarationReference, Meaning, Navigation } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
4
+ import { ApiItemKind } from '../items/ApiItem';
5
+ import { ApiDeclaredItem } from '../items/ApiDeclaredItem';
6
+ import { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';
7
+ import { ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';
8
+ import { ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';
9
+ import { ApiReadonlyMixin } from '../mixins/ApiReadonlyMixin';
10
+ /**
11
+ * Represents a TypeScript index signature.
12
+ *
13
+ * @remarks
14
+ *
15
+ * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
16
+ * API declarations.
17
+ *
18
+ * `ApiIndexSignature` represents a TypeScript declaration such as `[x: number]: number` in this example:
19
+ *
20
+ * ```ts
21
+ * export interface INumberTable {
22
+ * // An index signature
23
+ * [value: number]: number;
24
+ *
25
+ * // An overloaded index signature
26
+ * [name: string]: number;
27
+ * }
28
+ * ```
29
+ *
30
+ * @public
31
+ */
32
+ export class ApiIndexSignature extends ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiReadonlyMixin(ApiDeclaredItem)))) {
33
+ constructor(options) {
34
+ super(options);
35
+ }
36
+ static getContainerKey(overloadIndex) {
37
+ return `|${ApiItemKind.IndexSignature}|${overloadIndex}`;
38
+ }
39
+ /** @override */
40
+ get kind() {
41
+ return ApiItemKind.IndexSignature;
42
+ }
43
+ /** @override */
44
+ get containerKey() {
45
+ return ApiIndexSignature.getContainerKey(this.overloadIndex);
46
+ }
47
+ /** @beta @override */
48
+ buildCanonicalReference() {
49
+ const parent = this.parent
50
+ ? this.parent.canonicalReference
51
+ : // .withMeaning() requires some kind of component
52
+ DeclarationReference.empty().addNavigationStep(Navigation.Members, '(parent)');
53
+ return parent.withMeaning(Meaning.IndexSignature).withOverloadIndex(this.overloadIndex);
54
+ }
55
+ }
56
+ //# sourceMappingURL=ApiIndexSignature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiIndexSignature.js","sourceRoot":"","sources":["../../src/model/ApiIndexSignature.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,UAAU,EACX,MAAM,yDAAyD,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAgC,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAsC,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC5G,OAAO,EAAmC,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAmC,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAiC,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAa7F;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB,CAC1D,kBAAkB,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAC1E;IACC,YAAmB,OAAkC;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,aAAqB;QACjD,OAAO,IAAI,WAAW,CAAC,cAAc,IAAI,aAAa,EAAE,CAAC;IAC3D,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,WAAW,CAAC,cAAc,CAAC;IACpC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC/D,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,MAAM,GAAyB,IAAI,CAAC,MAAM;YAC9C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB;YAChC,CAAC,CAAC,iDAAiD;gBACjD,oBAAoB,CAAC,KAAK,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACnF,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport {\n DeclarationReference,\n Meaning,\n Navigation\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport { ApiItemKind } from '../items/ApiItem';\nimport { type IApiDeclaredItemOptions, ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport { type IApiParameterListMixinOptions, ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport { type IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';\nimport { type IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';\nimport { type IApiReadonlyMixinOptions, ApiReadonlyMixin } from '../mixins/ApiReadonlyMixin';\n\n/**\n * Constructor options for {@link ApiIndexSignature}.\n * @public\n */\nexport interface IApiIndexSignatureOptions\n extends IApiParameterListMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiReturnTypeMixinOptions,\n IApiReadonlyMixinOptions,\n IApiDeclaredItemOptions {}\n\n/**\n * Represents a TypeScript index signature.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiIndexSignature` represents a TypeScript declaration such as `[x: number]: number` in this example:\n *\n * ```ts\n * export interface INumberTable {\n * // An index signature\n * [value: number]: number;\n *\n * // An overloaded index signature\n * [name: string]: number;\n * }\n * ```\n *\n * @public\n */\nexport class ApiIndexSignature extends ApiParameterListMixin(\n ApiReleaseTagMixin(ApiReturnTypeMixin(ApiReadonlyMixin(ApiDeclaredItem)))\n) {\n public constructor(options: IApiIndexSignatureOptions) {\n super(options);\n }\n\n public static getContainerKey(overloadIndex: number): string {\n return `|${ApiItemKind.IndexSignature}|${overloadIndex}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.IndexSignature;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiIndexSignature.getContainerKey(this.overloadIndex);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const parent: DeclarationReference = this.parent\n ? this.parent.canonicalReference\n : // .withMeaning() requires some kind of component\n DeclarationReference.empty().addNavigationStep(Navigation.Members, '(parent)');\n return parent.withMeaning(Meaning.IndexSignature).withOverloadIndex(this.overloadIndex);\n }\n}\n"]}
@@ -0,0 +1,73 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { DeclarationReference, Meaning, Navigation } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
4
+ import { ApiItemKind } from '../items/ApiItem';
5
+ import { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';
6
+ import { ApiDeclaredItem } from '../items/ApiDeclaredItem';
7
+ import { ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';
8
+ import { HeritageType } from './HeritageType';
9
+ import { ApiNameMixin } from '../mixins/ApiNameMixin';
10
+ import { ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin';
11
+ import { ApiExportedMixin } from '../mixins/ApiExportedMixin';
12
+ /**
13
+ * Represents a TypeScript class declaration.
14
+ *
15
+ * @remarks
16
+ *
17
+ * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
18
+ * API declarations.
19
+ *
20
+ * `ApiInterface` represents a TypeScript declaration such as this:
21
+ *
22
+ * ```ts
23
+ * export interface X extends Y {
24
+ * }
25
+ * ```
26
+ *
27
+ * @public
28
+ */
29
+ export class ApiInterface extends ApiItemContainerMixin(ApiNameMixin(ApiTypeParameterListMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem))))) {
30
+ constructor(options) {
31
+ super(options);
32
+ this._extendsTypes = [];
33
+ for (const extendsTokenRange of options.extendsTokenRanges) {
34
+ this._extendsTypes.push(new HeritageType(this.buildExcerpt(extendsTokenRange)));
35
+ }
36
+ }
37
+ static getContainerKey(name) {
38
+ return `${name}|${ApiItemKind.Interface}`;
39
+ }
40
+ /** @override */
41
+ static onDeserializeInto(options, context, jsonObject) {
42
+ super.onDeserializeInto(options, context, jsonObject);
43
+ options.extendsTokenRanges = jsonObject.extendsTokenRanges;
44
+ }
45
+ /** @override */
46
+ get kind() {
47
+ return ApiItemKind.Interface;
48
+ }
49
+ /** @override */
50
+ get containerKey() {
51
+ return ApiInterface.getContainerKey(this.name);
52
+ }
53
+ /**
54
+ * The list of base interfaces that this interface inherits from using the `extends` keyword.
55
+ */
56
+ get extendsTypes() {
57
+ return this._extendsTypes;
58
+ }
59
+ /** @override */
60
+ serializeInto(jsonObject) {
61
+ super.serializeInto(jsonObject);
62
+ jsonObject.extendsTokenRanges = this.extendsTypes.map((x) => x.excerpt.tokenRange);
63
+ }
64
+ /** @beta @override */
65
+ buildCanonicalReference() {
66
+ const nameComponent = DeclarationReference.parseComponent(this.name);
67
+ const navigation = this.isExported ? Navigation.Exports : Navigation.Locals;
68
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
69
+ .addNavigationStep(navigation, nameComponent)
70
+ .withMeaning(Meaning.Interface);
71
+ }
72
+ }
73
+ //# sourceMappingURL=ApiInterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiInterface.js","sourceRoot":"","sources":["../../src/model/ApiInterface.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,UAAU,EAEX,MAAM,yDAAyD,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,qBAAqB,EAGtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,kBAAkB,EAEnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAA6B,YAAY,EAA0B,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAGL,yBAAyB,EAC1B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAGL,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AA0BpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,YAAa,SAAQ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,CAAC;IACrF,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,aAAa,GAAc,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,MAAM,UAAU,GAAe,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;QACxF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;aACjF,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC;aAC5C,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport {\n DeclarationReference,\n Meaning,\n Navigation,\n type Component\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport { ApiItemKind } from '../items/ApiItem';\nimport {\n ApiItemContainerMixin,\n type IApiItemContainerMixinOptions,\n type IApiItemContainerJson\n} from '../mixins/ApiItemContainerMixin';\nimport {\n ApiDeclaredItem,\n type IApiDeclaredItemOptions,\n type IApiDeclaredItemJson\n} from '../items/ApiDeclaredItem';\nimport {\n type IApiReleaseTagMixinOptions,\n ApiReleaseTagMixin,\n type IApiReleaseTagMixinJson\n} from '../mixins/ApiReleaseTagMixin';\nimport type { IExcerptTokenRange } from '../mixins/Excerpt';\nimport { HeritageType } from './HeritageType';\nimport { type IApiNameMixinOptions, ApiNameMixin, type IApiNameMixinJson } from '../mixins/ApiNameMixin';\nimport {\n type IApiTypeParameterListMixinOptions,\n type IApiTypeParameterListMixinJson,\n ApiTypeParameterListMixin\n} from '../mixins/ApiTypeParameterListMixin';\nimport type { DeserializerContext } from './DeserializerContext';\nimport {\n type IApiExportedMixinJson,\n type IApiExportedMixinOptions,\n ApiExportedMixin\n} from '../mixins/ApiExportedMixin';\n\n/**\n * Constructor options for {@link ApiInterface}.\n * @public\n */\nexport interface IApiInterfaceOptions\n extends IApiItemContainerMixinOptions,\n IApiNameMixinOptions,\n IApiTypeParameterListMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiDeclaredItemOptions,\n IApiExportedMixinOptions {\n extendsTokenRanges: IExcerptTokenRange[];\n}\n\nexport interface IApiInterfaceJson\n extends IApiItemContainerJson,\n IApiNameMixinJson,\n IApiTypeParameterListMixinJson,\n IApiReleaseTagMixinJson,\n IApiDeclaredItemJson,\n IApiExportedMixinJson {\n extendsTokenRanges: IExcerptTokenRange[];\n}\n\n/**\n * Represents a TypeScript class declaration.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiInterface` represents a TypeScript declaration such as this:\n *\n * ```ts\n * export interface X extends Y {\n * }\n * ```\n *\n * @public\n */\nexport class ApiInterface extends ApiItemContainerMixin(\n ApiNameMixin(ApiTypeParameterListMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem))))\n) {\n private readonly _extendsTypes: HeritageType[] = [];\n\n public constructor(options: IApiInterfaceOptions) {\n super(options);\n\n for (const extendsTokenRange of options.extendsTokenRanges) {\n this._extendsTypes.push(new HeritageType(this.buildExcerpt(extendsTokenRange)));\n }\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.Interface}`;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiInterfaceOptions>,\n context: DeserializerContext,\n jsonObject: IApiInterfaceJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.extendsTokenRanges = jsonObject.extendsTokenRanges;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Interface;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiInterface.getContainerKey(this.name);\n }\n\n /**\n * The list of base interfaces that this interface inherits from using the `extends` keyword.\n */\n public get extendsTypes(): ReadonlyArray<HeritageType> {\n return this._extendsTypes;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiInterfaceJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.extendsTokenRanges = this.extendsTypes.map((x) => x.excerpt.tokenRange);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\n const navigation: Navigation = this.isExported ? Navigation.Exports : Navigation.Locals;\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\n .addNavigationStep(navigation, nameComponent)\n .withMeaning(Meaning.Interface);\n }\n}\n"]}
@@ -0,0 +1,65 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { DeclarationReference, Meaning, Navigation } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
4
+ import { ApiItemKind } from '../items/ApiItem';
5
+ import { ApiProtectedMixin } from '../mixins/ApiProtectedMixin';
6
+ import { ApiStaticMixin } from '../mixins/ApiStaticMixin';
7
+ import { ApiDeclaredItem } from '../items/ApiDeclaredItem';
8
+ import { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';
9
+ import { ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';
10
+ import { ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';
11
+ import { ApiNameMixin } from '../mixins/ApiNameMixin';
12
+ import { ApiAbstractMixin } from '../mixins/ApiAbstractMixin';
13
+ import { ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin';
14
+ import { ApiOptionalMixin } from '../mixins/ApiOptionalMixin';
15
+ /**
16
+ * Represents a TypeScript member function declaration that belongs to an `ApiClass`.
17
+ *
18
+ * @remarks
19
+ *
20
+ * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
21
+ * API declarations.
22
+ *
23
+ * `ApiMethod` represents a TypeScript declaration such as the `render` member function in this example:
24
+ *
25
+ * ```ts
26
+ * export class Widget {
27
+ * public render(): void { }
28
+ * }
29
+ * ```
30
+ *
31
+ * Compare with {@link ApiMethodSignature}, which represents a method belonging to an interface.
32
+ * For example, a class method can be `static` but an interface method cannot.
33
+ *
34
+ * @public
35
+ */
36
+ export class ApiMethod extends ApiNameMixin(ApiAbstractMixin(ApiOptionalMixin(ApiParameterListMixin(ApiProtectedMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiStaticMixin(ApiTypeParameterListMixin(ApiDeclaredItem))))))))) {
37
+ constructor(options) {
38
+ super(options);
39
+ }
40
+ static getContainerKey(name, isStatic, overloadIndex) {
41
+ if (isStatic) {
42
+ return `${name}|${ApiItemKind.Method}|static|${overloadIndex}`;
43
+ }
44
+ else {
45
+ return `${name}|${ApiItemKind.Method}|instance|${overloadIndex}`;
46
+ }
47
+ }
48
+ /** @override */
49
+ get kind() {
50
+ return ApiItemKind.Method;
51
+ }
52
+ /** @override */
53
+ get containerKey() {
54
+ return ApiMethod.getContainerKey(this.name, this.isStatic, this.overloadIndex);
55
+ }
56
+ /** @beta @override */
57
+ buildCanonicalReference() {
58
+ const nameComponent = DeclarationReference.parseComponent(this.name);
59
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
60
+ .addNavigationStep(this.isStatic ? Navigation.Exports : Navigation.Members, nameComponent)
61
+ .withMeaning(Meaning.Member)
62
+ .withOverloadIndex(this.overloadIndex);
63
+ }
64
+ }
65
+ //# sourceMappingURL=ApiMethod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiMethod.js","sourceRoot":"","sources":["../../src/model/ApiMethod.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,UAAU,EAEX,MAAM,yDAAyD,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAkC,MAA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AAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACjF,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,aAAa,GAAc,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;aACjF,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC;aACzF,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC;aAC3B,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport {\n DeclarationReference,\n Meaning,\n Navigation,\n type Component\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport { ApiItemKind } from '../items/ApiItem';\nimport { ApiProtectedMixin, type IApiProtectedMixinOptions } from '../mixins/ApiProtectedMixin';\nimport { ApiStaticMixin, type IApiStaticMixinOptions } from '../mixins/ApiStaticMixin';\nimport { type IApiDeclaredItemOptions, ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport { type IApiParameterListMixinOptions, ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport { type IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';\nimport { ApiReturnTypeMixin, type IApiReturnTypeMixinOptions } from '../mixins/ApiReturnTypeMixin';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport { type IApiAbstractMixinOptions, ApiAbstractMixin } from '../mixins/ApiAbstractMixin';\nimport {\n ApiTypeParameterListMixin,\n type IApiTypeParameterListMixinOptions\n} from '../mixins/ApiTypeParameterListMixin';\nimport { ApiOptionalMixin, type IApiOptionalMixinOptions } from '../mixins/ApiOptionalMixin';\n\n/**\n * Constructor options for {@link ApiMethod}.\n * @public\n */\nexport interface IApiMethodOptions\n extends IApiNameMixinOptions,\n IApiAbstractMixinOptions,\n IApiOptionalMixinOptions,\n IApiParameterListMixinOptions,\n IApiProtectedMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiReturnTypeMixinOptions,\n IApiStaticMixinOptions,\n IApiTypeParameterListMixinOptions,\n IApiDeclaredItemOptions {}\n\n/**\n * Represents a TypeScript member function declaration that belongs to an `ApiClass`.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiMethod` represents a TypeScript declaration such as the `render` member function in this example:\n *\n * ```ts\n * export class Widget {\n * public render(): void { }\n * }\n * ```\n *\n * Compare with {@link ApiMethodSignature}, which represents a method belonging to an interface.\n * For example, a class method can be `static` but an interface method cannot.\n *\n * @public\n */\nexport class ApiMethod extends ApiNameMixin(\n ApiAbstractMixin(\n ApiOptionalMixin(\n ApiParameterListMixin(\n ApiProtectedMixin(\n ApiReleaseTagMixin(ApiReturnTypeMixin(ApiStaticMixin(ApiTypeParameterListMixin(ApiDeclaredItem))))\n )\n )\n )\n )\n) {\n public constructor(options: IApiMethodOptions) {\n super(options);\n }\n\n public static getContainerKey(name: string, isStatic: boolean, overloadIndex: number): string {\n if (isStatic) {\n return `${name}|${ApiItemKind.Method}|static|${overloadIndex}`;\n } else {\n return `${name}|${ApiItemKind.Method}|instance|${overloadIndex}`;\n }\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Method;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiMethod.getContainerKey(this.name, this.isStatic, this.overloadIndex);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\n .addNavigationStep(this.isStatic ? Navigation.Exports : Navigation.Members, nameComponent)\n .withMeaning(Meaning.Member)\n .withOverloadIndex(this.overloadIndex);\n }\n}\n"]}
@@ -0,0 +1,57 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { DeclarationReference, Meaning, Navigation } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
4
+ import { ApiItemKind } from '../items/ApiItem';
5
+ import { ApiDeclaredItem } from '../items/ApiDeclaredItem';
6
+ import { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';
7
+ import { ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';
8
+ import { ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';
9
+ import { ApiNameMixin } from '../mixins/ApiNameMixin';
10
+ import { ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin';
11
+ import { ApiOptionalMixin } from '../mixins/ApiOptionalMixin';
12
+ /**
13
+ * Represents a TypeScript member function declaration that belongs to an `ApiInterface`.
14
+ *
15
+ * @remarks
16
+ *
17
+ * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
18
+ * API declarations.
19
+ *
20
+ * `ApiMethodSignature` represents a TypeScript declaration such as the `render` member function in this example:
21
+ *
22
+ * ```ts
23
+ * export interface IWidget {
24
+ * render(): void;
25
+ * }
26
+ * ```
27
+ *
28
+ * Compare with {@link ApiMethod}, which represents a method belonging to a class.
29
+ * For example, a class method can be `static` but an interface method cannot.
30
+ *
31
+ * @public
32
+ */
33
+ export class ApiMethodSignature extends ApiNameMixin(ApiTypeParameterListMixin(ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiOptionalMixin(ApiDeclaredItem)))))) {
34
+ constructor(options) {
35
+ super(options);
36
+ }
37
+ static getContainerKey(name, overloadIndex) {
38
+ return `${name}|${ApiItemKind.MethodSignature}|${overloadIndex}`;
39
+ }
40
+ /** @override */
41
+ get kind() {
42
+ return ApiItemKind.MethodSignature;
43
+ }
44
+ /** @override */
45
+ get containerKey() {
46
+ return ApiMethodSignature.getContainerKey(this.name, this.overloadIndex);
47
+ }
48
+ /** @beta @override */
49
+ buildCanonicalReference() {
50
+ const nameComponent = DeclarationReference.parseComponent(this.name);
51
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
52
+ .addNavigationStep(Navigation.Members, nameComponent)
53
+ .withMeaning(Meaning.Member)
54
+ .withOverloadIndex(this.overloadIndex);
55
+ }
56
+ }
57
+ //# sourceMappingURL=ApiMethodSignature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiMethodSignature.js","sourceRoot":"","sources":["../../src/model/ApiMethodSignature.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,UAAU,EAEX,MAAM,yDAAyD,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAgC,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAsC,MAAM,iCAAiC,CAAC;AAC5G,OAAO,EAAE,kBAAkB,EAAmC,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAmC,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAA6B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAEL,yBAAyB,EAC1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAiC,MAAM,4BAA4B,CAAC;AAY7F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY,CAClD,yBAAyB,CACvB,qBAAqB,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CACjG,CACF;IACC,YAAmB,OAAmC;QACpD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,IAAY,EAAE,aAAqB;QAC/D,OAAO,GAAG,IAAI,IAAI,WAAW,CAAC,eAAe,IAAI,aAAa,EAAE,CAAC;IACnE,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,WAAW,CAAC,eAAe,CAAC;IACrC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,kBAAkB,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3E,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,aAAa,GAAc,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,CAAC;aACjF,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC;aACpD,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC;aAC3B,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport {\n DeclarationReference,\n Meaning,\n Navigation,\n type Component\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport { ApiItemKind } from '../items/ApiItem';\nimport { ApiDeclaredItem, type IApiDeclaredItemOptions } from '../items/ApiDeclaredItem';\nimport { ApiParameterListMixin, type IApiParameterListMixinOptions } from '../mixins/ApiParameterListMixin';\nimport { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport { type IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport {\n type IApiTypeParameterListMixinOptions,\n ApiTypeParameterListMixin\n} from '../mixins/ApiTypeParameterListMixin';\nimport { ApiOptionalMixin, type IApiOptionalMixinOptions } from '../mixins/ApiOptionalMixin';\n\n/** @public */\nexport interface IApiMethodSignatureOptions\n extends IApiNameMixinOptions,\n IApiTypeParameterListMixinOptions,\n IApiParameterListMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiReturnTypeMixinOptions,\n IApiOptionalMixinOptions,\n IApiDeclaredItemOptions {}\n\n/**\n * Represents a TypeScript member function declaration that belongs to an `ApiInterface`.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiMethodSignature` represents a TypeScript declaration such as the `render` member function in this example:\n *\n * ```ts\n * export interface IWidget {\n * render(): void;\n * }\n * ```\n *\n * Compare with {@link ApiMethod}, which represents a method belonging to a class.\n * For example, a class method can be `static` but an interface method cannot.\n *\n * @public\n */\nexport class ApiMethodSignature extends ApiNameMixin(\n ApiTypeParameterListMixin(\n ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiOptionalMixin(ApiDeclaredItem))))\n )\n) {\n public constructor(options: IApiMethodSignatureOptions) {\n super(options);\n }\n\n public static getContainerKey(name: string, overloadIndex: number): string {\n return `${name}|${ApiItemKind.MethodSignature}|${overloadIndex}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.MethodSignature;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiMethodSignature.getContainerKey(this.name, this.overloadIndex);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\n .addNavigationStep(Navigation.Members, nameComponent)\n .withMeaning(Meaning.Member)\n .withOverloadIndex(this.overloadIndex);\n }\n}\n"]}
@@ -0,0 +1,170 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
4
+ import { PackageName } from '@rushstack/node-core-library';
5
+ import { DocDeclarationReference } from '@microsoft/tsdoc';
6
+ import { ApiItem, ApiItemKind } from '../items/ApiItem';
7
+ import { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';
8
+ import { ApiPackage } from './ApiPackage';
9
+ import { ModelReferenceResolver } from './ModelReferenceResolver';
10
+ /**
11
+ * A serializable representation of a collection of API declarations.
12
+ *
13
+ * @remarks
14
+ *
15
+ * An `ApiModel` represents a collection of API declarations that can be serialized to disk. It captures all the
16
+ * important information needed to generate documentation, without any reliance on the TypeScript compiler engine.
17
+ *
18
+ * An `ApiModel` acts as the root of a tree of objects that all inherit from the `ApiItem` base class.
19
+ * The tree children are determined by the {@link (ApiItemContainerMixin:interface)} mixin base class. The model
20
+ * contains packages. Packages have an entry point (today, only one). And the entry point can contain various types
21
+ * of API declarations. The container relationships might look like this:
22
+ *
23
+ * ```
24
+ * Things that can contain other things:
25
+ *
26
+ * - ApiModel
27
+ * - ApiPackage
28
+ * - ApiEntryPoint
29
+ * - ApiClass
30
+ * - ApiMethod
31
+ * - ApiProperty
32
+ * - ApiEnum
33
+ * - ApiEnumMember
34
+ * - ApiInterface
35
+ * - ApiMethodSignature
36
+ * - ApiPropertySignature
37
+ * - ApiNamespace
38
+ * - (ApiClass, ApiEnum, ApiInterace, ...)
39
+ *
40
+ * ```
41
+ *
42
+ * Normally, API Extractor writes an .api.json file to disk for each project that it builds. Then, a tool like
43
+ * API Documenter can load the various `ApiPackage` objects into a single `ApiModel` and process them as a group.
44
+ * This is useful because compilation generally occurs separately (e.g. because projects may reside in different
45
+ * Git repos, or because they build with different TypeScript compiler configurations that may be incompatible),
46
+ * whereas API Documenter cannot detect broken hyperlinks without seeing the entire documentation set.
47
+ *
48
+ * @public
49
+ */
50
+ export class ApiModel extends ApiItemContainerMixin(ApiItem) {
51
+ constructor() {
52
+ super({});
53
+ this._packagesByName = undefined;
54
+ this._apiItemsByCanonicalReference = undefined;
55
+ this._resolver = new ModelReferenceResolver(this);
56
+ }
57
+ loadPackage(apiJsonFilename) {
58
+ const apiPackage = ApiPackage.loadFromJsonFile(apiJsonFilename);
59
+ this.addMember(apiPackage);
60
+ return apiPackage;
61
+ }
62
+ /** @override */
63
+ get kind() {
64
+ return ApiItemKind.Model;
65
+ }
66
+ /** @override */
67
+ get containerKey() {
68
+ return '';
69
+ }
70
+ get packages() {
71
+ return this.members;
72
+ }
73
+ /** @override */
74
+ addMember(member) {
75
+ if (member.kind !== ApiItemKind.Package) {
76
+ throw new Error('Only items of type ApiPackage may be added to an ApiModel');
77
+ }
78
+ super.addMember(member);
79
+ this._packagesByName = undefined; // invalidate the cache
80
+ this._apiItemsByCanonicalReference = undefined; // invalidate the cache
81
+ }
82
+ /**
83
+ * Efficiently finds a package by the NPM package name.
84
+ *
85
+ * @remarks
86
+ *
87
+ * If the NPM scope is omitted in the package name, it will still be found provided that it is an unambiguous match.
88
+ * For example, it's often convenient to write `{@link node-core-library#JsonFile}` instead of
89
+ * `{@link @rushstack/node-core-library#JsonFile}`.
90
+ */
91
+ tryGetPackageByName(packageName) {
92
+ // Build the lookup on demand
93
+ if (this._packagesByName === undefined) {
94
+ this._packagesByName = new Map();
95
+ const unscopedMap = new Map();
96
+ for (const apiPackage of this.packages) {
97
+ if (this._packagesByName.get(apiPackage.name)) {
98
+ // This should not happen
99
+ throw new Error(`The model contains multiple packages with the name ${apiPackage.name}`);
100
+ }
101
+ this._packagesByName.set(apiPackage.name, apiPackage);
102
+ const unscopedName = PackageName.parse(apiPackage.name).unscopedName;
103
+ if (unscopedMap.has(unscopedName)) {
104
+ // If another package has the same unscoped name, then we won't register it
105
+ unscopedMap.set(unscopedName, undefined);
106
+ }
107
+ else {
108
+ unscopedMap.set(unscopedName, apiPackage);
109
+ }
110
+ }
111
+ for (const [unscopedName, apiPackage] of unscopedMap) {
112
+ if (apiPackage) {
113
+ if (!this._packagesByName.has(unscopedName)) {
114
+ // If the unscoped name is unambiguous, then we can also use it as a lookup
115
+ this._packagesByName.set(unscopedName, apiPackage);
116
+ }
117
+ }
118
+ }
119
+ }
120
+ return this._packagesByName.get(packageName);
121
+ }
122
+ resolveDeclarationReference(declarationReference, contextApiItem) {
123
+ if (declarationReference instanceof DocDeclarationReference) {
124
+ return this._resolver.resolve(declarationReference, contextApiItem);
125
+ }
126
+ else if (declarationReference instanceof DeclarationReference) {
127
+ // use this._apiItemsByCanonicalReference to look up ApiItem
128
+ // Build the lookup on demand
129
+ if (!this._apiItemsByCanonicalReference) {
130
+ this._apiItemsByCanonicalReference = new Map();
131
+ for (const apiPackage of this.packages) {
132
+ this._initApiItemsRecursive(apiPackage, this._apiItemsByCanonicalReference);
133
+ }
134
+ }
135
+ const result = {
136
+ resolvedApiItem: undefined,
137
+ errorMessage: undefined
138
+ };
139
+ const apiItem = this._apiItemsByCanonicalReference.get(declarationReference.toString());
140
+ if (!apiItem) {
141
+ result.errorMessage = `${declarationReference.toString()} can not be located`;
142
+ }
143
+ else {
144
+ result.resolvedApiItem = apiItem;
145
+ }
146
+ return result;
147
+ }
148
+ else {
149
+ // NOTE: The "instanceof DeclarationReference" test assumes a specific version of the @microsoft/tsdoc package.
150
+ throw new Error('The "declarationReference" parameter must be an instance of' +
151
+ ' DocDeclarationReference or DeclarationReference');
152
+ }
153
+ }
154
+ _initApiItemsRecursive(apiItem, apiItemsByCanonicalReference) {
155
+ if (apiItem.canonicalReference && !apiItem.canonicalReference.isEmpty) {
156
+ apiItemsByCanonicalReference.set(apiItem.canonicalReference.toString(), apiItem);
157
+ }
158
+ // Recurse container members
159
+ if (ApiItemContainerMixin.isBaseClassOf(apiItem)) {
160
+ for (const apiMember of apiItem.members) {
161
+ this._initApiItemsRecursive(apiMember, apiItemsByCanonicalReference);
162
+ }
163
+ }
164
+ }
165
+ /** @beta @override */
166
+ buildCanonicalReference() {
167
+ return DeclarationReference.empty();
168
+ }
169
+ }
170
+ //# sourceMappingURL=ApiModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiModel.js","sourceRoot":"","sources":["../../src/model/ApiModel.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAA2C,MAAM,0BAA0B,CAAC;AAE3G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAO,QAAS,SAAQ,qBAAqB,CAAC,OAAO,CAAC;IAK1D;QACE,KAAK,CAAC,EAAE,CAAC,CAAC;QAHJ,oBAAe,GAAwC,SAAS,CAAC;QACjE,kCAA6B,GAAqC,SAAS,CAAC;QAIlF,IAAI,CAAC,SAAS,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACpD,CAAC;IAEM,WAAW,CAAC,eAAuB;QACxC,MAAM,UAAU,GAAe,UAAU,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;QAC5E,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC3B,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb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,OAAO,GAAwB,IAAI,CAAC,6BAA6B,CAAC,GAAG,CACzE,oBAAoB,CAAC,QAAQ,EAAE,CAChC,CAAC;YAEF,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,YAAY,GAAG,GAAG,oBAAoB,CAAC,QAAQ,EAAE,qBAAqB,CAAC;YAChF,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,eAAe,GAAG,OAAO,CAAC;YACnC,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,+GAA+G;YAC/G,MAAM,IAAI,KAAK,CACb,6DAA6D;gBAC3D,kDAAkD,CACrD,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,sBAAsB,CAAC,OAAgB,EAAE,4BAAkD;QACjG,IAAI,OAAO,CAAC,kBAAkB,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;YACtE,4BAA4B,CAAC,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;QACnF,CAAC;QAED,4BAA4B;QAC5B,IAAI,qBAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACxC,IAAI,CAAC,sBAAsB,CAAC,SAAS,EAAE,4BAA4B,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;IACH,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,OAAO,oBAAoB,CAAC,KAAK,EAAE,CAAC;IACtC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { PackageName } from '@rushstack/node-core-library';\nimport { DocDeclarationReference } from '@microsoft/tsdoc';\n\nimport { ApiItem, ApiItemKind } from '../items/ApiItem';\nimport { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';\nimport { ApiPackage } from './ApiPackage';\nimport { ModelReferenceResolver, type IResolveDeclarationReferenceResult } from './ModelReferenceResolver';\n\n/**\n * A serializable representation of a collection of API declarations.\n *\n * @remarks\n *\n * An `ApiModel` represents a collection of API declarations that can be serialized to disk. It captures all the\n * important information needed to generate documentation, without any reliance on the TypeScript compiler engine.\n *\n * An `ApiModel` acts as the root of a tree of objects that all inherit from the `ApiItem` base class.\n * The tree children are determined by the {@link (ApiItemContainerMixin:interface)} mixin base class. The model\n * contains packages. Packages have an entry point (today, only one). And the entry point can contain various types\n * of API declarations. The container relationships might look like this:\n *\n * ```\n * Things that can contain other things:\n *\n * - ApiModel\n * - ApiPackage\n * - ApiEntryPoint\n * - ApiClass\n * - ApiMethod\n * - ApiProperty\n * - ApiEnum\n * - ApiEnumMember\n * - ApiInterface\n * - ApiMethodSignature\n * - ApiPropertySignature\n * - ApiNamespace\n * - (ApiClass, ApiEnum, ApiInterace, ...)\n *\n * ```\n *\n * Normally, API Extractor writes an .api.json file to disk for each project that it builds. Then, a tool like\n * API Documenter can load the various `ApiPackage` objects into a single `ApiModel` and process them as a group.\n * This is useful because compilation generally occurs separately (e.g. because projects may reside in different\n * Git repos, or because they build with different TypeScript compiler configurations that may be incompatible),\n * whereas API Documenter cannot detect broken hyperlinks without seeing the entire documentation set.\n *\n * @public\n */\nexport class ApiModel extends ApiItemContainerMixin(ApiItem) {\n private readonly _resolver: ModelReferenceResolver;\n\n private _packagesByName: Map<string, ApiPackage> | undefined = undefined;\n private _apiItemsByCanonicalReference: Map<string, ApiItem> | undefined = undefined;\n public constructor() {\n super({});\n\n this._resolver = new ModelReferenceResolver(this);\n }\n\n public loadPackage(apiJsonFilename: string): ApiPackage {\n const apiPackage: ApiPackage = ApiPackage.loadFromJsonFile(apiJsonFilename);\n this.addMember(apiPackage);\n return apiPackage;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Model;\n }\n\n /** @override */\n public get containerKey(): string {\n return '';\n }\n\n public get packages(): ReadonlyArray<ApiPackage> {\n return this.members as ReadonlyArray<ApiPackage>;\n }\n\n /** @override */\n public addMember(member: ApiPackage): void {\n if (member.kind !== ApiItemKind.Package) {\n throw new Error('Only items of type ApiPackage may be added to an ApiModel');\n }\n super.addMember(member);\n this._packagesByName = undefined; // invalidate the cache\n this._apiItemsByCanonicalReference = undefined; // invalidate the cache\n }\n\n /**\n * Efficiently finds a package by the NPM package name.\n *\n * @remarks\n *\n * If the NPM scope is omitted in the package name, it will still be found provided that it is an unambiguous match.\n * For example, it's often convenient to write `{@link node-core-library#JsonFile}` instead of\n * `{@link @rushstack/node-core-library#JsonFile}`.\n */\n public tryGetPackageByName(packageName: string): ApiPackage | undefined {\n // Build the lookup on demand\n if (this._packagesByName === undefined) {\n this._packagesByName = new Map<string, ApiPackage>();\n\n const unscopedMap: Map<string, ApiPackage | undefined> = new Map<string, ApiPackage | undefined>();\n\n for (const apiPackage of this.packages) {\n if (this._packagesByName.get(apiPackage.name)) {\n // This should not happen\n throw new Error(`The model contains multiple packages with the name ${apiPackage.name}`);\n }\n\n this._packagesByName.set(apiPackage.name, apiPackage);\n\n const unscopedName: string = PackageName.parse(apiPackage.name).unscopedName;\n\n if (unscopedMap.has(unscopedName)) {\n // If another package has the same unscoped name, then we won't register it\n unscopedMap.set(unscopedName, undefined);\n } else {\n unscopedMap.set(unscopedName, apiPackage);\n }\n }\n\n for (const [unscopedName, apiPackage] of unscopedMap) {\n if (apiPackage) {\n if (!this._packagesByName.has(unscopedName)) {\n // If the unscoped name is unambiguous, then we can also use it as a lookup\n this._packagesByName.set(unscopedName, apiPackage);\n }\n }\n }\n }\n\n return this._packagesByName.get(packageName);\n }\n\n public resolveDeclarationReference(\n declarationReference: DocDeclarationReference | DeclarationReference,\n contextApiItem: ApiItem | undefined\n ): IResolveDeclarationReferenceResult {\n if (declarationReference instanceof DocDeclarationReference) {\n return this._resolver.resolve(declarationReference, contextApiItem);\n } else if (declarationReference instanceof DeclarationReference) {\n // use this._apiItemsByCanonicalReference to look up ApiItem\n\n // Build the lookup on demand\n if (!this._apiItemsByCanonicalReference) {\n this._apiItemsByCanonicalReference = new Map<string, ApiItem>();\n\n for (const apiPackage of this.packages) {\n this._initApiItemsRecursive(apiPackage, this._apiItemsByCanonicalReference);\n }\n }\n\n const result: IResolveDeclarationReferenceResult = {\n resolvedApiItem: undefined,\n errorMessage: undefined\n };\n\n const apiItem: ApiItem | undefined = this._apiItemsByCanonicalReference.get(\n declarationReference.toString()\n );\n\n if (!apiItem) {\n result.errorMessage = `${declarationReference.toString()} can not be located`;\n } else {\n result.resolvedApiItem = apiItem;\n }\n\n return result;\n } else {\n // NOTE: The \"instanceof DeclarationReference\" test assumes a specific version of the @microsoft/tsdoc package.\n throw new Error(\n 'The \"declarationReference\" parameter must be an instance of' +\n ' DocDeclarationReference or DeclarationReference'\n );\n }\n }\n\n private _initApiItemsRecursive(apiItem: ApiItem, apiItemsByCanonicalReference: Map<string, ApiItem>): void {\n if (apiItem.canonicalReference && !apiItem.canonicalReference.isEmpty) {\n apiItemsByCanonicalReference.set(apiItem.canonicalReference.toString(), apiItem);\n }\n\n // Recurse container members\n if (ApiItemContainerMixin.isBaseClassOf(apiItem)) {\n for (const apiMember of apiItem.members) {\n this._initApiItemsRecursive(apiMember, apiItemsByCanonicalReference);\n }\n }\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n return DeclarationReference.empty();\n }\n}\n"]}
@@ -0,0 +1,56 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ import { DeclarationReference, Meaning, Navigation } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
4
+ import { ApiItemKind } from '../items/ApiItem';
5
+ import { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';
6
+ import { ApiDeclaredItem } from '../items/ApiDeclaredItem';
7
+ import { ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';
8
+ import { ApiNameMixin } from '../mixins/ApiNameMixin';
9
+ import { ApiExportedMixin } from '../mixins/ApiExportedMixin';
10
+ /**
11
+ * Represents a TypeScript namespace declaration.
12
+ *
13
+ * @remarks
14
+ *
15
+ * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
16
+ * API declarations.
17
+ *
18
+ * `ApiNamespace` represents a TypeScript declaration such `X` or `Y` in this example:
19
+ *
20
+ * ```ts
21
+ * export namespace X {
22
+ * export namespace Y {
23
+ * export interface IWidget {
24
+ * render(): void;
25
+ * }
26
+ * }
27
+ * }
28
+ * ```
29
+ *
30
+ * @public
31
+ */
32
+ export class ApiNamespace extends ApiItemContainerMixin(ApiNameMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem)))) {
33
+ constructor(options) {
34
+ super(options);
35
+ }
36
+ static getContainerKey(name) {
37
+ return `${name}|${ApiItemKind.Namespace}`;
38
+ }
39
+ /** @override */
40
+ get kind() {
41
+ return ApiItemKind.Namespace;
42
+ }
43
+ /** @override */
44
+ get containerKey() {
45
+ return ApiNamespace.getContainerKey(this.name);
46
+ }
47
+ /** @beta @override */
48
+ buildCanonicalReference() {
49
+ const nameComponent = DeclarationReference.parseComponent(this.name);
50
+ const navigation = this.isExported ? Navigation.Exports : Navigation.Locals;
51
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
52
+ .addNavigationStep(navigation, nameComponent)
53
+ .withMeaning(Meaning.Namespace);
54
+ }
55
+ }
56
+ //# sourceMappingURL=ApiNamespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiNamespace.js","sourceRoot":"","sources":["../../src/model/ApiNamespace.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,UAAU,EAEX,MAAM,yDAAyD,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB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CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport {\n DeclarationReference,\n Meaning,\n Navigation,\n type Component\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport { ApiItemKind } from '../items/ApiItem';\nimport { ApiItemContainerMixin, type IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin';\nimport { type IApiDeclaredItemOptions, ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport { type IApiExportedMixinOptions, ApiExportedMixin } from '../mixins/ApiExportedMixin';\n\n/**\n * Constructor options for {@link ApiClass}.\n * @public\n */\nexport interface IApiNamespaceOptions\n extends IApiItemContainerMixinOptions,\n IApiNameMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiDeclaredItemOptions,\n IApiExportedMixinOptions {}\n\n/**\n * Represents a TypeScript namespace declaration.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiNamespace` represents a TypeScript declaration such `X` or `Y` in this example:\n *\n * ```ts\n * export namespace X {\n * export namespace Y {\n * export interface IWidget {\n * render(): void;\n * }\n * }\n * }\n * ```\n *\n * @public\n */\nexport class ApiNamespace extends ApiItemContainerMixin(\n ApiNameMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem)))\n) {\n public constructor(options: IApiNamespaceOptions) {\n super(options);\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.Namespace}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Namespace;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiNamespace.getContainerKey(this.name);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\n const navigation: Navigation = this.isExported ? Navigation.Exports : Navigation.Locals;\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\n .addNavigationStep(navigation, nameComponent)\n .withMeaning(Meaning.Namespace);\n }\n}\n"]}