UNPKG

2.6 kBTypeScriptView Raw
1import * as tsdoc from '@microsoft/tsdoc';
2import { ReleaseTag } from '@microsoft/api-extractor-model';
3import { VisitorState } from './VisitorState';
4/**
5 * Constructor parameters for `ApiItemMetadata`.
6 */
7export interface IApiItemMetadataOptions {
8 declaredReleaseTag: ReleaseTag;
9 effectiveReleaseTag: ReleaseTag;
10 releaseTagSameAsParent: boolean;
11 isEventProperty: boolean;
12 isOverride: boolean;
13 isSealed: boolean;
14 isVirtual: boolean;
15 isPreapproved: boolean;
16}
17/**
18 * Stores the Collector's additional analysis for an `AstDeclaration`. This object is assigned to
19 * `AstDeclaration.apiItemMetadata` but consumers must always obtain it by calling `Collector.fetchApiItemMetadata()`.
20 *
21 * @remarks
22 * Note that ancillary declarations share their `ApiItemMetadata` with the main declaration,
23 * whereas a separate `DeclarationMetadata` object is created for each declaration.
24 *
25 * Consider this example:
26 * ```ts
27 * export declare class A {
28 * get b(): string;
29 * set b(value: string);
30 * }
31 * export declare namespace A { }
32 * ```
33 *
34 * In this example, there are two "symbols": `A` and `b`
35 *
36 * There are four "declarations": `A` class, `A` namespace, `b` getter, `b` setter
37 *
38 * There are three "API items": `A` class, `A` namespace, `b` property. The property getter is the main declaration
39 * for `b`, and the setter is the "ancillary" declaration.
40 */
41export declare class ApiItemMetadata {
42 /**
43 * This is the release tag that was explicitly specified in the original doc comment, if any.
44 */
45 readonly declaredReleaseTag: ReleaseTag;
46 /**
47 * The "effective" release tag is a normalized value that is based on `declaredReleaseTag`,
48 * but may be inherited from a parent, or corrected if the declared value was somehow invalid.
49 * When actually trimming .d.ts files or generating docs, API Extractor uses the "effective" value
50 * instead of the "declared" value.
51 */
52 readonly effectiveReleaseTag: ReleaseTag;
53 readonly releaseTagSameAsParent: boolean;
54 readonly isEventProperty: boolean;
55 readonly isOverride: boolean;
56 readonly isSealed: boolean;
57 readonly isVirtual: boolean;
58 readonly isPreapproved: boolean;
59 /**
60 * This is the TSDoc comment for the declaration. It may be modified (or constructed artificially) by
61 * the DocCommentEnhancer.
62 */
63 tsdocComment: tsdoc.DocComment | undefined;
64 needsDocumentation: boolean;
65 docCommentEnhancerVisitorState: VisitorState;
66 constructor(options: IApiItemMetadataOptions);
67}
68//# sourceMappingURL=ApiItemMetadata.d.ts.map
\No newline at end of file