{"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,0BAAV,UAAU,QA2BrB;AAED;;;GAGG;AACH,WAAiB,UAAU;IACzB;;;;;OAKG;IACH,SAAgB,UAAU,CAAC,UAAsB;QAC/C,QAAQ,UAAU,EAAE,CAAC;YACnB,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;QAC/C,CAAC;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,0BAAV,UAAU,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):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ACxC,yDAAqF;AAA/C,gHAAA,cAAc,OAAA;AACpD,uEAA0G;AAA7D,8HAAA,qBAAqB,OAAA;AAClE,uDAAkF;AAA7C,8GAAA,aAAa,OAAA;AAClD,2CAAgE;AAAjC,kGAAA,OAAO,OAAA;AACtC,uDAAmG;AAA9D,8GAAA,aAAa,OAAA;AAAE,gHAAA,eAAe,OAAA;AACnE,mDAA4E;AAAzC,0GAAA,WAAW,OAAA;AAC9C,+DAA8F;AAArD,sHAAA,iBAAiB,OAAA;AAC1D,qDAA+E;AAA3C,4GAAA,YAAY,OAAA;AAChD,+CAAsE;AAArC,sGAAA,SAAS,OAAA;AAC1C,iEAAiG;AAAvD,wHAAA,kBAAkB,OAAA;AAC5D,6CAA4C;AAAnC,oGAAA,QAAQ,OAAA;AACjB,qDAA+E;AAA3C,4GAAA,YAAY,OAAA;AAChD,iDAAsG;AAApE,wGAAA,UAAU,OAAA;AAC5C,+CAAsE;AAArC,sGAAA,SAAS,OAAA;AAC1C,mDAA4E;AAAzC,0GAAA,WAAW,OAAA;AAC9C,qEAAuG;AAA3D,4HAAA,oBAAoB,OAAA;AAChE,qDAA+E;AAA3C,4GAAA,YAAY,OAAA;AAChD,uDAAkF;AAA7C,8GAAA,aAAa,OAAA;AAClD,mDAA4E;AAAzC,0GAAA,WAAW,OAAA;AAE9C,qDAAoD;AAA3C,4GAAA,YAAY,OAAA;AACrB,yDAAqF;AAA/C,gHAAA,cAAc,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 { type IApiDeclaredItemOptions, ApiDeclaredItem } from './items/ApiDeclaredItem';\nexport { type IApiDocumentedItemOptions, ApiDocumentedItem } from './items/ApiDocumentedItem';\nexport { ApiItemKind, type IApiItemOptions, ApiItem, type IApiItemConstructor } from './items/ApiItem';\nexport { type IApiPropertyItemOptions, ApiPropertyItem } from './items/ApiPropertyItem';\n\n// mixins\nexport {\n type IApiParameterListMixinOptions,\n type IApiParameterOptions,\n ApiParameterListMixin\n} from './mixins/ApiParameterListMixin';\nexport {\n type IApiTypeParameterOptions,\n type IApiTypeParameterListMixinOptions,\n ApiTypeParameterListMixin\n} from './mixins/ApiTypeParameterListMixin';\nexport { type IApiAbstractMixinOptions, ApiAbstractMixin } from './mixins/ApiAbstractMixin';\nexport { type IApiItemContainerMixinOptions, ApiItemContainerMixin } from './mixins/ApiItemContainerMixin';\nexport { type IApiProtectedMixinOptions, ApiProtectedMixin } from './mixins/ApiProtectedMixin';\nexport { type IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from './mixins/ApiReleaseTagMixin';\nexport { type IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from './mixins/ApiReturnTypeMixin';\nexport { type IApiStaticMixinOptions, ApiStaticMixin } from './mixins/ApiStaticMixin';\nexport { type IApiNameMixinOptions, ApiNameMixin } from './mixins/ApiNameMixin';\nexport { type IApiOptionalMixinOptions, ApiOptionalMixin } from './mixins/ApiOptionalMixin';\nexport { type IApiReadonlyMixinOptions, ApiReadonlyMixin } from './mixins/ApiReadonlyMixin';\nexport { type IApiInitializerMixinOptions, ApiInitializerMixin } from './mixins/ApiInitializerMixin';\nexport { type IApiExportedMixinOptions, ApiExportedMixin } from './mixins/ApiExportedMixin';\nexport {\n type IFindApiItemsResult,\n type IFindApiItemsMessage,\n FindApiItemsMessageId\n} from './mixins/IFindApiItemsResult';\n\nexport {\n ExcerptTokenKind,\n type IExcerptTokenRange,\n type IExcerptToken,\n ExcerptToken,\n Excerpt\n} from './mixins/Excerpt';\nexport type { Constructor, PropertiesOf } from './mixins/Mixin';\n\n// model\nexport { type IApiCallSignatureOptions, ApiCallSignature } from './model/ApiCallSignature';\nexport { type IApiClassOptions, ApiClass } from './model/ApiClass';\nexport { type IApiConstructorOptions, ApiConstructor } from './model/ApiConstructor';\nexport { type IApiConstructSignatureOptions, ApiConstructSignature } from './model/ApiConstructSignature';\nexport { type IApiEntryPointOptions, ApiEntryPoint } from './model/ApiEntryPoint';\nexport { type IApiEnumOptions, ApiEnum } from './model/ApiEnum';\nexport { type IApiEnumMemberOptions, ApiEnumMember, EnumMemberOrder } from './model/ApiEnumMember';\nexport { type IApiFunctionOptions, ApiFunction } from './model/ApiFunction';\nexport { type IApiIndexSignatureOptions, ApiIndexSignature } from './model/ApiIndexSignature';\nexport { type IApiInterfaceOptions, ApiInterface } from './model/ApiInterface';\nexport { type IApiMethodOptions, ApiMethod } from './model/ApiMethod';\nexport { type IApiMethodSignatureOptions, ApiMethodSignature } from './model/ApiMethodSignature';\nexport { ApiModel } from './model/ApiModel';\nexport { type IApiNamespaceOptions, ApiNamespace } from './model/ApiNamespace';\nexport { type IApiPackageOptions, ApiPackage, type IApiPackageSaveOptions } from './model/ApiPackage';\nexport { type IParameterOptions, Parameter } from './model/Parameter';\nexport { type IApiPropertyOptions, ApiProperty } from './model/ApiProperty';\nexport { type IApiPropertySignatureOptions, ApiPropertySignature } from './model/ApiPropertySignature';\nexport { type IApiTypeAliasOptions, ApiTypeAlias } from './model/ApiTypeAlias';\nexport { type ITypeParameterOptions, TypeParameter } from './model/TypeParameter';\nexport { type IApiVariableOptions, ApiVariable } from './model/ApiVariable';\nexport { type IResolveDeclarationReferenceResult } from './model/ModelReferenceResolver';\nexport { HeritageType } from './model/HeritageType';\nexport { type ISourceLocationOptions, SourceLocation } from './model/SourceLocation';\n"]}
{"version":3,"file":"ApiDeclaredItem.js","sourceRoot":"","sources":["../../src/items/ApiDeclaredItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAA+F;AAE/F,2DAI6B;AAE7B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YACxB,gBAAgB,EAAE,gBAAgB;YAClC,WAAW,EAAE,WAAW;SACzB,CAAC,CAAC;IACL,CAAC;CACF;AA7ID,0CA6IC","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';\n\nimport {\n ApiDocumentedItem,\n type IApiDocumentedItemJson,\n type IApiDocumentedItemOptions\n} from './ApiDocumentedItem';\nimport type { ApiItem } from './ApiItem';\nimport { Excerpt, ExcerptToken, type IExcerptTokenRange, type IExcerptToken } from '../mixins/Excerpt';\nimport type { DeserializerContext } from '../model/DeserializerContext';\nimport { SourceLocation } from '../model/SourceLocation';\n\n/**\n * Constructor options for {@link ApiDeclaredItem}.\n * @public\n */\nexport interface IApiDeclaredItemOptions extends IApiDocumentedItemOptions {\n excerptTokens: IExcerptToken[];\n fileUrlPath?: string;\n}\n\nexport interface IApiDeclaredItemJson extends IApiDocumentedItemJson {\n excerptTokens: IExcerptToken[];\n fileUrlPath?: string;\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 */\nexport class ApiDeclaredItem extends ApiDocumentedItem {\n private _excerptTokens: ExcerptToken[];\n private _excerpt: Excerpt;\n private _fileUrlPath?: string;\n private _sourceLocation?: SourceLocation;\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 this._fileUrlPath = options.fileUrlPath;\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 options.fileUrlPath = jsonObject.fileUrlPath;\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 * The file URL path relative to the `projectFolder` and `projectFolderURL` fields\n * as defined in the `api-extractor.json` config. Is `undefined` if the path is\n * the same as the parent API item's.\n */\n public get fileUrlPath(): string | undefined {\n return this._fileUrlPath;\n }\n\n /**\n * Returns the source location where the API item is declared.\n */\n public get sourceLocation(): SourceLocation {\n if (!this._sourceLocation) {\n this._sourceLocation = this._buildSourceLocation();\n }\n return this._sourceLocation;\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 // Only serialize this API item's file URL path if it exists and it's different from its parent's\n // (a little optimization to keep the doc model succinct).\n if (this.fileUrlPath) {\n if (!(this.parent instanceof ApiDeclaredItem) || this.fileUrlPath !== this.parent.fileUrlPath) {\n jsonObject.fileUrlPath = this.fileUrlPath;\n }\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 /**\n * Builds the cached object used by the `sourceLocation` property.\n */\n private _buildSourceLocation(): SourceLocation {\n const projectFolderUrl: string | undefined = this.getAssociatedPackage()?.projectFolderUrl;\n\n let fileUrlPath: string | undefined;\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (current instanceof ApiDeclaredItem && current.fileUrlPath) {\n fileUrlPath = current.fileUrlPath;\n break;\n }\n }\n\n return new SourceLocation({\n projectFolderUrl: projectFolderUrl,\n fileUrlPath: fileUrlPath\n });\n }\n}\n"]}
{"version":3,"file":"ApiDocumentedItem.js","sourceRoot":"","sources":["../../src/items/ApiDocumentedItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,wDAA0C;AAE1C,uCAA6E;AAe7E;;;;;;;;;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,CAAC;YAC9B,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;QAChD,CAAC;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,CAAC;YACpC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,UAAU,GAAG,EAAE,CAAC;QAC7B,CAAC;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';\n\nimport { ApiItem, type IApiItemOptions, type IApiItemJson } from './ApiItem';\nimport type { 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"]}