@microsoft/api-extractor-model 7.32.1 → 7.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/CHANGELOG.json +29 -0
  2. package/CHANGELOG.md +13 -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 +27 -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,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
+ const _isProtected = Symbol('ApiProtectedMixin._isProtected');
4
+ /**
5
+ * Mixin function for {@link (ApiProtectedMixin:interface)}.
6
+ *
7
+ * @param baseClass - The base class to be extended
8
+ * @returns A child class that extends baseClass, adding the {@link (ApiProtectedMixin:interface)} functionality.
9
+ *
10
+ * @public
11
+ */
12
+ export function ApiProtectedMixin(baseClass
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ ) {
15
+ class MixedClass extends baseClass {
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ constructor(...args) {
18
+ super(...args);
19
+ const options = args[0];
20
+ this[_isProtected] = options.isProtected;
21
+ }
22
+ /** @override */
23
+ static onDeserializeInto(options, context, jsonObject) {
24
+ baseClass.onDeserializeInto(options, context, jsonObject);
25
+ options.isProtected = jsonObject.isProtected;
26
+ }
27
+ get isProtected() {
28
+ return this[_isProtected];
29
+ }
30
+ /** @override */
31
+ serializeInto(jsonObject) {
32
+ super.serializeInto(jsonObject);
33
+ jsonObject.isProtected = this.isProtected;
34
+ }
35
+ }
36
+ return MixedClass;
37
+ }
38
+ /**
39
+ * Static members for {@link (ApiProtectedMixin:interface)}.
40
+ * @public
41
+ */
42
+ (function (ApiProtectedMixin) {
43
+ /**
44
+ * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiProtectedMixin` mixin.
45
+ *
46
+ * @remarks
47
+ *
48
+ * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
49
+ * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
50
+ * the TypeScript type system cannot invoke a runtime test.)
51
+ */
52
+ function isBaseClassOf(apiItem) {
53
+ return apiItem.hasOwnProperty(_isProtected);
54
+ }
55
+ ApiProtectedMixin.isBaseClassOf = isBaseClassOf;
56
+ })(ApiProtectedMixin || (ApiProtectedMixin = {}));
57
+ //# sourceMappingURL=ApiProtectedMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiProtectedMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiProtectedMixin.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAmB3D,MAAM,YAAY,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AA4B7E;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAA8B,IAAI,CAAC,CAAC,CAAC,CAAC;YACnD,IAAI,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;QAC3C,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA2C,EAC3C,OAA4B,EAC5B,UAAkC;YAElC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC/C,CAAC;QAED,IAAW,WAAW;YACpB,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA2C;YAC9D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,iBAAiB;IAChC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAC9C,CAAC;IAFe,+BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,iBAAiB,KAAjB,iBAAiB,QAajC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (IApiProtectedMixinOptions:interface)}.\n * @public\n */\nexport interface IApiProtectedMixinOptions extends IApiItemOptions {\n isProtected: boolean;\n}\n\nexport interface IApiProtectedMixinJson extends IApiItemJson {\n isProtected: boolean;\n}\n\nconst _isProtected: unique symbol = Symbol('ApiProtectedMixin._isProtected');\n\n/**\n * The mixin base class for API items that can have the TypeScript `protected` keyword applied to them.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiProtectedMixin extends ApiItem {\n /**\n * Whether the declaration has the TypeScript `protected` keyword.\n */\n readonly isProtected: boolean;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiProtectedMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiProtectedMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiProtectedMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiProtectedMixin) {\n class MixedClass extends baseClass implements ApiProtectedMixin {\n public [_isProtected]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiProtectedMixinOptions = args[0];\n this[_isProtected] = options.isProtected;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiProtectedMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiProtectedMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isProtected = jsonObject.isProtected;\n }\n\n public get isProtected(): boolean {\n return this[_isProtected];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiProtectedMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isProtected = this.isProtected;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiProtectedMixin:interface)}.\n * @public\n */\nexport namespace ApiProtectedMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiProtectedMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiProtectedMixin {\n return apiItem.hasOwnProperty(_isProtected);\n }\n}\n"]}
@@ -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
+ const _isReadonly = Symbol('ApiReadonlyMixin._isReadonly');
4
+ /**
5
+ * Mixin function for {@link (ApiReadonlyMixin:interface)}.
6
+ *
7
+ * @param baseClass - The base class to be extended
8
+ * @returns A child class that extends baseClass, adding the {@link (ApiReadonlyMixin:interface)}
9
+ * functionality.
10
+ *
11
+ * @public
12
+ */
13
+ export function ApiReadonlyMixin(baseClass
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ ) {
16
+ class MixedClass extends baseClass {
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ constructor(...args) {
19
+ super(...args);
20
+ const options = args[0];
21
+ this[_isReadonly] = options.isReadonly;
22
+ }
23
+ /** @override */
24
+ static onDeserializeInto(options, context, jsonObject) {
25
+ baseClass.onDeserializeInto(options, context, jsonObject);
26
+ options.isReadonly = jsonObject.isReadonly || false;
27
+ }
28
+ get isReadonly() {
29
+ return this[_isReadonly];
30
+ }
31
+ /** @override */
32
+ serializeInto(jsonObject) {
33
+ super.serializeInto(jsonObject);
34
+ jsonObject.isReadonly = this.isReadonly;
35
+ }
36
+ }
37
+ return MixedClass;
38
+ }
39
+ /**
40
+ * Static members for {@link (ApiReadonlyMixin:interface)}.
41
+ * @public
42
+ */
43
+ (function (ApiReadonlyMixin) {
44
+ /**
45
+ * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReadonlyMixin` mixin.
46
+ *
47
+ * @remarks
48
+ *
49
+ * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
50
+ * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
51
+ * the TypeScript type system cannot invoke a runtime test.)
52
+ */
53
+ function isBaseClassOf(apiItem) {
54
+ return apiItem.hasOwnProperty(_isReadonly);
55
+ }
56
+ ApiReadonlyMixin.isBaseClassOf = isBaseClassOf;
57
+ })(ApiReadonlyMixin || (ApiReadonlyMixin = {}));
58
+ //# sourceMappingURL=ApiReadonlyMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiReadonlyMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReadonlyMixin.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAmB3D,MAAM,WAAW,GAAkB,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAiD1E;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAA6B,IAAI,CAAC,CAAC,CAAC,CAAC;YAClD,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;QACzC,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA0C,EAC1C,OAA4B,EAC5B,UAAiC;YAEjC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,KAAK,CAAC;QACtD,CAAC;QAED,IAAW,UAAU;YACnB,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA0C;YAC7D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAC1C,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAFe,8BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,gBAAgB,KAAhB,gBAAgB,QAahC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (ApiReadonlyMixin:interface)}.\n * @public\n */\nexport interface IApiReadonlyMixinOptions extends IApiItemOptions {\n isReadonly: boolean;\n}\n\nexport interface IApiReadonlyMixinJson extends IApiItemJson {\n isReadonly: boolean;\n}\n\nconst _isReadonly: unique symbol = Symbol('ApiReadonlyMixin._isReadonly');\n\n/**\n * The mixin base class for API items that cannot be modified after instantiation.\n * Examples such as the readonly modifier and only having a getter but no setter.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiReadonlyMixin extends ApiItem {\n /**\n * Indicates that the API item's value cannot be assigned by an external consumer.\n *\n * @remarks\n * Examples of API items that would be considered \"read only\" by API Extractor:\n *\n * - A class or interface's property that has the `readonly` modifier.\n *\n * - A variable that has the `const` modifier.\n *\n * - A property or variable whose TSDoc comment includes the `@readonly` tag.\n *\n * - A property declaration with a getter but no setter.\n *\n * Note that if the `readonly` keyword appears in a type annotation, this does not\n * guarantee that that the API item will be considered readonly. For example:\n *\n * ```ts\n * declare class C {\n * // isReadonly=false in this case, because C.x is assignable\n * public x: readonly string[];\n * }\n * ```\n */\n readonly isReadonly: boolean;\n\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiReadonlyMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiReadonlyMixin:interface)}\n * functionality.\n *\n * @public\n */\nexport function ApiReadonlyMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiReadonlyMixin) {\n class MixedClass extends baseClass implements ApiReadonlyMixin {\n public [_isReadonly]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiReadonlyMixinOptions = args[0];\n this[_isReadonly] = options.isReadonly;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiReadonlyMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiReadonlyMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isReadonly = jsonObject.isReadonly || false;\n }\n\n public get isReadonly(): boolean {\n return this[_isReadonly];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiReadonlyMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isReadonly = this.isReadonly;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiReadonlyMixin:interface)}.\n * @public\n */\nexport namespace ApiReadonlyMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReadonlyMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiReadonlyMixin {\n return apiItem.hasOwnProperty(_isReadonly);\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
+ /* eslint-disable @typescript-eslint/no-redeclare */
4
+ import { Enum } from '@rushstack/node-core-library';
5
+ import { ReleaseTag } from '../aedoc/ReleaseTag';
6
+ const _releaseTag = Symbol('ApiReleaseTagMixin._releaseTag');
7
+ /**
8
+ * Mixin function for {@link (ApiReleaseTagMixin:interface)}.
9
+ *
10
+ * @param baseClass - The base class to be extended
11
+ * @returns A child class that extends baseClass, adding the {@link (ApiReleaseTagMixin:interface)} functionality.
12
+ *
13
+ * @public
14
+ */
15
+ export function ApiReleaseTagMixin(baseClass
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ ) {
18
+ class MixedClass extends baseClass {
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ constructor(...args) {
21
+ super(...args);
22
+ const options = args[0];
23
+ this[_releaseTag] = options.releaseTag;
24
+ }
25
+ /** @override */
26
+ static onDeserializeInto(options, context, jsonObject) {
27
+ baseClass.onDeserializeInto(options, context, jsonObject);
28
+ const deserializedReleaseTag = Enum.tryGetValueByKey(ReleaseTag, // eslint-disable-line
29
+ jsonObject.releaseTag);
30
+ if (deserializedReleaseTag === undefined) {
31
+ throw new Error(`Failed to deserialize release tag ${JSON.stringify(jsonObject.releaseTag)}`);
32
+ }
33
+ options.releaseTag = deserializedReleaseTag;
34
+ }
35
+ get releaseTag() {
36
+ return this[_releaseTag];
37
+ }
38
+ /** @override */
39
+ serializeInto(jsonObject) {
40
+ super.serializeInto(jsonObject);
41
+ jsonObject.releaseTag = ReleaseTag[this.releaseTag];
42
+ }
43
+ }
44
+ return MixedClass;
45
+ }
46
+ /**
47
+ * Static members for {@link (ApiReleaseTagMixin:interface)}.
48
+ * @public
49
+ */
50
+ (function (ApiReleaseTagMixin) {
51
+ /**
52
+ * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReleaseTagMixin` mixin.
53
+ *
54
+ * @remarks
55
+ *
56
+ * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
57
+ * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
58
+ * the TypeScript type system cannot invoke a runtime test.)
59
+ */
60
+ function isBaseClassOf(apiItem) {
61
+ return apiItem.hasOwnProperty(_releaseTag);
62
+ }
63
+ ApiReleaseTagMixin.isBaseClassOf = isBaseClassOf;
64
+ })(ApiReleaseTagMixin || (ApiReleaseTagMixin = {}));
65
+ //# sourceMappingURL=ApiReleaseTagMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiReleaseTagMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReleaseTagMixin.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,oDAAoD;AAEpD,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAejD,MAAM,WAAW,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAiC5E;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAA+B,IAAI,CAAC,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;QACzC,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA4C,EAC5C,OAA4B,EAC5B,UAAmC;YAEnC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,MAAM,sBAAsB,GAA2B,IAAI,CAAC,gBAAgB,CAC1E,UAAiB,EAAE,sBAAsB;YACzC,UAAU,CAAC,UAAU,CACtB,CAAC;YACF,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAChG,CAAC;YAED,OAAO,CAAC,UAAU,GAAG,sBAAsB,CAAC;QAC9C,CAAC;QAED,IAAW,UAAU;YACnB,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA4C;YAC/D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtD,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,kBAAkB;IACjC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAFe,gCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,kBAAkB,KAAlB,kBAAkB,QAalC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport { Enum } from '@rushstack/node-core-library';\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport { ReleaseTag } from '../aedoc/ReleaseTag';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (ApiReleaseTagMixin:interface)}.\n * @public\n */\nexport interface IApiReleaseTagMixinOptions extends IApiItemOptions {\n releaseTag: ReleaseTag;\n}\n\nexport interface IApiReleaseTagMixinJson extends IApiItemJson {\n releaseTag: string;\n}\n\nconst _releaseTag: unique symbol = Symbol('ApiReleaseTagMixin._releaseTag');\n\n/**\n * The mixin base class for API items that can be attributed with a TSDoc tag such as `@internal`,\n * `@alpha`, `@beta`, or `@public`. These \"release tags\" indicate the support level for an API.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiReleaseTagMixin extends ApiItem {\n /**\n * The effective release tag for this declaration. If it is not explicitly specified, the value may be\n * inherited from a containing declaration.\n *\n * @remarks\n * For example, an `ApiEnumMember` may inherit its release tag from the containing `ApiEnum`.\n */\n readonly releaseTag: ReleaseTag;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiReleaseTagMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiReleaseTagMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiReleaseTagMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiReleaseTagMixin) {\n class MixedClass extends baseClass implements ApiReleaseTagMixin {\n public [_releaseTag]: ReleaseTag;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiReleaseTagMixinOptions = args[0];\n this[_releaseTag] = options.releaseTag;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiReleaseTagMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiReleaseTagMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n const deserializedReleaseTag: ReleaseTag | undefined = Enum.tryGetValueByKey<ReleaseTag>(\n ReleaseTag as any, // eslint-disable-line\n jsonObject.releaseTag\n );\n if (deserializedReleaseTag === undefined) {\n throw new Error(`Failed to deserialize release tag ${JSON.stringify(jsonObject.releaseTag)}`);\n }\n\n options.releaseTag = deserializedReleaseTag;\n }\n\n public get releaseTag(): ReleaseTag {\n return this[_releaseTag];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiReleaseTagMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.releaseTag = ReleaseTag[this.releaseTag];\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiReleaseTagMixin:interface)}.\n * @public\n */\nexport namespace ApiReleaseTagMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReleaseTagMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiReleaseTagMixin {\n return apiItem.hasOwnProperty(_releaseTag);\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
+ /* eslint-disable @typescript-eslint/no-redeclare */
4
+ import { InternalError } from '@rushstack/node-core-library';
5
+ import { ApiDeclaredItem } from '../items/ApiDeclaredItem';
6
+ const _returnTypeExcerpt = Symbol('ApiReturnTypeMixin._returnTypeExcerpt');
7
+ /**
8
+ * Mixin function for {@link (ApiReturnTypeMixin:interface)}.
9
+ *
10
+ * @param baseClass - The base class to be extended
11
+ * @returns A child class that extends baseClass, adding the {@link (ApiReturnTypeMixin:interface)} functionality.
12
+ *
13
+ * @public
14
+ */
15
+ export function ApiReturnTypeMixin(baseClass
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ ) {
18
+ class MixedClass extends baseClass {
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ constructor(...args) {
21
+ super(...args);
22
+ const options = args[0];
23
+ if (this instanceof ApiDeclaredItem) {
24
+ this[_returnTypeExcerpt] = this.buildExcerpt(options.returnTypeTokenRange);
25
+ }
26
+ else {
27
+ throw new InternalError('ApiReturnTypeMixin expects a base class that inherits from ApiDeclaredItem');
28
+ }
29
+ }
30
+ /** @override */
31
+ static onDeserializeInto(options, context, jsonObject) {
32
+ baseClass.onDeserializeInto(options, context, jsonObject);
33
+ options.returnTypeTokenRange = jsonObject.returnTypeTokenRange;
34
+ }
35
+ get returnTypeExcerpt() {
36
+ return this[_returnTypeExcerpt];
37
+ }
38
+ /** @override */
39
+ serializeInto(jsonObject) {
40
+ super.serializeInto(jsonObject);
41
+ jsonObject.returnTypeTokenRange = this.returnTypeExcerpt.tokenRange;
42
+ }
43
+ }
44
+ return MixedClass;
45
+ }
46
+ /**
47
+ * Static members for {@link (ApiReturnTypeMixin:interface)}.
48
+ * @public
49
+ */
50
+ (function (ApiReturnTypeMixin) {
51
+ /**
52
+ * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReturnTypeMixin` mixin.
53
+ *
54
+ * @remarks
55
+ *
56
+ * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
57
+ * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
58
+ * the TypeScript type system cannot invoke a runtime test.)
59
+ */
60
+ function isBaseClassOf(apiItem) {
61
+ return apiItem.hasOwnProperty(_returnTypeExcerpt);
62
+ }
63
+ ApiReturnTypeMixin.isBaseClassOf = isBaseClassOf;
64
+ })(ApiReturnTypeMixin || (ApiReturnTypeMixin = {}));
65
+ //# sourceMappingURL=ApiReturnTypeMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiReturnTypeMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReturnTypeMixin.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,oDAAoD;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAI7D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAe3D,MAAM,kBAAkB,GAAkB,MAAM,CAAC,uCAAuC,CAAC,CAAC;AA4B1F;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAA+B,IAAI,CAAC,CAAC,CAAC,CAAC;YAEpD,IAAI,IAAI,YAAY,eAAe,EAAE,CAAC;gBACpC,IAAI,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;YAC7E,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,aAAa,CAAC,4EAA4E,CAAC,CAAC;YACxG,CAAC;QACH,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA4C,EAC5C,OAA4B,EAC5B,UAAmC;YAEnC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC;QACjE,CAAC;QAED,IAAW,iBAAiB;YAC1B,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAClC,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA4C;YAC/D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;QACtE,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,kBAAkB;IACjC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC;IAFe,gCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,kBAAkB,KAAlB,kBAAkB,QAalC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport { InternalError } from '@rushstack/node-core-library';\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { IExcerptTokenRange, Excerpt } from './Excerpt';\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (ApiReturnTypeMixin:interface)}.\n * @public\n */\nexport interface IApiReturnTypeMixinOptions extends IApiItemOptions {\n returnTypeTokenRange: IExcerptTokenRange;\n}\n\nexport interface IApiReturnTypeMixinJson extends IApiItemJson {\n returnTypeTokenRange: IExcerptTokenRange;\n}\n\nconst _returnTypeExcerpt: unique symbol = Symbol('ApiReturnTypeMixin._returnTypeExcerpt');\n\n/**\n * The mixin base class for API items that are functions that return a value.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiReturnTypeMixin extends ApiItem {\n /**\n * An {@link Excerpt} that describes the type of the function's return value.\n */\n readonly returnTypeExcerpt: Excerpt;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiReturnTypeMixinJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiReturnTypeMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiReturnTypeMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiReturnTypeMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiReturnTypeMixin) {\n class MixedClass extends baseClass implements ApiReturnTypeMixin {\n public [_returnTypeExcerpt]: Excerpt;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiReturnTypeMixinOptions = args[0];\n\n if (this instanceof ApiDeclaredItem) {\n this[_returnTypeExcerpt] = this.buildExcerpt(options.returnTypeTokenRange);\n } else {\n throw new InternalError('ApiReturnTypeMixin expects a base class that inherits from ApiDeclaredItem');\n }\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiReturnTypeMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiReturnTypeMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.returnTypeTokenRange = jsonObject.returnTypeTokenRange;\n }\n\n public get returnTypeExcerpt(): Excerpt {\n return this[_returnTypeExcerpt];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiReturnTypeMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.returnTypeTokenRange = this.returnTypeExcerpt.tokenRange;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiReturnTypeMixin:interface)}.\n * @public\n */\nexport namespace ApiReturnTypeMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReturnTypeMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiReturnTypeMixin {\n return apiItem.hasOwnProperty(_returnTypeExcerpt);\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
+ const _isStatic = Symbol('ApiStaticMixin._isStatic');
4
+ /**
5
+ * Mixin function for {@link (ApiStaticMixin:interface)}.
6
+ *
7
+ * @param baseClass - The base class to be extended
8
+ * @returns A child class that extends baseClass, adding the {@link (ApiStaticMixin:interface)} functionality.
9
+ *
10
+ * @public
11
+ */
12
+ export function ApiStaticMixin(baseClass
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ ) {
15
+ class MixedClass extends baseClass {
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ constructor(...args) {
18
+ super(...args);
19
+ const options = args[0];
20
+ this[_isStatic] = options.isStatic;
21
+ }
22
+ /** @override */
23
+ static onDeserializeInto(options, context, jsonObject) {
24
+ baseClass.onDeserializeInto(options, context, jsonObject);
25
+ options.isStatic = jsonObject.isStatic;
26
+ }
27
+ get isStatic() {
28
+ return this[_isStatic];
29
+ }
30
+ /** @override */
31
+ serializeInto(jsonObject) {
32
+ super.serializeInto(jsonObject);
33
+ jsonObject.isStatic = this.isStatic;
34
+ }
35
+ }
36
+ return MixedClass;
37
+ }
38
+ /**
39
+ * Static members for {@link (ApiStaticMixin:interface)}.
40
+ * @public
41
+ */
42
+ (function (ApiStaticMixin) {
43
+ /**
44
+ * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiStaticMixin` mixin.
45
+ *
46
+ * @remarks
47
+ *
48
+ * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
49
+ * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
50
+ * the TypeScript type system cannot invoke a runtime test.)
51
+ */
52
+ function isBaseClassOf(apiItem) {
53
+ return apiItem.hasOwnProperty(_isStatic);
54
+ }
55
+ ApiStaticMixin.isBaseClassOf = isBaseClassOf;
56
+ })(ApiStaticMixin || (ApiStaticMixin = {}));
57
+ //# sourceMappingURL=ApiStaticMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiStaticMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiStaticMixin.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAmB3D,MAAM,SAAS,GAAkB,MAAM,CAAC,0BAA0B,CAAC,CAAC;AA4BpE;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAA2B,IAAI,CAAC,CAAC,CAAC,CAAC;YAChD,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;QACrC,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAAwC,EACxC,OAA4B,EAC5B,UAA+B;YAE/B,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACzC,CAAC;QAED,IAAW,QAAQ;YACjB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAAwC;YAC3D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QACtC,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,cAAc;IAC7B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IAFe,4BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,cAAc,KAAd,cAAc,QAa9B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (IApiStaticMixinOptions:interface)}.\n * @public\n */\nexport interface IApiStaticMixinOptions extends IApiItemOptions {\n isStatic: boolean;\n}\n\nexport interface IApiStaticMixinJson extends IApiItemJson {\n isStatic: boolean;\n}\n\nconst _isStatic: unique symbol = Symbol('ApiStaticMixin._isStatic');\n\n/**\n * The mixin base class for API items that can have the TypeScript `static` keyword applied to them.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiStaticMixin extends ApiItem {\n /**\n * Whether the declaration has the TypeScript `static` keyword.\n */\n readonly isStatic: boolean;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiStaticMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiStaticMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiStaticMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiStaticMixin) {\n class MixedClass extends baseClass implements ApiStaticMixin {\n public [_isStatic]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiStaticMixinOptions = args[0];\n this[_isStatic] = options.isStatic;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiStaticMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiStaticMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isStatic = jsonObject.isStatic;\n }\n\n public get isStatic(): boolean {\n return this[_isStatic];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiStaticMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isStatic = this.isStatic;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiStaticMixin:interface)}.\n * @public\n */\nexport namespace ApiStaticMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiStaticMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiStaticMixin {\n return apiItem.hasOwnProperty(_isStatic);\n }\n}\n"]}
@@ -0,0 +1,90 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ /* eslint-disable @typescript-eslint/no-redeclare */
4
+ import { InternalError } from '@rushstack/node-core-library';
5
+ import { TypeParameter } from '../model/TypeParameter';
6
+ import { ApiDeclaredItem } from '../items/ApiDeclaredItem';
7
+ const _typeParameters = Symbol('ApiTypeParameterListMixin._typeParameters');
8
+ /**
9
+ * Mixin function for {@link (ApiTypeParameterListMixin:interface)}.
10
+ *
11
+ * @param baseClass - The base class to be extended
12
+ * @returns A child class that extends baseClass, adding the {@link (ApiTypeParameterListMixin:interface)}
13
+ * functionality.
14
+ *
15
+ * @public
16
+ */
17
+ export function ApiTypeParameterListMixin(baseClass
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+ ) {
20
+ class MixedClass extends baseClass {
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
+ constructor(...args) {
23
+ super(...args);
24
+ const options = args[0];
25
+ this[_typeParameters] = [];
26
+ if (this instanceof ApiDeclaredItem) {
27
+ if (options.typeParameters) {
28
+ for (const typeParameterOptions of options.typeParameters) {
29
+ const defaultTypeExcerpt = this.buildExcerpt(typeParameterOptions.defaultTypeTokenRange);
30
+ const typeParameter = new TypeParameter({
31
+ name: typeParameterOptions.typeParameterName,
32
+ constraintExcerpt: this.buildExcerpt(typeParameterOptions.constraintTokenRange),
33
+ defaultTypeExcerpt,
34
+ isOptional: !defaultTypeExcerpt.isEmpty,
35
+ parent: this
36
+ });
37
+ this[_typeParameters].push(typeParameter);
38
+ }
39
+ }
40
+ }
41
+ else {
42
+ throw new InternalError('ApiTypeParameterListMixin expects a base class that inherits from ApiDeclaredItem');
43
+ }
44
+ }
45
+ /** @override */
46
+ static onDeserializeInto(options, context, jsonObject) {
47
+ baseClass.onDeserializeInto(options, context, jsonObject);
48
+ options.typeParameters = jsonObject.typeParameters || [];
49
+ }
50
+ get typeParameters() {
51
+ return this[_typeParameters];
52
+ }
53
+ /** @override */
54
+ serializeInto(jsonObject) {
55
+ super.serializeInto(jsonObject);
56
+ const typeParameterObjects = [];
57
+ for (const typeParameter of this.typeParameters) {
58
+ typeParameterObjects.push({
59
+ typeParameterName: typeParameter.name,
60
+ constraintTokenRange: typeParameter.constraintExcerpt.tokenRange,
61
+ defaultTypeTokenRange: typeParameter.defaultTypeExcerpt.tokenRange
62
+ });
63
+ }
64
+ if (typeParameterObjects.length > 0) {
65
+ jsonObject.typeParameters = typeParameterObjects;
66
+ }
67
+ }
68
+ }
69
+ return MixedClass;
70
+ }
71
+ /**
72
+ * Static members for {@link (ApiTypeParameterListMixin:interface)}.
73
+ * @public
74
+ */
75
+ (function (ApiTypeParameterListMixin) {
76
+ /**
77
+ * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiParameterListMixin` mixin.
78
+ *
79
+ * @remarks
80
+ *
81
+ * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
82
+ * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
83
+ * the TypeScript type system cannot invoke a runtime test.)
84
+ */
85
+ function isBaseClassOf(apiItem) {
86
+ return apiItem.hasOwnProperty(_typeParameters);
87
+ }
88
+ ApiTypeParameterListMixin.isBaseClassOf = isBaseClassOf;
89
+ })(ApiTypeParameterListMixin || (ApiTypeParameterListMixin = {}));
90
+ //# sourceMappingURL=ApiTypeParameterListMixin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiTypeParameterListMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiTypeParameterListMixin.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,oDAAoD;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAI7D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAyB3D,MAAM,eAAe,GAAkB,MAAM,CAAC,2CAA2C,CAAC,CAAC;AA2B3F;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CACvC,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAAsC,IAAI,CAAC,CAAC,CAAC,CAAC;YAE3D,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC;YAE3B,IAAI,IAAI,YAAY,eAAe,EAAE,CAAC;gBACpC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;oBAC3B,KAAK,MAAM,oBAAoB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;wBAC1D,MAAM,kBAAkB,GAAY,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;wBAClG,MAAM,aAAa,GAAkB,IAAI,aAAa,CAAC;4BACrD,IAAI,EAAE,oBAAoB,CAAC,iBAAiB;4BAC5C,iBAAiB,EAAE,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,oBAAoB,CAAC;4BAC/E,kBAAkB;4BAClB,UAAU,EAAE,CAAC,kBAAkB,CAAC,OAAO;4BACvC,MAAM,EAAE,IAAI;yBACb,CAAC,CAAC;wBAEH,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;oBAC5C,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,aAAa,CACrB,mFAAmF,CACpF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAAmD,EACnD,OAA4B,EAC5B,UAA0C;YAE1C,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,IAAI,EAAE,CAAC;QAC3D,CAAC;QAED,IAAW,cAAc;YACvB,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC;QAC/B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAAmD;YACtE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,MAAM,oBAAoB,GAA+B,EAAE,CAAC;YAC5D,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBAChD,oBAAoB,CAAC,IAAI,CAAC;oBACxB,iBAAiB,EAAE,aAAa,CAAC,IAAI;oBACrC,oBAAoB,EAAE,aAAa,CAAC,iBAAiB,CAAC,UAAU;oBAChE,qBAAqB,EAAE,aAAa,CAAC,kBAAkB,CAAC,UAAU;iBACnE,CAAC,CAAC;YACL,CAAC;YAED,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,UAAU,CAAC,cAAc,GAAG,oBAAoB,CAAC;YACnD,CAAC;QACH,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,yBAAyB;IACxC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IACjD,CAAC;IAFe,uCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,yBAAyB,KAAzB,yBAAyB,QAazC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport { InternalError } from '@rushstack/node-core-library';\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { Excerpt, IExcerptTokenRange } from './Excerpt';\nimport { TypeParameter } from '../model/TypeParameter';\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Represents parameter information that is part of {@link IApiTypeParameterListMixinOptions}\n * @public\n */\nexport interface IApiTypeParameterOptions {\n typeParameterName: string;\n constraintTokenRange: IExcerptTokenRange;\n defaultTypeTokenRange: IExcerptTokenRange;\n}\n\n/**\n * Constructor options for {@link (ApiTypeParameterListMixin:interface)}.\n * @public\n */\nexport interface IApiTypeParameterListMixinOptions extends IApiItemOptions {\n typeParameters: IApiTypeParameterOptions[];\n}\n\nexport interface IApiTypeParameterListMixinJson extends IApiItemJson {\n typeParameters: IApiTypeParameterOptions[];\n}\n\nconst _typeParameters: unique symbol = Symbol('ApiTypeParameterListMixin._typeParameters');\n\n/**\n * The mixin base class for API items that can have type parameters.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiTypeParameterListMixin extends ApiItem {\n /**\n * The type parameters.\n */\n readonly typeParameters: ReadonlyArray<TypeParameter>;\n\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiTypeParameterListMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiTypeParameterListMixin:interface)}\n * functionality.\n *\n * @public\n */\nexport function ApiTypeParameterListMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiTypeParameterListMixin) {\n class MixedClass extends baseClass implements ApiTypeParameterListMixin {\n public readonly [_typeParameters]: TypeParameter[];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiTypeParameterListMixinOptions = args[0];\n\n this[_typeParameters] = [];\n\n if (this instanceof ApiDeclaredItem) {\n if (options.typeParameters) {\n for (const typeParameterOptions of options.typeParameters) {\n const defaultTypeExcerpt: Excerpt = this.buildExcerpt(typeParameterOptions.defaultTypeTokenRange);\n const typeParameter: TypeParameter = new TypeParameter({\n name: typeParameterOptions.typeParameterName,\n constraintExcerpt: this.buildExcerpt(typeParameterOptions.constraintTokenRange),\n defaultTypeExcerpt,\n isOptional: !defaultTypeExcerpt.isEmpty,\n parent: this\n });\n\n this[_typeParameters].push(typeParameter);\n }\n }\n } else {\n throw new InternalError(\n 'ApiTypeParameterListMixin expects a base class that inherits from ApiDeclaredItem'\n );\n }\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiTypeParameterListMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiTypeParameterListMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.typeParameters = jsonObject.typeParameters || [];\n }\n\n public get typeParameters(): ReadonlyArray<TypeParameter> {\n return this[_typeParameters];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiTypeParameterListMixinJson>): void {\n super.serializeInto(jsonObject);\n\n const typeParameterObjects: IApiTypeParameterOptions[] = [];\n for (const typeParameter of this.typeParameters) {\n typeParameterObjects.push({\n typeParameterName: typeParameter.name,\n constraintTokenRange: typeParameter.constraintExcerpt.tokenRange,\n defaultTypeTokenRange: typeParameter.defaultTypeExcerpt.tokenRange\n });\n }\n\n if (typeParameterObjects.length > 0) {\n jsonObject.typeParameters = typeParameterObjects;\n }\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiTypeParameterListMixin:interface)}.\n * @public\n */\nexport namespace ApiTypeParameterListMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiParameterListMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiTypeParameterListMixin {\n return apiItem.hasOwnProperty(_typeParameters);\n }\n}\n"]}
@@ -0,0 +1,101 @@
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 { Text } from '@rushstack/node-core-library';
4
+ /** @public */
5
+ export var ExcerptTokenKind;
6
+ (function (ExcerptTokenKind) {
7
+ /**
8
+ * Generic text without any special properties
9
+ */
10
+ ExcerptTokenKind["Content"] = "Content";
11
+ /**
12
+ * A reference to an API declaration
13
+ */
14
+ ExcerptTokenKind["Reference"] = "Reference";
15
+ })(ExcerptTokenKind || (ExcerptTokenKind = {}));
16
+ /**
17
+ * Represents a fragment of text belonging to an {@link Excerpt} object.
18
+ *
19
+ * @public
20
+ */
21
+ export class ExcerptToken {
22
+ constructor(kind, text, canonicalReference) {
23
+ this._kind = kind;
24
+ // Standardize the newlines across operating systems. Even though this may deviate from the actual
25
+ // input source file that was parsed, it's useful because the newline gets serialized inside
26
+ // a string literal in .api.json, which cannot be automatically normalized by Git.
27
+ this._text = Text.convertToLf(text);
28
+ this._canonicalReference = canonicalReference;
29
+ }
30
+ /**
31
+ * Indicates the kind of token.
32
+ */
33
+ get kind() {
34
+ return this._kind;
35
+ }
36
+ /**
37
+ * The text fragment.
38
+ */
39
+ get text() {
40
+ return this._text;
41
+ }
42
+ /**
43
+ * The hyperlink target for a token whose type is `ExcerptTokenKind.Reference`. For other token types,
44
+ * this property will be `undefined`.
45
+ */
46
+ get canonicalReference() {
47
+ return this._canonicalReference;
48
+ }
49
+ }
50
+ /**
51
+ * The `Excerpt` class is used by {@link ApiDeclaredItem} to represent a TypeScript code fragment that may be
52
+ * annotated with hyperlinks to declared types (and in the future, source code locations).
53
+ *
54
+ * @remarks
55
+ * API Extractor's .api.json file format stores excerpts compactly as a start/end indexes into an array of tokens.
56
+ * Every `ApiDeclaredItem` has a "main excerpt" corresponding to the full list of tokens. The declaration may
57
+ * also have have "captured" excerpts that correspond to subranges of tokens.
58
+ *
59
+ * For example, if the main excerpt is:
60
+ *
61
+ * ```
62
+ * function parse(s: string): Vector | undefined;
63
+ * ```
64
+ *
65
+ * ...then this entire signature is the "main excerpt", whereas the function's return type `Vector | undefined` is a
66
+ * captured excerpt. The `Vector` token might be a hyperlink to that API item.
67
+ *
68
+ * An excerpt may be empty (i.e. a token range containing zero tokens). For example, if a function's return value
69
+ * is not explicitly declared, then the returnTypeExcerpt will be empty. By contrast, a class constructor cannot
70
+ * have a return value, so ApiConstructor has no returnTypeExcerpt property at all.
71
+ *
72
+ * @public
73
+ */
74
+ export class Excerpt {
75
+ constructor(tokens, tokenRange) {
76
+ this.tokens = tokens;
77
+ this.tokenRange = tokenRange;
78
+ if (this.tokenRange.startIndex < 0 ||
79
+ this.tokenRange.endIndex > this.tokens.length ||
80
+ this.tokenRange.startIndex > this.tokenRange.endIndex) {
81
+ throw new Error('Invalid token range');
82
+ }
83
+ this.spannedTokens = this.tokens.slice(this.tokenRange.startIndex, this.tokenRange.endIndex);
84
+ }
85
+ /**
86
+ * The excerpted text, formed by concatenating the text of the `spannedTokens` strings.
87
+ */
88
+ get text() {
89
+ if (this._text === undefined) {
90
+ this._text = this.spannedTokens.map((x) => x.text).join('');
91
+ }
92
+ return this._text;
93
+ }
94
+ /**
95
+ * Returns true if the excerpt is an empty range.
96
+ */
97
+ get isEmpty() {
98
+ return this.tokenRange.startIndex === this.tokenRange.endIndex;
99
+ }
100
+ }
101
+ //# sourceMappingURL=Excerpt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Excerpt.js","sourceRoot":"","sources":["../../src/mixins/Excerpt.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAG3D,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEpD,cAAc;AACd,MAAM,CAAN,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,uCAAmB,CAAA;IAEnB;;OAEG;IACH,2CAAuB,CAAA;AACzB,CAAC,EAVW,gBAAgB,KAAhB,gBAAgB,QAU3B;AA8BD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAKvB,YAAmB,IAAsB,EAAE,IAAY,EAAE,kBAAyC;QAChG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,kGAAkG;QAClG,4FAA4F;QAC5F,kFAAkF;QAClF,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,OAAO,OAAO;IAqBlB,YAAmB,MAAmC,EAAE,UAA8B;QACpF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IACE,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC;YAC9B,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM;YAC7C,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EACrD,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC/F,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IACjE,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 { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { Text } from '@rushstack/node-core-library';\n\n/** @public */\nexport enum ExcerptTokenKind {\n /**\n * Generic text without any special properties\n */\n Content = 'Content',\n\n /**\n * A reference to an API declaration\n */\n Reference = 'Reference'\n}\n\n/**\n * Used by {@link Excerpt} to indicate a range of indexes within an array of `ExcerptToken` objects.\n *\n * @public\n */\nexport interface IExcerptTokenRange {\n /**\n * The starting index of the span.\n */\n startIndex: number;\n\n /**\n * The index of the last member of the span, plus one.\n *\n * @remarks\n *\n * If `startIndex` and `endIndex` are the same number, then the span is empty.\n */\n endIndex: number;\n}\n\n/** @public */\nexport interface IExcerptToken {\n readonly kind: ExcerptTokenKind;\n text: string;\n canonicalReference?: string;\n}\n\n/**\n * Represents a fragment of text belonging to an {@link Excerpt} object.\n *\n * @public\n */\nexport class ExcerptToken {\n private readonly _kind: ExcerptTokenKind;\n private readonly _text: string;\n private readonly _canonicalReference: DeclarationReference | undefined;\n\n public constructor(kind: ExcerptTokenKind, text: string, canonicalReference?: DeclarationReference) {\n this._kind = kind;\n\n // Standardize the newlines across operating systems. Even though this may deviate from the actual\n // input source file that was parsed, it's useful because the newline gets serialized inside\n // a string literal in .api.json, which cannot be automatically normalized by Git.\n this._text = Text.convertToLf(text);\n this._canonicalReference = canonicalReference;\n }\n\n /**\n * Indicates the kind of token.\n */\n public get kind(): ExcerptTokenKind {\n return this._kind;\n }\n\n /**\n * The text fragment.\n */\n public get text(): string {\n return this._text;\n }\n\n /**\n * The hyperlink target for a token whose type is `ExcerptTokenKind.Reference`. For other token types,\n * this property will be `undefined`.\n */\n public get canonicalReference(): DeclarationReference | undefined {\n return this._canonicalReference;\n }\n}\n\n/**\n * The `Excerpt` class is used by {@link ApiDeclaredItem} to represent a TypeScript code fragment that may be\n * annotated with hyperlinks to declared types (and in the future, source code locations).\n *\n * @remarks\n * API Extractor's .api.json file format stores excerpts compactly as a start/end indexes into an array of tokens.\n * Every `ApiDeclaredItem` has a \"main excerpt\" corresponding to the full list of tokens. The declaration may\n * also have have \"captured\" excerpts that correspond to subranges of tokens.\n *\n * For example, if the main excerpt is:\n *\n * ```\n * function parse(s: string): Vector | undefined;\n * ```\n *\n * ...then this entire signature is the \"main excerpt\", whereas the function's return type `Vector | undefined` is a\n * captured excerpt. The `Vector` token might be a hyperlink to that API item.\n *\n * An excerpt may be empty (i.e. a token range containing zero tokens). For example, if a function's return value\n * is not explicitly declared, then the returnTypeExcerpt will be empty. By contrast, a class constructor cannot\n * have a return value, so ApiConstructor has no returnTypeExcerpt property at all.\n *\n * @public\n */\nexport class Excerpt {\n /**\n * The complete list of tokens for the source code fragment that this excerpt is based upon.\n * If this object is the main excerpt, then it will span all of the tokens; otherwise, it will correspond to\n * a range within the array.\n */\n public readonly tokens: ReadonlyArray<ExcerptToken>;\n\n /**\n * Specifies the excerpt's range within the `tokens` array.\n */\n public readonly tokenRange: Readonly<IExcerptTokenRange>;\n\n /**\n * The tokens spanned by this excerpt. It is the range of the `tokens` array as specified by the `tokenRange`\n * property.\n */\n public readonly spannedTokens: ReadonlyArray<ExcerptToken>;\n\n private _text: string | undefined;\n\n public constructor(tokens: ReadonlyArray<ExcerptToken>, tokenRange: IExcerptTokenRange) {\n this.tokens = tokens;\n this.tokenRange = tokenRange;\n\n if (\n this.tokenRange.startIndex < 0 ||\n this.tokenRange.endIndex > this.tokens.length ||\n this.tokenRange.startIndex > this.tokenRange.endIndex\n ) {\n throw new Error('Invalid token range');\n }\n\n this.spannedTokens = this.tokens.slice(this.tokenRange.startIndex, this.tokenRange.endIndex);\n }\n\n /**\n * The excerpted text, formed by concatenating the text of the `spannedTokens` strings.\n */\n public get text(): string {\n if (this._text === undefined) {\n this._text = this.spannedTokens.map((x) => x.text).join('');\n }\n return this._text;\n }\n\n /**\n * Returns true if the excerpt is an empty range.\n */\n public get isEmpty(): boolean {\n return this.tokenRange.startIndex === this.tokenRange.endIndex;\n }\n}\n"]}
@@ -0,0 +1,26 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
+ // See LICENSE in the project root for license information.
3
+ /**
4
+ * Unique identifiers for messages returned as part of `IFindApiItemsResult`.
5
+ * @public
6
+ */
7
+ export var FindApiItemsMessageId;
8
+ (function (FindApiItemsMessageId) {
9
+ /**
10
+ * "Unable to resolve declaration reference within API item ___: ___"
11
+ */
12
+ FindApiItemsMessageId["DeclarationResolutionFailed"] = "declaration-resolution-failed";
13
+ /**
14
+ * "Unable to analyze extends clause ___ of API item ___ because no canonical reference was found."
15
+ */
16
+ FindApiItemsMessageId["ExtendsClauseMissingReference"] = "extends-clause-missing-reference";
17
+ /**
18
+ * "Unable to analyze references of API item ___ because it is not associated with an ApiModel"
19
+ */
20
+ FindApiItemsMessageId["NoAssociatedApiModel"] = "no-associated-api-model";
21
+ /**
22
+ * "Unable to analyze references of API item ___ because it is of unsupported kind ___"
23
+ */
24
+ FindApiItemsMessageId["UnsupportedKind"] = "unsupported-kind";
25
+ })(FindApiItemsMessageId || (FindApiItemsMessageId = {}));
26
+ //# sourceMappingURL=IFindApiItemsResult.js.map