@microsoft/api-extractor-model 7.13.9 → 7.13.13
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 +54 -0
- package/CHANGELOG.md +21 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/items/ApiDocumentedItem.js +1 -1
- package/lib/items/ApiPropertyItem.js +1 -1
- package/lib/items/ApiPropertyItem.js.map +1 -1
- package/lib/mixins/ApiItemContainerMixin.js.map +1 -1
- package/lib/mixins/ApiNameMixin.js.map +1 -1
- package/lib/mixins/ApiOptionalMixin.js.map +1 -1
- package/lib/mixins/ApiParameterListMixin.js.map +1 -1
- package/lib/mixins/ApiReleaseTagMixin.js.map +1 -1
- package/lib/mixins/ApiReturnTypeMixin.js.map +1 -1
- package/lib/mixins/ApiStaticMixin.js.map +1 -1
- package/lib/mixins/ApiTypeParameterListMixin.js.map +1 -1
- package/lib/model/ApiCallSignature.js +1 -1
- package/lib/model/ApiCallSignature.js.map +1 -1
- package/lib/model/ApiClass.js +1 -1
- package/lib/model/ApiClass.js.map +1 -1
- package/lib/model/ApiConstructSignature.js +1 -1
- package/lib/model/ApiConstructSignature.js.map +1 -1
- package/lib/model/ApiConstructor.js +1 -1
- package/lib/model/ApiConstructor.js.map +1 -1
- package/lib/model/ApiEntryPoint.js +1 -1
- package/lib/model/ApiEntryPoint.js.map +1 -1
- package/lib/model/ApiEnum.js +1 -1
- package/lib/model/ApiEnum.js.map +1 -1
- package/lib/model/ApiEnumMember.js +1 -1
- package/lib/model/ApiEnumMember.js.map +1 -1
- package/lib/model/ApiFunction.js +1 -1
- package/lib/model/ApiFunction.js.map +1 -1
- package/lib/model/ApiIndexSignature.js +1 -1
- package/lib/model/ApiIndexSignature.js.map +1 -1
- package/lib/model/ApiInterface.js +1 -1
- package/lib/model/ApiInterface.js.map +1 -1
- package/lib/model/ApiMethod.js +1 -1
- package/lib/model/ApiMethod.js.map +1 -1
- package/lib/model/ApiMethodSignature.js +1 -1
- package/lib/model/ApiMethodSignature.js.map +1 -1
- package/lib/model/ApiModel.js +1 -1
- package/lib/model/ApiModel.js.map +1 -1
- package/lib/model/ApiNamespace.js +1 -1
- package/lib/model/ApiNamespace.js.map +1 -1
- package/lib/model/ApiPackage.js +1 -1
- package/lib/model/ApiPackage.js.map +1 -1
- package/lib/model/ApiProperty.js +1 -1
- package/lib/model/ApiProperty.js.map +1 -1
- package/lib/model/ApiTypeAlias.js +1 -1
- package/lib/model/ApiTypeAlias.js.map +1 -1
- package/lib/model/ApiVariable.js +1 -1
- package/lib/model/ApiVariable.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/api-extractor-model",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "7.13.13",
|
|
6
|
+
"tag": "@microsoft/api-extractor-model_v7.13.13",
|
|
7
|
+
"date": "Wed, 13 Oct 2021 15:09:54 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"dependency": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Updating dependency \"@rushstack/node-core-library\" to `3.42.3`"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.4.3`"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"version": "7.13.12",
|
|
21
|
+
"tag": "@microsoft/api-extractor-model_v7.13.12",
|
|
22
|
+
"date": "Fri, 08 Oct 2021 08:08:34 GMT",
|
|
23
|
+
"comments": {
|
|
24
|
+
"dependency": [
|
|
25
|
+
{
|
|
26
|
+
"comment": "Updating dependency \"@rushstack/node-core-library\" to `3.42.2`"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"version": "7.13.11",
|
|
33
|
+
"tag": "@microsoft/api-extractor-model_v7.13.11",
|
|
34
|
+
"date": "Thu, 07 Oct 2021 07:13:35 GMT",
|
|
35
|
+
"comments": {
|
|
36
|
+
"dependency": [
|
|
37
|
+
{
|
|
38
|
+
"comment": "Updating dependency \"@rushstack/node-core-library\" to `3.42.1`"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"comment": "Updating dependency \"@rushstack/eslint-config\" to `2.4.2`"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"version": "7.13.10",
|
|
48
|
+
"tag": "@microsoft/api-extractor-model_v7.13.10",
|
|
49
|
+
"date": "Tue, 05 Oct 2021 15:08:38 GMT",
|
|
50
|
+
"comments": {
|
|
51
|
+
"dependency": [
|
|
52
|
+
{
|
|
53
|
+
"comment": "Updating dependency \"@rushstack/node-core-library\" to `3.42.0`"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
4
58
|
{
|
|
5
59
|
"version": "7.13.9",
|
|
6
60
|
"tag": "@microsoft/api-extractor-model_v7.13.9",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
# Change Log - @microsoft/api-extractor-model
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 13 Oct 2021 15:09:54 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 7.13.13
|
|
6
|
+
Wed, 13 Oct 2021 15:09:54 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 7.13.12
|
|
11
|
+
Fri, 08 Oct 2021 08:08:34 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 7.13.11
|
|
16
|
+
Thu, 07 Oct 2021 07:13:35 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 7.13.10
|
|
21
|
+
Tue, 05 Oct 2021 15:08:38 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
4
24
|
|
|
5
25
|
## 7.13.9
|
|
6
26
|
Fri, 24 Sep 2021 00:09:29 GMT
|
package/dist/tsdoc-metadata.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
3
|
// See LICENSE in the project root for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.HeritageType = exports.ApiVariable = exports.TypeParameter = exports.ApiTypeAlias = exports.ApiPropertySignature = exports.ApiProperty = exports.Parameter = exports.ApiPackage = exports.ApiNamespace = exports.ApiModel = exports.ApiMethodSignature = exports.ApiMethod = exports.ApiInterface = exports.ApiIndexSignature = exports.ApiFunction = exports.ApiEnumMember = exports.ApiEnum = exports.ApiEntryPoint = exports.ApiConstructSignature = exports.ApiConstructor = exports.ApiClass = exports.ApiCallSignature = exports.Excerpt = exports.ExcerptToken = exports.ApiOptionalMixin = exports.ApiNameMixin = exports.ApiStaticMixin = exports.ApiReturnTypeMixin = exports.ApiReleaseTagMixin = exports.ApiItemContainerMixin = exports.ApiTypeParameterListMixin = exports.ApiParameterListMixin = exports.ApiPropertyItem = exports.ApiItem = exports.ApiDocumentedItem = exports.ApiDeclaredItem = exports.ReleaseTag = exports.AedocDefinitions = void 0;
|
|
5
6
|
/**
|
|
6
7
|
* Use this library to read and write *.api.json files as defined by the
|
|
7
8
|
* {@link https://api-extractor.com/ | API Extractor} tool. These files are used to generate a documentation
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D
|
|
1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OAAA;AAC3C,+CAAiE;AAArC,sGAAA,SAAS,OAAA;AACrC,iEAA4F;AAAvD,wHAAA,kBAAkB,OAAA;AACvD,6CAA4C;AAAnC,oGAAA,QAAQ,OAAA;AACjB,qDAA0E;AAA3C,4GAAA,YAAY,OAAA;AAC3C,iDAA4F;AAA/D,wGAAA,UAAU,OAAA;AACvC,+CAAiE;AAArC,sGAAA,SAAS,OAAA;AACrC,mDAAuE;AAAzC,0GAAA,WAAW,OAAA;AACzC,qEAAkG;AAA3D,4HAAA,oBAAoB,OAAA;AAC3D,qDAA0E;AAA3C,4GAAA,YAAY,OAAA;AAC3C,uDAA6E;AAA7C,8GAAA,aAAa,OAAA;AAC7C,mDAAuE;AAAzC,0GAAA,WAAW,OAAA;AAEzC,qDAAoD;AAA3C,4GAAA,YAAY,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\n/**\r\n * Use this library to read and write *.api.json files as defined by the\r\n * {@link https://api-extractor.com/ | API Extractor} tool. These files are used to generate a documentation\r\n * website for your TypeScript package. The files store the API signatures and doc comments that were extracted\r\n * from your package.\r\n *\r\n * @packageDocumentation\r\n */\r\n\r\nexport { AedocDefinitions } from './aedoc/AedocDefinitions';\r\nexport { ReleaseTag } from './aedoc/ReleaseTag';\r\n\r\n// items\r\nexport { IApiDeclaredItemOptions, ApiDeclaredItem } from './items/ApiDeclaredItem';\r\nexport { IApiDocumentedItemOptions, ApiDocumentedItem } from './items/ApiDocumentedItem';\r\nexport { ApiItemKind, IApiItemOptions, ApiItem, IApiItemConstructor } from './items/ApiItem';\r\nexport { IApiPropertyItemOptions, ApiPropertyItem } from './items/ApiPropertyItem';\r\n\r\n// mixins\r\nexport {\r\n IApiParameterListMixinOptions,\r\n IApiParameterOptions,\r\n ApiParameterListMixin\r\n} from './mixins/ApiParameterListMixin';\r\nexport {\r\n IApiTypeParameterOptions,\r\n IApiTypeParameterListMixinOptions,\r\n ApiTypeParameterListMixin\r\n} from './mixins/ApiTypeParameterListMixin';\r\nexport { IApiItemContainerMixinOptions, ApiItemContainerMixin } from './mixins/ApiItemContainerMixin';\r\nexport { IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from './mixins/ApiReleaseTagMixin';\r\nexport { IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from './mixins/ApiReturnTypeMixin';\r\nexport { IApiStaticMixinOptions, ApiStaticMixin } from './mixins/ApiStaticMixin';\r\nexport { IApiNameMixinOptions, ApiNameMixin } from './mixins/ApiNameMixin';\r\nexport { IApiOptionalMixinOptions, ApiOptionalMixin } from './mixins/ApiOptionalMixin';\r\n\r\nexport { ExcerptTokenKind, IExcerptTokenRange, IExcerptToken, ExcerptToken, Excerpt } from './mixins/Excerpt';\r\nexport { Constructor, PropertiesOf } from './mixins/Mixin';\r\n\r\n// model\r\nexport { IApiCallSignatureOptions, ApiCallSignature } from './model/ApiCallSignature';\r\nexport { IApiClassOptions, ApiClass } from './model/ApiClass';\r\nexport { IApiConstructorOptions, ApiConstructor } from './model/ApiConstructor';\r\nexport { IApiConstructSignatureOptions, ApiConstructSignature } from './model/ApiConstructSignature';\r\nexport { IApiEntryPointOptions, ApiEntryPoint } from './model/ApiEntryPoint';\r\nexport { IApiEnumOptions, ApiEnum } from './model/ApiEnum';\r\nexport { IApiEnumMemberOptions, ApiEnumMember } from './model/ApiEnumMember';\r\nexport { IApiFunctionOptions, ApiFunction } from './model/ApiFunction';\r\nexport { IApiIndexSignatureOptions, ApiIndexSignature } from './model/ApiIndexSignature';\r\nexport { IApiInterfaceOptions, ApiInterface } from './model/ApiInterface';\r\nexport { IApiMethodOptions, ApiMethod } from './model/ApiMethod';\r\nexport { IApiMethodSignatureOptions, ApiMethodSignature } from './model/ApiMethodSignature';\r\nexport { ApiModel } from './model/ApiModel';\r\nexport { IApiNamespaceOptions, ApiNamespace } from './model/ApiNamespace';\r\nexport { IApiPackageOptions, ApiPackage, IApiPackageSaveOptions } from './model/ApiPackage';\r\nexport { IParameterOptions, Parameter } from './model/Parameter';\r\nexport { IApiPropertyOptions, ApiProperty } from './model/ApiProperty';\r\nexport { IApiPropertySignatureOptions, ApiPropertySignature } from './model/ApiPropertySignature';\r\nexport { IApiTypeAliasOptions, ApiTypeAlias } from './model/ApiTypeAlias';\r\nexport { ITypeParameterOptions, TypeParameter } from './model/TypeParameter';\r\nexport { IApiVariableOptions, ApiVariable } from './model/ApiVariable';\r\nexport { IResolveDeclarationReferenceResult } from './model/ModelReferenceResolver';\r\nexport { HeritageType } from './model/HeritageType';\r\n"]}
|
|
@@ -16,7 +16,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
16
16
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
17
17
|
if (mod && mod.__esModule) return mod;
|
|
18
18
|
var result = {};
|
|
19
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
19
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
20
20
|
__setModuleDefault(result, mod);
|
|
21
21
|
return result;
|
|
22
22
|
};
|
|
@@ -12,7 +12,7 @@ const ApiOptionalMixin_1 = require("../mixins/ApiOptionalMixin");
|
|
|
12
12
|
*
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
|
-
class ApiPropertyItem extends ApiNameMixin_1.ApiNameMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiOptionalMixin_1.ApiOptionalMixin(ApiDeclaredItem_1.ApiDeclaredItem))) {
|
|
15
|
+
class ApiPropertyItem extends (0, ApiNameMixin_1.ApiNameMixin)((0, ApiReleaseTagMixin_1.ApiReleaseTagMixin)((0, ApiOptionalMixin_1.ApiOptionalMixin)(ApiDeclaredItem_1.ApiDeclaredItem))) {
|
|
16
16
|
constructor(options) {
|
|
17
17
|
super(options);
|
|
18
18
|
this.propertyTypeExcerpt = this.buildExcerpt(options.propertyTypeTokenRange);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiPropertyItem.js","sourceRoot":"","sources":["../../src/items/ApiPropertyItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,8DAA0G;AAC1G,qEAA8F;AAC9F,yDAA4E;AAE5E,iEAAwF;AAkBxF;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,2BAAY,
|
|
1
|
+
{"version":3,"file":"ApiPropertyItem.js","sourceRoot":"","sources":["../../src/items/ApiPropertyItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,8DAA0G;AAC1G,qEAA8F;AAC9F,yDAA4E;AAE5E,iEAAwF;AAkBxF;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,IAAA,2BAAY,EAAC,IAAA,uCAAkB,EAAC,IAAA,mCAAgB,EAAC,iCAAe,CAAC,CAAC,CAAC;IAMtG,YAAmB,OAAgC;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC/E,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAAyC,EACzC,OAA4B,EAC5B,UAAgC;QAEhC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,OAAO,CAAC,sBAAsB,GAAG,UAAU,CAAC,sBAAsB,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,IAAW,eAAe;QACxB,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC;SAC3D;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAyC;QAC5D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAEhC,UAAU,CAAC,sBAAsB,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;IAC1E,CAAC;CACF;AA9CD,0CA8CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { Excerpt, IExcerptTokenRange } from '../mixins/Excerpt';\r\nimport { IApiDeclaredItemOptions, ApiDeclaredItem, IApiDeclaredItemJson } from '../items/ApiDeclaredItem';\r\nimport { ApiReleaseTagMixin, IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\r\nimport { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\nimport { ApiOptionalMixin, IApiOptionalMixinOptions } from '../mixins/ApiOptionalMixin';\r\n\r\n/**\r\n * Constructor options for {@link ApiPropertyItem}.\r\n * @public\r\n */\r\nexport interface IApiPropertyItemOptions\r\n extends IApiNameMixinOptions,\r\n IApiReleaseTagMixinOptions,\r\n IApiOptionalMixinOptions,\r\n IApiDeclaredItemOptions {\r\n propertyTypeTokenRange: IExcerptTokenRange;\r\n}\r\n\r\nexport interface IApiPropertyItemJson extends IApiDeclaredItemJson {\r\n propertyTypeTokenRange: IExcerptTokenRange;\r\n}\r\n\r\n/**\r\n * The abstract base class for {@link ApiProperty} and {@link ApiPropertySignature}.\r\n *\r\n * @public\r\n */\r\nexport class ApiPropertyItem extends ApiNameMixin(ApiReleaseTagMixin(ApiOptionalMixin(ApiDeclaredItem))) {\r\n /**\r\n * An {@link Excerpt} that describes the type of the property.\r\n */\r\n public readonly propertyTypeExcerpt: Excerpt;\r\n\r\n public constructor(options: IApiPropertyItemOptions) {\r\n super(options);\r\n\r\n this.propertyTypeExcerpt = this.buildExcerpt(options.propertyTypeTokenRange);\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiPropertyItemOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiPropertyItemJson\r\n ): void {\r\n super.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.propertyTypeTokenRange = jsonObject.propertyTypeTokenRange;\r\n }\r\n\r\n /**\r\n * Returns true if this property should be documented as an event.\r\n *\r\n * @remarks\r\n * The `@eventProperty` TSDoc modifier can be added to readonly properties to indicate that they return an\r\n * event object that event handlers can be attached to. The event-handling API is implementation-defined, but\r\n * typically the return type would be a class with members such as `addHandler()` and `removeHandler()`.\r\n * The documentation should display such properties under an \"Events\" heading instead of the\r\n * usual \"Properties\" heading.\r\n */\r\n public get isEventProperty(): boolean {\r\n if (this.tsdocComment) {\r\n return this.tsdocComment.modifierTagSet.isEventProperty();\r\n }\r\n return false;\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiPropertyItemJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.propertyTypeTokenRange = this.propertyTypeExcerpt.tokenRange;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiItemContainerMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiItemContainerMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAE5D,8CAO0B;AAC1B,iDAA8C;AAE9C,oEAA6E;AAc7E,MAAM,QAAQ,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AACzE,MAAM,cAAc,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC;AACrF,MAAM,sBAAsB,GAAkB,MAAM,CAAC,8CAA8C,CAAC,CAAC;AACrG,MAAM,cAAc,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC;AACrF,MAAM,cAAc,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC;AA0DrF;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,SAAqB;AACrB,8DAA8D;;IAE9D,MAAe,UAAW,SAAQ,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UAA0C;YAC7D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,MAAM,aAAa,GAAmB,EAAE,CAAC;YAEzC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;gBACjC,MAAM,gBAAgB,GAA0B,EAAE,CAAC;gBACnD,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;gBACvC,aAAa,CAAC,IAAI,CAAC,gBAAgC,CAAC,CAAC;aACtD;YAED,UAAU,CAAC,OAAO,GAAG,aAAa,CAAC;QACrC,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAzJD,sDAyJC;AAED;;;GAGG;AACH,WAAiB,qBAAqB;IACpC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAFe,mCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAarC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport {\r\n ApiItem,\r\n apiItem_onParentChanged,\r\n IApiItemJson,\r\n IApiItemOptions,\r\n IApiItemConstructor,\r\n ApiItemKind\r\n} from '../items/ApiItem';\r\nimport { ApiNameMixin } from './ApiNameMixin';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\nimport { InternalError, LegacyAdapters } from '@rushstack/node-core-library';\r\n\r\n/**\r\n * Constructor options for {@link (ApiItemContainerMixin:interface)}.\r\n * @public\r\n */\r\nexport interface IApiItemContainerMixinOptions extends IApiItemOptions {\r\n members?: ApiItem[];\r\n}\r\n\r\nexport interface IApiItemContainerJson extends IApiItemJson {\r\n members: IApiItemJson[];\r\n}\r\n\r\nconst _members: unique symbol = Symbol('ApiItemContainerMixin._members');\r\nconst _membersSorted: unique symbol = Symbol('ApiItemContainerMixin._membersSorted');\r\nconst _membersByContainerKey: unique symbol = Symbol('ApiItemContainerMixin._membersByContainerKey');\r\nconst _membersByName: unique symbol = Symbol('ApiItemContainerMixin._membersByName');\r\nconst _membersByKind: unique symbol = Symbol('ApiItemContainerMixin._membersByKind');\r\n\r\n/**\r\n * The mixin base class for API items that act as containers for other child items.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * Examples of `ApiItemContainerMixin` child classes include `ApiModel`, `ApiPackage`, `ApiEntryPoint`,\r\n * and `ApiEnum`. But note that `Parameter` is not considered a \"member\" of an `ApiMethod`; this relationship\r\n * is modeled using {@link (ApiParameterListMixin:interface).parameters} instead\r\n * of {@link ApiItem.members}.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiItemContainerMixin extends ApiItem {\r\n /**\r\n * Adds a new member to the container.\r\n *\r\n * @remarks\r\n * An ApiItem cannot be added to more than one container.\r\n */\r\n addMember(member: ApiItem): void;\r\n\r\n /**\r\n * Attempts to retrieve a member using its containerKey, or returns `undefined` if no matching member was found.\r\n *\r\n * @remarks\r\n * Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation\r\n * of this function, according to the aspects that are important for identifying it.\r\n *\r\n * See {@link ApiItem.containerKey} for more information.\r\n */\r\n tryGetMemberByKey(containerKey: string): ApiItem | undefined;\r\n\r\n /**\r\n * Returns a list of members with the specified name.\r\n */\r\n findMembersByName(name: string): ReadonlyArray<ApiItem>;\r\n\r\n /**\r\n * For a given member of this container, return its `ApiItem.getMergedSiblings()` list.\r\n * @internal\r\n */\r\n _getMergedSiblingsForMember(memberApiItem: ApiItem): ReadonlyArray<ApiItem>;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link ApiDeclaredItem}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiItemContainerMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiItemContainerMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiItemContainerMixin) {\r\n abstract class MixedClass extends baseClass implements ApiItemContainerMixin {\r\n public readonly [_members]: ApiItem[];\r\n public [_membersSorted]: boolean;\r\n public [_membersByContainerKey]: Map<string, ApiItem>;\r\n\r\n // For members of this container that extend ApiNameMixin, this stores the list of members with a given name.\r\n // Examples include merged declarations, overloaded functions, etc.\r\n public [_membersByName]: Map<string, ApiItem[]> | undefined;\r\n\r\n // For members of this container that do NOT extend ApiNameMixin, this stores the list of members\r\n // that share a common ApiItemKind. Examples include overloaded constructors or index signatures.\r\n public [_membersByKind]: Map<string, ApiItem[]> | undefined; // key is ApiItemKind\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n const options: IApiItemContainerMixinOptions = args[0] as IApiItemContainerMixinOptions;\r\n\r\n this[_members] = [];\r\n this[_membersByContainerKey] = new Map<string, ApiItem>();\r\n\r\n if (options.members) {\r\n for (const member of options.members) {\r\n this.addMember(member);\r\n }\r\n }\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiItemContainerMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiItemContainerJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.members = [];\r\n for (const memberObject of jsonObject.members) {\r\n options.members.push(ApiItem.deserialize(memberObject, context));\r\n }\r\n }\r\n\r\n /** @override */\r\n public get members(): ReadonlyArray<ApiItem> {\r\n if (!this[_membersSorted]) {\r\n LegacyAdapters.sortStable(this[_members], (x, y) => x.getSortKey().localeCompare(y.getSortKey()));\r\n this[_membersSorted] = true;\r\n }\r\n\r\n return this[_members];\r\n }\r\n\r\n public addMember(member: ApiItem): void {\r\n if (this[_membersByContainerKey].has(member.containerKey)) {\r\n throw new Error(\r\n `Another member has already been added with the same name (${member.displayName})` +\r\n ` and containerKey (${member.containerKey})`\r\n );\r\n }\r\n\r\n const existingParent: ApiItem | undefined = member.parent;\r\n if (existingParent !== undefined) {\r\n throw new Error(\r\n `This item has already been added to another container: \"${existingParent.displayName}\"`\r\n );\r\n }\r\n\r\n this[_members].push(member);\r\n this[_membersByName] = undefined; // invalidate the lookup\r\n this[_membersByKind] = undefined; // invalidate the lookup\r\n this[_membersSorted] = false;\r\n this[_membersByContainerKey].set(member.containerKey, member);\r\n\r\n member[apiItem_onParentChanged](this);\r\n }\r\n\r\n public tryGetMemberByKey(containerKey: string): ApiItem | undefined {\r\n return this[_membersByContainerKey].get(containerKey);\r\n }\r\n\r\n public findMembersByName(name: string): ReadonlyArray<ApiItem> {\r\n this._ensureMemberMaps();\r\n return this[_membersByName]!.get(name) || [];\r\n }\r\n\r\n /** @internal */\r\n public _getMergedSiblingsForMember(memberApiItem: ApiItem): ReadonlyArray<ApiItem> {\r\n this._ensureMemberMaps();\r\n let result: ApiItem[] | undefined;\r\n if (ApiNameMixin.isBaseClassOf(memberApiItem)) {\r\n result = this[_membersByName]!.get(memberApiItem.name);\r\n } else {\r\n result = this[_membersByKind]!.get(memberApiItem.kind);\r\n }\r\n if (!result) {\r\n throw new InternalError('Item was not found in the _membersByName/_membersByKind lookup');\r\n }\r\n return result;\r\n }\r\n\r\n /** @internal */\r\n public _ensureMemberMaps(): void {\r\n // Build the _membersByName and _membersByKind tables if they don't already exist\r\n if (this[_membersByName] === undefined) {\r\n const membersByName: Map<string, ApiItem[]> = new Map<string, ApiItem[]>();\r\n const membersByKind: Map<string, ApiItem[]> = new Map<string, ApiItem[]>();\r\n\r\n for (const member of this[_members]) {\r\n let map: Map<string, ApiItem[]> | Map<ApiItemKind, ApiItem[]>;\r\n let key: string | ApiItemKind;\r\n\r\n if (ApiNameMixin.isBaseClassOf(member)) {\r\n map = membersByName;\r\n key = member.name;\r\n } else {\r\n map = membersByKind;\r\n key = member.kind;\r\n }\r\n\r\n let list: ApiItem[] | undefined = map.get(key);\r\n if (list === undefined) {\r\n list = [];\r\n map.set(key, list);\r\n }\r\n list.push(member);\r\n }\r\n\r\n this[_membersByName] = membersByName;\r\n this[_membersByKind] = membersByKind;\r\n }\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiItemContainerJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n const memberObjects: IApiItemJson[] = [];\r\n\r\n for (const member of this.members) {\r\n const memberJsonObject: Partial<IApiItemJson> = {};\r\n member.serializeInto(memberJsonObject);\r\n memberObjects.push(memberJsonObject as IApiItemJson);\r\n }\r\n\r\n jsonObject.members = memberObjects;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiItemContainerMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiItemContainerMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiItemContainerMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiItemContainerMixin {\r\n return apiItem.hasOwnProperty(_members);\r\n }\r\n}\r\n"]}
|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Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport {\r\n ApiItem,\r\n apiItem_onParentChanged,\r\n IApiItemJson,\r\n IApiItemOptions,\r\n IApiItemConstructor,\r\n ApiItemKind\r\n} from '../items/ApiItem';\r\nimport { ApiNameMixin } from './ApiNameMixin';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\nimport { InternalError, LegacyAdapters } from '@rushstack/node-core-library';\r\n\r\n/**\r\n * Constructor options for {@link (ApiItemContainerMixin:interface)}.\r\n * @public\r\n */\r\nexport interface IApiItemContainerMixinOptions extends IApiItemOptions {\r\n members?: ApiItem[];\r\n}\r\n\r\nexport interface IApiItemContainerJson extends IApiItemJson {\r\n members: IApiItemJson[];\r\n}\r\n\r\nconst _members: unique symbol = Symbol('ApiItemContainerMixin._members');\r\nconst _membersSorted: unique symbol = Symbol('ApiItemContainerMixin._membersSorted');\r\nconst _membersByContainerKey: unique symbol = Symbol('ApiItemContainerMixin._membersByContainerKey');\r\nconst _membersByName: unique symbol = Symbol('ApiItemContainerMixin._membersByName');\r\nconst _membersByKind: unique symbol = Symbol('ApiItemContainerMixin._membersByKind');\r\n\r\n/**\r\n * The mixin base class for API items that act as containers for other child items.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * Examples of `ApiItemContainerMixin` child classes include `ApiModel`, `ApiPackage`, `ApiEntryPoint`,\r\n * and `ApiEnum`. But note that `Parameter` is not considered a \"member\" of an `ApiMethod`; this relationship\r\n * is modeled using {@link (ApiParameterListMixin:interface).parameters} instead\r\n * of {@link ApiItem.members}.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiItemContainerMixin extends ApiItem {\r\n /**\r\n * Adds a new member to the container.\r\n *\r\n * @remarks\r\n * An ApiItem cannot be added to more than one container.\r\n */\r\n addMember(member: ApiItem): void;\r\n\r\n /**\r\n * Attempts to retrieve a member using its containerKey, or returns `undefined` if no matching member was found.\r\n *\r\n * @remarks\r\n * Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation\r\n * of this function, according to the aspects that are important for identifying it.\r\n *\r\n * See {@link ApiItem.containerKey} for more information.\r\n */\r\n tryGetMemberByKey(containerKey: string): ApiItem | undefined;\r\n\r\n /**\r\n * Returns a list of members with the specified name.\r\n */\r\n findMembersByName(name: string): ReadonlyArray<ApiItem>;\r\n\r\n /**\r\n * For a given member of this container, return its `ApiItem.getMergedSiblings()` list.\r\n * @internal\r\n */\r\n _getMergedSiblingsForMember(memberApiItem: ApiItem): ReadonlyArray<ApiItem>;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link ApiDeclaredItem}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiItemContainerMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiItemContainerMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiItemContainerMixin) {\r\n class MixedClass extends baseClass implements ApiItemContainerMixin {\r\n public readonly [_members]: ApiItem[];\r\n public [_membersSorted]: boolean;\r\n public [_membersByContainerKey]: Map<string, ApiItem>;\r\n\r\n // For members of this container that extend ApiNameMixin, this stores the list of members with a given name.\r\n // Examples include merged declarations, overloaded functions, etc.\r\n public [_membersByName]: Map<string, ApiItem[]> | undefined;\r\n\r\n // For members of this container that do NOT extend ApiNameMixin, this stores the list of members\r\n // that share a common ApiItemKind. Examples include overloaded constructors or index signatures.\r\n public [_membersByKind]: Map<string, ApiItem[]> | undefined; // key is ApiItemKind\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n const options: IApiItemContainerMixinOptions = args[0] as IApiItemContainerMixinOptions;\r\n\r\n this[_members] = [];\r\n this[_membersByContainerKey] = new Map<string, ApiItem>();\r\n\r\n if (options.members) {\r\n for (const member of options.members) {\r\n this.addMember(member);\r\n }\r\n }\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiItemContainerMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiItemContainerJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.members = [];\r\n for (const memberObject of jsonObject.members) {\r\n options.members.push(ApiItem.deserialize(memberObject, context));\r\n }\r\n }\r\n\r\n /** @override */\r\n public get members(): ReadonlyArray<ApiItem> {\r\n if (!this[_membersSorted]) {\r\n LegacyAdapters.sortStable(this[_members], (x, y) => x.getSortKey().localeCompare(y.getSortKey()));\r\n this[_membersSorted] = true;\r\n }\r\n\r\n return this[_members];\r\n }\r\n\r\n public addMember(member: ApiItem): void {\r\n if (this[_membersByContainerKey].has(member.containerKey)) {\r\n throw new Error(\r\n `Another member has already been added with the same name (${member.displayName})` +\r\n ` and containerKey (${member.containerKey})`\r\n );\r\n }\r\n\r\n const existingParent: ApiItem | undefined = member.parent;\r\n if (existingParent !== undefined) {\r\n throw new Error(\r\n `This item has already been added to another container: \"${existingParent.displayName}\"`\r\n );\r\n }\r\n\r\n this[_members].push(member);\r\n this[_membersByName] = undefined; // invalidate the lookup\r\n this[_membersByKind] = undefined; // invalidate the lookup\r\n this[_membersSorted] = false;\r\n this[_membersByContainerKey].set(member.containerKey, member);\r\n\r\n member[apiItem_onParentChanged](this);\r\n }\r\n\r\n public tryGetMemberByKey(containerKey: string): ApiItem | undefined {\r\n return this[_membersByContainerKey].get(containerKey);\r\n }\r\n\r\n public findMembersByName(name: string): ReadonlyArray<ApiItem> {\r\n this._ensureMemberMaps();\r\n return this[_membersByName]!.get(name) || [];\r\n }\r\n\r\n /** @internal */\r\n public _getMergedSiblingsForMember(memberApiItem: ApiItem): ReadonlyArray<ApiItem> {\r\n this._ensureMemberMaps();\r\n let result: ApiItem[] | undefined;\r\n if (ApiNameMixin.isBaseClassOf(memberApiItem)) {\r\n result = this[_membersByName]!.get(memberApiItem.name);\r\n } else {\r\n result = this[_membersByKind]!.get(memberApiItem.kind);\r\n }\r\n if (!result) {\r\n throw new InternalError('Item was not found in the _membersByName/_membersByKind lookup');\r\n }\r\n return result;\r\n }\r\n\r\n /** @internal */\r\n public _ensureMemberMaps(): void {\r\n // Build the _membersByName and _membersByKind tables if they don't already exist\r\n if (this[_membersByName] === undefined) {\r\n const membersByName: Map<string, ApiItem[]> = new Map<string, ApiItem[]>();\r\n const membersByKind: Map<string, ApiItem[]> = new Map<string, ApiItem[]>();\r\n\r\n for (const member of this[_members]) {\r\n let map: Map<string, ApiItem[]> | Map<ApiItemKind, ApiItem[]>;\r\n let key: string | ApiItemKind;\r\n\r\n if (ApiNameMixin.isBaseClassOf(member)) {\r\n map = membersByName;\r\n key = member.name;\r\n } else {\r\n map = membersByKind;\r\n key = member.kind;\r\n }\r\n\r\n let list: ApiItem[] | undefined = map.get(key);\r\n if (list === undefined) {\r\n list = [];\r\n map.set(key, list);\r\n }\r\n list.push(member);\r\n }\r\n\r\n this[_membersByName] = membersByName;\r\n this[_membersByKind] = membersByKind;\r\n }\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiItemContainerJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n const memberObjects: IApiItemJson[] = [];\r\n\r\n for (const member of this.members) {\r\n const memberJsonObject: Partial<IApiItemJson> = {};\r\n member.serializeInto(memberJsonObject);\r\n memberObjects.push(memberJsonObject as IApiItemJson);\r\n }\r\n\r\n jsonObject.members = memberObjects;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiItemContainerMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiItemContainerMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiItemContainerMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiItemContainerMixin {\r\n return apiItem.hasOwnProperty(_members);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiNameMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiNameMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,KAAK,GAAkB,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAgC1D;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,SAAqB;AACrB,8DAA8D;;IAE9D,
|
|
1
|
+
{"version":3,"file":"ApiNameMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiNameMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,KAAK,GAAkB,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAgC1D;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,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,GAAyB,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;QAC7B,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAAsC,EACtC,OAA4B,EAC5B,UAA6B;YAE7B,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QACjC,CAAC;QAED,IAAW,IAAI;YACb,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,gBAAgB;QAChB,IAAW,WAAW;YACpB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAAsC;YACzD,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AA5CD,oCA4CC;AAED;;;GAGG;AACH,WAAiB,YAAY;IAC3B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAFe,0BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAa5B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link (IApiNameMixinOptions:interface)}.\r\n * @public\r\n */\r\nexport interface IApiNameMixinOptions extends IApiItemOptions {\r\n name: string;\r\n}\r\n\r\nexport interface IApiNameMixinJson extends IApiItemJson {\r\n name: string;\r\n}\r\n\r\nconst _name: unique symbol = Symbol('ApiNameMixin._name');\r\n\r\n/**\r\n * The mixin base class for API items that have a name. For example, a class has a name, but a class constructor\r\n * does not.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiNameMixin extends ApiItem {\r\n /**\r\n * The exported name of this API item.\r\n *\r\n * @remarks\r\n * Note that due tue type aliasing, the exported name may be different from the locally declared name.\r\n */\r\n readonly name: string;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiNameMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiNameMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiNameMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiNameMixin) {\r\n class MixedClass extends baseClass implements ApiNameMixin {\r\n public readonly [_name]: string;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiNameMixinOptions = args[0];\r\n this[_name] = options.name;\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiNameMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiNameMixinJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.name = jsonObject.name;\r\n }\r\n\r\n public get name(): string {\r\n return this[_name];\r\n }\r\n\r\n /** @override */\r\n public get displayName(): string {\r\n return this[_name];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiNameMixinJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.name = this.name;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiNameMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiNameMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiNameMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiNameMixin {\r\n return apiItem.hasOwnProperty(_name);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiOptionalMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiOptionalMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,WAAW,GAAkB,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAqC1E;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAC9B,SAAqB;AACrB,8DAA8D;;IAE9D,
|
|
1
|
+
{"version":3,"file":"ApiOptionalMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiOptionalMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,WAAW,GAAkB,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAqC1E;;;;;;;GAOG;AACH,SAAgB,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,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QAC3C,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,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QAC/C,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;AAvCD,4CAuCC;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,GAAhB,wBAAgB,KAAhB,wBAAgB,QAahC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link (IApiOptionalMixinOptions:interface)}.\r\n * @public\r\n */\r\nexport interface IApiOptionalMixinOptions extends IApiItemOptions {\r\n isOptional: boolean;\r\n}\r\n\r\nexport interface IApiOptionalMixinJson extends IApiItemJson {\r\n isOptional: boolean;\r\n}\r\n\r\nconst _isOptional: unique symbol = Symbol('ApiOptionalMixin._isOptional');\r\n\r\n/**\r\n * The mixin base class for API items that can be marked as optional by appending a `?` to them.\r\n * For example, a property of an interface can be optional.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiOptionalMixin extends ApiItem {\r\n /**\r\n * True if this is an optional property.\r\n * @remarks\r\n * For example:\r\n * ```ts\r\n * interface X {\r\n * y: string; // not optional\r\n * z?: string; // optional\r\n * }\r\n * ```\r\n */\r\n readonly isOptional: boolean;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiOptionalMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiOptionalMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiOptionalMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiOptionalMixin) {\r\n class MixedClass extends baseClass implements ApiOptionalMixin {\r\n public [_isOptional]: boolean;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiOptionalMixinOptions = args[0];\r\n this[_isOptional] = !!options.isOptional;\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiOptionalMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiOptionalMixinJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.isOptional = !!jsonObject.isOptional;\r\n }\r\n\r\n public get isOptional(): boolean {\r\n return this[_isOptional];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiOptionalMixinJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.isOptional = this.isOptional;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Optional members for {@link (ApiOptionalMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiOptionalMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiOptionalMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiOptionalMixin {\r\n return apiItem.hasOwnProperty(_isOptional);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiParameterListMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiParameterListMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAG5D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,CAAC;IAFe,mCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAarC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { Parameter } from '../model/Parameter';\r\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\r\nimport { IExcerptTokenRange } from './Excerpt';\r\nimport { InternalError } from '@rushstack/node-core-library';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Represents parameter information that is part of {@link IApiParameterListMixinOptions}\r\n * @public\r\n */\r\nexport interface IApiParameterOptions {\r\n parameterName: string;\r\n parameterTypeTokenRange: IExcerptTokenRange;\r\n}\r\n\r\n/**\r\n * Constructor options for {@link (ApiParameterListMixin:interface)}.\r\n * @public\r\n */\r\nexport interface IApiParameterListMixinOptions extends IApiItemOptions {\r\n overloadIndex: number;\r\n parameters: IApiParameterOptions[];\r\n}\r\n\r\nexport interface IApiParameterListJson extends IApiItemJson {\r\n overloadIndex: number;\r\n parameters: IApiParameterOptions[];\r\n}\r\n\r\nconst _overloadIndex: unique symbol = Symbol('ApiParameterListMixin._overloadIndex');\r\nconst _parameters: unique symbol = Symbol('ApiParameterListMixin._parameters');\r\n\r\n/**\r\n * The mixin base class for API items that can have function parameters (but not necessarily a return value).\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiParameterListMixin extends ApiItem {\r\n /**\r\n * When a function has multiple overloaded declarations, this zero-based integer index can be used to unqiuely\r\n * identify them.\r\n *\r\n * @remarks\r\n *\r\n * Consider this overloaded declaration:\r\n *\r\n * ```ts\r\n * export namespace Versioning {\r\n * // TSDoc: Versioning.(addVersions:1)\r\n * export function addVersions(x: number, y: number): number;\r\n *\r\n * // TSDoc: Versioning.(addVersions:2)\r\n * export function addVersions(x: string, y: string): string;\r\n *\r\n * // (implementation)\r\n * export function addVersions(x: number|string, y: number|string): number|string {\r\n * // . . .\r\n * }\r\n * }\r\n * ```\r\n *\r\n * In the above example, there are two overloaded declarations. The overload using numbers will have\r\n * `overloadIndex = 1`. The overload using strings will have `overloadIndex = 2`. The third declaration that\r\n * accepts all possible inputs is considered part of the implementation, and is not processed by API Extractor.\r\n */\r\n readonly overloadIndex: number;\r\n\r\n /**\r\n * The function parameters.\r\n */\r\n readonly parameters: ReadonlyArray<Parameter>;\r\n\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiParameterListMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiParameterListMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiParameterListMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiParameterListMixin) {\r\n class MixedClass extends baseClass implements ApiParameterListMixin {\r\n public readonly [_overloadIndex]: number;\r\n public readonly [_parameters]: Parameter[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiParameterListMixinOptions = args[0];\r\n this[_overloadIndex] = options.overloadIndex;\r\n\r\n this[_parameters] = [];\r\n\r\n if (this instanceof ApiDeclaredItem) {\r\n if (options.parameters) {\r\n for (const parameterOptions of options.parameters) {\r\n const parameter: Parameter = new Parameter({\r\n name: parameterOptions.parameterName,\r\n parameterTypeExcerpt: this.buildExcerpt(parameterOptions.parameterTypeTokenRange),\r\n parent: this\r\n });\r\n\r\n this[_parameters].push(parameter);\r\n }\r\n }\r\n } else {\r\n throw new InternalError('ApiReturnTypeMixin expects a base class that inherits from ApiDeclaredItem');\r\n }\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiParameterListMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiParameterListJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.overloadIndex = jsonObject.overloadIndex;\r\n options.parameters = jsonObject.parameters || [];\r\n }\r\n\r\n public get overloadIndex(): number {\r\n return this[_overloadIndex];\r\n }\r\n\r\n public get parameters(): ReadonlyArray<Parameter> {\r\n return this[_parameters];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiParameterListJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.overloadIndex = this.overloadIndex;\r\n\r\n const parameterObjects: IApiParameterOptions[] = [];\r\n for (const parameter of this.parameters) {\r\n parameterObjects.push({\r\n parameterName: parameter.name,\r\n parameterTypeTokenRange: parameter.parameterTypeExcerpt.tokenRange\r\n });\r\n }\r\n\r\n jsonObject.parameters = parameterObjects;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiParameterListMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiParameterListMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiParameterListMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiParameterListMixin {\r\n return apiItem.hasOwnProperty(_parameters);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReleaseTagMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReleaseTagMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAE5D,oEAAoD;AAGpD,oDAAiD;AAejD,MAAM,WAAW,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAiC5E;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAChC,SAAqB;AACrB,8DAA8D;;IAE9D,
|
|
1
|
+
{"version":3,"file":"ApiReleaseTagMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReleaseTagMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAE5D,oEAAoD;AAGpD,oDAAiD;AAejD,MAAM,WAAW,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAiC5E;;;;;;;GAOG;AACH,SAAgB,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,wBAAI,CAAC,gBAAgB,CAC1E,uBAAiB,EAAE,sBAAsB;YACzC,UAAU,CAAC,UAAU,CACtB,CAAC;YACF,IAAI,sBAAsB,KAAK,SAAS,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;aAC/F;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,uBAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtD,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AA/CD,gDA+CC;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,GAAlB,0BAAkB,KAAlB,0BAAkB,QAalC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { Enum } from '@rushstack/node-core-library';\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { ReleaseTag } from '../aedoc/ReleaseTag';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link (ApiReleaseTagMixin:interface)}.\r\n * @public\r\n */\r\nexport interface IApiReleaseTagMixinOptions extends IApiItemOptions {\r\n releaseTag: ReleaseTag;\r\n}\r\n\r\nexport interface IApiReleaseTagMixinJson extends IApiItemJson {\r\n releaseTag: string;\r\n}\r\n\r\nconst _releaseTag: unique symbol = Symbol('ApiReleaseTagMixin._releaseTag');\r\n\r\n/**\r\n * The mixin base class for API items that can be attributed with a TSDoc tag such as `@internal`,\r\n * `@alpha`, `@beta`, or `@public`. These \"release tags\" indicate the support level for an API.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiReleaseTagMixin extends ApiItem {\r\n /**\r\n * The effective release tag for this declaration. If it is not explicitly specified, the value may be\r\n * inherited from a containing declaration.\r\n *\r\n * @remarks\r\n * For example, an `ApiEnumMember` may inherit its release tag from the containing `ApiEnum`.\r\n */\r\n readonly releaseTag: ReleaseTag;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiReleaseTagMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiReleaseTagMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiReleaseTagMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiReleaseTagMixin) {\r\n class MixedClass extends baseClass implements ApiReleaseTagMixin {\r\n public [_releaseTag]: ReleaseTag;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiReleaseTagMixinOptions = args[0];\r\n this[_releaseTag] = options.releaseTag;\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiReleaseTagMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiReleaseTagMixinJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n const deserializedReleaseTag: ReleaseTag | undefined = Enum.tryGetValueByKey<ReleaseTag>(\r\n ReleaseTag as any, // eslint-disable-line\r\n jsonObject.releaseTag\r\n );\r\n if (deserializedReleaseTag === undefined) {\r\n throw new Error(`Failed to deserialize release tag ${JSON.stringify(jsonObject.releaseTag)}`);\r\n }\r\n\r\n options.releaseTag = deserializedReleaseTag;\r\n }\r\n\r\n public get releaseTag(): ReleaseTag {\r\n return this[_releaseTag];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiReleaseTagMixinJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.releaseTag = ReleaseTag[this.releaseTag];\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiReleaseTagMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiReleaseTagMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReleaseTagMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiReleaseTagMixin {\r\n return apiItem.hasOwnProperty(_releaseTag);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReturnTypeMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReturnTypeMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAI5D,8DAA2D;AAC3D,oEAA6D;AAe7D,MAAM,kBAAkB,GAAkB,MAAM,CAAC,uCAAuC,CAAC,CAAC;AA4B1F;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAChC,SAAqB;AACrB,8DAA8D;;IAE9D,
|
|
1
|
+
{"version":3,"file":"ApiReturnTypeMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReturnTypeMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAI5D,8DAA2D;AAC3D,oEAA6D;AAe7D,MAAM,kBAAkB,GAAkB,MAAM,CAAC,uCAAuC,CAAC,CAAC;AA4B1F;;;;;;;GAOG;AACH,SAAgB,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,iCAAe,EAAE;gBACnC,IAAI,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;aAC5E;iBAAM;gBACL,MAAM,IAAI,iCAAa,CAAC,4EAA4E,CAAC,CAAC;aACvG;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;AA5CD,gDA4CC;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,GAAlB,0BAAkB,KAAlB,0BAAkB,QAalC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { IExcerptTokenRange, Excerpt } from './Excerpt';\r\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\r\nimport { InternalError } from '@rushstack/node-core-library';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link (ApiReturnTypeMixin:interface)}.\r\n * @public\r\n */\r\nexport interface IApiReturnTypeMixinOptions extends IApiItemOptions {\r\n returnTypeTokenRange: IExcerptTokenRange;\r\n}\r\n\r\nexport interface IApiReturnTypeMixinJson extends IApiItemJson {\r\n returnTypeTokenRange: IExcerptTokenRange;\r\n}\r\n\r\nconst _returnTypeExcerpt: unique symbol = Symbol('ApiReturnTypeMixin._returnTypeExcerpt');\r\n\r\n/**\r\n * The mixin base class for API items that are functions that return a value.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiReturnTypeMixin extends ApiItem {\r\n /**\r\n * An {@link Excerpt} that describes the type of the function's return value.\r\n */\r\n readonly returnTypeExcerpt: Excerpt;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiReturnTypeMixinJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiReturnTypeMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiReturnTypeMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiReturnTypeMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiReturnTypeMixin) {\r\n class MixedClass extends baseClass implements ApiReturnTypeMixin {\r\n public [_returnTypeExcerpt]: Excerpt;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiReturnTypeMixinOptions = args[0];\r\n\r\n if (this instanceof ApiDeclaredItem) {\r\n this[_returnTypeExcerpt] = this.buildExcerpt(options.returnTypeTokenRange);\r\n } else {\r\n throw new InternalError('ApiReturnTypeMixin expects a base class that inherits from ApiDeclaredItem');\r\n }\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiReturnTypeMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiReturnTypeMixinJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.returnTypeTokenRange = jsonObject.returnTypeTokenRange;\r\n }\r\n\r\n public get returnTypeExcerpt(): Excerpt {\r\n return this[_returnTypeExcerpt];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiReturnTypeMixinJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.returnTypeTokenRange = this.returnTypeExcerpt.tokenRange;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiReturnTypeMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiReturnTypeMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReturnTypeMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiReturnTypeMixin {\r\n return apiItem.hasOwnProperty(_returnTypeExcerpt);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiStaticMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiStaticMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,SAAS,GAAkB,MAAM,CAAC,0BAA0B,CAAC,CAAC;AA4BpE;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,SAAqB;AACrB,8DAA8D;;IAE9D,
|
|
1
|
+
{"version":3,"file":"ApiStaticMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiStaticMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,SAAS,GAAkB,MAAM,CAAC,0BAA0B,CAAC,CAAC;AA4BpE;;;;;;;GAOG;AACH,SAAgB,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;AAvCD,wCAuCC;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,GAAd,sBAAc,KAAd,sBAAc,QAa9B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link (IApiStaticMixinOptions:interface)}.\r\n * @public\r\n */\r\nexport interface IApiStaticMixinOptions extends IApiItemOptions {\r\n isStatic: boolean;\r\n}\r\n\r\nexport interface IApiStaticMixinJson extends IApiItemJson {\r\n isStatic: boolean;\r\n}\r\n\r\nconst _isStatic: unique symbol = Symbol('ApiStaticMixin._isStatic');\r\n\r\n/**\r\n * The mixin base class for API items that can have the TypeScript `static` keyword applied to them.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiStaticMixin extends ApiItem {\r\n /**\r\n * Whether the declaration has the TypeScript `static` keyword.\r\n */\r\n readonly isStatic: boolean;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiStaticMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiStaticMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiStaticMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiStaticMixin) {\r\n class MixedClass extends baseClass implements ApiStaticMixin {\r\n public [_isStatic]: boolean;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiStaticMixinOptions = args[0];\r\n this[_isStatic] = options.isStatic;\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiStaticMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiStaticMixinJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.isStatic = jsonObject.isStatic;\r\n }\r\n\r\n public get isStatic(): boolean {\r\n return this[_isStatic];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiStaticMixinJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.isStatic = this.isStatic;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiStaticMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiStaticMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiStaticMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiStaticMixin {\r\n return apiItem.hasOwnProperty(_isStatic);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiTypeParameterListMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiTypeParameterListMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAI5D,0DAAuD;AACvD,oEAA6D;AAC7D,8DAA2D;AAyB3D,MAAM,eAAe,GAAkB,MAAM,CAAC,2CAA2C,CAAC,CAAC;AA2B3F;;;;;;;;GAQG;AACH,SAAgB,yBAAyB,CACvC,SAAqB;AACrB,8DAA8D;;IAE9D,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AAO,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;gBAC/C,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;aACJ;YAED,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACnC,UAAU,CAAC,cAAc,GAAG,oBAAoB,CAAC;aAClD;QACH,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAtED,8DAsEC;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,GAAzB,iCAAyB,KAAzB,iCAAyB,QAazC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { IExcerptTokenRange } from './Excerpt';\r\nimport { TypeParameter } from '../model/TypeParameter';\r\nimport { InternalError } from '@rushstack/node-core-library';\r\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Represents parameter information that is part of {@link IApiTypeParameterListMixinOptions}\r\n * @public\r\n */\r\nexport interface IApiTypeParameterOptions {\r\n typeParameterName: string;\r\n constraintTokenRange: IExcerptTokenRange;\r\n defaultTypeTokenRange: IExcerptTokenRange;\r\n}\r\n\r\n/**\r\n * Constructor options for {@link (ApiTypeParameterListMixin:interface)}.\r\n * @public\r\n */\r\nexport interface IApiTypeParameterListMixinOptions extends IApiItemOptions {\r\n typeParameters: IApiTypeParameterOptions[];\r\n}\r\n\r\nexport interface IApiTypeParameterListMixinJson extends IApiItemJson {\r\n typeParameters: IApiTypeParameterOptions[];\r\n}\r\n\r\nconst _typeParameters: unique symbol = Symbol('ApiTypeParameterListMixin._typeParameters');\r\n\r\n/**\r\n * The mixin base class for API items that can have type parameters.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiTypeParameterListMixin extends ApiItem {\r\n /**\r\n * The type parameters.\r\n */\r\n readonly typeParameters: ReadonlyArray<TypeParameter>;\r\n\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiTypeParameterListMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiTypeParameterListMixin:interface)}\r\n * functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiTypeParameterListMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiTypeParameterListMixin) {\r\n class MixedClass extends baseClass implements ApiTypeParameterListMixin {\r\n public readonly [_typeParameters]: TypeParameter[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiTypeParameterListMixinOptions = args[0];\r\n\r\n this[_typeParameters] = [];\r\n\r\n if (this instanceof ApiDeclaredItem) {\r\n if (options.typeParameters) {\r\n for (const typeParameterOptions of options.typeParameters) {\r\n const typeParameter: TypeParameter = new TypeParameter({\r\n name: typeParameterOptions.typeParameterName,\r\n constraintExcerpt: this.buildExcerpt(typeParameterOptions.constraintTokenRange),\r\n defaultTypeExcerpt: this.buildExcerpt(typeParameterOptions.defaultTypeTokenRange),\r\n parent: this\r\n });\r\n\r\n this[_typeParameters].push(typeParameter);\r\n }\r\n }\r\n } else {\r\n throw new InternalError(\r\n 'ApiTypeParameterListMixin expects a base class that inherits from ApiDeclaredItem'\r\n );\r\n }\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiTypeParameterListMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiTypeParameterListMixinJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.typeParameters = jsonObject.typeParameters || [];\r\n }\r\n\r\n public get typeParameters(): ReadonlyArray<TypeParameter> {\r\n return this[_typeParameters];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiTypeParameterListMixinJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n const typeParameterObjects: IApiTypeParameterOptions[] = [];\r\n for (const typeParameter of this.typeParameters) {\r\n typeParameterObjects.push({\r\n typeParameterName: typeParameter.name,\r\n constraintTokenRange: typeParameter.constraintExcerpt.tokenRange,\r\n defaultTypeTokenRange: typeParameter.defaultTypeExcerpt.tokenRange\r\n });\r\n }\r\n\r\n if (typeParameterObjects.length > 0) {\r\n jsonObject.typeParameters = typeParameterObjects;\r\n }\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiTypeParameterListMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiTypeParameterListMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiParameterListMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiTypeParameterListMixin {\r\n return apiItem.hasOwnProperty(_typeParameters);\r\n }\r\n}\r\n"]}
|
|
@@ -38,7 +38,7 @@ const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin
|
|
|
38
38
|
*
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
class ApiCallSignature extends ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiParameterListMixin_1.ApiParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiReturnTypeMixin_1.ApiReturnTypeMixin(ApiDeclaredItem_1.ApiDeclaredItem)))) {
|
|
41
|
+
class ApiCallSignature extends (0, ApiTypeParameterListMixin_1.ApiTypeParameterListMixin)((0, ApiParameterListMixin_1.ApiParameterListMixin)((0, ApiReleaseTagMixin_1.ApiReleaseTagMixin)((0, ApiReturnTypeMixin_1.ApiReturnTypeMixin)(ApiDeclaredItem_1.ApiDeclaredItem)))) {
|
|
42
42
|
constructor(options) {
|
|
43
43
|
super(options);
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiCallSignature.js","sourceRoot":"","sources":["../../src/model/ApiCallSignature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAIiE;AAEjE,8DAAoF;AACpF,2EAAuG;AACvG,qEAA8F;AAC9F,qEAA8F;AAC9F,mFAG6C;AAa7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAa,gBAAiB,SAAQ,qDAAyB,
|
|
1
|
+
{"version":3,"file":"ApiCallSignature.js","sourceRoot":"","sources":["../../src/model/ApiCallSignature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAIiE;AAEjE,8DAAoF;AACpF,2EAAuG;AACvG,qEAA8F;AAC9F,qEAA8F;AAC9F,mFAG6C;AAa7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAa,gBAAiB,SAAQ,IAAA,qDAAyB,EAC7D,IAAA,6CAAqB,EAAC,IAAA,uCAAkB,EAAC,IAAA,uCAAkB,EAAC,iCAAe,CAAC,CAAC,CAAC,CAC/E;IACC,YAAmB,OAAiC;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,aAAqB;QACjD,OAAO,IAAI,mCAAyB,IAAI,aAAa,EAAE,CAAC;IAC1D,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,2CAAiC;IACnC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9D,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,MAAM,GAAyB,IAAI,CAAC,MAAM;YAC9C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB;YAChC,CAAC,CAAC,iDAAiD;gBACjD,2CAAoB,CAAC,KAAK,EAAE,CAAC,iBAAiB,oBAAqB,UAAU,CAAC,CAAC;QACnF,OAAO,MAAM,CAAC,WAAW,4BAAuB,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACzF,CAAC;CACF;AA7BD,4CA6BC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport {\r\n DeclarationReference,\r\n Meaning,\r\n Navigation\r\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\r\nimport { ApiItemKind } from '../items/ApiItem';\r\nimport { IApiDeclaredItemOptions, ApiDeclaredItem } from '../items/ApiDeclaredItem';\r\nimport { IApiParameterListMixinOptions, ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\r\nimport { IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';\r\nimport { IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';\r\nimport {\r\n IApiTypeParameterListMixinOptions,\r\n ApiTypeParameterListMixin\r\n} from '../mixins/ApiTypeParameterListMixin';\r\n\r\n/**\r\n * Constructor options for {@link ApiCallSignature}.\r\n * @public\r\n */\r\nexport interface IApiCallSignatureOptions\r\n extends IApiTypeParameterListMixinOptions,\r\n IApiParameterListMixinOptions,\r\n IApiReleaseTagMixinOptions,\r\n IApiReturnTypeMixinOptions,\r\n IApiDeclaredItemOptions {}\r\n\r\n/**\r\n * Represents a TypeScript function call signature.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations.\r\n *\r\n * `ApiCallSignature` represents a TypeScript declaration such as `(x: number, y: number): number`\r\n * in this example:\r\n *\r\n * ```ts\r\n * export interface IChooser {\r\n * // A call signature:\r\n * (x: number, y: number): number;\r\n *\r\n * // Another overload for this call signature:\r\n * (x: string, y: string): string;\r\n * }\r\n *\r\n * function chooseFirst<T>(x: T, y: T): T {\r\n * return x;\r\n * }\r\n *\r\n * let chooser: IChooser = chooseFirst;\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ApiCallSignature extends ApiTypeParameterListMixin(\r\n ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiDeclaredItem)))\r\n) {\r\n public constructor(options: IApiCallSignatureOptions) {\r\n super(options);\r\n }\r\n\r\n public static getContainerKey(overloadIndex: number): string {\r\n return `|${ApiItemKind.CallSignature}|${overloadIndex}`;\r\n }\r\n\r\n /** @override */\r\n public get kind(): ApiItemKind {\r\n return ApiItemKind.CallSignature;\r\n }\r\n\r\n /** @override */\r\n public get containerKey(): string {\r\n return ApiCallSignature.getContainerKey(this.overloadIndex);\r\n }\r\n\r\n /** @beta @override */\r\n public buildCanonicalReference(): DeclarationReference {\r\n const parent: DeclarationReference = this.parent\r\n ? this.parent.canonicalReference\r\n : // .withMeaning() requires some kind of component\r\n DeclarationReference.empty().addNavigationStep(Navigation.Members, '(parent)');\r\n return parent.withMeaning(Meaning.CallSignature).withOverloadIndex(this.overloadIndex);\r\n }\r\n}\r\n"]}
|
package/lib/model/ApiClass.js
CHANGED
|
@@ -26,7 +26,7 @@ const ApiTypeParameterListMixin_1 = require("../mixins/ApiTypeParameterListMixin
|
|
|
26
26
|
*
|
|
27
27
|
* @public
|
|
28
28
|
*/
|
|
29
|
-
class ApiClass extends ApiItemContainerMixin_1.ApiItemContainerMixin(ApiNameMixin_1.ApiNameMixin(ApiTypeParameterListMixin_1.ApiTypeParameterListMixin(ApiReleaseTagMixin_1.ApiReleaseTagMixin(ApiDeclaredItem_1.ApiDeclaredItem)))) {
|
|
29
|
+
class ApiClass extends (0, ApiItemContainerMixin_1.ApiItemContainerMixin)((0, ApiNameMixin_1.ApiNameMixin)((0, ApiTypeParameterListMixin_1.ApiTypeParameterListMixin)((0, ApiReleaseTagMixin_1.ApiReleaseTagMixin)(ApiDeclaredItem_1.ApiDeclaredItem)))) {
|
|
30
30
|
constructor(options) {
|
|
31
31
|
super(options);
|
|
32
32
|
this._implementsTypes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClass.js","sourceRoot":"","sources":["../../src/model/ApiClass.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAKiE;AAEjE,8DAA0G;AAC1G,2EAAuG;AACvG,qEAA8F;AAE9F,iDAA8C;AAC9C,yDAA4E;AAC5E,mFAI6C;AAsB7C;;;;;;;;;;;;;;;GAeG;AACH,MAAa,QAAS,SAAQ,6CAAqB,
|
|
1
|
+
{"version":3,"file":"ApiClass.js","sourceRoot":"","sources":["../../src/model/ApiClass.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAKiE;AAEjE,8DAA0G;AAC1G,2EAAuG;AACvG,qEAA8F;AAE9F,iDAA8C;AAC9C,yDAA4E;AAC5E,mFAI6C;AAsB7C;;;;;;;;;;;;;;;GAeG;AACH,MAAa,QAAS,SAAQ,IAAA,6CAAqB,EACjD,IAAA,2BAAY,EAAC,IAAA,qDAAyB,EAAC,IAAA,uCAAkB,EAAC,iCAAe,CAAC,CAAC,CAAC,CAC7E;IAQC,YAAmB,OAAyB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QAHA,qBAAgB,GAAmB,EAAE,CAAC;QAKrD,IAAI,OAAO,CAAC,iBAAiB,EAAE;YAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;SACnF;aAAM;YACL,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;SAC9B;QAED,KAAK,MAAM,oBAAoB,IAAI,OAAO,CAAC,qBAAqB,EAAE;YAChE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;SACvF;I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AC,2CAAoB,CAAC,KAAK,EAAE,CAAC;aACjF,iBAAiB,oBAAqB,aAAa,CAAC;aACpD,WAAW,qBAAe,CAAC;IAChC,CAAC;CACF;AA5ED,4BA4EC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport {\r\n DeclarationReference,\r\n Meaning,\r\n Navigation,\r\n Component\r\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\r\nimport { ApiItemKind } from '../items/ApiItem';\r\nimport { ApiDeclaredItem, IApiDeclaredItemOptions, IApiDeclaredItemJson } from '../items/ApiDeclaredItem';\r\nimport { ApiItemContainerMixin, IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin';\r\nimport { ApiReleaseTagMixin, IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\r\nimport { IExcerptTokenRange } from '../mixins/Excerpt';\r\nimport { HeritageType } from './HeritageType';\r\nimport { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\r\nimport {\r\n ApiTypeParameterListMixin,\r\n IApiTypeParameterListMixinOptions,\r\n IApiTypeParameterListMixinJson\r\n} from '../mixins/ApiTypeParameterListMixin';\r\nimport { DeserializerContext } from './DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link ApiClass}.\r\n * @public\r\n */\r\nexport interface IApiClassOptions\r\n extends IApiItemContainerMixinOptions,\r\n IApiNameMixinOptions,\r\n IApiReleaseTagMixinOptions,\r\n IApiDeclaredItemOptions,\r\n IApiTypeParameterListMixinOptions {\r\n extendsTokenRange: IExcerptTokenRange | undefined;\r\n implementsTokenRanges: IExcerptTokenRange[];\r\n}\r\n\r\nexport interface IApiClassJson extends IApiDeclaredItemJson, IApiTypeParameterListMixinJson {\r\n extendsTokenRange?: IExcerptTokenRange;\r\n implementsTokenRanges: IExcerptTokenRange[];\r\n}\r\n\r\n/**\r\n * Represents a TypeScript class declaration.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations.\r\n *\r\n * `ApiClass` represents a TypeScript declaration such as this:\r\n *\r\n * ```ts\r\n * export class X { }\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ApiClass extends ApiItemContainerMixin(\r\n ApiNameMixin(ApiTypeParameterListMixin(ApiReleaseTagMixin(ApiDeclaredItem)))\r\n) {\r\n /**\r\n * The base class that this class inherits from (using the `extends` keyword), or undefined if there is no base class.\r\n */\r\n public readonly extendsType: HeritageType | undefined;\r\n\r\n private readonly _implementsTypes: HeritageType[] = [];\r\n\r\n public constructor(options: IApiClassOptions) {\r\n super(options);\r\n\r\n if (options.extendsTokenRange) {\r\n this.extendsType = new HeritageType(this.buildExcerpt(options.extendsTokenRange));\r\n } else {\r\n this.extendsType = undefined;\r\n }\r\n\r\n for (const implementsTokenRange of options.implementsTokenRanges) {\r\n this._implementsTypes.push(new HeritageType(this.buildExcerpt(implementsTokenRange)));\r\n }\r\n }\r\n\r\n public static getContainerKey(name: string): string {\r\n return `${name}|${ApiItemKind.Class}`;\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiClassOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiClassJson\r\n ): void {\r\n super.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.extendsTokenRange = jsonObject.extendsTokenRange;\r\n options.implementsTokenRanges = jsonObject.implementsTokenRanges;\r\n }\r\n\r\n /** @override */\r\n public get kind(): ApiItemKind {\r\n return ApiItemKind.Class;\r\n }\r\n\r\n /** @override */\r\n public get containerKey(): string {\r\n return ApiClass.getContainerKey(this.name);\r\n }\r\n\r\n /**\r\n * The list of interfaces that this class implements using the `implements` keyword.\r\n */\r\n public get implementsTypes(): ReadonlyArray<HeritageType> {\r\n return this._implementsTypes;\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiClassJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n // Note that JSON does not support the \"undefined\" value, so we simply omit the field entirely if it is undefined\r\n if (this.extendsType) {\r\n jsonObject.extendsTokenRange = this.extendsType.excerpt.tokenRange;\r\n }\r\n\r\n jsonObject.implementsTokenRanges = this.implementsTypes.map((x) => x.excerpt.tokenRange);\r\n }\r\n\r\n /** @beta @override */\r\n public buildCanonicalReference(): DeclarationReference {\r\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\r\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\r\n .addNavigationStep(Navigation.Exports, nameComponent)\r\n .withMeaning(Meaning.Class);\r\n }\r\n}\r\n"]}
|