@microsoft/api-extractor-model 7.15.2 → 7.16.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/README.md +68 -68
  2. package/dist/rollup.d.ts +16 -4
  3. package/dist/tsdoc-metadata.json +1 -1
  4. package/lib/aedoc/AedocDefinitions.js.map +1 -1
  5. package/lib/aedoc/ReleaseTag.js.map +1 -1
  6. package/lib/index.js.map +1 -1
  7. package/lib/items/ApiDeclaredItem.js.map +1 -1
  8. package/lib/items/ApiDocumentedItem.js.map +1 -1
  9. package/lib/items/ApiItem.js.map +1 -1
  10. package/lib/items/ApiPropertyItem.js.map +1 -1
  11. package/lib/mixins/ApiItemContainerMixin.js.map +1 -1
  12. package/lib/mixins/ApiNameMixin.js.map +1 -1
  13. package/lib/mixins/ApiOptionalMixin.js.map +1 -1
  14. package/lib/mixins/ApiParameterListMixin.d.ts +1 -0
  15. package/lib/mixins/ApiParameterListMixin.d.ts.map +1 -1
  16. package/lib/mixins/ApiParameterListMixin.js +4 -1
  17. package/lib/mixins/ApiParameterListMixin.js.map +1 -1
  18. package/lib/mixins/ApiReleaseTagMixin.js.map +1 -1
  19. package/lib/mixins/ApiReturnTypeMixin.js.map +1 -1
  20. package/lib/mixins/ApiStaticMixin.js.map +1 -1
  21. package/lib/mixins/ApiTypeParameterListMixin.js.map +1 -1
  22. package/lib/mixins/Excerpt.js.map +1 -1
  23. package/lib/mixins/Mixin.js.map +1 -1
  24. package/lib/model/ApiCallSignature.js.map +1 -1
  25. package/lib/model/ApiClass.js.map +1 -1
  26. package/lib/model/ApiConstructSignature.js.map +1 -1
  27. package/lib/model/ApiConstructor.js.map +1 -1
  28. package/lib/model/ApiEntryPoint.js.map +1 -1
  29. package/lib/model/ApiEnum.js.map +1 -1
  30. package/lib/model/ApiEnumMember.js.map +1 -1
  31. package/lib/model/ApiFunction.js.map +1 -1
  32. package/lib/model/ApiIndexSignature.js.map +1 -1
  33. package/lib/model/ApiInterface.js.map +1 -1
  34. package/lib/model/ApiMethod.js.map +1 -1
  35. package/lib/model/ApiMethodSignature.js.map +1 -1
  36. package/lib/model/ApiModel.js.map +1 -1
  37. package/lib/model/ApiNamespace.js.map +1 -1
  38. package/lib/model/ApiPackage.js.map +1 -1
  39. package/lib/model/ApiProperty.js.map +1 -1
  40. package/lib/model/ApiPropertySignature.js.map +1 -1
  41. package/lib/model/ApiTypeAlias.js.map +1 -1
  42. package/lib/model/ApiVariable.js.map +1 -1
  43. package/lib/model/Deserializer.js.map +1 -1
  44. package/lib/model/DeserializerContext.d.ts +10 -4
  45. package/lib/model/DeserializerContext.d.ts.map +1 -1
  46. package/lib/model/DeserializerContext.js +10 -4
  47. package/lib/model/DeserializerContext.js.map +1 -1
  48. package/lib/model/HeritageType.js.map +1 -1
  49. package/lib/model/ModelReferenceResolver.js.map +1 -1
  50. package/lib/model/Parameter.d.ts +5 -0
  51. package/lib/model/Parameter.d.ts.map +1 -1
  52. package/lib/model/Parameter.js +1 -0
  53. package/lib/model/Parameter.js.map +1 -1
  54. package/lib/model/TypeParameter.js.map +1 -1
  55. package/package.json +31 -28
  56. package/CHANGELOG.json +0 -1553
  57. package/CHANGELOG.md +0 -648
package/README.md CHANGED
@@ -1,68 +1,68 @@
1
- # @microsoft/api-extractor-model
2
-
3
- Use this library to read and write *.api.json files as defined by the [API Extractor](https://api-extractor.com/) tool.
4
- These files are used to generate a documentation website for your TypeScript package. The files store the
5
- API signatures and doc comments that were extracted from your package.
6
-
7
- API documentation for this package: https://rushstack.io/pages/api/api-extractor-model/
8
-
9
- ## Example Usage
10
-
11
- The following code sample shows how to load `example.api.json`, which would be generated by API Extractor
12
- when it analyzes a hypothetical NPM package called `example`:
13
-
14
- ```ts
15
- import { ApiModel, ApiPackage } from '@microsoft/api-extractor-model';
16
-
17
- const apiModel: ApiModel = new ApiModel();
18
- const apiPackage: ApiPackage = apiModel.loadPackage('example.api.json');
19
-
20
- for (const member of apiPackage.members) {
21
- console.log(member.displayName);
22
- }
23
- ```
24
-
25
- The `ApiModel` is acts as a container for various packages that are loaded and operated on as a group.
26
- For example, a documentation tool may need to resolve `@link` references across different packages.
27
- In this case we would load the various packages into the `ApiModel`, and then use
28
- the `ApiModel.resolveDeclarationReference()` to resolve the `@link` targets.
29
-
30
- The data structure forms a tree of various classes that start with the `Api` prefix. The nesting hierarchy
31
- might look like this:
32
-
33
- ```
34
- - ApiModel
35
- - ApiPackage
36
- - ApiEntryPoint
37
- - ApiClass
38
- - ApiMethod
39
- - ApiProperty
40
- - ApiEnum
41
- - ApiEnumMember
42
- - ApiInterface
43
- - ApiMethodSignature
44
- - ApiPropertySignature
45
- - ApiNamespace
46
- - (ApiClass, ApiEnum, ApiInterface, ...)
47
- ```
48
-
49
- You can use the `ApiItem.members` property to traverse this tree.
50
-
51
- Note that the non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use
52
- TypeScript "mixin" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various
53
- features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class
54
- to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components:
55
- the function that generates a subclass, an interface that describes the members of the subclass, and
56
- a namespace containing static members of the class.
57
-
58
- > For a complete project that uses these APIs to generate an API reference web site,
59
- > see the [@microsoft/api-documenter](https://www.npmjs.com/package/@microsoft/api-documenter) source code.
60
-
61
- ## Links
62
-
63
- - [CHANGELOG.md](
64
- https://github.com/microsoft/rushstack/blob/master/apps/api-extractor-model/CHANGELOG.md) - Find
65
- out what's new in the latest version
66
- - [API Reference](https://rushstack.io/pages/api/api-extractor-model/)
67
-
68
- API Extractor is part of the [Rush Stack](https://rushstack.io/) family of projects.
1
+ # @microsoft/api-extractor-model
2
+
3
+ Use this library to read and write *.api.json files as defined by the [API Extractor](https://api-extractor.com/) tool.
4
+ These files are used to generate a documentation website for your TypeScript package. The files store the
5
+ API signatures and doc comments that were extracted from your package.
6
+
7
+ API documentation for this package: https://rushstack.io/pages/api/api-extractor-model/
8
+
9
+ ## Example Usage
10
+
11
+ The following code sample shows how to load `example.api.json`, which would be generated by API Extractor
12
+ when it analyzes a hypothetical NPM package called `example`:
13
+
14
+ ```ts
15
+ import { ApiModel, ApiPackage } from '@microsoft/api-extractor-model';
16
+
17
+ const apiModel: ApiModel = new ApiModel();
18
+ const apiPackage: ApiPackage = apiModel.loadPackage('example.api.json');
19
+
20
+ for (const member of apiPackage.members) {
21
+ console.log(member.displayName);
22
+ }
23
+ ```
24
+
25
+ The `ApiModel` is acts as a container for various packages that are loaded and operated on as a group.
26
+ For example, a documentation tool may need to resolve `@link` references across different packages.
27
+ In this case we would load the various packages into the `ApiModel`, and then use
28
+ the `ApiModel.resolveDeclarationReference()` to resolve the `@link` targets.
29
+
30
+ The data structure forms a tree of various classes that start with the `Api` prefix. The nesting hierarchy
31
+ might look like this:
32
+
33
+ ```
34
+ - ApiModel
35
+ - ApiPackage
36
+ - ApiEntryPoint
37
+ - ApiClass
38
+ - ApiMethod
39
+ - ApiProperty
40
+ - ApiEnum
41
+ - ApiEnumMember
42
+ - ApiInterface
43
+ - ApiMethodSignature
44
+ - ApiPropertySignature
45
+ - ApiNamespace
46
+ - (ApiClass, ApiEnum, ApiInterface, ...)
47
+ ```
48
+
49
+ You can use the `ApiItem.members` property to traverse this tree.
50
+
51
+ Note that the non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use
52
+ TypeScript "mixin" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various
53
+ features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class
54
+ to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components:
55
+ the function that generates a subclass, an interface that describes the members of the subclass, and
56
+ a namespace containing static members of the class.
57
+
58
+ > For a complete project that uses these APIs to generate an API reference web site,
59
+ > see the [@microsoft/api-documenter](https://www.npmjs.com/package/@microsoft/api-documenter) source code.
60
+
61
+ ## Links
62
+
63
+ - [CHANGELOG.md](
64
+ https://github.com/microsoft/rushstack/blob/master/apps/api-extractor-model/CHANGELOG.md) - Find
65
+ out what's new in the latest version
66
+ - [API Reference](https://rushstack.io/pages/api/api-extractor-model/)
67
+
68
+ API Extractor is part of the [Rush Stack](https://rushstack.io/) family of projects.
package/dist/rollup.d.ts CHANGED
@@ -735,30 +735,36 @@ declare enum ApiJsonSchemaVersion {
735
735
  */
736
736
  V_1001 = 1001,
737
737
  /**
738
- * Remove "canonicalReference" field. This field was for diagnostic purposes only and was never deserialized.
738
+ * Remove `canonicalReference` field. This field was for diagnostic purposes only and was never deserialized.
739
739
  */
740
740
  V_1002 = 1002,
741
741
  /**
742
- * Reintroduce the "canonicalReference" field using the experimental new TSDoc declaration reference notation.
742
+ * Reintroduce the `canonicalReference` field using the experimental new TSDoc declaration reference notation.
743
743
  *
744
744
  * This is not a breaking change because this field is never deserialized; it is provided for informational
745
745
  * purposes only.
746
746
  */
747
747
  V_1003 = 1003,
748
748
  /**
749
- * Add a "tsdocConfig" field that tracks the TSDoc configuration for parsing doc comments.
749
+ * Add a `tsdocConfig` field that tracks the TSDoc configuration for parsing doc comments.
750
750
  *
751
751
  * This is not a breaking change because an older implementation will still work correctly. The
752
752
  * custom tags will be skipped over by the parser.
753
753
  */
754
754
  V_1004 = 1004,
755
+ /**
756
+ * Add an `isOptional` field to `IApiParameterOptions` to track whether a function parameter is optional.
757
+ *
758
+ * When loading older JSON files, the value defaults to `false`.
759
+ */
760
+ V_1005 = 1005,
755
761
  /**
756
762
  * The current latest .api.json schema version.
757
763
  *
758
764
  * IMPORTANT: When incrementing this number, consider whether `OLDEST_SUPPORTED` or `OLDEST_FORWARDS_COMPATIBLE`
759
765
  * should be updated.
760
766
  */
761
- LATEST = 1004,
767
+ LATEST = 1005,
762
768
  /**
763
769
  * The oldest .api.json schema version that is still supported for backwards compatibility.
764
770
  *
@@ -1981,6 +1987,7 @@ export declare interface IApiParameterListMixinOptions extends IApiItemOptions {
1981
1987
  export declare interface IApiParameterOptions {
1982
1988
  parameterName: string;
1983
1989
  parameterTypeTokenRange: IExcerptTokenRange;
1990
+ isOptional: boolean;
1984
1991
  }
1985
1992
 
1986
1993
  declare interface IApiPropertyItemJson extends IApiDeclaredItemJson {
@@ -2121,6 +2128,7 @@ export declare interface IExcerptTokenRange {
2121
2128
  export declare interface IParameterOptions {
2122
2129
  name: string;
2123
2130
  parameterTypeExcerpt: Excerpt;
2131
+ isOptional: boolean;
2124
2132
  parent: ApiParameterListMixin;
2125
2133
  }
2126
2134
 
@@ -2178,6 +2186,10 @@ export declare class Parameter {
2178
2186
  * The parameter name.
2179
2187
  */
2180
2188
  name: string;
2189
+ /**
2190
+ * Whether the parameter is optional.
2191
+ */
2192
+ isOptional: boolean;
2181
2193
  private _parent;
2182
2194
  constructor(options: IParameterOptions);
2183
2195
  /**
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.19.2"
8
+ "packageVersion": "7.19.4"
9
9
  }
10
10
  ]
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AedocDefinitions.js","sourceRoot":"","sources":["../../src/aedoc/AedocDefinitions.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,4CAA4G;AAE5G;;;GAGG;AACH,MAAa,gBAAgB;IAgBpB,MAAM,KAAK,kBAAkB;QAClC,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE;YACzC,MAAM,aAAa,GAAuB,IAAI,0BAAkB,EAAE,CAAC;YACnE,aAAa,CAAC,iBAAiB,CAC7B;gBACE,gBAAgB,CAAC,iBAAiB;gBAClC,gBAAgB,CAAC,eAAe;gBAChC,gBAAgB,CAAC,cAAc;aAChC,EACD,IAAI,CACL,CAAC;YAEF,aAAa,CAAC,iBAAiB,CAC7B;gBACE,oBAAY,CAAC,KAAK;gBAClB,oBAAY,CAAC,IAAI;gBACjB,oBAAY,CAAC,SAAS;gBACtB,oBAAY,CAAC,YAAY;gBACzB,oBAAY,CAAC,UAAU;gBACvB,oBAAY,CAAC,aAAa;gBAC1B,oBAAY,CAAC,OAAO;gBACpB,oBAAY,CAAC,UAAU;gBACvB,oBAAY,CAAC,QAAQ;gBACrB,oBAAY,CAAC,IAAI;gBACjB,oBAAY,CAAC,QAAQ;gBACrB,oBAAY,CAAC,oBAAoB;gBACjC,oBAAY,CAAC,KAAK;gBAClB,oBAAY,CAAC,cAAc;gBAC3B,oBAAY,CAAC,MAAM;gBACnB,oBAAY,CAAC,QAAQ;gBACrB,oBAAY,CAAC,OAAO;gBACpB,oBAAY,CAAC,OAAO;gBACpB,oBAAY,CAAC,MAAM;gBACnB,oBAAY,CAAC,MAAM;gBACnB,oBAAY,CAAC,OAAO;aACrB,EACD,IAAI,CACL,CAAC;YAEF,gBAAgB,CAAC,mBAAmB,GAAG,aAAa,CAAC;SACtD;QACD,OAAO,gBAAgB,CAAC,mBAAmB,CAAC;IAC9C,CAAC;;AA1DH,4CA6DC;AA5DwB,kCAAiB,GAAuB,IAAI,0BAAkB,CAAC;IACpF,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,0BAAkB,CAAC,WAAW;CAC3C,CAAC,CAAC;AAEoB,gCAAe,GAAuB,IAAI,0BAAkB,CAAC;IAClF,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,0BAAkB,CAAC,QAAQ;CACxC,CAAC,CAAC;AAEoB,+BAAc,GAAuB,IAAI,0BAAkB,CAAC;IACjF,OAAO,EAAE,cAAc;IACvB,UAAU,EAAE,0BAAkB,CAAC,WAAW;CAC3C,CAAC,CAAC","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 { TSDocConfiguration, TSDocTagDefinition, TSDocTagSyntaxKind, StandardTags } from '@microsoft/tsdoc';\r\n\r\n/**\r\n * @internal\r\n * @deprecated - tsdoc configuration is now constructed from tsdoc.json files associated with each package.\r\n */\r\nexport class AedocDefinitions {\r\n public static readonly betaDocumentation: TSDocTagDefinition = new TSDocTagDefinition({\r\n tagName: '@betaDocumentation',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag\r\n });\r\n\r\n public static readonly internalRemarks: TSDocTagDefinition = new TSDocTagDefinition({\r\n tagName: '@internalRemarks',\r\n syntaxKind: TSDocTagSyntaxKind.BlockTag\r\n });\r\n\r\n public static readonly preapprovedTag: TSDocTagDefinition = new TSDocTagDefinition({\r\n tagName: '@preapproved',\r\n syntaxKind: TSDocTagSyntaxKind.ModifierTag\r\n });\r\n\r\n public static get tsdocConfiguration(): TSDocConfiguration {\r\n if (!AedocDefinitions._tsdocConfiguration) {\r\n const configuration: TSDocConfiguration = new TSDocConfiguration();\r\n configuration.addTagDefinitions(\r\n [\r\n AedocDefinitions.betaDocumentation,\r\n AedocDefinitions.internalRemarks,\r\n AedocDefinitions.preapprovedTag\r\n ],\r\n true\r\n );\r\n\r\n configuration.setSupportForTags(\r\n [\r\n StandardTags.alpha,\r\n StandardTags.beta,\r\n StandardTags.decorator,\r\n StandardTags.defaultValue,\r\n StandardTags.deprecated,\r\n StandardTags.eventProperty,\r\n StandardTags.example,\r\n StandardTags.inheritDoc,\r\n StandardTags.internal,\r\n StandardTags.link,\r\n StandardTags.override,\r\n StandardTags.packageDocumentation,\r\n StandardTags.param,\r\n StandardTags.privateRemarks,\r\n StandardTags.public,\r\n StandardTags.readonly,\r\n StandardTags.remarks,\r\n StandardTags.returns,\r\n StandardTags.sealed,\r\n StandardTags.throws,\r\n StandardTags.virtual\r\n ],\r\n true\r\n );\r\n\r\n AedocDefinitions._tsdocConfiguration = configuration;\r\n }\r\n return AedocDefinitions._tsdocConfiguration;\r\n }\r\n\r\n private static _tsdocConfiguration: TSDocConfiguration | undefined;\r\n}\r\n"]}
1
+ {"version":3,"file":"AedocDefinitions.js","sourceRoot":"","sources":["../../src/aedoc/AedocDefinitions.ts"],"names":[],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C,CAAC;AAEoB,gCAAe,GAAuB,IAAI,0BAAkB,CAAC;IAClF,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,0BAAkB,CAAC,QAAQ;CACxC,CAAC,CAAC;AAEoB,+BAAc,GAAuB,IAAI,0BAAkB,CAAC;IACjF,OAAO,EAAE,cAAc;IACvB,UAAU,EAAE,0BAAkB,CAAC,WAAW;CAC3C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { TSDocConfiguration, TSDocTagDefinition, TSDocTagSyntaxKind, StandardTags } from '@microsoft/tsdoc';\n\n/**\n * @internal\n * @deprecated - tsdoc configuration is now constructed from tsdoc.json files associated with each package.\n */\nexport class AedocDefinitions {\n public static readonly betaDocumentation: TSDocTagDefinition = new TSDocTagDefinition({\n tagName: '@betaDocumentation',\n syntaxKind: TSDocTagSyntaxKind.ModifierTag\n });\n\n public static readonly internalRemarks: TSDocTagDefinition = new TSDocTagDefinition({\n tagName: '@internalRemarks',\n syntaxKind: TSDocTagSyntaxKind.BlockTag\n });\n\n public static readonly preapprovedTag: TSDocTagDefinition = new TSDocTagDefinition({\n tagName: '@preapproved',\n syntaxKind: TSDocTagSyntaxKind.ModifierTag\n });\n\n public static get tsdocConfiguration(): TSDocConfiguration {\n if (!AedocDefinitions._tsdocConfiguration) {\n const configuration: TSDocConfiguration = new TSDocConfiguration();\n configuration.addTagDefinitions(\n [\n AedocDefinitions.betaDocumentation,\n AedocDefinitions.internalRemarks,\n AedocDefinitions.preapprovedTag\n ],\n true\n );\n\n configuration.setSupportForTags(\n [\n StandardTags.alpha,\n StandardTags.beta,\n StandardTags.decorator,\n StandardTags.defaultValue,\n StandardTags.deprecated,\n StandardTags.eventProperty,\n StandardTags.example,\n StandardTags.inheritDoc,\n StandardTags.internal,\n StandardTags.link,\n StandardTags.override,\n StandardTags.packageDocumentation,\n StandardTags.param,\n StandardTags.privateRemarks,\n StandardTags.public,\n StandardTags.readonly,\n StandardTags.remarks,\n StandardTags.returns,\n StandardTags.sealed,\n StandardTags.throws,\n StandardTags.virtual\n ],\n true\n );\n\n AedocDefinitions._tsdocConfiguration = configuration;\n }\n return AedocDefinitions._tsdocConfiguration;\n }\n\n private static _tsdocConfiguration: TSDocConfiguration | undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ReleaseTag.js","sourceRoot":"","sources":["../../src/aedoc/ReleaseTag.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;;;;;;;GAaG;AACH,IAAY,UA2BX;AA3BD,WAAY,UAAU;IACpB;;OAEG;IACH,2CAAQ,CAAA;IACR;;;;OAIG;IACH,mDAAY,CAAA;IACZ;;;OAGG;IACH,6CAAS,CAAA;IACT;;;;OAIG;IACH,2CAAQ,CAAA;IACR;;;OAGG;IACH,+CAAU,CAAA;AACZ,CAAC,EA3BW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA2BrB;AAED;;;GAGG;AACH,WAAiB,UAAU;IACzB;;;;;OAKG;IACH,SAAgB,UAAU,CAAC,UAAsB;QAC/C,QAAQ,UAAU,EAAE;YAClB,KAAK,UAAU,CAAC,IAAI;gBAClB,OAAO,QAAQ,CAAC;YAClB,KAAK,UAAU,CAAC,QAAQ;gBACtB,OAAO,WAAW,CAAC;YACrB,KAAK,UAAU,CAAC,KAAK;gBACnB,OAAO,QAAQ,CAAC;YAClB,KAAK,UAAU,CAAC,IAAI;gBAClB,OAAO,OAAO,CAAC;YACjB,KAAK,UAAU,CAAC,MAAM;gBACpB,OAAO,SAAS,CAAC;YACnB;gBACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC9C;IACH,CAAC;IAfe,qBAAU,aAezB,CAAA;IAED;;;;;;;OAOG;IACH,SAAgB,OAAO,CAAC,CAAa,EAAE,CAAa;QAClD,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAFe,kBAAO,UAEtB,CAAA;AACH,CAAC,EAnCgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAmC1B","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 * A \"release tag\" is a custom TSDoc tag that is applied to an API to communicate the level of support\r\n * provided for third-party developers.\r\n *\r\n * @remarks\r\n *\r\n * The four release tags are: `@internal`, `@alpha`, `@beta`, and `@public`. They are applied to API items such\r\n * as classes, member functions, enums, etc. The release tag applies recursively to members of a container\r\n * (e.g. class or interface). For example, if a class is marked as `@beta`, then all of its members automatically\r\n * have this status; you DON'T need add the `@beta` tag to each member function. However, you could add\r\n * `@internal` to a member function to give it a different release status.\r\n *\r\n * @public\r\n */\r\nexport enum ReleaseTag {\r\n /**\r\n * No release tag was specified in the AEDoc summary.\r\n */\r\n None = 0,\r\n /**\r\n * Indicates that an API item is meant only for usage by other NPM packages from the same\r\n * maintainer. Third parties should never use \"internal\" APIs. (To emphasize this, their\r\n * names are prefixed by underscores.)\r\n */\r\n Internal = 1,\r\n /**\r\n * Indicates that an API item is eventually intended to be public, but currently is in an\r\n * early stage of development. Third parties should not use \"alpha\" APIs.\r\n */\r\n Alpha = 2,\r\n /**\r\n * Indicates that an API item has been released in an experimental state. Third parties are\r\n * encouraged to try it and provide feedback. However, a \"beta\" API should NOT be used\r\n * in production.\r\n */\r\n Beta = 3,\r\n /**\r\n * Indicates that an API item has been officially released. It is part of the supported\r\n * contract (e.g. SemVer) for a package.\r\n */\r\n Public = 4\r\n}\r\n\r\n/**\r\n * Helper functions for working with the `ReleaseTag` enum.\r\n * @public\r\n */\r\nexport namespace ReleaseTag {\r\n /**\r\n * Returns the TSDoc tag name for a `ReleaseTag` value.\r\n *\r\n * @remarks\r\n * For example, `getTagName(ReleaseTag.Internal)` would return the string `@internal`.\r\n */\r\n export function getTagName(releaseTag: ReleaseTag): string {\r\n switch (releaseTag) {\r\n case ReleaseTag.None:\r\n return '(none)';\r\n case ReleaseTag.Internal:\r\n return '@internal';\r\n case ReleaseTag.Alpha:\r\n return '@alpha';\r\n case ReleaseTag.Beta:\r\n return '@beta';\r\n case ReleaseTag.Public:\r\n return '@public';\r\n default:\r\n throw new Error('Unsupported release tag');\r\n }\r\n }\r\n\r\n /**\r\n * Compares two `ReleaseTag` values. Their values must not be `ReleaseTag.None`.\r\n * @returns 0 if `a` and `b` are equal, a positive number if `a` is more public than `b`,\r\n * and a negative number if `a` is less public than `b`.\r\n * @remarks\r\n * For example, `compareReleaseTag(ReleaseTag.Beta, ReleaseTag.Alpha)` will return a positive\r\n * number because beta is more public than alpha.\r\n */\r\n export function compare(a: ReleaseTag, b: ReleaseTag): number {\r\n return a - b;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ReleaseTag.js","sourceRoot":"","sources":["../../src/aedoc/ReleaseTag.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;;;;;;;;;;GAaG;AACH,IAAY,UA2BX;AA3BD,WAAY,UAAU;IACpB;;OAEG;IACH,2CAAQ,CAAA;IACR;;;;OAIG;IACH,mDAAY,CAAA;IACZ;;;OAGG;IACH,6CAAS,CAAA;IACT;;;;OAIG;IACH,2CAAQ,CAAA;IACR;;;OAGG;IACH,+CAAU,CAAA;AACZ,CAAC,EA3BW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA2BrB;AAED;;;GAGG;AACH,WAAiB,UAAU;IACzB;;;;;OAKG;IACH,SAAgB,UAAU,CAAC,UAAsB;QAC/C,QAAQ,UAAU,EAAE;YAClB,KAAK,UAAU,CAAC,IAAI;gBAClB,OAAO,QAAQ,CAAC;YAClB,KAAK,UAAU,CAAC,QAAQ;gBACtB,OAAO,WAAW,CAAC;YACrB,KAAK,UAAU,CAAC,KAAK;gBACnB,OAAO,QAAQ,CAAC;YAClB,KAAK,UAAU,CAAC,IAAI;gBAClB,OAAO,OAAO,CAAC;YACjB,KAAK,UAAU,CAAC,MAAM;gBACpB,OAAO,SAAS,CAAC;YACnB;gBACE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC9C;IACH,CAAC;IAfe,qBAAU,aAezB,CAAA;IAED;;;;;;;OAOG;IACH,SAAgB,OAAO,CAAC,CAAa,EAAE,CAAa;QAClD,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAFe,kBAAO,UAEtB,CAAA;AACH,CAAC,EAnCgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAmC1B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * A \"release tag\" is a custom TSDoc tag that is applied to an API to communicate the level of support\n * provided for third-party developers.\n *\n * @remarks\n *\n * The four release tags are: `@internal`, `@alpha`, `@beta`, and `@public`. They are applied to API items such\n * as classes, member functions, enums, etc. The release tag applies recursively to members of a container\n * (e.g. class or interface). For example, if a class is marked as `@beta`, then all of its members automatically\n * have this status; you DON'T need add the `@beta` tag to each member function. However, you could add\n * `@internal` to a member function to give it a different release status.\n *\n * @public\n */\nexport enum ReleaseTag {\n /**\n * No release tag was specified in the AEDoc summary.\n */\n None = 0,\n /**\n * Indicates that an API item is meant only for usage by other NPM packages from the same\n * maintainer. Third parties should never use \"internal\" APIs. (To emphasize this, their\n * names are prefixed by underscores.)\n */\n Internal = 1,\n /**\n * Indicates that an API item is eventually intended to be public, but currently is in an\n * early stage of development. Third parties should not use \"alpha\" APIs.\n */\n Alpha = 2,\n /**\n * Indicates that an API item has been released in an experimental state. Third parties are\n * encouraged to try it and provide feedback. However, a \"beta\" API should NOT be used\n * in production.\n */\n Beta = 3,\n /**\n * Indicates that an API item has been officially released. It is part of the supported\n * contract (e.g. SemVer) for a package.\n */\n Public = 4\n}\n\n/**\n * Helper functions for working with the `ReleaseTag` enum.\n * @public\n */\nexport namespace ReleaseTag {\n /**\n * Returns the TSDoc tag name for a `ReleaseTag` value.\n *\n * @remarks\n * For example, `getTagName(ReleaseTag.Internal)` would return the string `@internal`.\n */\n export function getTagName(releaseTag: ReleaseTag): string {\n switch (releaseTag) {\n case ReleaseTag.None:\n return '(none)';\n case ReleaseTag.Internal:\n return '@internal';\n case ReleaseTag.Alpha:\n return '@alpha';\n case ReleaseTag.Beta:\n return '@beta';\n case ReleaseTag.Public:\n return '@public';\n default:\n throw new Error('Unsupported release tag');\n }\n }\n\n /**\n * Compares two `ReleaseTag` values. Their values must not be `ReleaseTag.None`.\n * @returns 0 if `a` and `b` are equal, a positive number if `a` is more public than `b`,\n * and a negative number if `a` is less public than `b`.\n * @remarks\n * For example, `compareReleaseTag(ReleaseTag.Beta, ReleaseTag.Alpha)` will return a positive\n * number because beta is more public than alpha.\n */\n export function compare(a: ReleaseTag, b: ReleaseTag): number {\n return a - b;\n }\n}\n"]}
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;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"]}
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,+DAA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AA;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.\n// See LICENSE in the project root for license information.\n\n/**\n * Use this library to read and write *.api.json files as defined by the\n * {@link https://api-extractor.com/ | API Extractor} tool. These files are used to generate a documentation\n * website for your TypeScript package. The files store the API signatures and doc comments that were extracted\n * from your package.\n *\n * @packageDocumentation\n */\n\nexport { AedocDefinitions } from './aedoc/AedocDefinitions';\nexport { ReleaseTag } from './aedoc/ReleaseTag';\n\n// items\nexport { IApiDeclaredItemOptions, ApiDeclaredItem } from './items/ApiDeclaredItem';\nexport { IApiDocumentedItemOptions, ApiDocumentedItem } from './items/ApiDocumentedItem';\nexport { ApiItemKind, IApiItemOptions, ApiItem, IApiItemConstructor } from './items/ApiItem';\nexport { IApiPropertyItemOptions, ApiPropertyItem } from './items/ApiPropertyItem';\n\n// mixins\nexport {\n IApiParameterListMixinOptions,\n IApiParameterOptions,\n ApiParameterListMixin\n} from './mixins/ApiParameterListMixin';\nexport {\n IApiTypeParameterOptions,\n IApiTypeParameterListMixinOptions,\n ApiTypeParameterListMixin\n} from './mixins/ApiTypeParameterListMixin';\nexport { IApiItemContainerMixinOptions, ApiItemContainerMixin } from './mixins/ApiItemContainerMixin';\nexport { IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from './mixins/ApiReleaseTagMixin';\nexport { IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from './mixins/ApiReturnTypeMixin';\nexport { IApiStaticMixinOptions, ApiStaticMixin } from './mixins/ApiStaticMixin';\nexport { IApiNameMixinOptions, ApiNameMixin } from './mixins/ApiNameMixin';\nexport { IApiOptionalMixinOptions, ApiOptionalMixin } from './mixins/ApiOptionalMixin';\n\nexport { ExcerptTokenKind, IExcerptTokenRange, IExcerptToken, ExcerptToken, Excerpt } from './mixins/Excerpt';\nexport { Constructor, PropertiesOf } from './mixins/Mixin';\n\n// model\nexport { IApiCallSignatureOptions, ApiCallSignature } from './model/ApiCallSignature';\nexport { IApiClassOptions, ApiClass } from './model/ApiClass';\nexport { IApiConstructorOptions, ApiConstructor } from './model/ApiConstructor';\nexport { IApiConstructSignatureOptions, ApiConstructSignature } from './model/ApiConstructSignature';\nexport { IApiEntryPointOptions, ApiEntryPoint } from './model/ApiEntryPoint';\nexport { IApiEnumOptions, ApiEnum } from './model/ApiEnum';\nexport { IApiEnumMemberOptions, ApiEnumMember } from './model/ApiEnumMember';\nexport { IApiFunctionOptions, ApiFunction } from './model/ApiFunction';\nexport { IApiIndexSignatureOptions, ApiIndexSignature } from './model/ApiIndexSignature';\nexport { IApiInterfaceOptions, ApiInterface } from './model/ApiInterface';\nexport { IApiMethodOptions, ApiMethod } from './model/ApiMethod';\nexport { IApiMethodSignatureOptions, ApiMethodSignature } from './model/ApiMethodSignature';\nexport { ApiModel } from './model/ApiModel';\nexport { IApiNamespaceOptions, ApiNamespace } from './model/ApiNamespace';\nexport { IApiPackageOptions, ApiPackage, IApiPackageSaveOptions } from './model/ApiPackage';\nexport { IParameterOptions, Parameter } from './model/Parameter';\nexport { IApiPropertyOptions, ApiProperty } from './model/ApiProperty';\nexport { IApiPropertySignatureOptions, ApiPropertySignature } from './model/ApiPropertySignature';\nexport { IApiTypeAliasOptions, ApiTypeAlias } from './model/ApiTypeAlias';\nexport { ITypeParameterOptions, TypeParameter } from './model/TypeParameter';\nexport { IApiVariableOptions, ApiVariable } from './model/ApiVariable';\nexport { IResolveDeclarationReferenceResult } from './model/ModelReferenceResolver';\nexport { HeritageType } from './model/HeritageType';\n"]}
@@ -1 +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,EAAE,CAAC;aACnE;YACD,OAAO,YAAY,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,UAA8B;QAChD,OAAO,IAAI,iBAAO,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;CACF;AA1FD,0CA0FC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\r\nimport { ApiDocumentedItem, IApiDocumentedItemJson, IApiDocumentedItemOptions } from './ApiDocumentedItem';\r\nimport { Excerpt, ExcerptToken, IExcerptTokenRange, IExcerptToken } from '../mixins/Excerpt';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link ApiDeclaredItem}.\r\n * @public\r\n */\r\nexport interface IApiDeclaredItemOptions extends IApiDocumentedItemOptions {\r\n excerptTokens: IExcerptToken[];\r\n}\r\n\r\nexport interface IApiDeclaredItemJson extends IApiDocumentedItemJson {\r\n excerptTokens: IExcerptToken[];\r\n}\r\n\r\n/**\r\n * The base class for API items that have an associated source code excerpt containing a TypeScript 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 * Most `ApiItem` subclasses have declarations and thus extend `ApiDeclaredItem`. Counterexamples include\r\n * `ApiModel` and `ApiPackage`, which do not have any corresponding TypeScript source code.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class ApiDeclaredItem extends ApiDocumentedItem {\r\n private _excerptTokens: ExcerptToken[];\r\n private _excerpt: Excerpt;\r\n\r\n public constructor(options: IApiDeclaredItemOptions) {\r\n super(options);\r\n\r\n this._excerptTokens = options.excerptTokens.map((token) => {\r\n const canonicalReference: DeclarationReference | undefined =\r\n token.canonicalReference === undefined\r\n ? undefined\r\n : DeclarationReference.parse(token.canonicalReference);\r\n return new ExcerptToken(token.kind, token.text, canonicalReference);\r\n });\r\n this._excerpt = new Excerpt(this.excerptTokens, { startIndex: 0, endIndex: this.excerptTokens.length });\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiDeclaredItemOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiDeclaredItemJson\r\n ): void {\r\n super.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.excerptTokens = jsonObject.excerptTokens;\r\n }\r\n\r\n /**\r\n * The source code excerpt where the API item is declared.\r\n */\r\n public get excerpt(): Excerpt {\r\n return this._excerpt;\r\n }\r\n\r\n /**\r\n * The individual source code tokens that comprise the main excerpt.\r\n */\r\n public get excerptTokens(): ReadonlyArray<ExcerptToken> {\r\n return this._excerptTokens;\r\n }\r\n\r\n /**\r\n * If the API item has certain important modifier tags such as `@sealed`, `@virtual`, or `@override`,\r\n * this prepends them as a doc comment above the excerpt.\r\n */\r\n public getExcerptWithModifiers(): string {\r\n const excerpt: string = this.excerpt.text;\r\n const modifierTags: string[] = [];\r\n\r\n if (excerpt.length > 0) {\r\n if (this instanceof ApiDocumentedItem) {\r\n if (this.tsdocComment) {\r\n if (this.tsdocComment.modifierTagSet.isSealed()) {\r\n modifierTags.push('@sealed');\r\n }\r\n if (this.tsdocComment.modifierTagSet.isVirtual()) {\r\n modifierTags.push('@virtual');\r\n }\r\n if (this.tsdocComment.modifierTagSet.isOverride()) {\r\n modifierTags.push('@override');\r\n }\r\n }\r\n if (modifierTags.length > 0) {\r\n return '/** ' + modifierTags.join(' ') + ' */\\n' + excerpt;\r\n }\r\n }\r\n }\r\n\r\n return excerpt;\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiDeclaredItemJson>): void {\r\n super.serializeInto(jsonObject);\r\n jsonObject.excerptTokens = this.excerptTokens.map((x) => {\r\n const excerptToken: IExcerptToken = { kind: x.kind, text: x.text };\r\n if (x.canonicalReference !== undefined) {\r\n excerptToken.canonicalReference = x.canonicalReference.toString();\r\n }\r\n return excerptToken;\r\n });\r\n }\r\n\r\n /**\r\n * Constructs a new {@link Excerpt} corresponding to the provided token range.\r\n */\r\n public buildExcerpt(tokenRange: IExcerptTokenRange): Excerpt {\r\n return new Excerpt(this.excerptTokens, tokenRange);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiDeclaredItem.js","sourceRoot":"","sources":["../../src/items/ApiDeclaredItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAE5D,kGAA+F;AAC/F,2DAA2G;AAC3G,+CAA6F;AAe7F;;;;;;;;;;;;GAYG;AACH,gEAAgE;AAChE,MAAa,eAAgB,SAAQ,qCAAiB;IAIpD,YAAmB,OAAgC;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACxD,MAAM,kBAAkB,GACtB,KAAK,CAAC,kBAAkB,KAAK,SAAS;gBACpC,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,2CAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YAC3D,OAAO,IAAI,sBAAY,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAAyC,EACzC,OAA4B,EAC5B,UAAgC;QAEhC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAA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CAAC,CAAC,EAAE,EAAE;YACtD,MAAM,YAAY,GAAkB,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACnE,IAAI,CAAC,CAAC,kBAAkB,KAAK,SAAS,EAAE;gBACtC,YAAY,CAAC,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;aACnE;YACD,OAAO,YAAY,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,UAA8B;QAChD,OAAO,IAAI,iBAAO,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;CACF;AA1FD,0CA0FC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.s\n\nimport { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { ApiDocumentedItem, IApiDocumentedItemJson, IApiDocumentedItemOptions } from './ApiDocumentedItem';\nimport { Excerpt, ExcerptToken, IExcerptTokenRange, IExcerptToken } from '../mixins/Excerpt';\nimport { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link ApiDeclaredItem}.\n * @public\n */\nexport interface IApiDeclaredItemOptions extends IApiDocumentedItemOptions {\n excerptTokens: IExcerptToken[];\n}\n\nexport interface IApiDeclaredItemJson extends IApiDocumentedItemJson {\n excerptTokens: IExcerptToken[];\n}\n\n/**\n * The base class for API items that have an associated source code excerpt containing a TypeScript declaration.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * Most `ApiItem` subclasses have declarations and thus extend `ApiDeclaredItem`. Counterexamples include\n * `ApiModel` and `ApiPackage`, which do not have any corresponding TypeScript source code.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport class ApiDeclaredItem extends ApiDocumentedItem {\n private _excerptTokens: ExcerptToken[];\n private _excerpt: Excerpt;\n\n public constructor(options: IApiDeclaredItemOptions) {\n super(options);\n\n this._excerptTokens = options.excerptTokens.map((token) => {\n const canonicalReference: DeclarationReference | undefined =\n token.canonicalReference === undefined\n ? undefined\n : DeclarationReference.parse(token.canonicalReference);\n return new ExcerptToken(token.kind, token.text, canonicalReference);\n });\n this._excerpt = new Excerpt(this.excerptTokens, { startIndex: 0, endIndex: this.excerptTokens.length });\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiDeclaredItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiDeclaredItemJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.excerptTokens = jsonObject.excerptTokens;\n }\n\n /**\n * The source code excerpt where the API item is declared.\n */\n public get excerpt(): Excerpt {\n return this._excerpt;\n }\n\n /**\n * The individual source code tokens that comprise the main excerpt.\n */\n public get excerptTokens(): ReadonlyArray<ExcerptToken> {\n return this._excerptTokens;\n }\n\n /**\n * If the API item has certain important modifier tags such as `@sealed`, `@virtual`, or `@override`,\n * this prepends them as a doc comment above the excerpt.\n */\n public getExcerptWithModifiers(): string {\n const excerpt: string = this.excerpt.text;\n const modifierTags: string[] = [];\n\n if (excerpt.length > 0) {\n if (this instanceof ApiDocumentedItem) {\n if (this.tsdocComment) {\n if (this.tsdocComment.modifierTagSet.isSealed()) {\n modifierTags.push('@sealed');\n }\n if (this.tsdocComment.modifierTagSet.isVirtual()) {\n modifierTags.push('@virtual');\n }\n if (this.tsdocComment.modifierTagSet.isOverride()) {\n modifierTags.push('@override');\n }\n }\n if (modifierTags.length > 0) {\n return '/** ' + modifierTags.join(' ') + ' */\\n' + excerpt;\n }\n }\n }\n\n return excerpt;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiDeclaredItemJson>): void {\n super.serializeInto(jsonObject);\n jsonObject.excerptTokens = this.excerptTokens.map((x) => {\n const excerptToken: IExcerptToken = { kind: x.kind, text: x.text };\n if (x.canonicalReference !== undefined) {\n excerptToken.canonicalReference = x.canonicalReference.toString();\n }\n return excerptToken;\n });\n }\n\n /**\n * Constructs a new {@link Excerpt} corresponding to the provided token range.\n */\n public buildExcerpt(tokenRange: IExcerptTokenRange): Excerpt {\n return new Excerpt(this.excerptTokens, tokenRange);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiDocumentedItem.js","sourceRoot":"","sources":["../../src/items/ApiDocumentedItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;AAE3D,wDAA0C;AAC1C,uCAAmE;AAenE;;;;;;;;;GASG;AACH,MAAa,iBAAkB,SAAQ,iBAAO;IAG5C,YAAmB,OAAkC;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAC1C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAA2C,EAC3C,OAA4B,EAC5B,UAAwB;QAExB,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,MAAM,cAAc,GAA2B,UAAoC,CAAC;QAEpF,IAAI,cAAc,CAAC,UAAU,EAAE;YAC7B,MAAM,WAAW,GAAsB,IAAI,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;YAEzF,8EAA8E;YAC9E,2FAA2F;YAC3F,gGAAgG;YAChG,8EAA8E;YAC9E,MAAM,aAAa,GAAwB,WAAW,CAAC,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YAE9F,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;SAC/C;IACH,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAA2C;QAC9D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;YACnC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;SACzD;aAAM;YACL,UAAU,CAAC,UAAU,GAAG,EAAE,CAAC;SAC5B;IACH,CAAC;CACF;AA5CD,8CA4CC","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 * as tsdoc from '@microsoft/tsdoc';\r\nimport { ApiItem, IApiItemOptions, IApiItemJson } from './ApiItem';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link ApiDocumentedItem}.\r\n * @public\r\n */\r\nexport interface IApiDocumentedItemOptions extends IApiItemOptions {\r\n docComment: tsdoc.DocComment | undefined;\r\n}\r\n\r\nexport interface IApiDocumentedItemJson extends IApiItemJson {\r\n docComment: string;\r\n}\r\n\r\n/**\r\n * An abstract base class for API declarations that can have an associated TSDoc comment.\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 * @public\r\n */\r\nexport class ApiDocumentedItem extends ApiItem {\r\n private _tsdocComment: tsdoc.DocComment | undefined;\r\n\r\n public constructor(options: IApiDocumentedItemOptions) {\r\n super(options);\r\n this._tsdocComment = options.docComment;\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiDocumentedItemOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiItemJson\r\n ): void {\r\n super.onDeserializeInto(options, context, jsonObject);\r\n\r\n const documentedJson: IApiDocumentedItemJson = jsonObject as IApiDocumentedItemJson;\r\n\r\n if (documentedJson.docComment) {\r\n const tsdocParser: tsdoc.TSDocParser = new tsdoc.TSDocParser(context.tsdocConfiguration);\r\n\r\n // NOTE: For now, we ignore TSDoc errors found in a serialized .api.json file.\r\n // Normally these errors would have already been reported by API Extractor during analysis.\r\n // However, they could also arise if the JSON file was edited manually, or if the file was saved\r\n // using a different release of the software that used an incompatible syntax.\r\n const parserContext: tsdoc.ParserContext = tsdocParser.parseString(documentedJson.docComment);\r\n\r\n options.docComment = parserContext.docComment;\r\n }\r\n }\r\n\r\n public get tsdocComment(): tsdoc.DocComment | undefined {\r\n return this._tsdocComment;\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiDocumentedItemJson>): void {\r\n super.serializeInto(jsonObject);\r\n if (this.tsdocComment !== undefined) {\r\n jsonObject.docComment = this.tsdocComment.emitAsTsdoc();\r\n } else {\r\n jsonObject.docComment = '';\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiDocumentedItem.js","sourceRoot":"","sources":["../../src/items/ApiDocumentedItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;AAE3D,wDAA0C;AAC1C,uCAAmE;AAenE;;;;;;;;;GASG;AACH,MAAa,iBAAkB,SAAQ,iBAAO;IAG5C,YAAmB,OAAkC;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAC1C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAA2C,EAC3C,OAA4B,EAC5B,UAAwB;QAExB,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,MAAM,cAAc,GAA2B,UAAoC,CAAC;QAEpF,IAAI,cAAc,CAAC,UAAU,EAAE;YAC7B,MAAM,WAAW,GAAsB,IAAI,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;YAEzF,8EAA8E;YAC9E,2FAA2F;YAC3F,gGAAgG;YAChG,8EAA8E;YAC9E,MAAM,aAAa,GAAwB,WAAW,CAAC,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YAE9F,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;SAC/C;IACH,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAA2C;QAC9D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;YACnC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;SACzD;aAAM;YACL,UAAU,CAAC,UAAU,GAAG,EAAE,CAAC;SAC5B;IACH,CAAC;CACF;AA5CD,8CA4CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as tsdoc from '@microsoft/tsdoc';\nimport { ApiItem, IApiItemOptions, IApiItemJson } from './ApiItem';\nimport { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link ApiDocumentedItem}.\n * @public\n */\nexport interface IApiDocumentedItemOptions extends IApiItemOptions {\n docComment: tsdoc.DocComment | undefined;\n}\n\nexport interface IApiDocumentedItemJson extends IApiItemJson {\n docComment: string;\n}\n\n/**\n * An abstract base class for API declarations that can have an associated TSDoc comment.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * @public\n */\nexport class ApiDocumentedItem extends ApiItem {\n private _tsdocComment: tsdoc.DocComment | undefined;\n\n public constructor(options: IApiDocumentedItemOptions) {\n super(options);\n this._tsdocComment = options.docComment;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiDocumentedItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiItemJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n const documentedJson: IApiDocumentedItemJson = jsonObject as IApiDocumentedItemJson;\n\n if (documentedJson.docComment) {\n const tsdocParser: tsdoc.TSDocParser = new tsdoc.TSDocParser(context.tsdocConfiguration);\n\n // NOTE: For now, we ignore TSDoc errors found in a serialized .api.json file.\n // Normally these errors would have already been reported by API Extractor during analysis.\n // However, they could also arise if the JSON file was edited manually, or if the file was saved\n // using a different release of the software that used an incompatible syntax.\n const parserContext: tsdoc.ParserContext = tsdocParser.parseString(documentedJson.docComment);\n\n options.docComment = parserContext.docComment;\n }\n }\n\n public get tsdocComment(): tsdoc.DocComment | undefined {\n return this._tsdocComment;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiDocumentedItemJson>): void {\n super.serializeInto(jsonObject);\n if (this.tsdocComment !== undefined) {\n jsonObject.docComment = this.tsdocComment.emitAsTsdoc();\n } else {\n jsonObject.docComment = '';\n }\n }\n}\n"]}
@@ -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;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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,+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
+ {"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,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E,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.\n// See LICENSE in the project root for license information.\n\nimport { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { Constructor, PropertiesOf } from '../mixins/Mixin';\nimport { ApiPackage } from '../model/ApiPackage';\nimport { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport { DeserializerContext } from '../model/DeserializerContext';\nimport { InternalError } from '@rushstack/node-core-library';\nimport { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';\n\n/**\n * The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of\n * {@link ApiItem}.\n *\n * @public\n */\nexport enum ApiItemKind {\n CallSignature = 'CallSignature',\n Class = 'Class',\n Constructor = 'Constructor',\n ConstructSignature = 'ConstructSignature',\n EntryPoint = 'EntryPoint',\n Enum = 'Enum',\n EnumMember = 'EnumMember',\n Function = 'Function',\n IndexSignature = 'IndexSignature',\n Interface = 'Interface',\n Method = 'Method',\n MethodSignature = 'MethodSignature',\n Model = 'Model',\n Namespace = 'Namespace',\n Package = 'Package',\n Property = 'Property',\n PropertySignature = 'PropertySignature',\n TypeAlias = 'TypeAlias',\n Variable = 'Variable',\n None = 'None'\n}\n\n/**\n * Constructor options for {@link ApiItem}.\n * @public\n */\nexport interface IApiItemOptions {}\n\nexport interface IApiItemJson {\n kind: ApiItemKind;\n canonicalReference: string;\n}\n\n// PRIVATE - Allows ApiItemContainerMixin to assign the parent.\n//\nexport const apiItem_onParentChanged: unique symbol = Symbol('ApiItem._onAddToContainer');\n\n/**\n * The abstract base class for all members of an `ApiModel` object.\n *\n * @remarks\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n * @public\n */\nexport class ApiItem {\n private _canonicalReference: DeclarationReference | undefined;\n private _parent: ApiItem | undefined;\n\n public constructor(options: IApiItemOptions) {\n // (\"options\" is not used here, but part of the inheritance pattern)\n }\n\n public static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem {\n // The Deserializer class is coupled with a ton of other classes, so we delay loading it\n // to avoid ES5 circular imports.\n const deserializerModule: typeof import('../model/Deserializer') = require('../model/Deserializer');\n return deserializerModule.Deserializer.deserialize(context, jsonObject);\n }\n\n /** @virtual */\n public static onDeserializeInto(\n options: Partial<IApiItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiItemJson\n ): void {\n // (implemented by subclasses)\n }\n\n /** @virtual */\n public serializeInto(jsonObject: Partial<IApiItemJson>): void {\n jsonObject.kind = this.kind;\n jsonObject.canonicalReference = this.canonicalReference.toString();\n }\n\n /**\n * Identifies the subclass of the `ApiItem` base class.\n * @virtual\n */\n public get kind(): ApiItemKind {\n throw new Error('ApiItem.kind was not implemented by the child class');\n }\n\n /**\n * Warning: This API is used internally by API extractor but is not yet ready for general usage.\n *\n * @remarks\n *\n * Returns a `DeclarationReference` object using the experimental new declaration reference notation.\n *\n * @beta\n */\n public get canonicalReference(): DeclarationReference {\n if (!this._canonicalReference) {\n try {\n this._canonicalReference = this.buildCanonicalReference();\n } catch (e) {\n const name: string = this.getScopedNameWithinPackage() || this.displayName;\n throw new InternalError(`Error building canonical reference for ${name}:\\n` + (e as Error).message);\n }\n }\n return this._canonicalReference;\n }\n\n /**\n * Returns a string key that can be used to efficiently retrieve an `ApiItem` from an `ApiItemContainerMixin`.\n * The key is unique within the container. Its format is undocumented and may change at any time.\n *\n * @remarks\n * Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation\n * of this function, according to the aspects that are important for identifying it.\n *\n * @virtual\n */\n public get containerKey(): string {\n throw new InternalError('ApiItem.containerKey was not implemented by the child class');\n }\n\n /**\n * Returns a name for this object that can be used in diagnostic messages, for example.\n *\n * @remarks\n * For an object that inherits ApiNameMixin, this will return the declared name (e.g. the name of a TypeScript\n * function). Otherwise, it will return a string such as \"(call signature)\" or \"(model)\".\n *\n * @virtual\n */\n public get displayName(): string {\n switch (this.kind) {\n case ApiItemKind.CallSignature:\n return '(call)';\n case ApiItemKind.Constructor:\n return '(constructor)';\n case ApiItemKind.ConstructSignature:\n return '(new)';\n case ApiItemKind.IndexSignature:\n return '(indexer)';\n case ApiItemKind.Model:\n return '(model)';\n }\n return '(???)'; // All other types should inherit ApiNameMixin which will override this property\n }\n\n /**\n * If this item was added to a ApiItemContainerMixin item, then this returns the container item.\n * If this is an Parameter that was added to a method or function, then this returns the function item.\n * Otherwise, it returns undefined.\n * @virtual\n */\n public get parent(): ApiItem | undefined {\n return this._parent;\n }\n\n /**\n * This property supports a visitor pattern for walking the tree.\n * For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically.\n * Otherwise it returns an empty array.\n * @virtual\n */\n public get members(): ReadonlyArray<ApiItem> {\n return [];\n }\n\n /**\n * If this item has a name (i.e. extends `ApiNameMixin`), then return all items that have the same parent\n * and the same name. Otherwise, return all items that have the same parent and the same `ApiItemKind`.\n *\n * @remarks\n * Examples: For a function, this would return all overloads for the function. For a constructor, this would\n * return all overloads for the constructor. For a merged declaration (e.g. a `namespace` and `enum` with the\n * same name), this would return both declarations. If this item does not have a parent, or if it is the only\n * item of its name/kind, then the result is an array containing only this item.\n */\n public getMergedSiblings(): ReadonlyArray<ApiItem> {\n const parent: ApiItem | undefined = this._parent;\n if (parent && ApiItemContainerMixin.isBaseClassOf(parent)) {\n return parent._getMergedSiblingsForMember(this);\n }\n return [];\n }\n\n /**\n * Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.\n */\n public getHierarchy(): ReadonlyArray<ApiItem> {\n const hierarchy: ApiItem[] = [];\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n hierarchy.push(current);\n }\n hierarchy.reverse();\n return hierarchy;\n }\n\n /**\n * This returns a scoped name such as `\"Namespace1.Namespace2.MyClass.myMember()\"`. It does not include the\n * package name or entry point.\n *\n * @remarks\n * If called on an ApiEntrypoint, ApiPackage, or ApiModel item, the result is an empty string.\n */\n public getScopedNameWithinPackage(): string {\n const reversedParts: string[] = [];\n\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (\n current.kind === ApiItemKind.Model ||\n current.kind === ApiItemKind.Package ||\n current.kind === ApiItemKind.EntryPoint\n ) {\n break;\n }\n if (reversedParts.length !== 0) {\n reversedParts.push('.');\n } else {\n switch (current.kind) {\n case ApiItemKind.CallSignature:\n case ApiItemKind.ConstructSignature:\n case ApiItemKind.Constructor:\n case ApiItemKind.IndexSignature:\n // These functional forms don't have a proper name, so we don't append the \"()\" suffix\n break;\n default:\n if (ApiParameterListMixin.isBaseClassOf(current)) {\n reversedParts.push('()');\n }\n }\n }\n reversedParts.push(current.displayName);\n }\n\n return reversedParts.reverse().join('');\n }\n\n /**\n * If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned.\n * Otherwise undefined is returned.\n */\n public getAssociatedPackage(): ApiPackage | undefined {\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (current.kind === ApiItemKind.Package) {\n return current as ApiPackage;\n }\n }\n return undefined;\n }\n\n /** @virtual */\n public getSortKey(): string {\n return this.containerKey;\n }\n\n /**\n * PRIVATE\n *\n * @privateRemarks\n * Allows ApiItemContainerMixin to assign the parent when the item is added to a container.\n *\n * @internal\n */\n public [apiItem_onParentChanged](parent: ApiItem | undefined): void {\n this._parent = parent;\n this._canonicalReference = undefined;\n }\n\n /**\n * Builds the cached object used by the `canonicalReference` property.\n * @virtual\n */\n protected buildCanonicalReference(): DeclarationReference {\n throw new InternalError('ApiItem.canonicalReference was not implemented by the child class');\n }\n}\n\n/**\n * This abstraction is used by the mixin pattern.\n * It describes a class type that inherits from {@link ApiItem}.\n *\n * @public\n */\nexport interface IApiItemConstructor extends Constructor<ApiItem>, PropertiesOf<typeof ApiItem> {}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiPropertyItem.js","sourceRoot":"","sources":["../../src/items/ApiPropertyItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,8DAA0G;AAC1G,qEAA8F;AAC9F,yDAA4E;AAE5E,iEAAwF;AAkBxF;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,IAAA,2BAAY,EAAC,IAAA,uCAAkB,EAAC,IAAA,mCAAgB,EAAC,iCAAe,CAAC,CAAC,CAAC;IAMtG,YAAmB,OAAgC;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC/E,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAAyC,EACzC,OAA4B,EAC5B,UAAgC;QAEhC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,OAAO,CAAC,sBAAsB,GAAG,UAAU,CAAC,sBAAsB,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,IAAW,eAAe;QACxB,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC;SAC3D;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAyC;QAC5D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAEhC,UAAU,CAAC,sBAAsB,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;IAC1E,CAAC;CACF;AA9CD,0CA8CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { Excerpt, IExcerptTokenRange } from '../mixins/Excerpt';\r\nimport { IApiDeclaredItemOptions, ApiDeclaredItem, IApiDeclaredItemJson } from '../items/ApiDeclaredItem';\r\nimport { ApiReleaseTagMixin, IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\r\nimport { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\nimport { ApiOptionalMixin, IApiOptionalMixinOptions } from '../mixins/ApiOptionalMixin';\r\n\r\n/**\r\n * Constructor options for {@link ApiPropertyItem}.\r\n * @public\r\n */\r\nexport interface IApiPropertyItemOptions\r\n extends IApiNameMixinOptions,\r\n IApiReleaseTagMixinOptions,\r\n IApiOptionalMixinOptions,\r\n IApiDeclaredItemOptions {\r\n propertyTypeTokenRange: IExcerptTokenRange;\r\n}\r\n\r\nexport interface IApiPropertyItemJson extends IApiDeclaredItemJson {\r\n propertyTypeTokenRange: IExcerptTokenRange;\r\n}\r\n\r\n/**\r\n * The abstract base class for {@link ApiProperty} and {@link ApiPropertySignature}.\r\n *\r\n * @public\r\n */\r\nexport class ApiPropertyItem extends ApiNameMixin(ApiReleaseTagMixin(ApiOptionalMixin(ApiDeclaredItem))) {\r\n /**\r\n * An {@link Excerpt} that describes the type of the property.\r\n */\r\n public readonly propertyTypeExcerpt: Excerpt;\r\n\r\n public constructor(options: IApiPropertyItemOptions) {\r\n super(options);\r\n\r\n this.propertyTypeExcerpt = this.buildExcerpt(options.propertyTypeTokenRange);\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiPropertyItemOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiPropertyItemJson\r\n ): void {\r\n super.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.propertyTypeTokenRange = jsonObject.propertyTypeTokenRange;\r\n }\r\n\r\n /**\r\n * Returns true if this property should be documented as an event.\r\n *\r\n * @remarks\r\n * The `@eventProperty` TSDoc modifier can be added to readonly properties to indicate that they return an\r\n * event object that event handlers can be attached to. The event-handling API is implementation-defined, but\r\n * typically the return type would be a class with members such as `addHandler()` and `removeHandler()`.\r\n * The documentation should display such properties under an \"Events\" heading instead of the\r\n * usual \"Properties\" heading.\r\n */\r\n public get isEventProperty(): boolean {\r\n if (this.tsdocComment) {\r\n return this.tsdocComment.modifierTagSet.isEventProperty();\r\n }\r\n return false;\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiPropertyItemJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.propertyTypeTokenRange = this.propertyTypeExcerpt.tokenRange;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiPropertyItem.js","sourceRoot":"","sources":["../../src/items/ApiPropertyItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,8DAA0G;AAC1G,qEAA8F;AAC9F,yDAA4E;AAE5E,iEAAwF;AAkBxF;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,IAAA,2BAAY,EAAC,IAAA,uCAAkB,EAAC,IAAA,mCAAgB,EAAC,iCAAe,CAAC,CAAC,CAAC;IAMtG,YAAmB,OAAgC;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC/E,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAAyC,EACzC,OAA4B,EAC5B,UAAgC;QAEhC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,OAAO,CAAC,sBAAsB,GAAG,UAAU,CAAC,sBAAsB,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,IAAW,eAAe;QACxB,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC;SAC3D;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAyC;QAC5D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAEhC,UAAU,CAAC,sBAAsB,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;IAC1E,CAAC;CACF;AA9CD,0CA8CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { Excerpt, IExcerptTokenRange } from '../mixins/Excerpt';\nimport { IApiDeclaredItemOptions, ApiDeclaredItem, IApiDeclaredItemJson } from '../items/ApiDeclaredItem';\nimport { ApiReleaseTagMixin, IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport { IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport { DeserializerContext } from '../model/DeserializerContext';\nimport { ApiOptionalMixin, IApiOptionalMixinOptions } from '../mixins/ApiOptionalMixin';\n\n/**\n * Constructor options for {@link ApiPropertyItem}.\n * @public\n */\nexport interface IApiPropertyItemOptions\n extends IApiNameMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiOptionalMixinOptions,\n IApiDeclaredItemOptions {\n propertyTypeTokenRange: IExcerptTokenRange;\n}\n\nexport interface IApiPropertyItemJson extends IApiDeclaredItemJson {\n propertyTypeTokenRange: IExcerptTokenRange;\n}\n\n/**\n * The abstract base class for {@link ApiProperty} and {@link ApiPropertySignature}.\n *\n * @public\n */\nexport class ApiPropertyItem extends ApiNameMixin(ApiReleaseTagMixin(ApiOptionalMixin(ApiDeclaredItem))) {\n /**\n * An {@link Excerpt} that describes the type of the property.\n */\n public readonly propertyTypeExcerpt: Excerpt;\n\n public constructor(options: IApiPropertyItemOptions) {\n super(options);\n\n this.propertyTypeExcerpt = this.buildExcerpt(options.propertyTypeTokenRange);\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiPropertyItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiPropertyItemJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.propertyTypeTokenRange = jsonObject.propertyTypeTokenRange;\n }\n\n /**\n * Returns true if this property should be documented as an event.\n *\n * @remarks\n * The `@eventProperty` TSDoc modifier can be added to readonly properties to indicate that they return an\n * event object that event handlers can be attached to. The event-handling API is implementation-defined, but\n * typically the return type would be a class with members such as `addHandler()` and `removeHandler()`.\n * The documentation should display such properties under an \"Events\" heading instead of the\n * usual \"Properties\" heading.\n */\n public get isEventProperty(): boolean {\n if (this.tsdocComment) {\n return this.tsdocComment.modifierTagSet.isEventProperty();\n }\n return false;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiPropertyItemJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.propertyTypeTokenRange = this.propertyTypeExcerpt.tokenRange;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiItemContainerMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiItemContainerMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAE5D,8CAO0B;AAC1B,iDAA8C;AAE9C,oEAA6E;AAc7E,MAAM,QAAQ,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AACzE,MAAM,cAAc,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC;AACrF,MAAM,sBAAsB,GAAkB,MAAM,CAAC,8CAA8C,CAAC,CAAC;AACrG,M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BACpB;oBACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;iBACnB;gBAED,IAAI,CAAC,cAAc,CAAC,GAAG,aAAa,CAAC;gBACrC,IAAI,CAAC,cAAc,CAAC,GAAG,aAAa,CAAC;aACtC;QACH,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA0C;YAC7D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,MAAM,aAAa,GAAmB,EAAE,CAAC;YAEzC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;gBACjC,MAAM,gBAAgB,GAA0B,EAAE,CAAC;gBACnD,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;gBACvC,aAAa,CAAC,IAAI,CAAC,gBAAgC,CAAC,CAAC;aACtD;YAED,UAAU,CAAC,OAAO,GAAG,aAAa,CAAC;QACrC,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAzJD,sDAyJC;AAED;;;GAGG;AACH,WAAiB,qBAAqB;IACpC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAFe,mCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAarC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport {\r\n ApiItem,\r\n apiItem_onParentChanged,\r\n IApiItemJson,\r\n IApiItemOptions,\r\n IApiItemConstructor,\r\n ApiItemKind\r\n} from '../items/ApiItem';\r\nimport { ApiNameMixin } from './ApiNameMixin';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\nimport { InternalError, LegacyAdapters } from '@rushstack/node-core-library';\r\n\r\n/**\r\n * Constructor options for {@link (ApiItemContainerMixin:interface)}.\r\n * @public\r\n */\r\nexport interface IApiItemContainerMixinOptions extends IApiItemOptions {\r\n members?: ApiItem[];\r\n}\r\n\r\nexport interface IApiItemContainerJson extends IApiItemJson {\r\n members: IApiItemJson[];\r\n}\r\n\r\nconst _members: unique symbol = Symbol('ApiItemContainerMixin._members');\r\nconst _membersSorted: unique symbol = Symbol('ApiItemContainerMixin._membersSorted');\r\nconst _membersByContainerKey: unique symbol = Symbol('ApiItemContainerMixin._membersByContainerKey');\r\nconst _membersByName: unique symbol = Symbol('ApiItemContainerMixin._membersByName');\r\nconst _membersByKind: unique symbol = Symbol('ApiItemContainerMixin._membersByKind');\r\n\r\n/**\r\n * The mixin base class for API items that act as containers for other child items.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * Examples of `ApiItemContainerMixin` child classes include `ApiModel`, `ApiPackage`, `ApiEntryPoint`,\r\n * and `ApiEnum`. But note that `Parameter` is not considered a \"member\" of an `ApiMethod`; this relationship\r\n * is modeled using {@link (ApiParameterListMixin:interface).parameters} instead\r\n * of {@link ApiItem.members}.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiItemContainerMixin extends ApiItem {\r\n /**\r\n * Adds a new member to the container.\r\n *\r\n * @remarks\r\n * An ApiItem cannot be added to more than one container.\r\n */\r\n addMember(member: ApiItem): void;\r\n\r\n /**\r\n * Attempts to retrieve a member using its containerKey, or returns `undefined` if no matching member was found.\r\n *\r\n * @remarks\r\n * Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation\r\n * of this function, according to the aspects that are important for identifying it.\r\n *\r\n * See {@link ApiItem.containerKey} for more information.\r\n */\r\n tryGetMemberByKey(containerKey: string): ApiItem | undefined;\r\n\r\n /**\r\n * Returns a list of members with the specified name.\r\n */\r\n findMembersByName(name: string): ReadonlyArray<ApiItem>;\r\n\r\n /**\r\n * For a given member of this container, return its `ApiItem.getMergedSiblings()` list.\r\n * @internal\r\n */\r\n _getMergedSiblingsForMember(memberApiItem: ApiItem): ReadonlyArray<ApiItem>;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link ApiDeclaredItem}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiItemContainerMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiItemContainerMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiItemContainerMixin) {\r\n class MixedClass extends baseClass implements ApiItemContainerMixin {\r\n public readonly [_members]: ApiItem[];\r\n public [_membersSorted]: boolean;\r\n public [_membersByContainerKey]: Map<string, ApiItem>;\r\n\r\n // For members of this container that extend ApiNameMixin, this stores the list of members with a given name.\r\n // Examples include merged declarations, overloaded functions, etc.\r\n public [_membersByName]: Map<string, ApiItem[]> | undefined;\r\n\r\n // For members of this container that do NOT extend ApiNameMixin, this stores the list of members\r\n // that share a common ApiItemKind. Examples include overloaded constructors or index signatures.\r\n public [_membersByKind]: Map<string, ApiItem[]> | undefined; // key is ApiItemKind\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n const options: IApiItemContainerMixinOptions = args[0] as IApiItemContainerMixinOptions;\r\n\r\n this[_members] = [];\r\n this[_membersByContainerKey] = new Map<string, ApiItem>();\r\n\r\n if (options.members) {\r\n for (const member of options.members) {\r\n this.addMember(member);\r\n }\r\n }\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiItemContainerMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiItemContainerJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.members = [];\r\n for (const memberObject of jsonObject.members) {\r\n options.members.push(ApiItem.deserialize(memberObject, context));\r\n }\r\n }\r\n\r\n /** @override */\r\n public get members(): ReadonlyArray<ApiItem> {\r\n if (!this[_membersSorted]) {\r\n LegacyAdapters.sortStable(this[_members], (x, y) => x.getSortKey().localeCompare(y.getSortKey()));\r\n this[_membersSorted] = true;\r\n }\r\n\r\n return this[_members];\r\n }\r\n\r\n public addMember(member: ApiItem): void {\r\n if (this[_membersByContainerKey].has(member.containerKey)) {\r\n throw new Error(\r\n `Another member has already been added with the same name (${member.displayName})` +\r\n ` and containerKey (${member.containerKey})`\r\n );\r\n }\r\n\r\n const existingParent: ApiItem | undefined = member.parent;\r\n if (existingParent !== undefined) {\r\n throw new Error(\r\n `This item has already been added to another container: \"${existingParent.displayName}\"`\r\n );\r\n }\r\n\r\n this[_members].push(member);\r\n this[_membersByName] = undefined; // invalidate the lookup\r\n this[_membersByKind] = undefined; // invalidate the lookup\r\n this[_membersSorted] = false;\r\n this[_membersByContainerKey].set(member.containerKey, member);\r\n\r\n member[apiItem_onParentChanged](this);\r\n }\r\n\r\n public tryGetMemberByKey(containerKey: string): ApiItem | undefined {\r\n return this[_membersByContainerKey].get(containerKey);\r\n }\r\n\r\n public findMembersByName(name: string): ReadonlyArray<ApiItem> {\r\n this._ensureMemberMaps();\r\n return this[_membersByName]!.get(name) || [];\r\n }\r\n\r\n /** @internal */\r\n public _getMergedSiblingsForMember(memberApiItem: ApiItem): ReadonlyArray<ApiItem> {\r\n this._ensureMemberMaps();\r\n let result: ApiItem[] | undefined;\r\n if (ApiNameMixin.isBaseClassOf(memberApiItem)) {\r\n result = this[_membersByName]!.get(memberApiItem.name);\r\n } else {\r\n result = this[_membersByKind]!.get(memberApiItem.kind);\r\n }\r\n if (!result) {\r\n throw new InternalError('Item was not found in the _membersByName/_membersByKind lookup');\r\n }\r\n return result;\r\n }\r\n\r\n /** @internal */\r\n public _ensureMemberMaps(): void {\r\n // Build the _membersByName and _membersByKind tables if they don't already exist\r\n if (this[_membersByName] === undefined) {\r\n const membersByName: Map<string, ApiItem[]> = new Map<string, ApiItem[]>();\r\n const membersByKind: Map<string, ApiItem[]> = new Map<string, ApiItem[]>();\r\n\r\n for (const member of this[_members]) {\r\n let map: Map<string, ApiItem[]> | Map<ApiItemKind, ApiItem[]>;\r\n let key: string | ApiItemKind;\r\n\r\n if (ApiNameMixin.isBaseClassOf(member)) {\r\n map = membersByName;\r\n key = member.name;\r\n } else {\r\n map = membersByKind;\r\n key = member.kind;\r\n }\r\n\r\n let list: ApiItem[] | undefined = map.get(key);\r\n if (list === undefined) {\r\n list = [];\r\n map.set(key, list);\r\n }\r\n list.push(member);\r\n }\r\n\r\n this[_membersByName] = membersByName;\r\n this[_membersByKind] = membersByKind;\r\n }\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiItemContainerJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n const memberObjects: IApiItemJson[] = [];\r\n\r\n for (const member of this.members) {\r\n const memberJsonObject: Partial<IApiItemJson> = {};\r\n member.serializeInto(memberJsonObject);\r\n memberObjects.push(memberJsonObject as IApiItemJson);\r\n }\r\n\r\n jsonObject.members = memberObjects;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiItemContainerMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiItemContainerMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiItemContainerMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiItemContainerMixin {\r\n return apiItem.hasOwnProperty(_members);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiItemContainerMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiItemContainerMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAE5D,8CAO0B;AAC1B,iDAA8C;AAE9C,oEAA6E;AAc7E,MAAM,QAAQ,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AACzE,MAAM,cAAc,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC;AACrF,MAAM,sBAAsB,GAAkB,MAAM,CAAC,8CAA8C,CAAC,CAAC;AACrG,MAAM,cAAc,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC;AACrF,MAAM,cAAc,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC;AA0DrF;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAahC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YACf,MAAM,OAAO,GAAkC,IAAI,CAAC,CAAC,CAAkC,CAAC;YAExF,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YACpB,IAAI,CAAC,sBAAsB,CAAC,GAAG,IAAI,GAAG,EAAmB,CAAC;YAE1D,IAAI,OAAO,CAAC,OAAO,EAAE;gBACnB,KAAK,MAAM,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE;oBACpC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;iBACxB;aACF;QACH,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,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AAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAFe,mCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAarC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.s\n\nimport {\n ApiItem,\n apiItem_onParentChanged,\n IApiItemJson,\n IApiItemOptions,\n IApiItemConstructor,\n ApiItemKind\n} from '../items/ApiItem';\nimport { ApiNameMixin } from './ApiNameMixin';\nimport { DeserializerContext } from '../model/DeserializerContext';\nimport { InternalError, LegacyAdapters } from '@rushstack/node-core-library';\n\n/**\n * Constructor options for {@link (ApiItemContainerMixin:interface)}.\n * @public\n */\nexport interface IApiItemContainerMixinOptions extends IApiItemOptions {\n members?: ApiItem[];\n}\n\nexport interface IApiItemContainerJson extends IApiItemJson {\n members: IApiItemJson[];\n}\n\nconst _members: unique symbol = Symbol('ApiItemContainerMixin._members');\nconst _membersSorted: unique symbol = Symbol('ApiItemContainerMixin._membersSorted');\nconst _membersByContainerKey: unique symbol = Symbol('ApiItemContainerMixin._membersByContainerKey');\nconst _membersByName: unique symbol = Symbol('ApiItemContainerMixin._membersByName');\nconst _membersByKind: unique symbol = Symbol('ApiItemContainerMixin._membersByKind');\n\n/**\n * The mixin base class for API items that act as containers for other child items.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * Examples of `ApiItemContainerMixin` child classes include `ApiModel`, `ApiPackage`, `ApiEntryPoint`,\n * and `ApiEnum`. But note that `Parameter` is not considered a \"member\" of an `ApiMethod`; this relationship\n * is modeled using {@link (ApiParameterListMixin:interface).parameters} instead\n * of {@link ApiItem.members}.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiItemContainerMixin extends ApiItem {\n /**\n * Adds a new member to the container.\n *\n * @remarks\n * An ApiItem cannot be added to more than one container.\n */\n addMember(member: ApiItem): void;\n\n /**\n * Attempts to retrieve a member using its containerKey, or returns `undefined` if no matching member was found.\n *\n * @remarks\n * Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation\n * of this function, according to the aspects that are important for identifying it.\n *\n * See {@link ApiItem.containerKey} for more information.\n */\n tryGetMemberByKey(containerKey: string): ApiItem | undefined;\n\n /**\n * Returns a list of members with the specified name.\n */\n findMembersByName(name: string): ReadonlyArray<ApiItem>;\n\n /**\n * For a given member of this container, return its `ApiItem.getMergedSiblings()` list.\n * @internal\n */\n _getMergedSiblingsForMember(memberApiItem: ApiItem): ReadonlyArray<ApiItem>;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link ApiDeclaredItem}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiItemContainerMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiItemContainerMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiItemContainerMixin) {\n class MixedClass extends baseClass implements ApiItemContainerMixin {\n public readonly [_members]: ApiItem[];\n public [_membersSorted]: boolean;\n public [_membersByContainerKey]: Map<string, ApiItem>;\n\n // For members of this container that extend ApiNameMixin, this stores the list of members with a given name.\n // Examples include merged declarations, overloaded functions, etc.\n public [_membersByName]: Map<string, ApiItem[]> | undefined;\n\n // For members of this container that do NOT extend ApiNameMixin, this stores the list of members\n // that share a common ApiItemKind. Examples include overloaded constructors or index signatures.\n public [_membersByKind]: Map<string, ApiItem[]> | undefined; // key is ApiItemKind\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n const options: IApiItemContainerMixinOptions = args[0] as IApiItemContainerMixinOptions;\n\n this[_members] = [];\n this[_membersByContainerKey] = new Map<string, ApiItem>();\n\n if (options.members) {\n for (const member of options.members) {\n this.addMember(member);\n }\n }\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiItemContainerMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiItemContainerJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.members = [];\n for (const memberObject of jsonObject.members) {\n options.members.push(ApiItem.deserialize(memberObject, context));\n }\n }\n\n /** @override */\n public get members(): ReadonlyArray<ApiItem> {\n if (!this[_membersSorted]) {\n LegacyAdapters.sortStable(this[_members], (x, y) => x.getSortKey().localeCompare(y.getSortKey()));\n this[_membersSorted] = true;\n }\n\n return this[_members];\n }\n\n public addMember(member: ApiItem): void {\n if (this[_membersByContainerKey].has(member.containerKey)) {\n throw new Error(\n `Another member has already been added with the same name (${member.displayName})` +\n ` and containerKey (${member.containerKey})`\n );\n }\n\n const existingParent: ApiItem | undefined = member.parent;\n if (existingParent !== undefined) {\n throw new Error(\n `This item has already been added to another container: \"${existingParent.displayName}\"`\n );\n }\n\n this[_members].push(member);\n this[_membersByName] = undefined; // invalidate the lookup\n this[_membersByKind] = undefined; // invalidate the lookup\n this[_membersSorted] = false;\n this[_membersByContainerKey].set(member.containerKey, member);\n\n member[apiItem_onParentChanged](this);\n }\n\n public tryGetMemberByKey(containerKey: string): ApiItem | undefined {\n return this[_membersByContainerKey].get(containerKey);\n }\n\n public findMembersByName(name: string): ReadonlyArray<ApiItem> {\n this._ensureMemberMaps();\n return this[_membersByName]!.get(name) || [];\n }\n\n /** @internal */\n public _getMergedSiblingsForMember(memberApiItem: ApiItem): ReadonlyArray<ApiItem> {\n this._ensureMemberMaps();\n let result: ApiItem[] | undefined;\n if (ApiNameMixin.isBaseClassOf(memberApiItem)) {\n result = this[_membersByName]!.get(memberApiItem.name);\n } else {\n result = this[_membersByKind]!.get(memberApiItem.kind);\n }\n if (!result) {\n throw new InternalError('Item was not found in the _membersByName/_membersByKind lookup');\n }\n return result;\n }\n\n /** @internal */\n public _ensureMemberMaps(): void {\n // Build the _membersByName and _membersByKind tables if they don't already exist\n if (this[_membersByName] === undefined) {\n const membersByName: Map<string, ApiItem[]> = new Map<string, ApiItem[]>();\n const membersByKind: Map<string, ApiItem[]> = new Map<string, ApiItem[]>();\n\n for (const member of this[_members]) {\n let map: Map<string, ApiItem[]> | Map<ApiItemKind, ApiItem[]>;\n let key: string | ApiItemKind;\n\n if (ApiNameMixin.isBaseClassOf(member)) {\n map = membersByName;\n key = member.name;\n } else {\n map = membersByKind;\n key = member.kind;\n }\n\n let list: ApiItem[] | undefined = map.get(key);\n if (list === undefined) {\n list = [];\n map.set(key, list);\n }\n list.push(member);\n }\n\n this[_membersByName] = membersByName;\n this[_membersByKind] = membersByKind;\n }\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiItemContainerJson>): void {\n super.serializeInto(jsonObject);\n\n const memberObjects: IApiItemJson[] = [];\n\n for (const member of this.members) {\n const memberJsonObject: Partial<IApiItemJson> = {};\n member.serializeInto(memberJsonObject);\n memberObjects.push(memberJsonObject as IApiItemJson);\n }\n\n jsonObject.members = memberObjects;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiItemContainerMixin:interface)}.\n * @public\n */\nexport namespace ApiItemContainerMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiItemContainerMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiItemContainerMixin {\n return apiItem.hasOwnProperty(_members);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiNameMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiNameMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,KAAK,GAAkB,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAgC1D;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAAyB,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;QAC7B,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAAsC,EACtC,OAA4B,EAC5B,UAA6B;YAE7B,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QACjC,CAAC;QAED,IAAW,IAAI;YACb,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,gBAAgB;QAChB,IAAW,WAAW;YACpB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAAsC;YACzD,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AA5CD,oCA4CC;AAED;;;GAGG;AACH,WAAiB,YAAY;IAC3B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAFe,0BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAa5B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link (IApiNameMixinOptions:interface)}.\r\n * @public\r\n */\r\nexport interface IApiNameMixinOptions extends IApiItemOptions {\r\n name: string;\r\n}\r\n\r\nexport interface IApiNameMixinJson extends IApiItemJson {\r\n name: string;\r\n}\r\n\r\nconst _name: unique symbol = Symbol('ApiNameMixin._name');\r\n\r\n/**\r\n * The mixin base class for API items that have a name. For example, a class has a name, but a class constructor\r\n * does not.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiNameMixin extends ApiItem {\r\n /**\r\n * The exported name of this API item.\r\n *\r\n * @remarks\r\n * Note that due tue type aliasing, the exported name may be different from the locally declared name.\r\n */\r\n readonly name: string;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiNameMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiNameMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiNameMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiNameMixin) {\r\n class MixedClass extends baseClass implements ApiNameMixin {\r\n public readonly [_name]: string;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiNameMixinOptions = args[0];\r\n this[_name] = options.name;\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiNameMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiNameMixinJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.name = jsonObject.name;\r\n }\r\n\r\n public get name(): string {\r\n return this[_name];\r\n }\r\n\r\n /** @override */\r\n public get displayName(): string {\r\n return this[_name];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiNameMixinJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.name = this.name;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Static members for {@link (ApiNameMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiNameMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiNameMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiNameMixin {\r\n return apiItem.hasOwnProperty(_name);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiNameMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiNameMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,KAAK,GAAkB,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAgC1D;;;;;;;GAOG;AACH,SAAgB,YAAY,CAC1B,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAAyB,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;QAC7B,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAAsC,EACtC,OAA4B,EAC5B,UAA6B;YAE7B,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QACjC,CAAC;QAED,IAAW,IAAI;YACb,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,gBAAgB;QAChB,IAAW,WAAW;YACpB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAAsC;YACzD,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AA5CD,oCA4CC;AAED;;;GAGG;AACH,WAAiB,YAAY;IAC3B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAFe,0BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAa5B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.s\n\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (IApiNameMixinOptions:interface)}.\n * @public\n */\nexport interface IApiNameMixinOptions extends IApiItemOptions {\n name: string;\n}\n\nexport interface IApiNameMixinJson extends IApiItemJson {\n name: string;\n}\n\nconst _name: unique symbol = Symbol('ApiNameMixin._name');\n\n/**\n * The mixin base class for API items that have a name. For example, a class has a name, but a class constructor\n * does not.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiNameMixin extends ApiItem {\n /**\n * The exported name of this API item.\n *\n * @remarks\n * Note that due tue type aliasing, the exported name may be different from the locally declared name.\n */\n readonly name: string;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiNameMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiNameMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiNameMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiNameMixin) {\n class MixedClass extends baseClass implements ApiNameMixin {\n public readonly [_name]: string;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiNameMixinOptions = args[0];\n this[_name] = options.name;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiNameMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiNameMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.name = jsonObject.name;\n }\n\n public get name(): string {\n return this[_name];\n }\n\n /** @override */\n public get displayName(): string {\n return this[_name];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiNameMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.name = this.name;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiNameMixin:interface)}.\n * @public\n */\nexport namespace ApiNameMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiNameMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiNameMixin {\n return apiItem.hasOwnProperty(_name);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiOptionalMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiOptionalMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,WAAW,GAAkB,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAqC1E;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAC9B,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAA6B,IAAI,CAAC,CAAC,CAAC,CAAC;YAClD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QAC3C,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA0C,EAC1C,OAA4B,EAC5B,UAAiC;YAEjC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QAC/C,CAAC;QAED,IAAW,UAAU;YACnB,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA0C;YAC7D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAC1C,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAvCD,4CAuCC;AAED;;;GAGG;AACH,WAAiB,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAFe,8BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAahC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.s\r\n\r\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\r\nimport { DeserializerContext } from '../model/DeserializerContext';\r\n\r\n/**\r\n * Constructor options for {@link (IApiOptionalMixinOptions:interface)}.\r\n * @public\r\n */\r\nexport interface IApiOptionalMixinOptions extends IApiItemOptions {\r\n isOptional: boolean;\r\n}\r\n\r\nexport interface IApiOptionalMixinJson extends IApiItemJson {\r\n isOptional: boolean;\r\n}\r\n\r\nconst _isOptional: unique symbol = Symbol('ApiOptionalMixin._isOptional');\r\n\r\n/**\r\n * The mixin base class for API items that can be marked as optional by appending a `?` to them.\r\n * For example, a property of an interface can be optional.\r\n *\r\n * @remarks\r\n *\r\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\r\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\r\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\r\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\r\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\r\n * the function that generates a subclass, an interface that describes the members of the subclass, and\r\n * a namespace containing static members of the class.\r\n *\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ApiOptionalMixin extends ApiItem {\r\n /**\r\n * True if this is an optional property.\r\n * @remarks\r\n * For example:\r\n * ```ts\r\n * interface X {\r\n * y: string; // not optional\r\n * z?: string; // optional\r\n * }\r\n * ```\r\n */\r\n readonly isOptional: boolean;\r\n\r\n /** @override */\r\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\r\n}\r\n\r\n/**\r\n * Mixin function for {@link (ApiOptionalMixin:interface)}.\r\n *\r\n * @param baseClass - The base class to be extended\r\n * @returns A child class that extends baseClass, adding the {@link (ApiOptionalMixin:interface)} functionality.\r\n *\r\n * @public\r\n */\r\nexport function ApiOptionalMixin<TBaseClass extends IApiItemConstructor>(\r\n baseClass: TBaseClass\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n): TBaseClass & (new (...args: any[]) => ApiOptionalMixin) {\r\n class MixedClass extends baseClass implements ApiOptionalMixin {\r\n public [_isOptional]: boolean;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n public constructor(...args: any[]) {\r\n super(...args);\r\n\r\n const options: IApiOptionalMixinOptions = args[0];\r\n this[_isOptional] = !!options.isOptional;\r\n }\r\n\r\n /** @override */\r\n public static onDeserializeInto(\r\n options: Partial<IApiOptionalMixinOptions>,\r\n context: DeserializerContext,\r\n jsonObject: IApiOptionalMixinJson\r\n ): void {\r\n baseClass.onDeserializeInto(options, context, jsonObject);\r\n\r\n options.isOptional = !!jsonObject.isOptional;\r\n }\r\n\r\n public get isOptional(): boolean {\r\n return this[_isOptional];\r\n }\r\n\r\n /** @override */\r\n public serializeInto(jsonObject: Partial<IApiOptionalMixinJson>): void {\r\n super.serializeInto(jsonObject);\r\n\r\n jsonObject.isOptional = this.isOptional;\r\n }\r\n }\r\n\r\n return MixedClass;\r\n}\r\n\r\n/**\r\n * Optional members for {@link (ApiOptionalMixin:interface)}.\r\n * @public\r\n */\r\nexport namespace ApiOptionalMixin {\r\n /**\r\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiOptionalMixin` mixin.\r\n *\r\n * @remarks\r\n *\r\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\r\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\r\n * the TypeScript type system cannot invoke a runtime test.)\r\n */\r\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiOptionalMixin {\r\n return apiItem.hasOwnProperty(_isOptional);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ApiOptionalMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiOptionalMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,4DAA4D;;;AAiB5D,MAAM,WAAW,GAAkB,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAqC1E;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAC9B,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAA6B,IAAI,CAAC,CAAC,CAAC,CAAC;YAClD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QAC3C,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA0C,EAC1C,OAA4B,EAC5B,UAAiC;YAEjC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;QAC/C,CAAC;QAED,IAAW,UAAU;YACnB,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA0C;YAC7D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAC1C,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAvCD,4CAuCC;AAED;;;GAGG;AACH,WAAiB,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAFe,8BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAahC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.s\n\nimport { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (IApiOptionalMixinOptions:interface)}.\n * @public\n */\nexport interface IApiOptionalMixinOptions extends IApiItemOptions {\n isOptional: boolean;\n}\n\nexport interface IApiOptionalMixinJson extends IApiItemJson {\n isOptional: boolean;\n}\n\nconst _isOptional: unique symbol = Symbol('ApiOptionalMixin._isOptional');\n\n/**\n * The mixin base class for API items that can be marked as optional by appending a `?` to them.\n * For example, a property of an interface can be optional.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiOptionalMixin extends ApiItem {\n /**\n * True if this is an optional property.\n * @remarks\n * For example:\n * ```ts\n * interface X {\n * y: string; // not optional\n * z?: string; // optional\n * }\n * ```\n */\n readonly isOptional: boolean;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiOptionalMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiOptionalMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiOptionalMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiOptionalMixin) {\n class MixedClass extends baseClass implements ApiOptionalMixin {\n public [_isOptional]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiOptionalMixinOptions = args[0];\n this[_isOptional] = !!options.isOptional;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiOptionalMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiOptionalMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isOptional = !!jsonObject.isOptional;\n }\n\n public get isOptional(): boolean {\n return this[_isOptional];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiOptionalMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isOptional = this.isOptional;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Optional members for {@link (ApiOptionalMixin:interface)}.\n * @public\n */\nexport namespace ApiOptionalMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiOptionalMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiOptionalMixin {\n return apiItem.hasOwnProperty(_isOptional);\n }\n}\n"]}