@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.
- package/CHANGELOG.json +29 -0
- package/CHANGELOG.md +13 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-esm/aedoc/AedocDefinitions.js +57 -0
- package/lib-esm/aedoc/AedocDefinitions.js.map +1 -0
- package/lib-esm/aedoc/ReleaseTag.js +87 -0
- package/lib-esm/aedoc/ReleaseTag.js.map +1 -0
- package/lib-esm/index.js +58 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/items/ApiDeclaredItem.js +137 -0
- package/lib-esm/items/ApiDeclaredItem.js.map +1 -0
- package/lib-esm/items/ApiDocumentedItem.js +48 -0
- package/lib-esm/items/ApiDocumentedItem.js.map +1 -0
- package/lib-esm/items/ApiItem.js +270 -0
- package/lib-esm/items/ApiItem.js.map +1 -0
- package/lib-esm/items/ApiPropertyItem.js +45 -0
- package/lib-esm/items/ApiPropertyItem.js.map +1 -0
- package/lib-esm/mixins/ApiAbstractMixin.js +58 -0
- package/lib-esm/mixins/ApiAbstractMixin.js.map +1 -0
- package/lib-esm/mixins/ApiExportedMixin.js +63 -0
- package/lib-esm/mixins/ApiExportedMixin.js.map +1 -0
- package/lib-esm/mixins/ApiInitializerMixin.js +70 -0
- package/lib-esm/mixins/ApiInitializerMixin.js.map +1 -0
- package/lib-esm/mixins/ApiItemContainerMixin.js +319 -0
- package/lib-esm/mixins/ApiItemContainerMixin.js.map +1 -0
- package/lib-esm/mixins/ApiNameMixin.js +61 -0
- package/lib-esm/mixins/ApiNameMixin.js.map +1 -0
- package/lib-esm/mixins/ApiOptionalMixin.js +57 -0
- package/lib-esm/mixins/ApiOptionalMixin.js.map +1 -0
- package/lib-esm/mixins/ApiParameterListMixin.js +93 -0
- package/lib-esm/mixins/ApiParameterListMixin.js.map +1 -0
- package/lib-esm/mixins/ApiProtectedMixin.js +57 -0
- package/lib-esm/mixins/ApiProtectedMixin.js.map +1 -0
- package/lib-esm/mixins/ApiReadonlyMixin.js +58 -0
- package/lib-esm/mixins/ApiReadonlyMixin.js.map +1 -0
- package/lib-esm/mixins/ApiReleaseTagMixin.js +65 -0
- package/lib-esm/mixins/ApiReleaseTagMixin.js.map +1 -0
- package/lib-esm/mixins/ApiReturnTypeMixin.js +65 -0
- package/lib-esm/mixins/ApiReturnTypeMixin.js.map +1 -0
- package/lib-esm/mixins/ApiStaticMixin.js +57 -0
- package/lib-esm/mixins/ApiStaticMixin.js.map +1 -0
- package/lib-esm/mixins/ApiTypeParameterListMixin.js +90 -0
- package/lib-esm/mixins/ApiTypeParameterListMixin.js.map +1 -0
- package/lib-esm/mixins/Excerpt.js +101 -0
- package/lib-esm/mixins/Excerpt.js.map +1 -0
- package/lib-esm/mixins/IFindApiItemsResult.js +26 -0
- package/lib-esm/mixins/IFindApiItemsResult.js.map +1 -0
- package/lib-esm/mixins/Mixin.js +4 -0
- package/lib-esm/mixins/Mixin.js.map +1 -0
- package/lib-esm/model/ApiCallSignature.js +63 -0
- package/lib-esm/model/ApiCallSignature.js.map +1 -0
- package/lib-esm/model/ApiClass.js +84 -0
- package/lib-esm/model/ApiClass.js.map +1 -0
- package/lib-esm/model/ApiConstructSignature.js +76 -0
- package/lib-esm/model/ApiConstructSignature.js.map +1 -0
- package/lib-esm/model/ApiConstructor.js +60 -0
- package/lib-esm/model/ApiConstructor.js.map +1 -0
- package/lib-esm/model/ApiEntryPoint.js +71 -0
- package/lib-esm/model/ApiEntryPoint.js.map +1 -0
- package/lib-esm/model/ApiEnum.js +65 -0
- package/lib-esm/model/ApiEnum.js.map +1 -0
- package/lib-esm/model/ApiEnumMember.js +80 -0
- package/lib-esm/model/ApiEnumMember.js.map +1 -0
- package/lib-esm/model/ApiFunction.js +58 -0
- package/lib-esm/model/ApiFunction.js.map +1 -0
- package/lib-esm/model/ApiIndexSignature.js +56 -0
- package/lib-esm/model/ApiIndexSignature.js.map +1 -0
- package/lib-esm/model/ApiInterface.js +73 -0
- package/lib-esm/model/ApiInterface.js.map +1 -0
- package/lib-esm/model/ApiMethod.js +65 -0
- package/lib-esm/model/ApiMethod.js.map +1 -0
- package/lib-esm/model/ApiMethodSignature.js +57 -0
- package/lib-esm/model/ApiMethodSignature.js.map +1 -0
- package/lib-esm/model/ApiModel.js +170 -0
- package/lib-esm/model/ApiModel.js.map +1 -0
- package/lib-esm/model/ApiNamespace.js +56 -0
- package/lib-esm/model/ApiNamespace.js.map +1 -0
- package/lib-esm/model/ApiPackage.js +148 -0
- package/lib-esm/model/ApiPackage.js.map +1 -0
- package/lib-esm/model/ApiProperty.js +72 -0
- package/lib-esm/model/ApiProperty.js.map +1 -0
- package/lib-esm/model/ApiPropertySignature.js +51 -0
- package/lib-esm/model/ApiPropertySignature.js.map +1 -0
- package/lib-esm/model/ApiTypeAlias.js +71 -0
- package/lib-esm/model/ApiTypeAlias.js.map +1 -0
- package/lib-esm/model/ApiVariable.js +66 -0
- package/lib-esm/model/ApiVariable.js.map +1 -0
- package/lib-esm/model/Deserializer.js +88 -0
- package/lib-esm/model/Deserializer.js.map +1 -0
- package/lib-esm/model/DeserializerContext.js +111 -0
- package/lib-esm/model/DeserializerContext.js.map +1 -0
- package/lib-esm/model/HeritageType.js +25 -0
- package/lib-esm/model/HeritageType.js.map +1 -0
- package/lib-esm/model/ModelReferenceResolver.js +177 -0
- package/lib-esm/model/ModelReferenceResolver.js.map +1 -0
- package/lib-esm/model/Parameter.js +39 -0
- package/lib-esm/model/Parameter.js.map +1 -0
- package/lib-esm/model/SourceLocation.js +35 -0
- package/lib-esm/model/SourceLocation.js.map +1 -0
- package/lib-esm/model/TypeParameter.js +49 -0
- package/lib-esm/model/TypeParameter.js.map +1 -0
- package/package.json +27 -5
- /package/{lib → lib-commonjs}/aedoc/AedocDefinitions.js +0 -0
- /package/{lib → lib-commonjs}/aedoc/AedocDefinitions.js.map +0 -0
- /package/{lib → lib-commonjs}/aedoc/ReleaseTag.js +0 -0
- /package/{lib → lib-commonjs}/aedoc/ReleaseTag.js.map +0 -0
- /package/{lib → lib-commonjs}/index.js +0 -0
- /package/{lib → lib-commonjs}/index.js.map +0 -0
- /package/{lib → lib-commonjs}/items/ApiDeclaredItem.js +0 -0
- /package/{lib → lib-commonjs}/items/ApiDeclaredItem.js.map +0 -0
- /package/{lib → lib-commonjs}/items/ApiDocumentedItem.js +0 -0
- /package/{lib → lib-commonjs}/items/ApiDocumentedItem.js.map +0 -0
- /package/{lib → lib-commonjs}/items/ApiItem.js +0 -0
- /package/{lib → lib-commonjs}/items/ApiItem.js.map +0 -0
- /package/{lib → lib-commonjs}/items/ApiPropertyItem.js +0 -0
- /package/{lib → lib-commonjs}/items/ApiPropertyItem.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiAbstractMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiAbstractMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiExportedMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiExportedMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiInitializerMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiInitializerMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiItemContainerMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiItemContainerMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiNameMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiNameMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiOptionalMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiOptionalMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiParameterListMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiParameterListMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiProtectedMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiProtectedMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiReadonlyMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiReadonlyMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiReleaseTagMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiReleaseTagMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiReturnTypeMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiReturnTypeMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiStaticMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiStaticMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiTypeParameterListMixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/ApiTypeParameterListMixin.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/Excerpt.js +0 -0
- /package/{lib → lib-commonjs}/mixins/Excerpt.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/IFindApiItemsResult.js +0 -0
- /package/{lib → lib-commonjs}/mixins/IFindApiItemsResult.js.map +0 -0
- /package/{lib → lib-commonjs}/mixins/Mixin.js +0 -0
- /package/{lib → lib-commonjs}/mixins/Mixin.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiCallSignature.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiCallSignature.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiClass.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiClass.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiConstructSignature.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiConstructSignature.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiConstructor.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiConstructor.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiEntryPoint.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiEntryPoint.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiEnum.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiEnum.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiEnumMember.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiEnumMember.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiFunction.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiFunction.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiIndexSignature.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiIndexSignature.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiInterface.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiInterface.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiMethod.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiMethod.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiMethodSignature.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiMethodSignature.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiModel.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiModel.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiNamespace.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiNamespace.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiPackage.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiPackage.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiProperty.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiProperty.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiPropertySignature.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiPropertySignature.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiTypeAlias.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiTypeAlias.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ApiVariable.js +0 -0
- /package/{lib → lib-commonjs}/model/ApiVariable.js.map +0 -0
- /package/{lib → lib-commonjs}/model/Deserializer.js +0 -0
- /package/{lib → lib-commonjs}/model/Deserializer.js.map +0 -0
- /package/{lib → lib-commonjs}/model/DeserializerContext.js +0 -0
- /package/{lib → lib-commonjs}/model/DeserializerContext.js.map +0 -0
- /package/{lib → lib-commonjs}/model/HeritageType.js +0 -0
- /package/{lib → lib-commonjs}/model/HeritageType.js.map +0 -0
- /package/{lib → lib-commonjs}/model/ModelReferenceResolver.js +0 -0
- /package/{lib → lib-commonjs}/model/ModelReferenceResolver.js.map +0 -0
- /package/{lib → lib-commonjs}/model/Parameter.js +0 -0
- /package/{lib → lib-commonjs}/model/Parameter.js.map +0 -0
- /package/{lib → lib-commonjs}/model/SourceLocation.js +0 -0
- /package/{lib → lib-commonjs}/model/SourceLocation.js.map +0 -0
- /package/{lib → lib-commonjs}/model/TypeParameter.js +0 -0
- /package/{lib → lib-commonjs}/model/TypeParameter.js.map +0 -0
- /package/{lib → lib-dts}/aedoc/AedocDefinitions.d.ts +0 -0
- /package/{lib → lib-dts}/aedoc/AedocDefinitions.d.ts.map +0 -0
- /package/{lib → lib-dts}/aedoc/ReleaseTag.d.ts +0 -0
- /package/{lib → lib-dts}/aedoc/ReleaseTag.d.ts.map +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts.map +0 -0
- /package/{lib → lib-dts}/items/ApiDeclaredItem.d.ts +0 -0
- /package/{lib → lib-dts}/items/ApiDeclaredItem.d.ts.map +0 -0
- /package/{lib → lib-dts}/items/ApiDocumentedItem.d.ts +0 -0
- /package/{lib → lib-dts}/items/ApiDocumentedItem.d.ts.map +0 -0
- /package/{lib → lib-dts}/items/ApiItem.d.ts +0 -0
- /package/{lib → lib-dts}/items/ApiItem.d.ts.map +0 -0
- /package/{lib → lib-dts}/items/ApiPropertyItem.d.ts +0 -0
- /package/{lib → lib-dts}/items/ApiPropertyItem.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiAbstractMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiAbstractMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiExportedMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiExportedMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiInitializerMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiInitializerMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiItemContainerMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiItemContainerMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiNameMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiNameMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiOptionalMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiOptionalMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiParameterListMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiParameterListMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiProtectedMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiProtectedMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiReadonlyMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiReadonlyMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiReleaseTagMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiReleaseTagMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiReturnTypeMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiReturnTypeMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiStaticMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiStaticMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/ApiTypeParameterListMixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/ApiTypeParameterListMixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/Excerpt.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/Excerpt.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/IFindApiItemsResult.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/IFindApiItemsResult.d.ts.map +0 -0
- /package/{lib → lib-dts}/mixins/Mixin.d.ts +0 -0
- /package/{lib → lib-dts}/mixins/Mixin.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiCallSignature.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiCallSignature.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiClass.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiClass.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiConstructSignature.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiConstructSignature.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiConstructor.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiConstructor.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiEntryPoint.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiEntryPoint.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiEnum.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiEnum.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiEnumMember.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiEnumMember.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiFunction.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiFunction.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiIndexSignature.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiIndexSignature.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiInterface.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiInterface.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiMethod.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiMethod.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiMethodSignature.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiMethodSignature.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiModel.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiModel.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiNamespace.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiNamespace.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiPackage.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiPackage.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiProperty.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiProperty.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiPropertySignature.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiPropertySignature.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiTypeAlias.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiTypeAlias.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ApiVariable.d.ts +0 -0
- /package/{lib → lib-dts}/model/ApiVariable.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/Deserializer.d.ts +0 -0
- /package/{lib → lib-dts}/model/Deserializer.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/DeserializerContext.d.ts +0 -0
- /package/{lib → lib-dts}/model/DeserializerContext.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/HeritageType.d.ts +0 -0
- /package/{lib → lib-dts}/model/HeritageType.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/ModelReferenceResolver.d.ts +0 -0
- /package/{lib → lib-dts}/model/ModelReferenceResolver.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/Parameter.d.ts +0 -0
- /package/{lib → lib-dts}/model/Parameter.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/SourceLocation.d.ts +0 -0
- /package/{lib → lib-dts}/model/SourceLocation.d.ts.map +0 -0
- /package/{lib → lib-dts}/model/TypeParameter.d.ts +0 -0
- /package/{lib → lib-dts}/model/TypeParameter.d.ts.map +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
export var ApiJsonSchemaVersion;
|
|
4
|
+
(function (ApiJsonSchemaVersion) {
|
|
5
|
+
/**
|
|
6
|
+
* The initial release.
|
|
7
|
+
*/
|
|
8
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1000"] = 1000] = "V_1000";
|
|
9
|
+
/**
|
|
10
|
+
* Add support for type parameters and type alias types.
|
|
11
|
+
*/
|
|
12
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1001"] = 1001] = "V_1001";
|
|
13
|
+
/**
|
|
14
|
+
* Remove `canonicalReference` field. This field was for diagnostic purposes only and was never deserialized.
|
|
15
|
+
*/
|
|
16
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1002"] = 1002] = "V_1002";
|
|
17
|
+
/**
|
|
18
|
+
* Reintroduce the `canonicalReference` field using the experimental new TSDoc declaration reference notation.
|
|
19
|
+
*
|
|
20
|
+
* This is not a breaking change because this field is never deserialized; it is provided for informational
|
|
21
|
+
* purposes only.
|
|
22
|
+
*/
|
|
23
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1003"] = 1003] = "V_1003";
|
|
24
|
+
/**
|
|
25
|
+
* Add a `tsdocConfig` field that tracks the TSDoc configuration for parsing doc comments.
|
|
26
|
+
*
|
|
27
|
+
* This is not a breaking change because an older implementation will still work correctly. The
|
|
28
|
+
* custom tags will be skipped over by the parser.
|
|
29
|
+
*/
|
|
30
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1004"] = 1004] = "V_1004";
|
|
31
|
+
/**
|
|
32
|
+
* Add an `isOptional` field to `Parameter` and `TypeParameter` to track whether a function parameter is optional.
|
|
33
|
+
*
|
|
34
|
+
* When loading older JSON files, the value defaults to `false`.
|
|
35
|
+
*/
|
|
36
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1005"] = 1005] = "V_1005";
|
|
37
|
+
/**
|
|
38
|
+
* Add an `isProtected` field to `ApiConstructor`, `ApiMethod`, and `ApiProperty` to
|
|
39
|
+
* track whether a class member has the `protected` modifier.
|
|
40
|
+
*
|
|
41
|
+
* Add an `isReadonly` field to `ApiProperty`, `ApiPropertySignature`, and `ApiVariable` to
|
|
42
|
+
* track whether the item is readonly.
|
|
43
|
+
*
|
|
44
|
+
* When loading older JSON files, the values default to `false`.
|
|
45
|
+
*/
|
|
46
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1006"] = 1006] = "V_1006";
|
|
47
|
+
/**
|
|
48
|
+
* Add `ApiItemContainerMixin.preserveMemberOrder` to support enums that preserve their original sort order.
|
|
49
|
+
*
|
|
50
|
+
* When loading older JSON files, the value default to `false`.
|
|
51
|
+
*/
|
|
52
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1007"] = 1007] = "V_1007";
|
|
53
|
+
/**
|
|
54
|
+
* Add an `initializerTokenRange` field to `ApiProperty` and `ApiVariable` to track the item's
|
|
55
|
+
* initializer.
|
|
56
|
+
*
|
|
57
|
+
* When loading older JSON files, this range is empty.
|
|
58
|
+
*/
|
|
59
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1008"] = 1008] = "V_1008";
|
|
60
|
+
/**
|
|
61
|
+
* Add an `isReadonly` field to `ApiIndexSignature` to track whether the item is readonly.
|
|
62
|
+
*
|
|
63
|
+
* When loading older JSON files, the values defaults to `false`.
|
|
64
|
+
*/
|
|
65
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1009"] = 1009] = "V_1009";
|
|
66
|
+
/**
|
|
67
|
+
* Add a `fileUrlPath` field to `ApiDeclaredItem` to track the URL to a declared item's source file.
|
|
68
|
+
*
|
|
69
|
+
* When loading older JSON files, the value defaults to `undefined`.
|
|
70
|
+
*/
|
|
71
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1010"] = 1010] = "V_1010";
|
|
72
|
+
/**
|
|
73
|
+
* Add an `isAbstract` field to `ApiClass`, `ApiMethod`, and `ApiProperty` to
|
|
74
|
+
* track whether the item is abstract.
|
|
75
|
+
*
|
|
76
|
+
* When loading older JSON files, the value defaults to `false`.
|
|
77
|
+
*/
|
|
78
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["V_1011"] = 1011] = "V_1011";
|
|
79
|
+
/**
|
|
80
|
+
* The current latest .api.json schema version.
|
|
81
|
+
*
|
|
82
|
+
* IMPORTANT: When incrementing this number, consider whether `OLDEST_SUPPORTED` or `OLDEST_FORWARDS_COMPATIBLE`
|
|
83
|
+
* should be updated.
|
|
84
|
+
*/
|
|
85
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["LATEST"] = 1011] = "LATEST";
|
|
86
|
+
/**
|
|
87
|
+
* The oldest .api.json schema version that is still supported for backwards compatibility.
|
|
88
|
+
*
|
|
89
|
+
* This must be updated if you change to the file format and do not implement compatibility logic for
|
|
90
|
+
* deserializing the older representation.
|
|
91
|
+
*/
|
|
92
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["OLDEST_SUPPORTED"] = 1001] = "OLDEST_SUPPORTED";
|
|
93
|
+
/**
|
|
94
|
+
* Used to assign `IApiPackageMetadataJson.oldestForwardsCompatibleVersion`.
|
|
95
|
+
*
|
|
96
|
+
* This value must be \<= `ApiJsonSchemaVersion.LATEST`. It must be reset to the `LATEST` value
|
|
97
|
+
* if the older library would not be able to deserialize your new file format. Adding a nonessential field
|
|
98
|
+
* is generally okay. Removing, modifying, or reinterpreting existing fields is NOT safe.
|
|
99
|
+
*/
|
|
100
|
+
ApiJsonSchemaVersion[ApiJsonSchemaVersion["OLDEST_FORWARDS_COMPATIBLE"] = 1001] = "OLDEST_FORWARDS_COMPATIBLE";
|
|
101
|
+
})(ApiJsonSchemaVersion || (ApiJsonSchemaVersion = {}));
|
|
102
|
+
export class DeserializerContext {
|
|
103
|
+
constructor(options) {
|
|
104
|
+
this.apiJsonFilename = options.apiJsonFilename;
|
|
105
|
+
this.toolPackage = options.toolPackage;
|
|
106
|
+
this.toolVersion = options.toolVersion;
|
|
107
|
+
this.versionToDeserialize = options.versionToDeserialize;
|
|
108
|
+
this.tsdocConfiguration = options.tsdocConfiguration;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=DeserializerContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeserializerContext.js","sourceRoot":"","sources":["../../src/model/DeserializerContext.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAI3D,MAAM,CAAN,IAAY,oBA+GX;AA/GD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,sEAAa,CAAA;IAEb;;OAEG;IACH,sEAAa,CAAA;IAEb;;OAEG;IACH,sEAAa,CAAA;IAEb;;;;;OAKG;IACH,sEAAa,CAAA;IAEb;;;;;OAKG;IACH,sEAAa,CAAA;IAEb;;;;OAIG;IACH,sEAAa,CAAA;IAEb;;;;;;;;OAQG;IACH,sEAAa,CAAA;IAEb;;;;OAIG;IACH,sEAAa,CAAA;IAEb;;;;;OAKG;IACH,sEAAa,CAAA;IAEb;;;;OAIG;IACH,sEAAa,CAAA;IAEb;;;;OAIG;IACH,sEAAa,CAAA;IAEb;;;;;OAKG;IACH,sEAAa,CAAA;IAEb;;;;;OAKG;IACH,sEAAe,CAAA;IAEf;;;;;OAKG;IACH,0FAAyB,CAAA;IAEzB;;;;;;OAMG;IACH,8GAAmC,CAAA;AACrC,CAAC,EA/GW,oBAAoB,KAApB,oBAAoB,QA+G/B;AAED,MAAM,OAAO,mBAAmB;IA0B9B,YAAmB,OAA4B;QAC7C,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QACzD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IACvD,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 { TSDocConfiguration } from '@microsoft/tsdoc';\n\nexport enum ApiJsonSchemaVersion {\n /**\n * The initial release.\n */\n V_1000 = 1000,\n\n /**\n * Add support for type parameters and type alias types.\n */\n V_1001 = 1001,\n\n /**\n * Remove `canonicalReference` field. This field was for diagnostic purposes only and was never deserialized.\n */\n V_1002 = 1002,\n\n /**\n * Reintroduce the `canonicalReference` field using the experimental new TSDoc declaration reference notation.\n *\n * This is not a breaking change because this field is never deserialized; it is provided for informational\n * purposes only.\n */\n V_1003 = 1003,\n\n /**\n * Add a `tsdocConfig` field that tracks the TSDoc configuration for parsing doc comments.\n *\n * This is not a breaking change because an older implementation will still work correctly. The\n * custom tags will be skipped over by the parser.\n */\n V_1004 = 1004,\n\n /**\n * Add an `isOptional` field to `Parameter` and `TypeParameter` to track whether a function parameter is optional.\n *\n * When loading older JSON files, the value defaults to `false`.\n */\n V_1005 = 1005,\n\n /**\n * Add an `isProtected` field to `ApiConstructor`, `ApiMethod`, and `ApiProperty` to\n * track whether a class member has the `protected` modifier.\n *\n * Add an `isReadonly` field to `ApiProperty`, `ApiPropertySignature`, and `ApiVariable` to\n * track whether the item is readonly.\n *\n * When loading older JSON files, the values default to `false`.\n */\n V_1006 = 1006,\n\n /**\n * Add `ApiItemContainerMixin.preserveMemberOrder` to support enums that preserve their original sort order.\n *\n * When loading older JSON files, the value default to `false`.\n */\n V_1007 = 1007,\n\n /**\n * Add an `initializerTokenRange` field to `ApiProperty` and `ApiVariable` to track the item's\n * initializer.\n *\n * When loading older JSON files, this range is empty.\n */\n V_1008 = 1008,\n\n /**\n * Add an `isReadonly` field to `ApiIndexSignature` to track whether the item is readonly.\n *\n * When loading older JSON files, the values defaults to `false`.\n */\n V_1009 = 1009,\n\n /**\n * Add a `fileUrlPath` field to `ApiDeclaredItem` to track the URL to a declared item's source file.\n *\n * When loading older JSON files, the value defaults to `undefined`.\n */\n V_1010 = 1010,\n\n /**\n * Add an `isAbstract` field to `ApiClass`, `ApiMethod`, and `ApiProperty` to\n * track whether the item is abstract.\n *\n * When loading older JSON files, the value defaults to `false`.\n */\n V_1011 = 1011,\n\n /**\n * The current latest .api.json schema version.\n *\n * IMPORTANT: When incrementing this number, consider whether `OLDEST_SUPPORTED` or `OLDEST_FORWARDS_COMPATIBLE`\n * should be updated.\n */\n LATEST = V_1011,\n\n /**\n * The oldest .api.json schema version that is still supported for backwards compatibility.\n *\n * This must be updated if you change to the file format and do not implement compatibility logic for\n * deserializing the older representation.\n */\n OLDEST_SUPPORTED = V_1001,\n\n /**\n * Used to assign `IApiPackageMetadataJson.oldestForwardsCompatibleVersion`.\n *\n * This value must be \\<= `ApiJsonSchemaVersion.LATEST`. It must be reset to the `LATEST` value\n * if the older library would not be able to deserialize your new file format. Adding a nonessential field\n * is generally okay. Removing, modifying, or reinterpreting existing fields is NOT safe.\n */\n OLDEST_FORWARDS_COMPATIBLE = V_1001\n}\n\nexport class DeserializerContext {\n /**\n * The path of the file being deserialized, which may be useful for diagnostic purposes.\n */\n public readonly apiJsonFilename: string;\n\n /**\n * Metadata from `IApiPackageMetadataJson.toolPackage`.\n */\n public readonly toolPackage: string;\n\n /**\n * Metadata from `IApiPackageMetadataJson.toolVersion`.\n */\n public readonly toolVersion: string;\n\n /**\n * The version of the schema being deserialized, as obtained from `IApiPackageMetadataJson.schemaVersion`.\n */\n public readonly versionToDeserialize: ApiJsonSchemaVersion;\n\n /**\n * The TSDoc configuration for the context.\n */\n public readonly tsdocConfiguration: TSDocConfiguration;\n\n public constructor(options: DeserializerContext) {\n this.apiJsonFilename = options.apiJsonFilename;\n this.toolPackage = options.toolPackage;\n this.toolVersion = options.toolVersion;\n this.versionToDeserialize = options.versionToDeserialize;\n this.tsdocConfiguration = options.tsdocConfiguration;\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
* Represents a type referenced via an "extends" or "implements" heritage clause for a TypeScript class
|
|
5
|
+
* or interface.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
*
|
|
9
|
+
* For example, consider this declaration:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* export class Widget extends Controls.WidgetBase implements Controls.IWidget, IDisposable {
|
|
13
|
+
* // . . .
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* The heritage types are `Controls.WidgetBase`, `Controls.IWidget`, and `IDisposable`.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export class HeritageType {
|
|
21
|
+
constructor(excerpt) {
|
|
22
|
+
this.excerpt = excerpt;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=HeritageType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeritageType.js","sourceRoot":"","sources":["../../src/model/HeritageType.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAI3D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,YAAY;IAiBvB,YAAmB,OAAgB;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,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 { Excerpt } from '../mixins/Excerpt';\n\n/**\n * Represents a type referenced via an \"extends\" or \"implements\" heritage clause for a TypeScript class\n * or interface.\n *\n * @remarks\n *\n * For example, consider this declaration:\n *\n * ```ts\n * export class Widget extends Controls.WidgetBase implements Controls.IWidget, IDisposable {\n * // . . .\n * }\n * ```\n *\n * The heritage types are `Controls.WidgetBase`, `Controls.IWidget`, and `IDisposable`.\n * @public\n */\nexport class HeritageType {\n /**\n * An excerpt corresponding to the referenced type.\n * @remarks\n *\n * For example, consider this declaration:\n *\n * ```ts\n * export class Widget extends Controls.WidgetBase implements Controls.IWidget, IDisposable {\n * // . . .\n * }\n * ```\n *\n * The excerpt might be `Controls.WidgetBase`, `Controls.IWidget`, or `IDisposable`.\n */\n public readonly excerpt: Excerpt;\n\n public constructor(excerpt: Excerpt) {\n this.excerpt = excerpt;\n }\n}\n"]}
|
|
@@ -0,0 +1,177 @@
|
|
|
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 { SelectorKind } from '@microsoft/tsdoc';
|
|
4
|
+
import { ApiItemKind } from '../items/ApiItem';
|
|
5
|
+
import { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';
|
|
6
|
+
import { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';
|
|
7
|
+
/**
|
|
8
|
+
* This resolves a TSDoc declaration reference by walking the `ApiModel` hierarchy.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
*
|
|
12
|
+
* This class is analogous to `AstReferenceResolver` from the `@microsoft/api-extractor` project,
|
|
13
|
+
* which resolves declaration references by walking the compiler state.
|
|
14
|
+
*/
|
|
15
|
+
export class ModelReferenceResolver {
|
|
16
|
+
constructor(apiModel) {
|
|
17
|
+
this._apiModel = apiModel;
|
|
18
|
+
}
|
|
19
|
+
resolve(declarationReference, contextApiItem) {
|
|
20
|
+
const result = {
|
|
21
|
+
resolvedApiItem: undefined,
|
|
22
|
+
errorMessage: undefined
|
|
23
|
+
};
|
|
24
|
+
let apiPackage = undefined;
|
|
25
|
+
// Is this an absolute reference?
|
|
26
|
+
if (declarationReference.packageName !== undefined) {
|
|
27
|
+
apiPackage = this._apiModel.tryGetPackageByName(declarationReference.packageName);
|
|
28
|
+
if (apiPackage === undefined) {
|
|
29
|
+
result.errorMessage = `The package "${declarationReference.packageName}" could not be located`;
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// If the package name is omitted, try to infer it from the context
|
|
35
|
+
if (contextApiItem !== undefined) {
|
|
36
|
+
apiPackage = contextApiItem.getAssociatedPackage();
|
|
37
|
+
}
|
|
38
|
+
if (apiPackage === undefined) {
|
|
39
|
+
result.errorMessage =
|
|
40
|
+
`The reference does not include a package name, and the package could not be inferred` +
|
|
41
|
+
` from the context`;
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const importPath = declarationReference.importPath || '';
|
|
46
|
+
const foundEntryPoints = apiPackage.findEntryPointsByPath(importPath);
|
|
47
|
+
if (foundEntryPoints.length !== 1) {
|
|
48
|
+
result.errorMessage = `The import path "${importPath}" could not be resolved`;
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
let currentItem = foundEntryPoints[0];
|
|
52
|
+
// Now search for the member reference
|
|
53
|
+
for (const memberReference of declarationReference.memberReferences) {
|
|
54
|
+
if (memberReference.memberSymbol !== undefined) {
|
|
55
|
+
result.errorMessage = `Symbols are not yet supported in declaration references`;
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
if (memberReference.memberIdentifier === undefined) {
|
|
59
|
+
result.errorMessage = `Missing member identifier`;
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
const identifier = memberReference.memberIdentifier.identifier;
|
|
63
|
+
if (!ApiItemContainerMixin.isBaseClassOf(currentItem)) {
|
|
64
|
+
// For example, {@link MyClass.myMethod.X} is invalid because methods cannot contain members
|
|
65
|
+
result.errorMessage = `Unable to resolve ${JSON.stringify(identifier)} because ${currentItem.getScopedNameWithinPackage()} cannot act as a container`;
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
const foundMembers = currentItem.findMembersByName(identifier);
|
|
69
|
+
if (foundMembers.length === 0) {
|
|
70
|
+
result.errorMessage = `The member reference ${JSON.stringify(identifier)} was not found`;
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
const memberSelector = memberReference.selector;
|
|
74
|
+
if (memberSelector === undefined) {
|
|
75
|
+
if (foundMembers.length > 1) {
|
|
76
|
+
result.errorMessage = `The member reference ${JSON.stringify(identifier)} was ambiguous`;
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
currentItem = foundMembers[0];
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
let memberSelectorResult;
|
|
83
|
+
switch (memberSelector.selectorKind) {
|
|
84
|
+
case SelectorKind.System:
|
|
85
|
+
memberSelectorResult = this._selectUsingSystemSelector(foundMembers, memberSelector, identifier);
|
|
86
|
+
break;
|
|
87
|
+
case SelectorKind.Index:
|
|
88
|
+
memberSelectorResult = this._selectUsingIndexSelector(foundMembers, memberSelector, identifier);
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
result.errorMessage = `The selector "${memberSelector.selector}" is not a supported selector type`;
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
if (memberSelectorResult.resolvedApiItem === undefined) {
|
|
95
|
+
return memberSelectorResult;
|
|
96
|
+
}
|
|
97
|
+
currentItem = memberSelectorResult.resolvedApiItem;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
result.resolvedApiItem = currentItem;
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
_selectUsingSystemSelector(foundMembers, memberSelector, identifier) {
|
|
104
|
+
const result = {
|
|
105
|
+
resolvedApiItem: undefined,
|
|
106
|
+
errorMessage: undefined
|
|
107
|
+
};
|
|
108
|
+
const selectorName = memberSelector.selector;
|
|
109
|
+
let selectorItemKind;
|
|
110
|
+
switch (selectorName) {
|
|
111
|
+
case 'class':
|
|
112
|
+
selectorItemKind = ApiItemKind.Class;
|
|
113
|
+
break;
|
|
114
|
+
case 'enum':
|
|
115
|
+
selectorItemKind = ApiItemKind.Enum;
|
|
116
|
+
break;
|
|
117
|
+
case 'function':
|
|
118
|
+
selectorItemKind = ApiItemKind.Function;
|
|
119
|
+
break;
|
|
120
|
+
case 'interface':
|
|
121
|
+
selectorItemKind = ApiItemKind.Interface;
|
|
122
|
+
break;
|
|
123
|
+
case 'namespace':
|
|
124
|
+
selectorItemKind = ApiItemKind.Namespace;
|
|
125
|
+
break;
|
|
126
|
+
case 'type':
|
|
127
|
+
selectorItemKind = ApiItemKind.TypeAlias;
|
|
128
|
+
break;
|
|
129
|
+
case 'variable':
|
|
130
|
+
selectorItemKind = ApiItemKind.Variable;
|
|
131
|
+
break;
|
|
132
|
+
default:
|
|
133
|
+
result.errorMessage = `Unsupported system selector "${selectorName}"`;
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
const matches = foundMembers.filter((x) => x.kind === selectorItemKind);
|
|
137
|
+
if (matches.length === 0) {
|
|
138
|
+
result.errorMessage =
|
|
139
|
+
`A declaration for "${identifier}" was not found that matches the` +
|
|
140
|
+
` TSDoc selector "${selectorName}"`;
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
if (matches.length > 1) {
|
|
144
|
+
result.errorMessage = `More than one declaration "${identifier}" matches the TSDoc selector "${selectorName}"`;
|
|
145
|
+
}
|
|
146
|
+
result.resolvedApiItem = matches[0];
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
_selectUsingIndexSelector(foundMembers, memberSelector, identifier) {
|
|
150
|
+
const result = {
|
|
151
|
+
resolvedApiItem: undefined,
|
|
152
|
+
errorMessage: undefined
|
|
153
|
+
};
|
|
154
|
+
const selectedMembers = [];
|
|
155
|
+
const selectorOverloadIndex = parseInt(memberSelector.selector, 10);
|
|
156
|
+
for (const foundMember of foundMembers) {
|
|
157
|
+
if (ApiParameterListMixin.isBaseClassOf(foundMember)) {
|
|
158
|
+
if (foundMember.overloadIndex === selectorOverloadIndex) {
|
|
159
|
+
selectedMembers.push(foundMember);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (selectedMembers.length === 0) {
|
|
164
|
+
result.errorMessage =
|
|
165
|
+
`An overload for ${JSON.stringify(identifier)} was not found that matches` +
|
|
166
|
+
` the TSDoc selector ":${selectorOverloadIndex}"`;
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
if (selectedMembers.length === 1) {
|
|
170
|
+
result.resolvedApiItem = selectedMembers[0];
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
result.errorMessage = `The member reference ${JSON.stringify(identifier)} was ambiguous`;
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=ModelReferenceResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModelReferenceResolver.js","sourceRoot":"","sources":["../../src/model/ModelReferenceResolver.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAwD,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEtG,OAAO,EAAgB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAI7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAoBxE;;;;;;;GAOG;AACH,MAAM,OAAO,sBAAsB;IAGjC,YAAmB,QAAkB;QACnC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,OAAO,CACZ,oBAA6C,EAC7C,cAAmC;QAEnC,MAAM,MAAM,GAAuC;YACjD,eAAe,EAAE,SAAS;YAC1B,YAAY,EAAE,SAAS;SACxB,CAAC;QAEF,IAAI,UAAU,GAA2B,SAAS,CAAC;QAEnD,iCAAiC;QACjC,IAAI,oBAAoB,CAAC,WAAW,KAAK,S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1E,yBAAyB,qBAAqB,GAAG,CAAC;YACpD,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,MAAM,CAAC,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;YAC5C,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,CAAC,YAAY,GAAG,wBAAwB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC;QACzF,OAAO,MAAM,CAAC;IAChB,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 DocDeclarationReference, type DocMemberSelector, SelectorKind } from '@microsoft/tsdoc';\n\nimport { type ApiItem, ApiItemKind } from '../items/ApiItem';\nimport type { ApiModel } from './ApiModel';\nimport type { ApiPackage } from './ApiPackage';\nimport type { ApiEntryPoint } from './ApiEntryPoint';\nimport { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';\nimport { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\n\n/**\n * Result object for {@link ApiModel.resolveDeclarationReference}.\n *\n * @public\n */\nexport interface IResolveDeclarationReferenceResult {\n /**\n * The referenced ApiItem, if the declaration reference could be resolved.\n */\n resolvedApiItem: ApiItem | undefined;\n\n /**\n * If resolvedApiItem is undefined, then this will always contain an error message explaining why the\n * resolution failed.\n */\n errorMessage: string | undefined;\n}\n\n/**\n * This resolves a TSDoc declaration reference by walking the `ApiModel` hierarchy.\n *\n * @remarks\n *\n * This class is analogous to `AstReferenceResolver` from the `@microsoft/api-extractor` project,\n * which resolves declaration references by walking the compiler state.\n */\nexport class ModelReferenceResolver {\n private readonly _apiModel: ApiModel;\n\n public constructor(apiModel: ApiModel) {\n this._apiModel = apiModel;\n }\n\n public resolve(\n declarationReference: DocDeclarationReference,\n contextApiItem: ApiItem | undefined\n ): IResolveDeclarationReferenceResult {\n const result: IResolveDeclarationReferenceResult = {\n resolvedApiItem: undefined,\n errorMessage: undefined\n };\n\n let apiPackage: ApiPackage | undefined = undefined;\n\n // Is this an absolute reference?\n if (declarationReference.packageName !== undefined) {\n apiPackage = this._apiModel.tryGetPackageByName(declarationReference.packageName);\n if (apiPackage === undefined) {\n result.errorMessage = `The package \"${declarationReference.packageName}\" could not be located`;\n return result;\n }\n } else {\n // If the package name is omitted, try to infer it from the context\n if (contextApiItem !== undefined) {\n apiPackage = contextApiItem.getAssociatedPackage();\n }\n\n if (apiPackage === undefined) {\n result.errorMessage =\n `The reference does not include a package name, and the package could not be inferred` +\n ` from the context`;\n return result;\n }\n }\n\n const importPath: string = declarationReference.importPath || '';\n\n const foundEntryPoints: ReadonlyArray<ApiEntryPoint> = apiPackage.findEntryPointsByPath(importPath);\n if (foundEntryPoints.length !== 1) {\n result.errorMessage = `The import path \"${importPath}\" could not be resolved`;\n return result;\n }\n\n let currentItem: ApiItem = foundEntryPoints[0];\n\n // Now search for the member reference\n for (const memberReference of declarationReference.memberReferences) {\n if (memberReference.memberSymbol !== undefined) {\n result.errorMessage = `Symbols are not yet supported in declaration references`;\n return result;\n }\n\n if (memberReference.memberIdentifier === undefined) {\n result.errorMessage = `Missing member identifier`;\n return result;\n }\n\n const identifier: string = memberReference.memberIdentifier.identifier;\n\n if (!ApiItemContainerMixin.isBaseClassOf(currentItem)) {\n // For example, {@link MyClass.myMethod.X} is invalid because methods cannot contain members\n result.errorMessage = `Unable to resolve ${JSON.stringify(\n identifier\n )} because ${currentItem.getScopedNameWithinPackage()} cannot act as a container`;\n return result;\n }\n\n const foundMembers: ReadonlyArray<ApiItem> = currentItem.findMembersByName(identifier);\n if (foundMembers.length === 0) {\n result.errorMessage = `The member reference ${JSON.stringify(identifier)} was not found`;\n return result;\n }\n\n const memberSelector: DocMemberSelector | undefined = memberReference.selector;\n if (memberSelector === undefined) {\n if (foundMembers.length > 1) {\n result.errorMessage = `The member reference ${JSON.stringify(identifier)} was ambiguous`;\n return result;\n }\n currentItem = foundMembers[0];\n } else {\n let memberSelectorResult: IResolveDeclarationReferenceResult;\n switch (memberSelector.selectorKind) {\n case SelectorKind.System:\n memberSelectorResult = this._selectUsingSystemSelector(foundMembers, memberSelector, identifier);\n break;\n case SelectorKind.Index:\n memberSelectorResult = this._selectUsingIndexSelector(foundMembers, memberSelector, identifier);\n break;\n default:\n result.errorMessage = `The selector \"${memberSelector.selector}\" is not a supported selector type`;\n return result;\n }\n if (memberSelectorResult.resolvedApiItem === undefined) {\n return memberSelectorResult;\n }\n currentItem = memberSelectorResult.resolvedApiItem;\n }\n }\n result.resolvedApiItem = currentItem;\n return result;\n }\n\n private _selectUsingSystemSelector(\n foundMembers: ReadonlyArray<ApiItem>,\n memberSelector: DocMemberSelector,\n identifier: string\n ): IResolveDeclarationReferenceResult {\n const result: IResolveDeclarationReferenceResult = {\n resolvedApiItem: undefined,\n errorMessage: undefined\n };\n\n const selectorName: string = memberSelector.selector;\n\n let selectorItemKind: ApiItemKind;\n switch (selectorName) {\n case 'class':\n selectorItemKind = ApiItemKind.Class;\n break;\n case 'enum':\n selectorItemKind = ApiItemKind.Enum;\n break;\n case 'function':\n selectorItemKind = ApiItemKind.Function;\n break;\n case 'interface':\n selectorItemKind = ApiItemKind.Interface;\n break;\n case 'namespace':\n selectorItemKind = ApiItemKind.Namespace;\n break;\n case 'type':\n selectorItemKind = ApiItemKind.TypeAlias;\n break;\n case 'variable':\n selectorItemKind = ApiItemKind.Variable;\n break;\n default:\n result.errorMessage = `Unsupported system selector \"${selectorName}\"`;\n return result;\n }\n\n const matches: ApiItem[] = foundMembers.filter((x) => x.kind === selectorItemKind);\n if (matches.length === 0) {\n result.errorMessage =\n `A declaration for \"${identifier}\" was not found that matches the` +\n ` TSDoc selector \"${selectorName}\"`;\n return result;\n }\n if (matches.length > 1) {\n result.errorMessage = `More than one declaration \"${identifier}\" matches the TSDoc selector \"${selectorName}\"`;\n }\n result.resolvedApiItem = matches[0];\n return result;\n }\n\n private _selectUsingIndexSelector(\n foundMembers: ReadonlyArray<ApiItem>,\n memberSelector: DocMemberSelector,\n identifier: string\n ): IResolveDeclarationReferenceResult {\n const result: IResolveDeclarationReferenceResult = {\n resolvedApiItem: undefined,\n errorMessage: undefined\n };\n\n const selectedMembers: ApiItem[] = [];\n\n const selectorOverloadIndex: number = parseInt(memberSelector.selector, 10);\n for (const foundMember of foundMembers) {\n if (ApiParameterListMixin.isBaseClassOf(foundMember)) {\n if (foundMember.overloadIndex === selectorOverloadIndex) {\n selectedMembers.push(foundMember);\n }\n }\n }\n\n if (selectedMembers.length === 0) {\n result.errorMessage =\n `An overload for ${JSON.stringify(identifier)} was not found that matches` +\n ` the TSDoc selector \":${selectorOverloadIndex}\"`;\n return result;\n }\n\n if (selectedMembers.length === 1) {\n result.resolvedApiItem = selectedMembers[0];\n return result;\n }\n\n result.errorMessage = `The member reference ${JSON.stringify(identifier)} was ambiguous`;\n return result;\n }\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { ApiDocumentedItem } from '../items/ApiDocumentedItem';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a named parameter for a function-like declaration.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
*
|
|
9
|
+
* `Parameter` represents a TypeScript declaration such as `x: number` in this example:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* export function add(x: number, y: number): number {
|
|
13
|
+
* return x + y;
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* `Parameter` objects belong to the {@link (ApiParameterListMixin:interface).parameters} collection.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export class Parameter {
|
|
22
|
+
constructor(options) {
|
|
23
|
+
this.name = options.name;
|
|
24
|
+
this.parameterTypeExcerpt = options.parameterTypeExcerpt;
|
|
25
|
+
this.isOptional = options.isOptional;
|
|
26
|
+
this._parent = options.parent;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the `@param` documentation for this parameter, if present.
|
|
30
|
+
*/
|
|
31
|
+
get tsdocParamBlock() {
|
|
32
|
+
if (this._parent instanceof ApiDocumentedItem) {
|
|
33
|
+
if (this._parent.tsdocComment) {
|
|
34
|
+
return this._parent.tsdocComment.params.tryGetBlockByName(this.name);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=Parameter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Parameter.js","sourceRoot":"","sources":["../../src/model/Parameter.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAI3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAe/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,SAAS;IAkBpB,YAAmB,OAA0B;QAC3C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QACzD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QACxB,IAAI,IAAI,CAAC,OAAO,YAAY,iBAAiB,EAAE,CAAC;YAC9C,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;gBAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACvE,CAAC;QACH,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 * as tsdoc from '@microsoft/tsdoc';\n\nimport { ApiDocumentedItem } from '../items/ApiDocumentedItem';\nimport type { Excerpt } from '../mixins/Excerpt';\nimport type { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\n\n/**\n * Constructor options for {@link Parameter}.\n * @public\n */\nexport interface IParameterOptions {\n name: string;\n parameterTypeExcerpt: Excerpt;\n isOptional: boolean;\n parent: ApiParameterListMixin;\n}\n\n/**\n * Represents a named parameter for a function-like declaration.\n *\n * @remarks\n *\n * `Parameter` represents a TypeScript declaration such as `x: number` in this example:\n *\n * ```ts\n * export function add(x: number, y: number): number {\n * return x + y;\n * }\n * ```\n *\n * `Parameter` objects belong to the {@link (ApiParameterListMixin:interface).parameters} collection.\n *\n * @public\n */\nexport class Parameter {\n /**\n * An {@link Excerpt} that describes the type of the parameter.\n */\n public readonly parameterTypeExcerpt: Excerpt;\n\n /**\n * The parameter name.\n */\n public name: string;\n\n /**\n * Whether the parameter is optional.\n */\n public isOptional: boolean;\n\n private _parent: ApiParameterListMixin;\n\n public constructor(options: IParameterOptions) {\n this.name = options.name;\n this.parameterTypeExcerpt = options.parameterTypeExcerpt;\n this.isOptional = options.isOptional;\n this._parent = options.parent;\n }\n\n /**\n * Returns the `@param` documentation for this parameter, if present.\n */\n public get tsdocParamBlock(): tsdoc.DocParamBlock | undefined {\n if (this._parent instanceof ApiDocumentedItem) {\n if (this._parent.tsdocComment) {\n return this._parent.tsdocComment.params.tryGetBlockByName(this.name);\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { URL } from 'node:url';
|
|
4
|
+
/**
|
|
5
|
+
* The source location where a given API item is declared.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* The source location points to the `.ts` source file where the API item was originally
|
|
9
|
+
declared. However, in some cases, if source map resolution fails, it falls back to pointing
|
|
10
|
+
to the `.d.ts` file instead.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export class SourceLocation {
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this._projectFolderUrl = options.projectFolderUrl;
|
|
17
|
+
this._fileUrlPath = options.fileUrlPath;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the file URL to the given source location. Returns `undefined` if the file URL
|
|
21
|
+
* cannot be determined.
|
|
22
|
+
*/
|
|
23
|
+
get fileUrl() {
|
|
24
|
+
if (this._projectFolderUrl === undefined || this._fileUrlPath === undefined) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
let projectFolderUrl = this._projectFolderUrl;
|
|
28
|
+
if (!projectFolderUrl.endsWith('/')) {
|
|
29
|
+
projectFolderUrl += '/';
|
|
30
|
+
}
|
|
31
|
+
const url = new URL(this._fileUrlPath, projectFolderUrl);
|
|
32
|
+
return url.href;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=SourceLocation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SourceLocation.js","sourceRoot":"","sources":["../../src/model/SourceLocation.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAoB/B;;;;;;;;;GASG;AACH,MAAM,OAAO,cAAc;IAIzB,YAAmB,OAA+B;QAChD,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACH,IAAW,OAAO;QAChB,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YAC5E,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,gBAAgB,GAAW,IAAI,CAAC,iBAAiB,CAAC;QACtD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,gBAAgB,IAAI,GAAG,CAAC;QAC1B,CAAC;QAED,MAAM,GAAG,GAAQ,IAAI,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,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 { URL } from 'node:url';\n\n/**\n * Constructor options for `SourceLocation`.\n * @public\n */\nexport interface ISourceLocationOptions {\n /**\n * The project folder URL as defined by the `api-extractor.json` config `projectFolderUrl`\n * setting.\n */\n projectFolderUrl?: string;\n\n /**\n * The file URL path relative to the `projectFolder` and `projectFolderURL` fields as\n * defined in the `api-extractor.json` config.\n */\n fileUrlPath?: string;\n}\n\n/**\n * The source location where a given API item is declared.\n *\n * @remarks\n * The source location points to the `.ts` source file where the API item was originally\n declared. However, in some cases, if source map resolution fails, it falls back to pointing\n to the `.d.ts` file instead.\n *\n * @public\n */\nexport class SourceLocation {\n private readonly _projectFolderUrl?: string;\n private readonly _fileUrlPath?: string;\n\n public constructor(options: ISourceLocationOptions) {\n this._projectFolderUrl = options.projectFolderUrl;\n this._fileUrlPath = options.fileUrlPath;\n }\n\n /**\n * Returns the file URL to the given source location. Returns `undefined` if the file URL\n * cannot be determined.\n */\n public get fileUrl(): string | undefined {\n if (this._projectFolderUrl === undefined || this._fileUrlPath === undefined) {\n return undefined;\n }\n\n let projectFolderUrl: string = this._projectFolderUrl;\n if (!projectFolderUrl.endsWith('/')) {\n projectFolderUrl += '/';\n }\n\n const url: URL = new URL(this._fileUrlPath, projectFolderUrl);\n return url.href;\n }\n}\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { ApiDocumentedItem } from '../items/ApiDocumentedItem';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a named type parameter for a generic declaration.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
*
|
|
9
|
+
* `TypeParameter` represents a TypeScript declaration such as `T` in this example:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* interface IIdentifier {
|
|
13
|
+
* getCode(): string;
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* class BarCode implements IIdentifier {
|
|
17
|
+
* private _value: number;
|
|
18
|
+
* public getCode(): string { return this._value.toString(); }
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* class Book<TIdentifier extends IIdentifier = BarCode> {
|
|
22
|
+
* public identifier: TIdentifier;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* `TypeParameter` objects belong to the {@link (ApiTypeParameterListMixin:interface).typeParameters} collection.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export class TypeParameter {
|
|
31
|
+
constructor(options) {
|
|
32
|
+
this.name = options.name;
|
|
33
|
+
this.constraintExcerpt = options.constraintExcerpt;
|
|
34
|
+
this.defaultTypeExcerpt = options.defaultTypeExcerpt;
|
|
35
|
+
this.isOptional = options.isOptional;
|
|
36
|
+
this._parent = options.parent;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Returns the `@typeParam` documentation for this parameter, if present.
|
|
40
|
+
*/
|
|
41
|
+
get tsdocTypeParamBlock() {
|
|
42
|
+
if (this._parent instanceof ApiDocumentedItem) {
|
|
43
|
+
if (this._parent.tsdocComment) {
|
|
44
|
+
return this._parent.tsdocComment.typeParams.tryGetBlockByName(this.name);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=TypeParameter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeParameter.js","sourceRoot":"","sources":["../../src/model/TypeParameter.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAI3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAgB/D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,OAAO,aAAa;IAyCxB,YAAmB,OAA8B;QAC/C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACnD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,mBAAmB;QAC5B,IAAI,IAAI,CAAC,OAAO,YAAY,iBAAiB,EAAE,CAAC;YAC9C,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;gBAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC3E,CAAC;QACH,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 * as tsdoc from '@microsoft/tsdoc';\n\nimport { ApiDocumentedItem } from '../items/ApiDocumentedItem';\nimport type { Excerpt } from '../mixins/Excerpt';\nimport type { ApiTypeParameterListMixin } from '../mixins/ApiTypeParameterListMixin';\n\n/**\n * Constructor options for {@link TypeParameter}.\n * @public\n */\nexport interface ITypeParameterOptions {\n name: string;\n constraintExcerpt: Excerpt;\n defaultTypeExcerpt: Excerpt;\n isOptional: boolean;\n parent: ApiTypeParameterListMixin;\n}\n\n/**\n * Represents a named type parameter for a generic declaration.\n *\n * @remarks\n *\n * `TypeParameter` represents a TypeScript declaration such as `T` in this example:\n *\n * ```ts\n * interface IIdentifier {\n * getCode(): string;\n * }\n *\n * class BarCode implements IIdentifier {\n * private _value: number;\n * public getCode(): string { return this._value.toString(); }\n * }\n *\n * class Book<TIdentifier extends IIdentifier = BarCode> {\n * public identifier: TIdentifier;\n * }\n * ```\n *\n * `TypeParameter` objects belong to the {@link (ApiTypeParameterListMixin:interface).typeParameters} collection.\n *\n * @public\n */\nexport class TypeParameter {\n /**\n * An {@link Excerpt} that describes the base constraint of the type parameter.\n *\n * @remarks\n * In the example below, the `constraintExcerpt` would correspond to the `IIdentifier` subexpression:\n *\n * ```ts\n * class Book<TIdentifier extends IIdentifier = BarCode> {\n * public identifier: TIdentifier;\n * }\n * ```\n */\n public readonly constraintExcerpt: Excerpt;\n\n /**\n * An {@link Excerpt} that describes the default type of the type parameter.\n *\n * @remarks\n * In the example below, the `defaultTypeExcerpt` would correspond to the `BarCode` subexpression:\n *\n * ```ts\n * class Book<TIdentifier extends IIdentifier = BarCode> {\n * public identifier: TIdentifier;\n * }\n * ```\n */\n public readonly defaultTypeExcerpt: Excerpt;\n\n /**\n * The parameter name.\n */\n public name: string;\n\n /**\n * Whether the type parameter is optional. True IFF there exists a `defaultTypeExcerpt`.\n */\n public isOptional: boolean;\n\n private _parent: ApiTypeParameterListMixin;\n\n public constructor(options: ITypeParameterOptions) {\n this.name = options.name;\n this.constraintExcerpt = options.constraintExcerpt;\n this.defaultTypeExcerpt = options.defaultTypeExcerpt;\n this.isOptional = options.isOptional;\n this._parent = options.parent;\n }\n\n /**\n * Returns the `@typeParam` documentation for this parameter, if present.\n */\n public get tsdocTypeParamBlock(): tsdoc.DocParamBlock | undefined {\n if (this._parent instanceof ApiDocumentedItem) {\n if (this._parent.tsdocComment) {\n return this._parent.tsdocComment.typeParams.tryGetBlockByName(this.name);\n }\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/api-extractor-model",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.33.0",
|
|
4
4
|
"description": "A helper library for loading and saving the .api.json files created by API Extractor",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,19 +8,41 @@
|
|
|
8
8
|
"directory": "libraries/api-extractor-model"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://api-extractor.com",
|
|
11
|
-
"main": "lib/index.js",
|
|
12
|
-
"
|
|
11
|
+
"main": "./lib-commonjs/index.js",
|
|
12
|
+
"module": "./lib-esm/index.js",
|
|
13
|
+
"types": "./dist/rollup.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/rollup.d.ts",
|
|
17
|
+
"import": "./lib-esm/index.js",
|
|
18
|
+
"require": "./lib-commonjs/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./lib/*": {
|
|
21
|
+
"types": "./lib-dts/*.d.ts",
|
|
22
|
+
"import": "./lib-esm/*.js",
|
|
23
|
+
"require": "./lib-commonjs/*.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"typesVersions": {
|
|
28
|
+
"*": {
|
|
29
|
+
"lib/*": [
|
|
30
|
+
"lib-dts/*"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
13
34
|
"license": "MIT",
|
|
14
35
|
"dependencies": {
|
|
15
36
|
"@microsoft/tsdoc": "~0.16.0",
|
|
16
37
|
"@microsoft/tsdoc-config": "~0.18.0",
|
|
17
|
-
"@rushstack/node-core-library": "5.
|
|
38
|
+
"@rushstack/node-core-library": "5.20.0"
|
|
18
39
|
},
|
|
19
40
|
"devDependencies": {
|
|
20
|
-
"@rushstack/heft": "1.1.
|
|
41
|
+
"@rushstack/heft": "1.1.7",
|
|
21
42
|
"eslint": "~9.37.0",
|
|
22
43
|
"decoupled-local-node-rig": "1.0.0"
|
|
23
44
|
},
|
|
45
|
+
"sideEffects": false,
|
|
24
46
|
"scripts": {
|
|
25
47
|
"build": "heft build --clean",
|
|
26
48
|
"_phase:build": "heft run --only build -- --clean",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|