UNPKG

2.04 kBTypeScriptView Raw
1import * as tsdoc from '@microsoft/tsdoc';
2import { AstDeclaration } from '../analyzer/AstDeclaration';
3/**
4 * Stores the Collector's additional analysis for a specific `AstDeclaration` signature. This object is assigned to
5 * `AstDeclaration.declarationMetadata` but consumers must always obtain it by calling
6 * `Collector.fetchDeclarationMetadata()`.
7 *
8 * Note that ancillary declarations share their `ApiItemMetadata` with the main declaration,
9 * whereas a separate `DeclarationMetadata` object is created for each declaration.
10 */
11export declare abstract class DeclarationMetadata {
12 /**
13 * The ParserContext from when the TSDoc comment was parsed from the source code.
14 * If the source code did not contain a doc comment, then this will be undefined.
15 *
16 * Note that if an ancillary declaration has a doc comment, it is tracked here, whereas
17 * `ApiItemMetadata.tsdocComment` corresponds to documentation for the main declaration.
18 */
19 abstract readonly tsdocParserContext: tsdoc.ParserContext | undefined;
20 /**
21 * If true, then this declaration is treated as part of another declaration.
22 */
23 abstract readonly isAncillary: boolean;
24 /**
25 * A list of other declarations that are treated as being part of this declaration. For example, a property
26 * getter/setter pair will be treated as a single API item, with the setter being treated as ancillary to the getter.
27 *
28 * If the `ancillaryDeclarations` array is non-empty, then `isAncillary` will be false for this declaration,
29 * and `isAncillary` will be true for all the array items.
30 */
31 abstract readonly ancillaryDeclarations: ReadonlyArray<AstDeclaration>;
32}
33/**
34 * Used internally by the `Collector` to build up `DeclarationMetadata`.
35 */
36export declare class InternalDeclarationMetadata extends DeclarationMetadata {
37 tsdocParserContext: tsdoc.ParserContext | undefined;
38 isAncillary: boolean;
39 ancillaryDeclarations: AstDeclaration[];
40}
41//# sourceMappingURL=DeclarationMetadata.d.ts.map
\No newline at end of file