@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,148 @@
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 { JsonFile, PackageJsonLookup } from '@rushstack/node-core-library';
5
+ import { TSDocConfiguration } from '@microsoft/tsdoc';
6
+ import { TSDocConfigFile } from '@microsoft/tsdoc-config';
7
+ import { ApiItem, ApiItemKind } from '../items/ApiItem';
8
+ import { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';
9
+ import { ApiDocumentedItem } from '../items/ApiDocumentedItem';
10
+ import { ApiNameMixin } from '../mixins/ApiNameMixin';
11
+ import { DeserializerContext, ApiJsonSchemaVersion } from './DeserializerContext';
12
+ /**
13
+ * Represents an NPM package containing API declarations.
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
+ * @public
21
+ */
22
+ export class ApiPackage extends ApiItemContainerMixin(ApiNameMixin(ApiDocumentedItem)) {
23
+ constructor(options) {
24
+ super(options);
25
+ this._tsdocConfiguration = options.tsdocConfiguration;
26
+ this._projectFolderUrl = options.projectFolderUrl;
27
+ }
28
+ /** @override */
29
+ static onDeserializeInto(options, context, jsonObject) {
30
+ super.onDeserializeInto(options, context, jsonObject);
31
+ options.projectFolderUrl = jsonObject.projectFolderUrl;
32
+ }
33
+ static loadFromJsonFile(apiJsonFilename) {
34
+ const jsonObject = JsonFile.load(apiJsonFilename);
35
+ if (!jsonObject || !jsonObject.metadata || typeof jsonObject.metadata.schemaVersion !== 'number') {
36
+ throw new Error(`Error loading ${apiJsonFilename}:` +
37
+ `\nThe file format is not recognized; the "metadata.schemaVersion" field is missing or invalid`);
38
+ }
39
+ const schemaVersion = jsonObject.metadata.schemaVersion;
40
+ if (schemaVersion < ApiJsonSchemaVersion.OLDEST_SUPPORTED) {
41
+ throw new Error(`Error loading ${apiJsonFilename}:` +
42
+ `\nThe file format is version ${schemaVersion},` +
43
+ ` whereas ${ApiJsonSchemaVersion.OLDEST_SUPPORTED} is the oldest version supported by this tool`);
44
+ }
45
+ let oldestForwardsCompatibleVersion = schemaVersion;
46
+ if (jsonObject.metadata.oldestForwardsCompatibleVersion) {
47
+ // Sanity check
48
+ if (jsonObject.metadata.oldestForwardsCompatibleVersion > schemaVersion) {
49
+ throw new Error(`Error loading ${apiJsonFilename}:` +
50
+ `\nInvalid file format; "oldestForwardsCompatibleVersion" cannot be newer than "schemaVersion"`);
51
+ }
52
+ oldestForwardsCompatibleVersion = jsonObject.metadata.oldestForwardsCompatibleVersion;
53
+ }
54
+ let versionToDeserialize = schemaVersion;
55
+ if (versionToDeserialize > ApiJsonSchemaVersion.LATEST) {
56
+ // If the file format is too new, can we treat it as some earlier compatible version
57
+ // as indicated by oldestForwardsCompatibleVersion?
58
+ versionToDeserialize = Math.max(oldestForwardsCompatibleVersion, ApiJsonSchemaVersion.LATEST);
59
+ if (versionToDeserialize > ApiJsonSchemaVersion.LATEST) {
60
+ // Nope, still too new
61
+ throw new Error(`Error loading ${apiJsonFilename}:` +
62
+ `\nThe file format version ${schemaVersion} was written by a newer release of` +
63
+ ` the api-extractor-model library; you may need to upgrade your software`);
64
+ }
65
+ }
66
+ const tsdocConfiguration = new TSDocConfiguration();
67
+ if (versionToDeserialize >= ApiJsonSchemaVersion.V_1004) {
68
+ const tsdocConfigFile = TSDocConfigFile.loadFromObject(jsonObject.metadata.tsdocConfig);
69
+ if (tsdocConfigFile.hasErrors) {
70
+ throw new Error(`Error loading ${apiJsonFilename}:\n` + tsdocConfigFile.getErrorSummary());
71
+ }
72
+ tsdocConfigFile.configureParser(tsdocConfiguration);
73
+ }
74
+ const context = new DeserializerContext({
75
+ apiJsonFilename,
76
+ toolPackage: jsonObject.metadata.toolPackage,
77
+ toolVersion: jsonObject.metadata.toolVersion,
78
+ versionToDeserialize: versionToDeserialize,
79
+ tsdocConfiguration
80
+ });
81
+ return ApiItem.deserialize(jsonObject, context);
82
+ }
83
+ /** @override */
84
+ get kind() {
85
+ return ApiItemKind.Package;
86
+ }
87
+ /** @override */
88
+ get containerKey() {
89
+ // No prefix needed, because ApiPackage is the only possible member of an ApiModel
90
+ return this.name;
91
+ }
92
+ get entryPoints() {
93
+ return this.members;
94
+ }
95
+ /**
96
+ * The TSDoc configuration that was used when analyzing the API for this package.
97
+ *
98
+ * @remarks
99
+ *
100
+ * Normally this configuration is loaded from the project's tsdoc.json file. It is stored
101
+ * in the .api.json file so that doc comments can be parsed accurately when loading the file.
102
+ */
103
+ get tsdocConfiguration() {
104
+ return this._tsdocConfiguration;
105
+ }
106
+ get projectFolderUrl() {
107
+ return this._projectFolderUrl;
108
+ }
109
+ /** @override */
110
+ addMember(member) {
111
+ if (member.kind !== ApiItemKind.EntryPoint) {
112
+ throw new Error('Only items of type ApiEntryPoint may be added to an ApiPackage');
113
+ }
114
+ super.addMember(member);
115
+ }
116
+ findEntryPointsByPath(importPath) {
117
+ return this.findMembersByName(importPath);
118
+ }
119
+ saveToJsonFile(apiJsonFilename, options) {
120
+ if (!options) {
121
+ options = {};
122
+ }
123
+ const packageJson = PackageJsonLookup.loadOwnPackageJson(__dirname);
124
+ const tsdocConfigFile = TSDocConfigFile.loadFromParser(this.tsdocConfiguration);
125
+ const tsdocConfig = tsdocConfigFile.saveToObject();
126
+ const jsonObject = {
127
+ metadata: {
128
+ toolPackage: options.toolPackage || packageJson.name,
129
+ // In test mode, we don't write the real version, since that would cause spurious diffs whenever
130
+ // the version is bumped. Instead we write a placeholder string.
131
+ toolVersion: options.testMode ? '[test mode]' : options.toolVersion || packageJson.version,
132
+ schemaVersion: ApiJsonSchemaVersion.LATEST,
133
+ oldestForwardsCompatibleVersion: ApiJsonSchemaVersion.OLDEST_FORWARDS_COMPATIBLE,
134
+ tsdocConfig
135
+ }
136
+ };
137
+ if (this.projectFolderUrl) {
138
+ jsonObject.projectFolderUrl = this.projectFolderUrl;
139
+ }
140
+ this.serializeInto(jsonObject);
141
+ JsonFile.save(jsonObject, apiJsonFilename, options);
142
+ }
143
+ /** @beta @override */
144
+ buildCanonicalReference() {
145
+ return DeclarationReference.package(this.name);
146
+ }
147
+ }
148
+ //# sourceMappingURL=ApiPackage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiPackage.js","sourceRoot":"","sources":["../../src/model/ApiPackage.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EACL,QAAQ,EAER,iBAAiB,EAGlB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB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AO,GAAG,EAAE,CAAC;QACf,CAAC;QAED,MAAM,WAAW,GAAiB,iBAAiB,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAElF,MAAM,eAAe,GAAoB,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACjG,MAAM,WAAW,GAAe,eAAe,CAAC,YAAY,EAAE,CAAC;QAE/D,MAAM,UAAU,GAAoB;YAClC,QAAQ,EAAE;gBACR,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,WAAW,CAAC,IAAI;gBACpD,gGAAgG;gBAChG,iEAAiE;gBACjE,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,IAAI,WAAW,CAAC,OAAO;gBAC1F,aAAa,EAAE,oBAAoB,CAAC,MAAM;gBAC1C,+BAA+B,EAAE,oBAAoB,CAAC,0BAA0B;gBAChF,WAAW;aACZ;SACiB,CAAC;QAErB,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,UAAU,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QACtD,CAAC;QAED,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,OAAO,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,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 {\n JsonFile,\n type IJsonFileSaveOptions,\n PackageJsonLookup,\n type IPackageJson,\n type JsonObject\n} from '@rushstack/node-core-library';\nimport { TSDocConfiguration } from '@microsoft/tsdoc';\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\n\nimport { ApiItem, ApiItemKind, type IApiItemJson } from '../items/ApiItem';\nimport { ApiItemContainerMixin, type IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin';\nimport { ApiDocumentedItem, type IApiDocumentedItemOptions } from '../items/ApiDocumentedItem';\nimport type { ApiEntryPoint } from './ApiEntryPoint';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport { DeserializerContext, ApiJsonSchemaVersion } from './DeserializerContext';\n\n/**\n * Constructor options for {@link ApiPackage}.\n * @public\n */\nexport interface IApiPackageOptions\n extends IApiItemContainerMixinOptions,\n IApiNameMixinOptions,\n IApiDocumentedItemOptions {\n tsdocConfiguration: TSDocConfiguration;\n projectFolderUrl?: string;\n}\n\nexport interface IApiPackageMetadataJson {\n /**\n * The NPM package name for the tool that wrote the *.api.json file.\n * For informational purposes only.\n */\n toolPackage: string;\n\n /**\n * The NPM package version for the tool that wrote the *.api.json file.\n * For informational purposes only.\n */\n toolVersion: string;\n\n /**\n * The schema version for the .api.json file format. Used for determining whether the file format is\n * supported, and for backwards compatibility.\n */\n schemaVersion: ApiJsonSchemaVersion;\n\n /**\n * To support forwards compatibility, the `oldestForwardsCompatibleVersion` field tracks the oldest schema version\n * whose corresponding deserializer could safely load this file.\n *\n * @remarks\n * Normally api-extractor-model should refuse to load a schema version that is newer than the latest version\n * that its deserializer understands. However, sometimes a schema change may merely introduce some new fields\n * without modifying or removing any existing fields. In this case, an older api-extractor-model library can\n * safely deserialize the newer version (by ignoring the extra fields that it doesn't recognize). The newer\n * serializer can use this field to communicate that.\n *\n * If present, the `oldestForwardsCompatibleVersion` must be less than or equal to\n * `IApiPackageMetadataJson.schemaVersion`.\n */\n oldestForwardsCompatibleVersion?: ApiJsonSchemaVersion;\n\n /**\n * The TSDoc configuration that was used when analyzing the API for this package.\n *\n * @remarks\n *\n * The structure of this objet is defined by the `@microsoft/tsdoc-config` library.\n * Normally this configuration is loaded from the project's tsdoc.json file. It is stored\n * in the .api.json file so that doc comments can be parsed accurately when loading the file.\n */\n tsdocConfig: JsonObject;\n}\n\nexport interface IApiPackageJson extends IApiItemJson {\n /**\n * A file header that stores metadata about the tool that wrote the *.api.json file.\n */\n metadata: IApiPackageMetadataJson;\n\n /**\n * The base URL where the project's source code can be viewed on a website such as GitHub or\n * Azure DevOps. This URL path corresponds to the `<projectFolder>` path on disk. Provided via the\n * `api-extractor.json` config.\n */\n projectFolderUrl?: string;\n}\n\n/**\n * Options for {@link ApiPackage.saveToJsonFile}.\n * @public\n */\nexport interface IApiPackageSaveOptions extends IJsonFileSaveOptions {\n /**\n * Optionally specifies a value for the \"toolPackage\" field in the output .api.json data file;\n * otherwise, the value will be \"api-extractor-model\".\n */\n toolPackage?: string;\n\n /**\n * Optionally specifies a value for the \"toolVersion\" field in the output .api.json data file;\n * otherwise, the value will be the current version of the api-extractor-model package.\n */\n toolVersion?: string;\n\n /**\n * Set to true only when invoking API Extractor's test harness.\n *\n * @remarks\n * When `testMode` is true, the `toolVersion` field in the .api.json file is assigned an empty string\n * to prevent spurious diffs in output files tracked for tests.\n */\n testMode?: boolean;\n}\n\n/**\n * Represents an NPM package containing API declarations.\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 * @public\n */\nexport class ApiPackage extends ApiItemContainerMixin(ApiNameMixin(ApiDocumentedItem)) {\n private readonly _tsdocConfiguration: TSDocConfiguration;\n private readonly _projectFolderUrl?: string;\n\n public constructor(options: IApiPackageOptions) {\n super(options);\n\n this._tsdocConfiguration = options.tsdocConfiguration;\n this._projectFolderUrl = options.projectFolderUrl;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiPackageOptions>,\n context: DeserializerContext,\n jsonObject: IApiPackageJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.projectFolderUrl = jsonObject.projectFolderUrl;\n }\n\n public static loadFromJsonFile(apiJsonFilename: string): ApiPackage {\n const jsonObject: IApiPackageJson = JsonFile.load(apiJsonFilename);\n\n if (!jsonObject || !jsonObject.metadata || typeof jsonObject.metadata.schemaVersion !== 'number') {\n throw new Error(\n `Error loading ${apiJsonFilename}:` +\n `\\nThe file format is not recognized; the \"metadata.schemaVersion\" field is missing or invalid`\n );\n }\n\n const schemaVersion: number = jsonObject.metadata.schemaVersion;\n\n if (schemaVersion < ApiJsonSchemaVersion.OLDEST_SUPPORTED) {\n throw new Error(\n `Error loading ${apiJsonFilename}:` +\n `\\nThe file format is version ${schemaVersion},` +\n ` whereas ${ApiJsonSchemaVersion.OLDEST_SUPPORTED} is the oldest version supported by this tool`\n );\n }\n\n let oldestForwardsCompatibleVersion: number = schemaVersion;\n if (jsonObject.metadata.oldestForwardsCompatibleVersion) {\n // Sanity check\n if (jsonObject.metadata.oldestForwardsCompatibleVersion > schemaVersion) {\n throw new Error(\n `Error loading ${apiJsonFilename}:` +\n `\\nInvalid file format; \"oldestForwardsCompatibleVersion\" cannot be newer than \"schemaVersion\"`\n );\n }\n oldestForwardsCompatibleVersion = jsonObject.metadata.oldestForwardsCompatibleVersion;\n }\n\n let versionToDeserialize: number = schemaVersion;\n if (versionToDeserialize > ApiJsonSchemaVersion.LATEST) {\n // If the file format is too new, can we treat it as some earlier compatible version\n // as indicated by oldestForwardsCompatibleVersion?\n versionToDeserialize = Math.max(oldestForwardsCompatibleVersion, ApiJsonSchemaVersion.LATEST);\n\n if (versionToDeserialize > ApiJsonSchemaVersion.LATEST) {\n // Nope, still too new\n throw new Error(\n `Error loading ${apiJsonFilename}:` +\n `\\nThe file format version ${schemaVersion} was written by a newer release of` +\n ` the api-extractor-model library; you may need to upgrade your software`\n );\n }\n }\n\n const tsdocConfiguration: TSDocConfiguration = new TSDocConfiguration();\n\n if (versionToDeserialize >= ApiJsonSchemaVersion.V_1004) {\n const tsdocConfigFile: TSDocConfigFile = TSDocConfigFile.loadFromObject(\n jsonObject.metadata.tsdocConfig\n );\n if (tsdocConfigFile.hasErrors) {\n throw new Error(`Error loading ${apiJsonFilename}:\\n` + tsdocConfigFile.getErrorSummary());\n }\n\n tsdocConfigFile.configureParser(tsdocConfiguration);\n }\n\n const context: DeserializerContext = new DeserializerContext({\n apiJsonFilename,\n toolPackage: jsonObject.metadata.toolPackage,\n toolVersion: jsonObject.metadata.toolVersion,\n versionToDeserialize: versionToDeserialize,\n tsdocConfiguration\n });\n\n return ApiItem.deserialize(jsonObject, context) as ApiPackage;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Package;\n }\n\n /** @override */\n public get containerKey(): string {\n // No prefix needed, because ApiPackage is the only possible member of an ApiModel\n return this.name;\n }\n\n public get entryPoints(): ReadonlyArray<ApiEntryPoint> {\n return this.members as ReadonlyArray<ApiEntryPoint>;\n }\n\n /**\n * The TSDoc configuration that was used when analyzing the API for this package.\n *\n * @remarks\n *\n * Normally this configuration is loaded from the project's tsdoc.json file. It is stored\n * in the .api.json file so that doc comments can be parsed accurately when loading the file.\n */\n public get tsdocConfiguration(): TSDocConfiguration {\n return this._tsdocConfiguration;\n }\n\n public get projectFolderUrl(): string | undefined {\n return this._projectFolderUrl;\n }\n\n /** @override */\n public addMember(member: ApiEntryPoint): void {\n if (member.kind !== ApiItemKind.EntryPoint) {\n throw new Error('Only items of type ApiEntryPoint may be added to an ApiPackage');\n }\n super.addMember(member);\n }\n\n public findEntryPointsByPath(importPath: string): ReadonlyArray<ApiEntryPoint> {\n return this.findMembersByName(importPath) as ReadonlyArray<ApiEntryPoint>;\n }\n\n public saveToJsonFile(apiJsonFilename: string, options?: IApiPackageSaveOptions): void {\n if (!options) {\n options = {};\n }\n\n const packageJson: IPackageJson = PackageJsonLookup.loadOwnPackageJson(__dirname);\n\n const tsdocConfigFile: TSDocConfigFile = TSDocConfigFile.loadFromParser(this.tsdocConfiguration);\n const tsdocConfig: JsonObject = tsdocConfigFile.saveToObject();\n\n const jsonObject: IApiPackageJson = {\n metadata: {\n toolPackage: options.toolPackage || packageJson.name,\n // In test mode, we don't write the real version, since that would cause spurious diffs whenever\n // the version is bumped. Instead we write a placeholder string.\n toolVersion: options.testMode ? '[test mode]' : options.toolVersion || packageJson.version,\n schemaVersion: ApiJsonSchemaVersion.LATEST,\n oldestForwardsCompatibleVersion: ApiJsonSchemaVersion.OLDEST_FORWARDS_COMPATIBLE,\n tsdocConfig\n }\n } as IApiPackageJson;\n\n if (this.projectFolderUrl) {\n jsonObject.projectFolderUrl = this.projectFolderUrl;\n }\n\n this.serializeInto(jsonObject);\n JsonFile.save(jsonObject, apiJsonFilename, options);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n return DeclarationReference.package(this.name);\n }\n}\n"]}
@@ -0,0 +1,72 @@
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 { ApiAbstractMixin } from '../mixins/ApiAbstractMixin';
6
+ import { ApiProtectedMixin } from '../mixins/ApiProtectedMixin';
7
+ import { ApiStaticMixin } from '../mixins/ApiStaticMixin';
8
+ import { ApiInitializerMixin } from '../mixins/ApiInitializerMixin';
9
+ import { ApiPropertyItem } from '../items/ApiPropertyItem';
10
+ /**
11
+ * Represents a TypeScript property declaration that belongs to an `ApiClass`.
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
+ * `ApiProperty` represents a TypeScript declaration such as the `width` and `height` members in this example:
19
+ *
20
+ * ```ts
21
+ * export class Widget {
22
+ * public width: number = 100;
23
+ *
24
+ * public get height(): number {
25
+ * if (this.isSquashed()) {
26
+ * return 0;
27
+ * } else {
28
+ * return this.clientArea.height;
29
+ * }
30
+ * }
31
+ * }
32
+ * ```
33
+ *
34
+ * Note that member variables are also considered to be properties.
35
+ *
36
+ * If the property has both a getter function and setter function, they will be represented by a single `ApiProperty`
37
+ * and must have a single documentation comment.
38
+ *
39
+ * Compare with {@link ApiPropertySignature}, which represents a property belonging to an interface.
40
+ * For example, a class property can be `static` but an interface property cannot.
41
+ *
42
+ * @public
43
+ */
44
+ export class ApiProperty extends ApiAbstractMixin(ApiProtectedMixin(ApiStaticMixin(ApiInitializerMixin(ApiPropertyItem)))) {
45
+ constructor(options) {
46
+ super(options);
47
+ }
48
+ static getContainerKey(name, isStatic) {
49
+ if (isStatic) {
50
+ return `${name}|${ApiItemKind.Property}|static`;
51
+ }
52
+ else {
53
+ return `${name}|${ApiItemKind.Property}|instance`;
54
+ }
55
+ }
56
+ /** @override */
57
+ get kind() {
58
+ return ApiItemKind.Property;
59
+ }
60
+ /** @override */
61
+ get containerKey() {
62
+ return ApiProperty.getContainerKey(this.name, this.isStatic);
63
+ }
64
+ /** @beta @override */
65
+ buildCanonicalReference() {
66
+ const nameComponent = DeclarationReference.parseComponent(this.name);
67
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
68
+ .addNavigationStep(this.isStatic ? Navigation.Exports : Navigation.Members, nameComponent)
69
+ .withMeaning(Meaning.Member);
70
+ }
71
+ }
72
+ //# sourceMappingURL=ApiProperty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiProperty.js","sourceRoot":"","sources":["../../src/model/ApiProperty.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,gBAAgB,EAAiC,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAkC,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,cAAc,EAA+B,MAAM,0BAA0B,CAAC;AACvF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,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 { ApiAbstractMixin, type IApiAbstractMixinOptions } from '../mixins/ApiAbstractMixin';\nimport { ApiProtectedMixin, type IApiProtectedMixinOptions } from '../mixins/ApiProtectedMixin';\nimport { ApiStaticMixin, type IApiStaticMixinOptions } from '../mixins/ApiStaticMixin';\nimport { ApiInitializerMixin, type IApiInitializerMixinOptions } from '../mixins/ApiInitializerMixin';\nimport { ApiPropertyItem, type IApiPropertyItemOptions } from '../items/ApiPropertyItem';\n\n/**\n * Constructor options for {@link ApiProperty}.\n * @public\n */\nexport interface IApiPropertyOptions\n extends IApiPropertyItemOptions,\n IApiAbstractMixinOptions,\n IApiProtectedMixinOptions,\n IApiStaticMixinOptions,\n IApiInitializerMixinOptions {}\n\n/**\n * Represents a TypeScript property 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 * `ApiProperty` represents a TypeScript declaration such as the `width` and `height` members in this example:\n *\n * ```ts\n * export class Widget {\n * public width: number = 100;\n *\n * public get height(): number {\n * if (this.isSquashed()) {\n * return 0;\n * } else {\n * return this.clientArea.height;\n * }\n * }\n * }\n * ```\n *\n * Note that member variables are also considered to be properties.\n *\n * If the property has both a getter function and setter function, they will be represented by a single `ApiProperty`\n * and must have a single documentation comment.\n *\n * Compare with {@link ApiPropertySignature}, which represents a property belonging to an interface.\n * For example, a class property can be `static` but an interface property cannot.\n *\n * @public\n */\nexport class ApiProperty extends ApiAbstractMixin(\n ApiProtectedMixin(ApiStaticMixin(ApiInitializerMixin(ApiPropertyItem)))\n) {\n public constructor(options: IApiPropertyOptions) {\n super(options);\n }\n\n public static getContainerKey(name: string, isStatic: boolean): string {\n if (isStatic) {\n return `${name}|${ApiItemKind.Property}|static`;\n } else {\n return `${name}|${ApiItemKind.Property}|instance`;\n }\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Property;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiProperty.getContainerKey(this.name, this.isStatic);\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 }\n}\n"]}
@@ -0,0 +1,51 @@
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 { ApiPropertyItem } from '../items/ApiPropertyItem';
6
+ /**
7
+ * Represents a TypeScript property declaration that belongs to an `ApiInterface`.
8
+ *
9
+ * @remarks
10
+ *
11
+ * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
12
+ * API declarations.
13
+ *
14
+ * `ApiPropertySignature` represents a TypeScript declaration such as the `width` and `height` members in this example:
15
+ *
16
+ * ```ts
17
+ * export interface IWidget {
18
+ * readonly width: number;
19
+ * height: number;
20
+ * }
21
+ * ```
22
+ *
23
+ * Compare with {@link ApiProperty}, which represents a property belonging to a class.
24
+ * For example, a class property can be `static` but an interface property cannot.
25
+ *
26
+ * @public
27
+ */
28
+ export class ApiPropertySignature extends ApiPropertyItem {
29
+ constructor(options) {
30
+ super(options);
31
+ }
32
+ static getContainerKey(name) {
33
+ return `${name}|${ApiItemKind.PropertySignature}`;
34
+ }
35
+ /** @override */
36
+ get kind() {
37
+ return ApiItemKind.PropertySignature;
38
+ }
39
+ /** @override */
40
+ get containerKey() {
41
+ return ApiPropertySignature.getContainerKey(this.name);
42
+ }
43
+ /** @beta @override */
44
+ buildCanonicalReference() {
45
+ const nameComponent = DeclarationReference.parseComponent(this.name);
46
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
47
+ .addNavigationStep(Navigation.Members, nameComponent)
48
+ .withMeaning(Meaning.Member);
49
+ }
50
+ }
51
+ //# sourceMappingURL=ApiPropertySignature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiPropertySignature.js","sourceRoot":"","sources":["../../src/model/ApiPropertySignature.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;AAQzF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,oBAAqB,SAAQ,eAAe;IACvD,YAAmB,OAAqC;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,OAAO,GAAG,IAAI,IAAI,WAAW,CAAC,iBAAiB,EAAE,CAAC;IACpD,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,WAAW,CAAC,iBAAiB,CAAC;IACvC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,oBAAoB,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,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,CAAC;IACjC,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 { ApiPropertyItem, type IApiPropertyItemOptions } from '../items/ApiPropertyItem';\n\n/**\n * Constructor options for {@link ApiPropertySignature}.\n * @public\n */\nexport interface IApiPropertySignatureOptions extends IApiPropertyItemOptions {}\n\n/**\n * Represents a TypeScript property 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 * `ApiPropertySignature` represents a TypeScript declaration such as the `width` and `height` members in this example:\n *\n * ```ts\n * export interface IWidget {\n * readonly width: number;\n * height: number;\n * }\n * ```\n *\n * Compare with {@link ApiProperty}, which represents a property belonging to a class.\n * For example, a class property can be `static` but an interface property cannot.\n *\n * @public\n */\nexport class ApiPropertySignature extends ApiPropertyItem {\n public constructor(options: IApiPropertySignatureOptions) {\n super(options);\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.PropertySignature}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.PropertySignature;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiPropertySignature.getContainerKey(this.name);\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 }\n}\n"]}
@@ -0,0 +1,71 @@
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 { ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';
7
+ import { ApiNameMixin } from '../mixins/ApiNameMixin';
8
+ import { ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin';
9
+ import { ApiExportedMixin } from '../mixins/ApiExportedMixin';
10
+ /**
11
+ * Represents a TypeScript type alias 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
+ * `ApiTypeAlias` represents a definition such as one of these examples:
19
+ *
20
+ * ```ts
21
+ * // A union type:
22
+ * export type Shape = Square | Triangle | Circle;
23
+ *
24
+ * // A generic type alias:
25
+ * export type BoxedValue<T> = { value: T };
26
+ *
27
+ * export type BoxedArray<T> = { array: T[] };
28
+ *
29
+ * // A conditional type alias:
30
+ * export type Boxed<T> = T extends any[] ? BoxedArray<T[number]> : BoxedValue<T>;
31
+ *
32
+ * ```
33
+ *
34
+ * @public
35
+ */
36
+ export class ApiTypeAlias extends ApiTypeParameterListMixin(ApiNameMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem)))) {
37
+ constructor(options) {
38
+ super(options);
39
+ this.typeExcerpt = this.buildExcerpt(options.typeTokenRange);
40
+ }
41
+ /** @override */
42
+ static onDeserializeInto(options, context, jsonObject) {
43
+ super.onDeserializeInto(options, context, jsonObject);
44
+ options.typeTokenRange = jsonObject.typeTokenRange;
45
+ }
46
+ static getContainerKey(name) {
47
+ return `${name}|${ApiItemKind.TypeAlias}`;
48
+ }
49
+ /** @override */
50
+ get kind() {
51
+ return ApiItemKind.TypeAlias;
52
+ }
53
+ /** @override */
54
+ get containerKey() {
55
+ return ApiTypeAlias.getContainerKey(this.name);
56
+ }
57
+ /** @override */
58
+ serializeInto(jsonObject) {
59
+ super.serializeInto(jsonObject);
60
+ jsonObject.typeTokenRange = this.typeExcerpt.tokenRange;
61
+ }
62
+ /** @beta @override */
63
+ buildCanonicalReference() {
64
+ const nameComponent = DeclarationReference.parseComponent(this.name);
65
+ const navigation = this.isExported ? Navigation.Exports : Navigation.Locals;
66
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
67
+ .addNavigationStep(navigation, nameComponent)
68
+ .withMeaning(Meaning.TypeAlias);
69
+ }
70
+ }
71
+ //# sourceMappingURL=ApiTypeAlias.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiTypeAlias.js","sourceRoot":"","sources":["../../src/model/ApiTypeAlias.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,UAAU,EAEX,MAAM,yDAAyD,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAmC,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAA6B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EACL,yBAAyB,EAG1B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAGL,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AAsBpC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,YAAa,SAAQ,yBAAyB,CACzD,YAAY,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CACpE;IAcC,YAAmB,OAA6B;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,C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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 type { Excerpt, IExcerptTokenRange } from '../mixins/Excerpt';\nimport { ApiItemKind } from '../items/ApiItem';\nimport {\n ApiDeclaredItem,\n type IApiDeclaredItemOptions,\n type IApiDeclaredItemJson\n} from '../items/ApiDeclaredItem';\nimport { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport {\n ApiTypeParameterListMixin,\n type IApiTypeParameterListMixinOptions,\n type IApiTypeParameterListMixinJson\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 ApiTypeAlias}.\n * @public\n */\nexport interface IApiTypeAliasOptions\n extends IApiNameMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiDeclaredItemOptions,\n IApiTypeParameterListMixinOptions,\n IApiExportedMixinOptions {\n typeTokenRange: IExcerptTokenRange;\n}\n\nexport interface IApiTypeAliasJson\n extends IApiDeclaredItemJson,\n IApiTypeParameterListMixinJson,\n IApiExportedMixinJson {\n typeTokenRange: IExcerptTokenRange;\n}\n\n/**\n * Represents a TypeScript type alias 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 * `ApiTypeAlias` represents a definition such as one of these examples:\n *\n * ```ts\n * // A union type:\n * export type Shape = Square | Triangle | Circle;\n *\n * // A generic type alias:\n * export type BoxedValue<T> = { value: T };\n *\n * export type BoxedArray<T> = { array: T[] };\n *\n * // A conditional type alias:\n * export type Boxed<T> = T extends any[] ? BoxedArray<T[number]> : BoxedValue<T>;\n *\n * ```\n *\n * @public\n */\nexport class ApiTypeAlias extends ApiTypeParameterListMixin(\n ApiNameMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem)))\n) {\n /**\n * An {@link Excerpt} that describes the type of the alias.\n *\n * @remarks\n * In the example below, the `typeExcerpt` would correspond to the subexpression\n * `T extends any[] ? BoxedArray<T[number]> : BoxedValue<T>;`:\n *\n * ```ts\n * export type Boxed<T> = T extends any[] ? BoxedArray<T[number]> : BoxedValue<T>;\n * ```\n */\n public readonly typeExcerpt: Excerpt;\n\n public constructor(options: IApiTypeAliasOptions) {\n super(options);\n\n this.typeExcerpt = this.buildExcerpt(options.typeTokenRange);\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiTypeAliasOptions>,\n context: DeserializerContext,\n jsonObject: IApiTypeAliasJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.typeTokenRange = jsonObject.typeTokenRange;\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.TypeAlias}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.TypeAlias;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiTypeAlias.getContainerKey(this.name);\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiTypeAliasJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.typeTokenRange = this.typeExcerpt.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.TypeAlias);\n }\n}\n"]}
@@ -0,0 +1,66 @@
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 { ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';
7
+ import { ApiReadonlyMixin } from '../mixins/ApiReadonlyMixin';
8
+ import { ApiNameMixin } from '../mixins/ApiNameMixin';
9
+ import { ApiInitializerMixin } from '../mixins/ApiInitializerMixin';
10
+ import { ApiExportedMixin } from '../mixins/ApiExportedMixin';
11
+ /**
12
+ * Represents a TypeScript variable declaration.
13
+ *
14
+ * @remarks
15
+ *
16
+ * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
17
+ * API declarations.
18
+ *
19
+ * `ApiVariable` represents an exported `const` or `let` object such as these examples:
20
+ *
21
+ * ```ts
22
+ * // A variable declaration
23
+ * export let verboseLogging: boolean;
24
+ *
25
+ * // A constant variable declaration with an initializer
26
+ * export const canvas: IWidget = createCanvas();
27
+ * ```
28
+ *
29
+ * @public
30
+ */
31
+ export class ApiVariable extends ApiNameMixin(ApiReleaseTagMixin(ApiReadonlyMixin(ApiInitializerMixin(ApiExportedMixin(ApiDeclaredItem))))) {
32
+ constructor(options) {
33
+ super(options);
34
+ this.variableTypeExcerpt = this.buildExcerpt(options.variableTypeTokenRange);
35
+ }
36
+ /** @override */
37
+ static onDeserializeInto(options, context, jsonObject) {
38
+ super.onDeserializeInto(options, context, jsonObject);
39
+ options.variableTypeTokenRange = jsonObject.variableTypeTokenRange;
40
+ }
41
+ static getContainerKey(name) {
42
+ return `${name}|${ApiItemKind.Variable}`;
43
+ }
44
+ /** @override */
45
+ get kind() {
46
+ return ApiItemKind.Variable;
47
+ }
48
+ /** @override */
49
+ get containerKey() {
50
+ return ApiVariable.getContainerKey(this.name);
51
+ }
52
+ /** @override */
53
+ serializeInto(jsonObject) {
54
+ super.serializeInto(jsonObject);
55
+ jsonObject.variableTypeTokenRange = this.variableTypeExcerpt.tokenRange;
56
+ }
57
+ /** @beta @override */
58
+ buildCanonicalReference() {
59
+ const nameComponent = DeclarationReference.parseComponent(this.name);
60
+ const navigation = this.isExported ? Navigation.Exports : Navigation.Locals;
61
+ return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())
62
+ .addNavigationStep(navigation, nameComponent)
63
+ .withMeaning(Meaning.Variable);
64
+ }
65
+ }
66
+ //# sourceMappingURL=ApiVariable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiVariable.js","sourceRoot":"","sources":["../../src/model/ApiVariable.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,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAmC,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAiC,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAA6B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAoC,MAAM,+BAA+B,CAAC;AAGtG,OAAO,EAGL,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AAoBpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,WAAY,SAAQ,YAAY,CAC3C,kBAAkB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAC7F;IAMC,YAAmB,OAA4B;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC/E,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAAqC,EACrC,OAA4B,EAC5B,UAA4B;QAE5B,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,OAAO,CAAC,sBAAsB,GAAG,UAAU,CAAC,sBAAsB,CAAC;IACrE,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,OAAO,GAAG,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC3C,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,WAAW,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAqC;QACxD,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAEhC,UAAU,CAAC,sBAAsB,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;IAC1E,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,QAAQ,CAAC,CAAC;IACnC,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 ApiDeclaredItem,\n type IApiDeclaredItemOptions,\n type IApiDeclaredItemJson\n} from '../items/ApiDeclaredItem';\nimport { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport { ApiReadonlyMixin, type IApiReadonlyMixinOptions } from '../mixins/ApiReadonlyMixin';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport { ApiInitializerMixin, type IApiInitializerMixinOptions } from '../mixins/ApiInitializerMixin';\nimport type { IExcerptTokenRange, Excerpt } from '../mixins/Excerpt';\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 ApiVariable}.\n * @public\n */\nexport interface IApiVariableOptions\n extends IApiNameMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiReadonlyMixinOptions,\n IApiDeclaredItemOptions,\n IApiInitializerMixinOptions,\n IApiExportedMixinOptions {\n variableTypeTokenRange: IExcerptTokenRange;\n}\n\nexport interface IApiVariableJson extends IApiDeclaredItemJson, IApiExportedMixinJson {\n variableTypeTokenRange: IExcerptTokenRange;\n}\n\n/**\n * Represents a TypeScript variable 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 * `ApiVariable` represents an exported `const` or `let` object such as these examples:\n *\n * ```ts\n * // A variable declaration\n * export let verboseLogging: boolean;\n *\n * // A constant variable declaration with an initializer\n * export const canvas: IWidget = createCanvas();\n * ```\n *\n * @public\n */\nexport class ApiVariable extends ApiNameMixin(\n ApiReleaseTagMixin(ApiReadonlyMixin(ApiInitializerMixin(ApiExportedMixin(ApiDeclaredItem))))\n) {\n /**\n * An {@link Excerpt} that describes the type of the variable.\n */\n public readonly variableTypeExcerpt: Excerpt;\n\n public constructor(options: IApiVariableOptions) {\n super(options);\n\n this.variableTypeExcerpt = this.buildExcerpt(options.variableTypeTokenRange);\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiVariableOptions>,\n context: DeserializerContext,\n jsonObject: IApiVariableJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.variableTypeTokenRange = jsonObject.variableTypeTokenRange;\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.Variable}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Variable;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiVariable.getContainerKey(this.name);\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiVariableJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.variableTypeTokenRange = this.variableTypeExcerpt.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.Variable);\n }\n}\n"]}
@@ -0,0 +1,88 @@
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 { ApiItemKind } from '../items/ApiItem';
4
+ import { ApiClass } from './ApiClass';
5
+ import { ApiEntryPoint } from './ApiEntryPoint';
6
+ import { ApiMethod } from './ApiMethod';
7
+ import { ApiModel } from './ApiModel';
8
+ import { ApiNamespace } from './ApiNamespace';
9
+ import { ApiPackage } from './ApiPackage';
10
+ import { ApiInterface } from './ApiInterface';
11
+ import { ApiPropertySignature } from './ApiPropertySignature';
12
+ import { ApiMethodSignature } from './ApiMethodSignature';
13
+ import { ApiProperty } from './ApiProperty';
14
+ import { ApiEnumMember } from './ApiEnumMember';
15
+ import { ApiEnum } from './ApiEnum';
16
+ import { ApiConstructor } from './ApiConstructor';
17
+ import { ApiConstructSignature } from './ApiConstructSignature';
18
+ import { ApiFunction } from './ApiFunction';
19
+ import { ApiCallSignature } from './ApiCallSignature';
20
+ import { ApiIndexSignature } from './ApiIndexSignature';
21
+ import { ApiTypeAlias } from './ApiTypeAlias';
22
+ import { ApiVariable } from './ApiVariable';
23
+ export class Deserializer {
24
+ static deserialize(context, jsonObject) {
25
+ const options = {};
26
+ switch (jsonObject.kind) {
27
+ case ApiItemKind.Class:
28
+ ApiClass.onDeserializeInto(options, context, jsonObject);
29
+ return new ApiClass(options);
30
+ case ApiItemKind.CallSignature:
31
+ ApiCallSignature.onDeserializeInto(options, context, jsonObject);
32
+ return new ApiCallSignature(options);
33
+ case ApiItemKind.Constructor:
34
+ ApiConstructor.onDeserializeInto(options, context, jsonObject);
35
+ return new ApiConstructor(options);
36
+ case ApiItemKind.ConstructSignature:
37
+ ApiConstructSignature.onDeserializeInto(options, context, jsonObject);
38
+ return new ApiConstructSignature(options);
39
+ case ApiItemKind.EntryPoint:
40
+ ApiEntryPoint.onDeserializeInto(options, context, jsonObject);
41
+ return new ApiEntryPoint(options);
42
+ case ApiItemKind.Enum:
43
+ ApiEnum.onDeserializeInto(options, context, jsonObject);
44
+ return new ApiEnum(options);
45
+ case ApiItemKind.EnumMember:
46
+ ApiEnumMember.onDeserializeInto(options, context, jsonObject);
47
+ return new ApiEnumMember(options);
48
+ case ApiItemKind.Function:
49
+ ApiFunction.onDeserializeInto(options, context, jsonObject);
50
+ return new ApiFunction(options);
51
+ case ApiItemKind.IndexSignature:
52
+ ApiIndexSignature.onDeserializeInto(options, context, jsonObject);
53
+ return new ApiIndexSignature(options);
54
+ case ApiItemKind.Interface:
55
+ ApiInterface.onDeserializeInto(options, context, jsonObject);
56
+ return new ApiInterface(options);
57
+ case ApiItemKind.Method:
58
+ ApiMethod.onDeserializeInto(options, context, jsonObject);
59
+ return new ApiMethod(options);
60
+ case ApiItemKind.MethodSignature:
61
+ ApiMethodSignature.onDeserializeInto(options, context, jsonObject);
62
+ return new ApiMethodSignature(options);
63
+ case ApiItemKind.Model:
64
+ return new ApiModel();
65
+ case ApiItemKind.Namespace:
66
+ ApiNamespace.onDeserializeInto(options, context, jsonObject);
67
+ return new ApiNamespace(options);
68
+ case ApiItemKind.Package:
69
+ ApiPackage.onDeserializeInto(options, context, jsonObject);
70
+ return new ApiPackage(options);
71
+ case ApiItemKind.Property:
72
+ ApiProperty.onDeserializeInto(options, context, jsonObject);
73
+ return new ApiProperty(options);
74
+ case ApiItemKind.PropertySignature:
75
+ ApiPropertySignature.onDeserializeInto(options, context, jsonObject);
76
+ return new ApiPropertySignature(options);
77
+ case ApiItemKind.TypeAlias:
78
+ ApiTypeAlias.onDeserializeInto(options, context, jsonObject);
79
+ return new ApiTypeAlias(options);
80
+ case ApiItemKind.Variable:
81
+ ApiVariable.onDeserializeInto(options, context, jsonObject);
82
+ return new ApiVariable(options);
83
+ default:
84
+ throw new Error(`Failed to deserialize unsupported API item type ${JSON.stringify(jsonObject.kind)}`);
85
+ }
86
+ }
87
+ }
88
+ //# sourceMappingURL=Deserializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Deserializer.js","sourceRoot":"","sources":["../../src/model/Deserializer.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAyD,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACtG,OAAO,EAAE,QAAQ,EAA6C,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,aAAa,EAA8B,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,SAAS,EAA0B,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAA6B,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAiD,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE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EAAE,OAAO,EAAE,UAA8B,CAAC,CAAC;gBAChF,OAAO,IAAI,WAAW,CAAC,OAA8B,CAAC,CAAC;YACzD;gBACE,MAAM,IAAI,KAAK,CAAC,mDAAmD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1G,CAAC;IACH,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 { type IApiItemJson, type IApiItemOptions, type ApiItem, ApiItemKind } from '../items/ApiItem';\nimport { ApiClass, type IApiClassOptions, type IApiClassJson } from './ApiClass';\nimport { ApiEntryPoint, type IApiEntryPointOptions } from './ApiEntryPoint';\nimport { ApiMethod, type IApiMethodOptions } from './ApiMethod';\nimport { ApiModel } from './ApiModel';\nimport { ApiNamespace, type IApiNamespaceOptions } from './ApiNamespace';\nimport { ApiPackage, type IApiPackageOptions, type IApiPackageJson } from './ApiPackage';\nimport { ApiInterface, type IApiInterfaceOptions, type IApiInterfaceJson } from './ApiInterface';\nimport { ApiPropertySignature, type IApiPropertySignatureOptions } from './ApiPropertySignature';\nimport { ApiMethodSignature, type IApiMethodSignatureOptions } from './ApiMethodSignature';\nimport { ApiProperty, type IApiPropertyOptions } from './ApiProperty';\nimport { ApiEnumMember, type IApiEnumMemberOptions } from './ApiEnumMember';\nimport { ApiEnum, type IApiEnumOptions } from './ApiEnum';\nimport type { IApiPropertyItemJson } from '../items/ApiPropertyItem';\nimport { ApiConstructor, type IApiConstructorOptions } from './ApiConstructor';\nimport { ApiConstructSignature, type IApiConstructSignatureOptions } from './ApiConstructSignature';\nimport { ApiFunction, type IApiFunctionOptions } from './ApiFunction';\nimport { ApiCallSignature, type IApiCallSignatureOptions } from './ApiCallSignature';\nimport { ApiIndexSignature, type IApiIndexSignatureOptions } from './ApiIndexSignature';\nimport { ApiTypeAlias, type IApiTypeAliasOptions, type IApiTypeAliasJson } from './ApiTypeAlias';\nimport { ApiVariable, type IApiVariableOptions, type IApiVariableJson } from './ApiVariable';\nimport type { IApiDeclaredItemJson } from '../items/ApiDeclaredItem';\nimport type { DeserializerContext } from './DeserializerContext';\n\nexport class Deserializer {\n public static deserialize(context: DeserializerContext, jsonObject: IApiItemJson): ApiItem {\n const options: Partial<IApiItemOptions> = {};\n\n switch (jsonObject.kind) {\n case ApiItemKind.Class:\n ApiClass.onDeserializeInto(options, context, jsonObject as IApiClassJson);\n return new ApiClass(options as IApiClassOptions);\n case ApiItemKind.CallSignature:\n ApiCallSignature.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiCallSignature(options as IApiCallSignatureOptions);\n case ApiItemKind.Constructor:\n ApiConstructor.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiConstructor(options as IApiConstructorOptions);\n case ApiItemKind.ConstructSignature:\n ApiConstructSignature.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiConstructSignature(options as IApiConstructSignatureOptions);\n case ApiItemKind.EntryPoint:\n ApiEntryPoint.onDeserializeInto(options, context, jsonObject);\n return new ApiEntryPoint(options as IApiEntryPointOptions);\n case ApiItemKind.Enum:\n ApiEnum.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiEnum(options as IApiEnumOptions);\n case ApiItemKind.EnumMember:\n ApiEnumMember.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiEnumMember(options as IApiEnumMemberOptions);\n case ApiItemKind.Function:\n ApiFunction.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiFunction(options as IApiFunctionOptions);\n case ApiItemKind.IndexSignature:\n ApiIndexSignature.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiIndexSignature(options as IApiIndexSignatureOptions);\n case ApiItemKind.Interface:\n ApiInterface.onDeserializeInto(options, context, jsonObject as IApiInterfaceJson);\n return new ApiInterface(options as IApiInterfaceOptions);\n case ApiItemKind.Method:\n ApiMethod.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiMethod(options as IApiMethodOptions);\n case ApiItemKind.MethodSignature:\n ApiMethodSignature.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiMethodSignature(options as IApiMethodSignatureOptions);\n case ApiItemKind.Model:\n return new ApiModel();\n case ApiItemKind.Namespace:\n ApiNamespace.onDeserializeInto(options, context, jsonObject as IApiDeclaredItemJson);\n return new ApiNamespace(options as IApiNamespaceOptions);\n case ApiItemKind.Package:\n ApiPackage.onDeserializeInto(options, context, jsonObject as IApiPackageJson);\n return new ApiPackage(options as IApiPackageOptions);\n case ApiItemKind.Property:\n ApiProperty.onDeserializeInto(options, context, jsonObject as IApiPropertyItemJson);\n return new ApiProperty(options as IApiPropertyOptions);\n case ApiItemKind.PropertySignature:\n ApiPropertySignature.onDeserializeInto(options, context, jsonObject as IApiPropertyItemJson);\n return new ApiPropertySignature(options as IApiPropertySignatureOptions);\n case ApiItemKind.TypeAlias:\n ApiTypeAlias.onDeserializeInto(options, context, jsonObject as IApiTypeAliasJson);\n return new ApiTypeAlias(options as IApiTypeAliasOptions);\n case ApiItemKind.Variable:\n ApiVariable.onDeserializeInto(options, context, jsonObject as IApiVariableJson);\n return new ApiVariable(options as IApiVariableOptions);\n default:\n throw new Error(`Failed to deserialize unsupported API item type ${JSON.stringify(jsonObject.kind)}`);\n }\n }\n}\n"]}