@microsoft/api-extractor-model 7.13.16 → 7.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.json +51 -0
  2. package/CHANGELOG.md +25 -1
  3. package/dist/rollup.d.ts +2 -2
  4. package/dist/tsdoc-metadata.json +1 -1
  5. package/lib/index.js +3 -1
  6. package/lib/index.js.map +1 -1
  7. package/lib/items/ApiItem.d.ts +1 -1
  8. package/lib/items/ApiItem.d.ts.map +1 -1
  9. package/lib/items/ApiItem.js +43 -14
  10. package/lib/items/ApiItem.js.map +1 -1
  11. package/lib/mixins/Excerpt.d.ts +1 -1
  12. package/lib/mixins/Excerpt.d.ts.map +1 -1
  13. package/lib/mixins/Excerpt.js +13 -1
  14. package/lib/mixins/Excerpt.js.map +1 -1
  15. package/lib/model/ApiCallSignature.js +3 -2
  16. package/lib/model/ApiCallSignature.js.map +1 -1
  17. package/lib/model/ApiClass.js +3 -2
  18. package/lib/model/ApiClass.js.map +1 -1
  19. package/lib/model/ApiConstructSignature.js +3 -2
  20. package/lib/model/ApiConstructSignature.js.map +1 -1
  21. package/lib/model/ApiConstructor.js +3 -2
  22. package/lib/model/ApiConstructor.js.map +1 -1
  23. package/lib/model/ApiEntryPoint.js +1 -1
  24. package/lib/model/ApiEntryPoint.js.map +1 -1
  25. package/lib/model/ApiEnum.js +4 -3
  26. package/lib/model/ApiEnum.js.map +1 -1
  27. package/lib/model/ApiEnumMember.js +2 -1
  28. package/lib/model/ApiEnumMember.js.map +1 -1
  29. package/lib/model/ApiFunction.js +3 -2
  30. package/lib/model/ApiFunction.js.map +1 -1
  31. package/lib/model/ApiIndexSignature.js +3 -2
  32. package/lib/model/ApiIndexSignature.js.map +1 -1
  33. package/lib/model/ApiInterface.js +3 -2
  34. package/lib/model/ApiInterface.js.map +1 -1
  35. package/lib/model/ApiMethod.js +4 -3
  36. package/lib/model/ApiMethod.js.map +1 -1
  37. package/lib/model/ApiMethodSignature.js +3 -2
  38. package/lib/model/ApiMethodSignature.js.map +1 -1
  39. package/lib/model/ApiModel.js +2 -2
  40. package/lib/model/ApiModel.js.map +1 -1
  41. package/lib/model/ApiNamespace.js +3 -2
  42. package/lib/model/ApiNamespace.js.map +1 -1
  43. package/lib/model/ApiPackage.js +2 -2
  44. package/lib/model/ApiPackage.js.map +1 -1
  45. package/lib/model/ApiProperty.js +4 -3
  46. package/lib/model/ApiProperty.js.map +1 -1
  47. package/lib/model/ApiPropertySignature.js +3 -2
  48. package/lib/model/ApiPropertySignature.js.map +1 -1
  49. package/lib/model/ApiTypeAlias.js +3 -2
  50. package/lib/model/ApiTypeAlias.js.map +1 -1
  51. package/lib/model/ApiVariable.js +3 -2
  52. package/lib/model/ApiVariable.js.map +1 -1
  53. package/lib/model/Deserializer.js +20 -19
  54. package/lib/model/Deserializer.js.map +1 -1
  55. package/lib/model/ModelReferenceResolver.js +8 -7
  56. package/lib/model/ModelReferenceResolver.js.map +1 -1
  57. package/package.json +5 -5
package/CHANGELOG.json CHANGED
@@ -1,6 +1,57 @@
1
1
  {
2
2
  "name": "@microsoft/api-extractor-model",
3
3
  "entries": [
4
+ {
5
+ "version": "7.15.0",
6
+ "tag": "@microsoft/api-extractor-model_v7.15.0",
7
+ "date": "Thu, 09 Dec 2021 00:21:54 GMT",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "comment": "Replace const enums with conventional enums to allow for compatibility with JavaScript consumers."
12
+ }
13
+ ]
14
+ }
15
+ },
16
+ {
17
+ "version": "7.14.0",
18
+ "tag": "@microsoft/api-extractor-model_v7.14.0",
19
+ "date": "Wed, 08 Dec 2021 16:14:05 GMT",
20
+ "comments": {
21
+ "minor": [
22
+ {
23
+ "comment": "Update to TypeScript 4.5"
24
+ }
25
+ ]
26
+ }
27
+ },
28
+ {
29
+ "version": "7.13.18",
30
+ "tag": "@microsoft/api-extractor-model_v7.13.18",
31
+ "date": "Mon, 06 Dec 2021 16:08:33 GMT",
32
+ "comments": {
33
+ "dependency": [
34
+ {
35
+ "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.44.1`"
36
+ },
37
+ {
38
+ "comment": "Updating dependency \"@rushstack/eslint-config\" to `2.5.0`"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "version": "7.13.17",
45
+ "tag": "@microsoft/api-extractor-model_v7.13.17",
46
+ "date": "Fri, 03 Dec 2021 03:05:22 GMT",
47
+ "comments": {
48
+ "dependency": [
49
+ {
50
+ "comment": "Updating dependency \"@rushstack/node-core-library\" to `3.44.0`"
51
+ }
52
+ ]
53
+ }
54
+ },
4
55
  {
5
56
  "version": "7.13.16",
6
57
  "tag": "@microsoft/api-extractor-model_v7.13.16",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,30 @@
1
1
  # Change Log - @microsoft/api-extractor-model
2
2
 
3
- This log was last generated on Sat, 06 Nov 2021 00:09:13 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 09 Dec 2021 00:21:54 GMT and should not be manually modified.
4
+
5
+ ## 7.15.0
6
+ Thu, 09 Dec 2021 00:21:54 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - Replace const enums with conventional enums to allow for compatibility with JavaScript consumers.
11
+
12
+ ## 7.14.0
13
+ Wed, 08 Dec 2021 16:14:05 GMT
14
+
15
+ ### Minor changes
16
+
17
+ - Update to TypeScript 4.5
18
+
19
+ ## 7.13.18
20
+ Mon, 06 Dec 2021 16:08:33 GMT
21
+
22
+ _Version update only_
23
+
24
+ ## 7.13.17
25
+ Fri, 03 Dec 2021 03:05:22 GMT
26
+
27
+ _Version update only_
4
28
 
5
29
  ## 7.13.16
6
30
  Sat, 06 Nov 2021 00:09:13 GMT
package/dist/rollup.d.ts CHANGED
@@ -702,7 +702,7 @@ export declare namespace ApiItemContainerMixin {
702
702
  *
703
703
  * @public
704
704
  */
705
- export declare const enum ApiItemKind {
705
+ export declare enum ApiItemKind {
706
706
  CallSignature = "CallSignature",
707
707
  Class = "Class",
708
708
  Constructor = "Constructor",
@@ -1705,7 +1705,7 @@ export declare class ExcerptToken {
1705
1705
  }
1706
1706
 
1707
1707
  /** @public */
1708
- export declare const enum ExcerptTokenKind {
1708
+ export declare enum ExcerptTokenKind {
1709
1709
  /**
1710
1710
  * Generic text without any special properties
1711
1711
  */
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.18.15"
8
+ "packageVersion": "7.19.0"
9
9
  }
10
10
  ]
11
11
  }
package/lib/index.js CHANGED
@@ -2,7 +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
+ 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.ExcerptTokenKind = exports.ApiOptionalMixin = exports.ApiNameMixin = exports.ApiStaticMixin = exports.ApiReturnTypeMixin = exports.ApiReleaseTagMixin = exports.ApiItemContainerMixin = exports.ApiTypeParameterListMixin = exports.ApiParameterListMixin = exports.ApiPropertyItem = exports.ApiItem = exports.ApiItemKind = exports.ApiDocumentedItem = exports.ApiDeclaredItem = exports.ReleaseTag = exports.AedocDefinitions = void 0;
6
6
  /**
7
7
  * Use this library to read and write *.api.json files as defined by the
8
8
  * {@link https://api-extractor.com/ | API Extractor} tool. These files are used to generate a documentation
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "ApiDeclaredItem", { enumerable: true, get: funct
21
21
  var ApiDocumentedItem_1 = require("./items/ApiDocumentedItem");
22
22
  Object.defineProperty(exports, "ApiDocumentedItem", { enumerable: true, get: function () { return ApiDocumentedItem_1.ApiDocumentedItem; } });
23
23
  var ApiItem_1 = require("./items/ApiItem");
24
+ Object.defineProperty(exports, "ApiItemKind", { enumerable: true, get: function () { return ApiItem_1.ApiItemKind; } });
24
25
  Object.defineProperty(exports, "ApiItem", { enumerable: true, get: function () { return ApiItem_1.ApiItem; } });
25
26
  var ApiPropertyItem_1 = require("./items/ApiPropertyItem");
26
27
  Object.defineProperty(exports, "ApiPropertyItem", { enumerable: true, get: function () { return ApiPropertyItem_1.ApiPropertyItem; } });
@@ -42,6 +43,7 @@ Object.defineProperty(exports, "ApiNameMixin", { enumerable: true, get: function
42
43
  var ApiOptionalMixin_1 = require("./mixins/ApiOptionalMixin");
43
44
  Object.defineProperty(exports, "ApiOptionalMixin", { enumerable: true, get: function () { return ApiOptionalMixin_1.ApiOptionalMixin; } });
44
45
  var Excerpt_1 = require("./mixins/Excerpt");
46
+ Object.defineProperty(exports, "ExcerptTokenKind", { enumerable: true, get: function () { return Excerpt_1.ExcerptTokenKind; } });
45
47
  Object.defineProperty(exports, "ExcerptToken", { enumerable: true, get: function () { return Excerpt_1.ExcerptToken; } });
46
48
  Object.defineProperty(exports, "Excerpt", { enumerable: true, get: function () { return Excerpt_1.Excerpt; } });
47
49
  // model
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;;;AAE3D;;;;;;;GAOG;AAEH,6DAA4D;AAAnD,oHAAA,gBAAgB,OAAA;AACzB,iDAAgD;AAAvC,wGAAA,UAAU,OAAA;AAEnB,QAAQ;AACR,2DAAmF;AAAjD,kHAAA,eAAe,OAAA;AACjD,+DAAyF;AAArD,sHAAA,iBAAiB,OAAA;AACrD,2CAA6F;AAAtD,kGAAA,OAAO,OAAA;AAC9C,2DAAmF;AAAjD,kHAAA,eAAe,OAAA;AAEjD,SAAS;AACT,wEAIwC;AADtC,8HAAA,qBAAqB,OAAA;AAEvB,gFAI4C;AAD1C,sIAAA,yBAAyB,OAAA;AAE3B,wEAAsG;AAA9D,8HAAA,qBAAqB,OAAA;AAC7D,kEAA6F;AAAxD,wHAAA,kBAAkB,OAAA;AACvD,kEAA6F;AAAxD,wHAAA,kBAAkB,OAAA;AACvD,0DAAiF;AAAhD,gHAAA,cAAc,OAAA;AAC/C,sDAA2E;AAA5C,4GAAA,YAAY,OAAA;AAC3C,8DAAuF;AAApD,oHAAA,gBAAgB,OAAA;AAEnD,4CAA8G;AAAhD,uGAAA,YAAY,OAAA;AAAE,kGAAA,OAAO,OAAA;AAGnF,QAAQ;AACR,6DAAsF;AAAnD,oHAAA,gBAAgB,OAAA;AACnD,6CAA8D;AAAnC,oGAAA,QAAQ,OAAA;AACnC,yDAAgF;AAA/C,gHAAA,cAAc,OAAA;AAC/C,uEAAqG;AAA7D,8HAAA,qBAAqB,OAAA;AAC7D,uDAA6E;AAA7C,8GAAA,aAAa,OAAA;AAC7C,2CAA2D;AAAjC,kGAAA,OAAO,OAAA;AACjC,uDAA6E;AAA7C,8GAAA,aAAa,OAAA;AAC7C,mDAAuE;AAAzC,0GAAA,WAAW,OAAA;AACzC,+DAAyF;AAArD,sHAAA,iBAAiB,OAAA;AACrD,qDAA0E;AAA3C,4GAAA,YAAY,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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;GAOG;AAEH,6DAA4D;AAAnD,oHAAA,gBAAgB,OAAA;AACzB,iDAAgD;AAAvC,wGAAA,UAAU,OAAA;AAEnB,QAAQ;AACR,2DAAmF;AAAjD,kHAAA,eAAe,OAAA;AACjD,+DAAyF;AAArD,sHAAA,iBAAiB,OAAA;AACrD,2CAA6F;AAApF,sGAAA,WAAW,OAAA;AAAmB,kGAAA,OAAO,OAAA;AAC9C,2DAAmF;AAAjD,kHAAA,eAAe,OAAA;AAEjD,SAAS;AACT,wEAIwC;AADtC,8HAAA,qBAAqB,OAAA;AAEvB,gFAI4C;AAD1C,sIAAA,yBAAyB,OAAA;AAE3B,wEAAsG;AAA9D,8HAAA,qBAAqB,OAAA;AAC7D,kEAA6F;AAAxD,wHAAA,kBAAkB,OAAA;AACvD,kEAA6F;AAAxD,wHAAA,kBAAkB,OAAA;AACvD,0DAAiF;AAAhD,gHAAA,cAAc,OAAA;AAC/C,sDAA2E;AAA5C,4GAAA,YAAY,OAAA;AAC3C,8DAAuF;AAApD,oHAAA,gBAAgB,OAAA;AAEnD,4CAA8G;AAArG,2GAAA,gBAAgB,OAAA;AAAqC,uGAAA,YAAY,OAAA;AAAE,kGAAA,OAAO,OAAA;AAGnF,QAAQ;AACR,6DAAsF;AAAnD,oHAAA,gBAAgB,OAAA;AACnD,6CAA8D;AAAnC,oGAAA,QAAQ,OAAA;AACnC,yDAAgF;AAA/C,gHAAA,cAAc,OAAA;AAC/C,uEAAqG;AAA7D,8HAAA,qBAAqB,OAAA;AAC7D,uDAA6E;AAA7C,8GAAA,aAAa,OAAA;AAC7C,2CAA2D;AAAjC,kGAAA,OAAO,OAAA;AACjC,uDAA6E;AAA7C,8GAAA,aAAa,OAAA;AAC7C,mDAAuE;AAAzC,0GAAA,WAAW,OAAA;AACzC,+DAAyF;AAArD,sHAAA,iBAAiB,OAAA;AACrD,qDAA0E;AAA3C,4GAAA,YAAY,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"]}
@@ -8,7 +8,7 @@ import { DeserializerContext } from '../model/DeserializerContext';
8
8
  *
9
9
  * @public
10
10
  */
11
- export declare const enum ApiItemKind {
11
+ export declare enum ApiItemKind {
12
12
  CallSignature = "CallSignature",
13
13
  Class = "Class",
14
14
  Constructor = "Constructor",
@@ -1 +1 @@
1
- {"version":3,"file":"ApiItem.d.ts","sourceRoot":"","sources":["../../src/items/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MAAM,CAc/B;IAED;;;;;OAKG;IACH,IAAW,MAAM,IAAI,OAAO,GAAG,SAAS,CAEvC;IAED;;;;;OAKG;IACH,IAAW,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAE3C;IAED;;;;;;;;;OASG;IACI,iBAAiB,IAAI,aAAa,CAAC,OAAO,CAAC;IAQlD;;OAEG;IACI,YAAY,IAAI,aAAa,CAAC,OAAO,CAAC;IAS7C;;;;;;OAMG;IACI,0BAA0B,IAAI,MAAM;IAiC3C;;;OAGG;IACI,oBAAoB,IAAI,UAAU,GAAG,SAAS;IASrD,eAAe;IACR,UAAU,IAAI,MAAM;IAI3B;;;;;;;OAOG;IACI,CAAC,uBAAuB,CAAC,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAKnE;;;OAGG;IACH,SAAS,CAAC,uBAAuB,IAAI,oBAAoB;CAG1D;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,OAAO,CAAC;CAAG"}
@@ -2,10 +2,39 @@
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.ApiItem = exports.apiItem_onParentChanged = void 0;
5
+ exports.ApiItem = exports.apiItem_onParentChanged = exports.ApiItemKind = void 0;
6
6
  const ApiParameterListMixin_1 = require("../mixins/ApiParameterListMixin");
7
7
  const node_core_library_1 = require("@rushstack/node-core-library");
8
8
  const ApiItemContainerMixin_1 = require("../mixins/ApiItemContainerMixin");
9
+ /**
10
+ * The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of
11
+ * {@link ApiItem}.
12
+ *
13
+ * @public
14
+ */
15
+ var ApiItemKind;
16
+ (function (ApiItemKind) {
17
+ ApiItemKind["CallSignature"] = "CallSignature";
18
+ ApiItemKind["Class"] = "Class";
19
+ ApiItemKind["Constructor"] = "Constructor";
20
+ ApiItemKind["ConstructSignature"] = "ConstructSignature";
21
+ ApiItemKind["EntryPoint"] = "EntryPoint";
22
+ ApiItemKind["Enum"] = "Enum";
23
+ ApiItemKind["EnumMember"] = "EnumMember";
24
+ ApiItemKind["Function"] = "Function";
25
+ ApiItemKind["IndexSignature"] = "IndexSignature";
26
+ ApiItemKind["Interface"] = "Interface";
27
+ ApiItemKind["Method"] = "Method";
28
+ ApiItemKind["MethodSignature"] = "MethodSignature";
29
+ ApiItemKind["Model"] = "Model";
30
+ ApiItemKind["Namespace"] = "Namespace";
31
+ ApiItemKind["Package"] = "Package";
32
+ ApiItemKind["Property"] = "Property";
33
+ ApiItemKind["PropertySignature"] = "PropertySignature";
34
+ ApiItemKind["TypeAlias"] = "TypeAlias";
35
+ ApiItemKind["Variable"] = "Variable";
36
+ ApiItemKind["None"] = "None";
37
+ })(ApiItemKind = exports.ApiItemKind || (exports.ApiItemKind = {}));
9
38
  // PRIVATE - Allows ApiItemContainerMixin to assign the parent.
10
39
  //
11
40
  exports.apiItem_onParentChanged = Symbol('ApiItem._onAddToContainer');
@@ -88,15 +117,15 @@ class ApiItem {
88
117
  */
89
118
  get displayName() {
90
119
  switch (this.kind) {
91
- case "CallSignature" /* CallSignature */:
120
+ case ApiItemKind.CallSignature:
92
121
  return '(call)';
93
- case "Constructor" /* Constructor */:
122
+ case ApiItemKind.Constructor:
94
123
  return '(constructor)';
95
- case "ConstructSignature" /* ConstructSignature */:
124
+ case ApiItemKind.ConstructSignature:
96
125
  return '(new)';
97
- case "IndexSignature" /* IndexSignature */:
126
+ case ApiItemKind.IndexSignature:
98
127
  return '(indexer)';
99
- case "Model" /* Model */:
128
+ case ApiItemKind.Model:
100
129
  return '(model)';
101
130
  }
102
131
  return '(???)'; // All other types should inherit ApiNameMixin which will override this property
@@ -157,9 +186,9 @@ class ApiItem {
157
186
  getScopedNameWithinPackage() {
158
187
  const reversedParts = [];
159
188
  for (let current = this; current !== undefined; current = current.parent) {
160
- if (current.kind === "Model" /* Model */ ||
161
- current.kind === "Package" /* Package */ ||
162
- current.kind === "EntryPoint" /* EntryPoint */) {
189
+ if (current.kind === ApiItemKind.Model ||
190
+ current.kind === ApiItemKind.Package ||
191
+ current.kind === ApiItemKind.EntryPoint) {
163
192
  break;
164
193
  }
165
194
  if (reversedParts.length !== 0) {
@@ -167,10 +196,10 @@ class ApiItem {
167
196
  }
168
197
  else {
169
198
  switch (current.kind) {
170
- case "CallSignature" /* CallSignature */:
171
- case "ConstructSignature" /* ConstructSignature */:
172
- case "Constructor" /* Constructor */:
173
- case "IndexSignature" /* IndexSignature */:
199
+ case ApiItemKind.CallSignature:
200
+ case ApiItemKind.ConstructSignature:
201
+ case ApiItemKind.Constructor:
202
+ case ApiItemKind.IndexSignature:
174
203
  // These functional forms don't have a proper name, so we don't append the "()" suffix
175
204
  break;
176
205
  default:
@@ -189,7 +218,7 @@ class ApiItem {
189
218
  */
190
219
  getAssociatedPackage() {
191
220
  for (let current = this; current !== undefined; current = current.parent) {
192
- if (current.kind === "Package" /* Package */) {
221
+ if (current.kind === ApiItemKind.Package) {
193
222
  return current;
194
223
  }
195
224
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ApiItem.js","sourceRoot":"","sources":["../../src/items/ApiItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAK3D,2EAAwE;AAExE,oEAA6D;AAC7D,2EAAwE;AA0CxE,+DAA+D;AAC/D,EAAE;AACW,QAAA,uBAAuB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAa,OAAO;IAIlB,YAAmB,OAAwB;QACzC,oEAAoE;IACtE,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAwB,EAAE,OAA4B;QAC9E,yFAAyF;QACzF,iCAAiC;QACjC,MAAM,kBAAkB,GAA2C,OAAO,CAAC,uBAAuB,CAAC,CAAC;QACpG,OAAO,kBAAkB,C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,MAAM;oBACR;wBACE,IAAI,6CAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;4BAChD,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;yBAC1B;iBACJ;aACF;YACD,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SACzC;QAED,OAAO,aAAa,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACI,oBAAoB;QACzB,KAAK,IAAI,OAAO,GAAwB,IAAI,EAAE,OAAO,KAAK,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE;YAC7F,IAAI,OAAO,CAAC,IAAI,4BAAwB,EAAE;gBACxC,OAAO,OAAqB,CAAC;aAC9B;SACF;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,eAAe;IACR,UAAU;QACf,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;;;;;;OAOG;IACI,CAAC,+BAAuB,CAAC,CAAC,MAA2B;QAC1D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;IACvC,CAAC;IAED;;;OAGG;IACO,uBAAuB;QAC/B,MAAM,IAAI,iCAAa,CAAC,mEAAmE,CAAC,CAAC;IAC/F,CAAC;CACF;AAlOD,0BAkOC","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 { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\r\nimport { Constructor, PropertiesOf } from '../mixins/Mixin';\r\nimport { ApiPackage } from '../model/ApiPackage';\r\nimport { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\nimport { InternalError } from '@rushstack/node-core-library';\r\nimport { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';\r\n\r\n/**\r\n * The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of\r\n * {@link ApiItem}.\r\n *\r\n * @public\r\n */\r\nexport const enum ApiItemKind {\r\n CallSignature = 'CallSignature',\r\n Class = 'Class',\r\n Constructor = 'Constructor',\r\n ConstructSignature = 'ConstructSignature',\r\n EntryPoint = 'EntryPoint',\r\n Enum = 'Enum',\r\n EnumMember = 'EnumMember',\r\n Function = 'Function',\r\n IndexSignature = 'IndexSignature',\r\n Interface = 'Interface',\r\n Method = 'Method',\r\n MethodSignature = 'MethodSignature',\r\n Model = 'Model',\r\n Namespace = 'Namespace',\r\n Package = 'Package',\r\n Property = 'Property',\r\n PropertySignature = 'PropertySignature',\r\n TypeAlias = 'TypeAlias',\r\n Variable = 'Variable',\r\n None = 'None'\r\n}\r\n\r\n/**\r\n * Constructor options for {@link ApiItem}.\r\n * @public\r\n */\r\nexport interface IApiItemOptions {}\r\n\r\nexport interface IApiItemJson {\r\n kind: ApiItemKind;\r\n canonicalReference: string;\r\n}\r\n\r\n// PRIVATE - Allows ApiItemContainerMixin to assign the parent.\r\n//\r\nexport const apiItem_onParentChanged: unique symbol = Symbol('ApiItem._onAddToContainer');\r\n\r\n/**\r\n * The abstract base class for all members of an `ApiModel` object.\r\n *\r\n * @remarks\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations.\r\n * @public\r\n */\r\nexport class ApiItem {\r\n private _canonicalReference: DeclarationReference | undefined;\r\n private _parent: ApiItem | undefined;\r\n\r\n public constructor(options: IApiItemOptions) {\r\n // (\"options\" is not used here, but part of the inheritance pattern)\r\n }\r\n\r\n public static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem {\r\n // The Deserializer class is coupled with a ton of other classes, so we delay loading it\r\n // to avoid ES5 circular imports.\r\n const deserializerModule: typeof import('../model/Deserializer') = require('../model/Deserializer');\r\n return deserializerModule.Deserializer.deserialize(context, jsonObject);\r\n }\r\n\r\n /** @virtual */\r\n public static onDeserializeInto(\r\n options: Partial<IApiItemOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiItemJson\r\n ): void {\r\n // (implemented by subclasses)\r\n }\r\n\r\n /** @virtual */\r\n public serializeInto(jsonObject: Partial<IApiItemJson>): void {\r\n jsonObject.kind = this.kind;\r\n jsonObject.canonicalReference = this.canonicalReference.toString();\r\n }\r\n\r\n /**\r\n * Identifies the subclass of the `ApiItem` base class.\r\n * @virtual\r\n */\r\n public get kind(): ApiItemKind {\r\n throw new Error('ApiItem.kind was not implemented by the child class');\r\n }\r\n\r\n /**\r\n * Warning: This API is used internally by API extractor but is not yet ready for general usage.\r\n *\r\n * @remarks\r\n *\r\n * Returns a `DeclarationReference` object using the experimental new declaration reference notation.\r\n *\r\n * @beta\r\n */\r\n public get canonicalReference(): DeclarationReference {\r\n if (!this._canonicalReference) {\r\n try {\r\n this._canonicalReference = this.buildCanonicalReference();\r\n } catch (e) {\r\n const name: string = this.getScopedNameWithinPackage() || this.displayName;\r\n throw new InternalError(`Error building canonical reference for ${name}:\\n` + (e as Error).message);\r\n }\r\n }\r\n return this._canonicalReference;\r\n }\r\n\r\n /**\r\n * Returns a string key that can be used to efficiently retrieve an `ApiItem` from an `ApiItemContainerMixin`.\r\n * The key is unique within the container. Its format is undocumented and may change at any time.\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 * @virtual\r\n */\r\n public get containerKey(): string {\r\n throw new InternalError('ApiItem.containerKey was not implemented by the child class');\r\n }\r\n\r\n /**\r\n * Returns a name for this object that can be used in diagnostic messages, for example.\r\n *\r\n * @remarks\r\n * For an object that inherits ApiNameMixin, this will return the declared name (e.g. the name of a TypeScript\r\n * function). Otherwise, it will return a string such as \"(call signature)\" or \"(model)\".\r\n *\r\n * @virtual\r\n */\r\n public get displayName(): string {\r\n switch (this.kind) {\r\n case ApiItemKind.CallSignature:\r\n return '(call)';\r\n case ApiItemKind.Constructor:\r\n return '(constructor)';\r\n case ApiItemKind.ConstructSignature:\r\n return '(new)';\r\n case ApiItemKind.IndexSignature:\r\n return '(indexer)';\r\n case ApiItemKind.Model:\r\n return '(model)';\r\n }\r\n return '(???)'; // All other types should inherit ApiNameMixin which will override this property\r\n }\r\n\r\n /**\r\n * If this item was added to a ApiItemContainerMixin item, then this returns the container item.\r\n * If this is an Parameter that was added to a method or function, then this returns the function item.\r\n * Otherwise, it returns undefined.\r\n * @virtual\r\n */\r\n public get parent(): ApiItem | undefined {\r\n return this._parent;\r\n }\r\n\r\n /**\r\n * This property supports a visitor pattern for walking the tree.\r\n * For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically.\r\n * Otherwise it returns an empty array.\r\n * @virtual\r\n */\r\n public get members(): ReadonlyArray<ApiItem> {\r\n return [];\r\n }\r\n\r\n /**\r\n * If this item has a name (i.e. extends `ApiNameMixin`), then return all items that have the same parent\r\n * and the same name. Otherwise, return all items that have the same parent and the same `ApiItemKind`.\r\n *\r\n * @remarks\r\n * Examples: For a function, this would return all overloads for the function. For a constructor, this would\r\n * return all overloads for the constructor. For a merged declaration (e.g. a `namespace` and `enum` with the\r\n * same name), this would return both declarations. If this item does not have a parent, or if it is the only\r\n * item of its name/kind, then the result is an array containing only this item.\r\n */\r\n public getMergedSiblings(): ReadonlyArray<ApiItem> {\r\n const parent: ApiItem | undefined = this._parent;\r\n if (parent && ApiItemContainerMixin.isBaseClassOf(parent)) {\r\n return parent._getMergedSiblingsForMember(this);\r\n }\r\n return [];\r\n }\r\n\r\n /**\r\n * Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.\r\n */\r\n public getHierarchy(): ReadonlyArray<ApiItem> {\r\n const hierarchy: ApiItem[] = [];\r\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\r\n hierarchy.push(current);\r\n }\r\n hierarchy.reverse();\r\n return hierarchy;\r\n }\r\n\r\n /**\r\n * This returns a scoped name such as `\"Namespace1.Namespace2.MyClass.myMember()\"`. It does not include the\r\n * package name or entry point.\r\n *\r\n * @remarks\r\n * If called on an ApiEntrypoint, ApiPackage, or ApiModel item, the result is an empty string.\r\n */\r\n public getScopedNameWithinPackage(): string {\r\n const reversedParts: string[] = [];\r\n\r\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\r\n if (\r\n current.kind === ApiItemKind.Model ||\r\n current.kind === ApiItemKind.Package ||\r\n current.kind === ApiItemKind.EntryPoint\r\n ) {\r\n break;\r\n }\r\n if (reversedParts.length !== 0) {\r\n reversedParts.push('.');\r\n } else {\r\n switch (current.kind) {\r\n case ApiItemKind.CallSignature:\r\n case ApiItemKind.ConstructSignature:\r\n case ApiItemKind.Constructor:\r\n case ApiItemKind.IndexSignature:\r\n // These functional forms don't have a proper name, so we don't append the \"()\" suffix\r\n break;\r\n default:\r\n if (ApiParameterListMixin.isBaseClassOf(current)) {\r\n reversedParts.push('()');\r\n }\r\n }\r\n }\r\n reversedParts.push(current.displayName);\r\n }\r\n\r\n return reversedParts.reverse().join('');\r\n }\r\n\r\n /**\r\n * If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned.\r\n * Otherwise undefined is returned.\r\n */\r\n public getAssociatedPackage(): ApiPackage | undefined {\r\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\r\n if (current.kind === ApiItemKind.Package) {\r\n return current as ApiPackage;\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /** @virtual */\r\n public getSortKey(): string {\r\n return this.containerKey;\r\n }\r\n\r\n /**\r\n * PRIVATE\r\n *\r\n * @privateRemarks\r\n * Allows ApiItemContainerMixin to assign the parent when the item is added to a container.\r\n *\r\n * @internal\r\n */\r\n public [apiItem_onParentChanged](parent: ApiItem | undefined): void {\r\n this._parent = parent;\r\n this._canonicalReference = undefined;\r\n }\r\n\r\n /**\r\n * Builds the cached object used by the `canonicalReference` property.\r\n * @virtual\r\n */\r\n protected buildCanonicalReference(): DeclarationReference {\r\n throw new InternalError('ApiItem.canonicalReference was not implemented by the child class');\r\n }\r\n}\r\n\r\n/**\r\n * This abstraction is used by the mixin pattern.\r\n * It describes a class type that inherits from {@link ApiItem}.\r\n *\r\n * @public\r\n */\r\nexport interface IApiItemConstructor extends Constructor<ApiItem>, PropertiesOf<typeof ApiItem> {}\r\n"]}
1
+ {"version":3,"file":"ApiItem.js","sourceRoot":"","sources":["../../src/items/ApiItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAK3D,2EAAwE;AAExE,oEAA6D;AAC7D,2EAAwE;AAExE;;;;;GAKG;AACH,IAAY,WAqBX;AArBD,WAAY,WAAW;IACrB,8CAA+B,CAAA;IAC/B,8BAAe,CAAA;IACf,0CAA2B,CAAA;IAC3B,wDAAyC,CAAA;IACzC,wCAAyB,CAAA;IACzB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,kDAAmC,CAAA;IACnC,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,sDAAuC,CAAA;IACvC,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;AACf,CAAC,EArBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAqBtB;AAaD,+DAA+D;AAC/D,EAAE;AACW,QAAA,uBAAuB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAa,OAAO;IAIlB,YAAmB,OAAwB;QACzC,oEAAoE;IACtE,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAwB,EAAE,OAA4B;QAC9E,yFAAyF;QACzF,iCAAiC;QACjC,MAAM,kBAAkB,GAA2C,OAAO,CAAC,uBAAuB,CAAC,CAAC;QACpG,OAAO,kBAAkB,CAAC,YAAY,CAAC,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AAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACzB;iBAAM;gBACL,QAAQ,OAAO,CAAC,IAAI,EAAE;oBACpB,KAAK,WAAW,CAAC,aAAa,CAAC;oBAC/B,KAAK,WAAW,CAAC,kBAAkB,CAAC;oBACpC,KAAK,WAAW,CAAC,WAAW,CAAC;oBAC7B,KAAK,WAAW,CAAC,cAAc;wBAC7B,sFAAsF;wBACtF,MAAM;oBACR;wBACE,IAAI,6CAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;4BAChD,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;yBAC1B;iBACJ;aACF;YACD,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SACzC;QAED,OAAO,aAAa,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACI,oBAAoB;QACzB,KAAK,IAAI,OAAO,GAAwB,IAAI,EAAE,OAAO,KAAK,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE;YAC7F,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,OAAO,EAAE;gBACxC,OAAO,OAAqB,CAAC;aAC9B;SACF;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,eAAe;IACR,UAAU;QACf,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;;;;;;OAOG;IACI,CAAC,+BAAuB,CAAC,CAAC,MAA2B;QAC1D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;IACvC,CAAC;IAED;;;OAGG;IACO,uBAAuB;QAC/B,MAAM,IAAI,iCAAa,CAAC,mEAAmE,CAAC,CAAC;IAC/F,CAAC;CACF;AAlOD,0BAkOC","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 { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\r\nimport { Constructor, PropertiesOf } from '../mixins/Mixin';\r\nimport { ApiPackage } from '../model/ApiPackage';\r\nimport { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\nimport { InternalError } from '@rushstack/node-core-library';\r\nimport { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';\r\n\r\n/**\r\n * The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of\r\n * {@link ApiItem}.\r\n *\r\n * @public\r\n */\r\nexport enum ApiItemKind {\r\n CallSignature = 'CallSignature',\r\n Class = 'Class',\r\n Constructor = 'Constructor',\r\n ConstructSignature = 'ConstructSignature',\r\n EntryPoint = 'EntryPoint',\r\n Enum = 'Enum',\r\n EnumMember = 'EnumMember',\r\n Function = 'Function',\r\n IndexSignature = 'IndexSignature',\r\n Interface = 'Interface',\r\n Method = 'Method',\r\n MethodSignature = 'MethodSignature',\r\n Model = 'Model',\r\n Namespace = 'Namespace',\r\n Package = 'Package',\r\n Property = 'Property',\r\n PropertySignature = 'PropertySignature',\r\n TypeAlias = 'TypeAlias',\r\n Variable = 'Variable',\r\n None = 'None'\r\n}\r\n\r\n/**\r\n * Constructor options for {@link ApiItem}.\r\n * @public\r\n */\r\nexport interface IApiItemOptions {}\r\n\r\nexport interface IApiItemJson {\r\n kind: ApiItemKind;\r\n canonicalReference: string;\r\n}\r\n\r\n// PRIVATE - Allows ApiItemContainerMixin to assign the parent.\r\n//\r\nexport const apiItem_onParentChanged: unique symbol = Symbol('ApiItem._onAddToContainer');\r\n\r\n/**\r\n * The abstract base class for all members of an `ApiModel` object.\r\n *\r\n * @remarks\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations.\r\n * @public\r\n */\r\nexport class ApiItem {\r\n private _canonicalReference: DeclarationReference | undefined;\r\n private _parent: ApiItem | undefined;\r\n\r\n public constructor(options: IApiItemOptions) {\r\n // (\"options\" is not used here, but part of the inheritance pattern)\r\n }\r\n\r\n public static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem {\r\n // The Deserializer class is coupled with a ton of other classes, so we delay loading it\r\n // to avoid ES5 circular imports.\r\n const deserializerModule: typeof import('../model/Deserializer') = require('../model/Deserializer');\r\n return deserializerModule.Deserializer.deserialize(context, jsonObject);\r\n }\r\n\r\n /** @virtual */\r\n public static onDeserializeInto(\r\n options: Partial<IApiItemOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiItemJson\r\n ): void {\r\n // (implemented by subclasses)\r\n }\r\n\r\n /** @virtual */\r\n public serializeInto(jsonObject: Partial<IApiItemJson>): void {\r\n jsonObject.kind = this.kind;\r\n jsonObject.canonicalReference = this.canonicalReference.toString();\r\n }\r\n\r\n /**\r\n * Identifies the subclass of the `ApiItem` base class.\r\n * @virtual\r\n */\r\n public get kind(): ApiItemKind {\r\n throw new Error('ApiItem.kind was not implemented by the child class');\r\n }\r\n\r\n /**\r\n * Warning: This API is used internally by API extractor but is not yet ready for general usage.\r\n *\r\n * @remarks\r\n *\r\n * Returns a `DeclarationReference` object using the experimental new declaration reference notation.\r\n *\r\n * @beta\r\n */\r\n public get canonicalReference(): DeclarationReference {\r\n if (!this._canonicalReference) {\r\n try {\r\n this._canonicalReference = this.buildCanonicalReference();\r\n } catch (e) {\r\n const name: string = this.getScopedNameWithinPackage() || this.displayName;\r\n throw new InternalError(`Error building canonical reference for ${name}:\\n` + (e as Error).message);\r\n }\r\n }\r\n return this._canonicalReference;\r\n }\r\n\r\n /**\r\n * Returns a string key that can be used to efficiently retrieve an `ApiItem` from an `ApiItemContainerMixin`.\r\n * The key is unique within the container. Its format is undocumented and may change at any time.\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 * @virtual\r\n */\r\n public get containerKey(): string {\r\n throw new InternalError('ApiItem.containerKey was not implemented by the child class');\r\n }\r\n\r\n /**\r\n * Returns a name for this object that can be used in diagnostic messages, for example.\r\n *\r\n * @remarks\r\n * For an object that inherits ApiNameMixin, this will return the declared name (e.g. the name of a TypeScript\r\n * function). Otherwise, it will return a string such as \"(call signature)\" or \"(model)\".\r\n *\r\n * @virtual\r\n */\r\n public get displayName(): string {\r\n switch (this.kind) {\r\n case ApiItemKind.CallSignature:\r\n return '(call)';\r\n case ApiItemKind.Constructor:\r\n return '(constructor)';\r\n case ApiItemKind.ConstructSignature:\r\n return '(new)';\r\n case ApiItemKind.IndexSignature:\r\n return '(indexer)';\r\n case ApiItemKind.Model:\r\n return '(model)';\r\n }\r\n return '(???)'; // All other types should inherit ApiNameMixin which will override this property\r\n }\r\n\r\n /**\r\n * If this item was added to a ApiItemContainerMixin item, then this returns the container item.\r\n * If this is an Parameter that was added to a method or function, then this returns the function item.\r\n * Otherwise, it returns undefined.\r\n * @virtual\r\n */\r\n public get parent(): ApiItem | undefined {\r\n return this._parent;\r\n }\r\n\r\n /**\r\n * This property supports a visitor pattern for walking the tree.\r\n * For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically.\r\n * Otherwise it returns an empty array.\r\n * @virtual\r\n */\r\n public get members(): ReadonlyArray<ApiItem> {\r\n return [];\r\n }\r\n\r\n /**\r\n * If this item has a name (i.e. extends `ApiNameMixin`), then return all items that have the same parent\r\n * and the same name. Otherwise, return all items that have the same parent and the same `ApiItemKind`.\r\n *\r\n * @remarks\r\n * Examples: For a function, this would return all overloads for the function. For a constructor, this would\r\n * return all overloads for the constructor. For a merged declaration (e.g. a `namespace` and `enum` with the\r\n * same name), this would return both declarations. If this item does not have a parent, or if it is the only\r\n * item of its name/kind, then the result is an array containing only this item.\r\n */\r\n public getMergedSiblings(): ReadonlyArray<ApiItem> {\r\n const parent: ApiItem | undefined = this._parent;\r\n if (parent && ApiItemContainerMixin.isBaseClassOf(parent)) {\r\n return parent._getMergedSiblingsForMember(this);\r\n }\r\n return [];\r\n }\r\n\r\n /**\r\n * Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.\r\n */\r\n public getHierarchy(): ReadonlyArray<ApiItem> {\r\n const hierarchy: ApiItem[] = [];\r\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\r\n hierarchy.push(current);\r\n }\r\n hierarchy.reverse();\r\n return hierarchy;\r\n }\r\n\r\n /**\r\n * This returns a scoped name such as `\"Namespace1.Namespace2.MyClass.myMember()\"`. It does not include the\r\n * package name or entry point.\r\n *\r\n * @remarks\r\n * If called on an ApiEntrypoint, ApiPackage, or ApiModel item, the result is an empty string.\r\n */\r\n public getScopedNameWithinPackage(): string {\r\n const reversedParts: string[] = [];\r\n\r\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\r\n if (\r\n current.kind === ApiItemKind.Model ||\r\n current.kind === ApiItemKind.Package ||\r\n current.kind === ApiItemKind.EntryPoint\r\n ) {\r\n break;\r\n }\r\n if (reversedParts.length !== 0) {\r\n reversedParts.push('.');\r\n } else {\r\n switch (current.kind) {\r\n case ApiItemKind.CallSignature:\r\n case ApiItemKind.ConstructSignature:\r\n case ApiItemKind.Constructor:\r\n case ApiItemKind.IndexSignature:\r\n // These functional forms don't have a proper name, so we don't append the \"()\" suffix\r\n break;\r\n default:\r\n if (ApiParameterListMixin.isBaseClassOf(current)) {\r\n reversedParts.push('()');\r\n }\r\n }\r\n }\r\n reversedParts.push(current.displayName);\r\n }\r\n\r\n return reversedParts.reverse().join('');\r\n }\r\n\r\n /**\r\n * If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned.\r\n * Otherwise undefined is returned.\r\n */\r\n public getAssociatedPackage(): ApiPackage | undefined {\r\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\r\n if (current.kind === ApiItemKind.Package) {\r\n return current as ApiPackage;\r\n }\r\n }\r\n return undefined;\r\n }\r\n\r\n /** @virtual */\r\n public getSortKey(): string {\r\n return this.containerKey;\r\n }\r\n\r\n /**\r\n * PRIVATE\r\n *\r\n * @privateRemarks\r\n * Allows ApiItemContainerMixin to assign the parent when the item is added to a container.\r\n *\r\n * @internal\r\n */\r\n public [apiItem_onParentChanged](parent: ApiItem | undefined): void {\r\n this._parent = parent;\r\n this._canonicalReference = undefined;\r\n }\r\n\r\n /**\r\n * Builds the cached object used by the `canonicalReference` property.\r\n * @virtual\r\n */\r\n protected buildCanonicalReference(): DeclarationReference {\r\n throw new InternalError('ApiItem.canonicalReference was not implemented by the child class');\r\n }\r\n}\r\n\r\n/**\r\n * This abstraction is used by the mixin pattern.\r\n * It describes a class type that inherits from {@link ApiItem}.\r\n *\r\n * @public\r\n */\r\nexport interface IApiItemConstructor extends Constructor<ApiItem>, PropertiesOf<typeof ApiItem> {}\r\n"]}
@@ -1,6 +1,6 @@
1
1
  import { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
2
2
  /** @public */
3
- export declare const enum ExcerptTokenKind {
3
+ export declare enum ExcerptTokenKind {
4
4
  /**
5
5
  * Generic text without any special properties
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Excerpt.d.ts","sourceRoot":"","sources":["../../src/mixins/Excerpt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAG/F,cAAc;AACd,0BAAkB,gBAAgB;IAChC;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,SAAS,cAAc;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,cAAc;AACd,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,qBAAa,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AM,CAAC;CAClB;AAED,cAAc;AACd,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAmC;gBAEpD,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,oBAAoB;IAUlG;;OAEG;IACH,IAAW,IAAI,IAAI,gBAAgB,CAElC;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;OAGG;IACH,IAAW,kBAAkB,IAAI,oBAAoB,GAAG,SAAS,CAEhE;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,OAAO;IAClB;;;;OAIG;IACH,SAAgB,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAEpD;;OAEG;IACH,SAAgB,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAEzD;;;OAGG;IACH,SAAgB,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAE3D,OAAO,CAAC,KAAK,CAAqB;gBAEf,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,kBAAkB;IAetF;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAKxB;IAED;;OAEG;IACH,IAAW,OAAO,IAAI,OAAO,CAE5B;CACF"}
@@ -2,8 +2,20 @@
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.Excerpt = exports.ExcerptToken = void 0;
5
+ exports.Excerpt = exports.ExcerptToken = exports.ExcerptTokenKind = void 0;
6
6
  const node_core_library_1 = require("@rushstack/node-core-library");
7
+ /** @public */
8
+ var ExcerptTokenKind;
9
+ (function (ExcerptTokenKind) {
10
+ /**
11
+ * Generic text without any special properties
12
+ */
13
+ ExcerptTokenKind["Content"] = "Content";
14
+ /**
15
+ * A reference to an API declaration
16
+ */
17
+ ExcerptTokenKind["Reference"] = "Reference";
18
+ })(ExcerptTokenKind = exports.ExcerptTokenKind || (exports.ExcerptTokenKind = {}));
7
19
  /**
8
20
  * Represents a fragment of text belonging to an {@link Excerpt} object.
9
21
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Excerpt.js","sourceRoot":"","sources":["../../src/mixins/Excerpt.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,oEAAoD;AA2CpD;;;;GAIG;AACH,MAAa,YAAY;IAKvB,YAAmB,IAAsB,EAAE,IAAY,EAAE,kBAAyC;QAChG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,kGAAkG;QAClG,4FAA4F;QAC5F,kFAAkF;QAClF,IAAI,CAAC,KAAK,GAAG,wBAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;CACF;AApCD,oCAoCC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,OAAO;IAqBlB,YAAmB,MAAmC,EAAE,UAA8B;QACpF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IACE,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC;YAC9B,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM;YAC7C,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EACrD;YACA,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACxC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC/F,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC7D;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IACjE,CAAC;CACF;AApDD,0BAoDC","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 { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\r\nimport { Text } from '@rushstack/node-core-library';\r\n\r\n/** @public */\r\nexport const enum ExcerptTokenKind {\r\n /**\r\n * Generic text without any special properties\r\n */\r\n Content = 'Content',\r\n\r\n /**\r\n * A reference to an API declaration\r\n */\r\n Reference = 'Reference'\r\n}\r\n\r\n/**\r\n * Used by {@link Excerpt} to indicate a range of indexes within an array of `ExcerptToken` objects.\r\n *\r\n * @public\r\n */\r\nexport interface IExcerptTokenRange {\r\n /**\r\n * The starting index of the span.\r\n */\r\n startIndex: number;\r\n\r\n /**\r\n * The index of the last member of the span, plus one.\r\n *\r\n * @remarks\r\n *\r\n * If `startIndex` and `endIndex` are the same number, then the span is empty.\r\n */\r\n endIndex: number;\r\n}\r\n\r\n/** @public */\r\nexport interface IExcerptToken {\r\n readonly kind: ExcerptTokenKind;\r\n text: string;\r\n canonicalReference?: string;\r\n}\r\n\r\n/**\r\n * Represents a fragment of text belonging to an {@link Excerpt} object.\r\n *\r\n * @public\r\n */\r\nexport class ExcerptToken {\r\n private readonly _kind: ExcerptTokenKind;\r\n private readonly _text: string;\r\n private readonly _canonicalReference: DeclarationReference | undefined;\r\n\r\n public constructor(kind: ExcerptTokenKind, text: string, canonicalReference?: DeclarationReference) {\r\n this._kind = kind;\r\n\r\n // Standardize the newlines across operating systems. Even though this may deviate from the actual\r\n // input source file that was parsed, it's useful because the newline gets serialized inside\r\n // a string literal in .api.json, which cannot be automatically normalized by Git.\r\n this._text = Text.convertToLf(text);\r\n this._canonicalReference = canonicalReference;\r\n }\r\n\r\n /**\r\n * Indicates the kind of token.\r\n */\r\n public get kind(): ExcerptTokenKind {\r\n return this._kind;\r\n }\r\n\r\n /**\r\n * The text fragment.\r\n */\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n /**\r\n * The hyperlink target for a token whose type is `ExcerptTokenKind.Reference`. For other token types,\r\n * this property will be `undefined`.\r\n */\r\n public get canonicalReference(): DeclarationReference | undefined {\r\n return this._canonicalReference;\r\n }\r\n}\r\n\r\n/**\r\n * The `Excerpt` class is used by {@link ApiDeclaredItem} to represent a TypeScript code fragment that may be\r\n * annotated with hyperlinks to declared types (and in the future, source code locations).\r\n *\r\n * @remarks\r\n * API Extractor's .api.json file format stores excerpts compactly as a start/end indexes into an array of tokens.\r\n * Every `ApiDeclaredItem` has a \"main excerpt\" corresponding to the full list of tokens. The declaration may\r\n * also have have \"captured\" excerpts that correspond to subranges of tokens.\r\n *\r\n * For example, if the main excerpt is:\r\n *\r\n * ```\r\n * function parse(s: string): Vector | undefined;\r\n * ```\r\n *\r\n * ...then this entire signature is the \"main excerpt\", whereas the function's return type `Vector | undefined` is a\r\n * captured excerpt. The `Vector` token might be a hyperlink to that API item.\r\n *\r\n * An excerpt may be empty (i.e. a token range containing zero tokens). For example, if a function's return value\r\n * is not explicitly declared, then the returnTypeExcerpt will be empty. By contrast, a class constructor cannot\r\n * have a return value, so ApiConstructor has no returnTypeExcerpt property at all.\r\n *\r\n * @public\r\n */\r\nexport class Excerpt {\r\n /**\r\n * The complete list of tokens for the source code fragment that this excerpt is based upon.\r\n * If this object is the main excerpt, then it will span all of the tokens; otherwise, it will correspond to\r\n * a range within the array.\r\n */\r\n public readonly tokens: ReadonlyArray<ExcerptToken>;\r\n\r\n /**\r\n * Specifies the excerpt's range within the `tokens` array.\r\n */\r\n public readonly tokenRange: Readonly<IExcerptTokenRange>;\r\n\r\n /**\r\n * The tokens spanned by this excerpt. It is the range of the `tokens` array as specified by the `tokenRange`\r\n * property.\r\n */\r\n public readonly spannedTokens: ReadonlyArray<ExcerptToken>;\r\n\r\n private _text: string | undefined;\r\n\r\n public constructor(tokens: ReadonlyArray<ExcerptToken>, tokenRange: IExcerptTokenRange) {\r\n this.tokens = tokens;\r\n this.tokenRange = tokenRange;\r\n\r\n if (\r\n this.tokenRange.startIndex < 0 ||\r\n this.tokenRange.endIndex > this.tokens.length ||\r\n this.tokenRange.startIndex > this.tokenRange.endIndex\r\n ) {\r\n throw new Error('Invalid token range');\r\n }\r\n\r\n this.spannedTokens = this.tokens.slice(this.tokenRange.startIndex, this.tokenRange.endIndex);\r\n }\r\n\r\n /**\r\n * The excerpted text, formed by concatenating the text of the `spannedTokens` strings.\r\n */\r\n public get text(): string {\r\n if (this._text === undefined) {\r\n this._text = this.spannedTokens.map((x) => x.text).join('');\r\n }\r\n return this._text;\r\n }\r\n\r\n /**\r\n * Returns true if the excerpt is an empty range.\r\n */\r\n public get isEmpty(): boolean {\r\n return this.tokenRange.startIndex === this.tokenRange.endIndex;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Excerpt.js","sourceRoot":"","sources":["../../src/mixins/Excerpt.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,oEAAoD;AAEpD,cAAc;AACd,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,uCAAmB,CAAA;IAEnB;;OAEG;IACH,2CAAuB,CAAA;AACzB,CAAC,EAVW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAU3B;AA8BD;;;;GAIG;AACH,MAAa,YAAY;IAKvB,YAAmB,IAAsB,EAAE,IAAY,EAAE,kBAAyC;QAChG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,kGAAkG;QAClG,4FAA4F;QAC5F,kFAAkF;QAClF,IAAI,CAAC,KAAK,GAAG,wBAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,IAAW,kBAAkB;QAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;CACF;AApCD,oCAoCC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,OAAO;IAqBlB,YAAmB,MAAmC,EAAE,UAA8B;QACpF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IACE,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC;YAC9B,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM;YAC7C,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EACrD;YACA,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACxC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC/F,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACb,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC7D;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,KAAK,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IACjE,CAAC;CACF;AApDD,0BAoDC","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 { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\r\nimport { Text } from '@rushstack/node-core-library';\r\n\r\n/** @public */\r\nexport enum ExcerptTokenKind {\r\n /**\r\n * Generic text without any special properties\r\n */\r\n Content = 'Content',\r\n\r\n /**\r\n * A reference to an API declaration\r\n */\r\n Reference = 'Reference'\r\n}\r\n\r\n/**\r\n * Used by {@link Excerpt} to indicate a range of indexes within an array of `ExcerptToken` objects.\r\n *\r\n * @public\r\n */\r\nexport interface IExcerptTokenRange {\r\n /**\r\n * The starting index of the span.\r\n */\r\n startIndex: number;\r\n\r\n /**\r\n * The index of the last member of the span, plus one.\r\n *\r\n * @remarks\r\n *\r\n * If `startIndex` and `endIndex` are the same number, then the span is empty.\r\n */\r\n endIndex: number;\r\n}\r\n\r\n/** @public */\r\nexport interface IExcerptToken {\r\n readonly kind: ExcerptTokenKind;\r\n text: string;\r\n canonicalReference?: string;\r\n}\r\n\r\n/**\r\n * Represents a fragment of text belonging to an {@link Excerpt} object.\r\n *\r\n * @public\r\n */\r\nexport class ExcerptToken {\r\n private readonly _kind: ExcerptTokenKind;\r\n private readonly _text: string;\r\n private readonly _canonicalReference: DeclarationReference | undefined;\r\n\r\n public constructor(kind: ExcerptTokenKind, text: string, canonicalReference?: DeclarationReference) {\r\n this._kind = kind;\r\n\r\n // Standardize the newlines across operating systems. Even though this may deviate from the actual\r\n // input source file that was parsed, it's useful because the newline gets serialized inside\r\n // a string literal in .api.json, which cannot be automatically normalized by Git.\r\n this._text = Text.convertToLf(text);\r\n this._canonicalReference = canonicalReference;\r\n }\r\n\r\n /**\r\n * Indicates the kind of token.\r\n */\r\n public get kind(): ExcerptTokenKind {\r\n return this._kind;\r\n }\r\n\r\n /**\r\n * The text fragment.\r\n */\r\n public get text(): string {\r\n return this._text;\r\n }\r\n\r\n /**\r\n * The hyperlink target for a token whose type is `ExcerptTokenKind.Reference`. For other token types,\r\n * this property will be `undefined`.\r\n */\r\n public get canonicalReference(): DeclarationReference | undefined {\r\n return this._canonicalReference;\r\n }\r\n}\r\n\r\n/**\r\n * The `Excerpt` class is used by {@link ApiDeclaredItem} to represent a TypeScript code fragment that may be\r\n * annotated with hyperlinks to declared types (and in the future, source code locations).\r\n *\r\n * @remarks\r\n * API Extractor's .api.json file format stores excerpts compactly as a start/end indexes into an array of tokens.\r\n * Every `ApiDeclaredItem` has a \"main excerpt\" corresponding to the full list of tokens. The declaration may\r\n * also have have \"captured\" excerpts that correspond to subranges of tokens.\r\n *\r\n * For example, if the main excerpt is:\r\n *\r\n * ```\r\n * function parse(s: string): Vector | undefined;\r\n * ```\r\n *\r\n * ...then this entire signature is the \"main excerpt\", whereas the function's return type `Vector | undefined` is a\r\n * captured excerpt. The `Vector` token might be a hyperlink to that API item.\r\n *\r\n * An excerpt may be empty (i.e. a token range containing zero tokens). For example, if a function's return value\r\n * is not explicitly declared, then the returnTypeExcerpt will be empty. By contrast, a class constructor cannot\r\n * have a return value, so ApiConstructor has no returnTypeExcerpt property at all.\r\n *\r\n * @public\r\n */\r\nexport class Excerpt {\r\n /**\r\n * The complete list of tokens for the source code fragment that this excerpt is based upon.\r\n * If this object is the main excerpt, then it will span all of the tokens; otherwise, it will correspond to\r\n * a range within the array.\r\n */\r\n public readonly tokens: ReadonlyArray<ExcerptToken>;\r\n\r\n /**\r\n * Specifies the excerpt's range within the `tokens` array.\r\n */\r\n public readonly tokenRange: Readonly<IExcerptTokenRange>;\r\n\r\n /**\r\n * The tokens spanned by this excerpt. It is the range of the `tokens` array as specified by the `tokenRange`\r\n * property.\r\n */\r\n public readonly spannedTokens: ReadonlyArray<ExcerptToken>;\r\n\r\n private _text: string | undefined;\r\n\r\n public constructor(tokens: ReadonlyArray<ExcerptToken>, tokenRange: IExcerptTokenRange) {\r\n this.tokens = tokens;\r\n this.tokenRange = tokenRange;\r\n\r\n if (\r\n this.tokenRange.startIndex < 0 ||\r\n this.tokenRange.endIndex > this.tokens.length ||\r\n this.tokenRange.startIndex > this.tokenRange.endIndex\r\n ) {\r\n throw new Error('Invalid token range');\r\n }\r\n\r\n this.spannedTokens = this.tokens.slice(this.tokenRange.startIndex, this.tokenRange.endIndex);\r\n }\r\n\r\n /**\r\n * The excerpted text, formed by concatenating the text of the `spannedTokens` strings.\r\n */\r\n public get text(): string {\r\n if (this._text === undefined) {\r\n this._text = this.spannedTokens.map((x) => x.text).join('');\r\n }\r\n return this._text;\r\n }\r\n\r\n /**\r\n * Returns true if the excerpt is an empty range.\r\n */\r\n public get isEmpty(): boolean {\r\n return this.tokenRange.startIndex === this.tokenRange.endIndex;\r\n }\r\n}\r\n"]}
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.ApiCallSignature = void 0;
6
6
  const DeclarationReference_1 = require("@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference");
7
+ const ApiItem_1 = require("../items/ApiItem");
7
8
  const ApiDeclaredItem_1 = require("../items/ApiDeclaredItem");
8
9
  const ApiParameterListMixin_1 = require("../mixins/ApiParameterListMixin");
9
10
  const ApiReleaseTagMixin_1 = require("../mixins/ApiReleaseTagMixin");
@@ -43,11 +44,11 @@ class ApiCallSignature extends (0, ApiTypeParameterListMixin_1.ApiTypeParameterL
43
44
  super(options);
44
45
  }
45
46
  static getContainerKey(overloadIndex) {
46
- return `|${"CallSignature" /* CallSignature */}|${overloadIndex}`;
47
+ return `|${ApiItem_1.ApiItemKind.CallSignature}|${overloadIndex}`;
47
48
  }
48
49
  /** @override */
49
50
  get kind() {
50
- return "CallSignature" /* CallSignature */;
51
+ return ApiItem_1.ApiItemKind.CallSignature;
51
52
  }
52
53
  /** @override */
53
54
  get containerKey() {
@@ -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,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"]}
1
+ {"version":3,"file":"ApiCallSignature.js","sourceRoot":"","sources":["../../src/model/ApiCallSignature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAIiE;AACjE,8CAA+C;AAC/C,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,qBAAW,CAAC,aAAa,IAAI,aAAa,EAAE,CAAC;IAC1D,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,aAAa,CAAC;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"]}
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.ApiClass = void 0;
6
6
  const DeclarationReference_1 = require("@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference");
7
+ const ApiItem_1 = require("../items/ApiItem");
7
8
  const ApiDeclaredItem_1 = require("../items/ApiDeclaredItem");
8
9
  const ApiItemContainerMixin_1 = require("../mixins/ApiItemContainerMixin");
9
10
  const ApiReleaseTagMixin_1 = require("../mixins/ApiReleaseTagMixin");
@@ -41,7 +42,7 @@ class ApiClass extends (0, ApiItemContainerMixin_1.ApiItemContainerMixin)((0, Ap
41
42
  }
42
43
  }
43
44
  static getContainerKey(name) {
44
- return `${name}|${"Class" /* Class */}`;
45
+ return `${name}|${ApiItem_1.ApiItemKind.Class}`;
45
46
  }
46
47
  /** @override */
47
48
  static onDeserializeInto(options, context, jsonObject) {
@@ -51,7 +52,7 @@ class ApiClass extends (0, ApiItemContainerMixin_1.ApiItemContainerMixin)((0, Ap
51
52
  }
52
53
  /** @override */
53
54
  get kind() {
54
- return "Class" /* Class */;
55
+ return ApiItem_1.ApiItemKind.Class;
55
56
  }
56
57
  /** @override */
57
58
  get containerKey() {
@@ -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;;;;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W,eAAe;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAkC;QACrD,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAEhC,iHAAiH;QACjH,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC;SACpE;QAED,UAAU,CAAC,qBAAqB,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3F,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,aAAa,GAAc,2CAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,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"]}
1
+ {"version":3,"file":"ApiClass.js","sourceRoot":"","sources":["../../src/model/ApiClass.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAKiE;AACjE,8CAA+C;AAC/C,8DAA0G;AAC1G,2EAAuG;AACvG,qEAA8F;AAE9F,iDAA8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AC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAkC;QACrD,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAEhC,iHAAiH;QACjH,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC;SACpE;QAED,UAAU,CAAC,qBAAqB,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3F,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,aAAa,GAAc,2CAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,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"]}
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.ApiConstructSignature = void 0;
6
6
  const DeclarationReference_1 = require("@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference");
7
+ const ApiItem_1 = require("../items/ApiItem");
7
8
  const ApiDeclaredItem_1 = require("../items/ApiDeclaredItem");
8
9
  const ApiParameterListMixin_1 = require("../mixins/ApiParameterListMixin");
9
10
  const ApiReleaseTagMixin_1 = require("../mixins/ApiReleaseTagMixin");
@@ -56,11 +57,11 @@ class ApiConstructSignature extends (0, ApiTypeParameterListMixin_1.ApiTypeParam
56
57
  super(options);
57
58
  }
58
59
  static getContainerKey(overloadIndex) {
59
- return `|${"ConstructSignature" /* ConstructSignature */}|${overloadIndex}`;
60
+ return `|${ApiItem_1.ApiItemKind.ConstructSignature}|${overloadIndex}`;
60
61
  }
61
62
  /** @override */
62
63
  get kind() {
63
- return "ConstructSignature" /* ConstructSignature */;
64
+ return ApiItem_1.ApiItemKind.ConstructSignature;
64
65
  }
65
66
  /** @override */
66
67
  get containerKey() {
@@ -1 +1 @@
1
- {"version":3,"file":"ApiConstructSignature.js","sourceRoot":"","sources":["../../src/model/ApiConstructSignature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAIiE;AAEjE,8DAAoF;AACpF,2EAAuG;AACvG,qEAA8F;AAC9F,qEAA8F;AAC9F,mFAG6C;AAa7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAa,qBAAsB,SAAQ,IAAA,qDAAyB,EAClE,IAAA,6CAAqB,EAAC,IAAA,uCAAkB,EAAC,IAAA,uCAAkB,EAAC,iCAAe,CAAC,CAAC,CAAC,CAC/E;IACC,YAAmB,OAAsC;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,aAAqB;QACjD,OAAO,IAAI,6CAA8B,IAAI,aAAa,EAAE,CAAC;IAC/D,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,qDAAsC;IACxC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,qBAAqB,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACnE,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,gCAA4B,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9F,CAAC;CACF;AA7BD,sDA6BC","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 ApiTypeParameterListMixin,\r\n IApiTypeParameterListMixinOptions\r\n} from '../mixins/ApiTypeParameterListMixin';\r\n\r\n/**\r\n * Constructor options for {@link ApiConstructor}.\r\n * @public\r\n */\r\nexport interface IApiConstructSignatureOptions\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 construct signature that belongs to an `ApiInterface`.\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 * `ApiConstructSignature` represents a construct signature using the `new` keyword such as in this example:\r\n *\r\n * ```ts\r\n * export interface IVector {\r\n * x: number;\r\n * y: number;\r\n * }\r\n *\r\n * export interface IVectorConstructor {\r\n * // A construct signature:\r\n * new(x: number, y: number): IVector;\r\n * }\r\n *\r\n * export function createVector(vectorConstructor: IVectorConstructor,\r\n * x: number, y: number): IVector {\r\n * return new vectorConstructor(x, y);\r\n * }\r\n *\r\n * class Vector implements IVector {\r\n * public x: number;\r\n * public y: number;\r\n * public constructor(x: number, y: number) {\r\n * this.x = x;\r\n * this.y = y;\r\n * }\r\n * }\r\n *\r\n * let vector: Vector = createVector(Vector, 1, 2);\r\n * ```\r\n *\r\n * Compare with {@link ApiConstructor}, which describes the class constructor itself.\r\n *\r\n * @public\r\n */\r\nexport class ApiConstructSignature extends ApiTypeParameterListMixin(\r\n ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiDeclaredItem)))\r\n) {\r\n public constructor(options: IApiConstructSignatureOptions) {\r\n super(options);\r\n }\r\n\r\n public static getContainerKey(overloadIndex: number): string {\r\n return `|${ApiItemKind.ConstructSignature}|${overloadIndex}`;\r\n }\r\n\r\n /** @override */\r\n public get kind(): ApiItemKind {\r\n return ApiItemKind.ConstructSignature;\r\n }\r\n\r\n /** @override */\r\n public get containerKey(): string {\r\n return ApiConstructSignature.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.ConstructSignature).withOverloadIndex(this.overloadIndex);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiConstructSignature.js","sourceRoot":"","sources":["../../src/model/ApiConstructSignature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAIiE;AACjE,8CAA+C;AAC/C,8DAAoF;AACpF,2EAAuG;AACvG,qEAA8F;AAC9F,qEAA8F;AAC9F,mFAG6C;AAa7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAa,qBAAsB,SAAQ,IAAA,qDAAyB,EAClE,IAAA,6CAAqB,EAAC,IAAA,uCAAkB,EAAC,IAAA,uCAAkB,EAAC,iCAAe,CAAC,CAAC,CAAC,CAC/E;IACC,YAAmB,OAAsC;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,aAAqB;QACjD,OAAO,IAAI,qBAAW,CAAC,kBAAkB,IAAI,aAAa,EAAE,CAAC;IAC/D,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,kBAAkB,CAAC;IACxC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,qBAAqB,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACnE,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,gCAA4B,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9F,CAAC;CACF;AA7BD,sDA6BC","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 ApiTypeParameterListMixin,\r\n IApiTypeParameterListMixinOptions\r\n} from '../mixins/ApiTypeParameterListMixin';\r\n\r\n/**\r\n * Constructor options for {@link ApiConstructor}.\r\n * @public\r\n */\r\nexport interface IApiConstructSignatureOptions\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 construct signature that belongs to an `ApiInterface`.\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 * `ApiConstructSignature` represents a construct signature using the `new` keyword such as in this example:\r\n *\r\n * ```ts\r\n * export interface IVector {\r\n * x: number;\r\n * y: number;\r\n * }\r\n *\r\n * export interface IVectorConstructor {\r\n * // A construct signature:\r\n * new(x: number, y: number): IVector;\r\n * }\r\n *\r\n * export function createVector(vectorConstructor: IVectorConstructor,\r\n * x: number, y: number): IVector {\r\n * return new vectorConstructor(x, y);\r\n * }\r\n *\r\n * class Vector implements IVector {\r\n * public x: number;\r\n * public y: number;\r\n * public constructor(x: number, y: number) {\r\n * this.x = x;\r\n * this.y = y;\r\n * }\r\n * }\r\n *\r\n * let vector: Vector = createVector(Vector, 1, 2);\r\n * ```\r\n *\r\n * Compare with {@link ApiConstructor}, which describes the class constructor itself.\r\n *\r\n * @public\r\n */\r\nexport class ApiConstructSignature extends ApiTypeParameterListMixin(\r\n ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiDeclaredItem)))\r\n) {\r\n public constructor(options: IApiConstructSignatureOptions) {\r\n super(options);\r\n }\r\n\r\n public static getContainerKey(overloadIndex: number): string {\r\n return `|${ApiItemKind.ConstructSignature}|${overloadIndex}`;\r\n }\r\n\r\n /** @override */\r\n public get kind(): ApiItemKind {\r\n return ApiItemKind.ConstructSignature;\r\n }\r\n\r\n /** @override */\r\n public get containerKey(): string {\r\n return ApiConstructSignature.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.ConstructSignature).withOverloadIndex(this.overloadIndex);\r\n }\r\n}\r\n"]}