UNPKG

4.3 kBSource Map (JSON)View Raw
1{"version":3,"file":"ApiItemMetadata.js","sourceRoot":"","sources":["../../src/collector/ApiItemMetadata.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D,iDAA8C;AAgB9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,eAAe;IAqC1B,YAAmB,OAAgC;QALnD,iCAAiC;QAC1B,uBAAkB,GAAY,IAAI,CAAC;QAEnC,mCAA8B,GAAiB,2BAAY,CAAC,SAAS,CAAC;QAG3E,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;QACvD,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;QAC7D,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC;CACF;AA/CD,0CA+CC","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 { ReleaseTag } from '@microsoft/api-extractor-model';\nimport { VisitorState } from './VisitorState';\n\n/**\n * Constructor parameters for `ApiItemMetadata`.\n */\nexport interface IApiItemMetadataOptions {\n declaredReleaseTag: ReleaseTag;\n effectiveReleaseTag: ReleaseTag;\n releaseTagSameAsParent: boolean;\n isEventProperty: boolean;\n isOverride: boolean;\n isSealed: boolean;\n isVirtual: boolean;\n isPreapproved: boolean;\n}\n\n/**\n * Stores the Collector's additional analysis for an `AstDeclaration`. This object is assigned to\n * `AstDeclaration.apiItemMetadata` but consumers must always obtain it by calling `Collector.fetchApiItemMetadata()`.\n *\n * @remarks\n * Note that ancillary declarations share their `ApiItemMetadata` with the main declaration,\n * whereas a separate `DeclarationMetadata` object is created for each declaration.\n *\n * Consider this example:\n * ```ts\n * export declare class A {\n * get b(): string;\n * set b(value: string);\n * }\n * export declare namespace A { }\n * ```\n *\n * In this example, there are two \"symbols\": `A` and `b`\n *\n * There are four \"declarations\": `A` class, `A` namespace, `b` getter, `b` setter\n *\n * There are three \"API items\": `A` class, `A` namespace, `b` property. The property getter is the main declaration\n * for `b`, and the setter is the \"ancillary\" declaration.\n */\nexport class ApiItemMetadata {\n /**\n * This is the release tag that was explicitly specified in the original doc comment, if any.\n */\n public readonly declaredReleaseTag: ReleaseTag;\n\n /**\n * The \"effective\" release tag is a normalized value that is based on `declaredReleaseTag`,\n * but may be inherited from a parent, or corrected if the declared value was somehow invalid.\n * When actually trimming .d.ts files or generating docs, API Extractor uses the \"effective\" value\n * instead of the \"declared\" value.\n */\n public readonly effectiveReleaseTag: ReleaseTag;\n\n // If true, then it would be redundant to show this release tag\n public readonly releaseTagSameAsParent: boolean;\n\n // NOTE: In the future, the Collector may infer or error-correct some of these states.\n // Generators should rely on these instead of tsdocComment.modifierTagSet.\n public readonly isEventProperty: boolean;\n public readonly isOverride: boolean;\n public readonly isSealed: boolean;\n public readonly isVirtual: boolean;\n\n public readonly isPreapproved: boolean;\n\n /**\n * This is the TSDoc comment for the declaration. It may be modified (or constructed artificially) by\n * the DocCommentEnhancer.\n */\n public tsdocComment: tsdoc.DocComment | undefined;\n\n // Assigned by DocCommentEnhancer\n public needsDocumentation: boolean = true;\n\n public docCommentEnhancerVisitorState: VisitorState = VisitorState.Unvisited;\n\n public constructor(options: IApiItemMetadataOptions) {\n this.declaredReleaseTag = options.declaredReleaseTag;\n this.effectiveReleaseTag = options.effectiveReleaseTag;\n this.releaseTagSameAsParent = options.releaseTagSameAsParent;\n this.isEventProperty = options.isEventProperty;\n this.isOverride = options.isOverride;\n this.isSealed = options.isSealed;\n this.isVirtual = options.isVirtual;\n this.isPreapproved = options.isPreapproved;\n }\n}\n"]}
\No newline at end of file