1 | import * as ts from 'typescript';
|
2 | import { AstSymbol } from './AstSymbol';
|
3 | import { AstEntity } from './AstEntity';
|
4 |
|
5 |
|
6 |
|
7 | export interface IAstDeclarationOptions {
|
8 | readonly declaration: ts.Declaration;
|
9 | readonly astSymbol: AstSymbol;
|
10 | readonly parent: AstDeclaration | undefined;
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export declare class AstDeclaration {
|
30 | readonly declaration: ts.Declaration;
|
31 | readonly astSymbol: AstSymbol;
|
32 | |
33 |
|
34 |
|
35 | readonly parent: AstDeclaration | undefined;
|
36 | |
37 |
|
38 |
|
39 | readonly modifierFlags: ts.ModifierFlags;
|
40 | |
41 |
|
42 |
|
43 |
|
44 |
|
45 | declarationMetadata: unknown;
|
46 | |
47 |
|
48 |
|
49 |
|
50 |
|
51 | apiItemMetadata: unknown;
|
52 | private readonly _analyzedChildren;
|
53 | private readonly _analyzedReferencedAstEntitiesSet;
|
54 | private _childrenByName;
|
55 | constructor(options: IAstDeclarationOptions);
|
56 | /**
|
57 | * Returns the children for this AstDeclaration.
|
58 | * @remarks
|
59 | * The collection will be empty until AstSymbol.analyzed is true.
|
60 | */
|
61 | get children(): ReadonlyArray<AstDeclaration>;
|
62 | /**
|
63 | * Returns the AstEntity objects referenced by this node.
|
64 | * @remarks
|
65 | * NOTE: The collection will be empty until AstSymbol.analyzed is true.
|
66 | *
|
67 | * Since we assume references are always collected by a traversal starting at the
|
68 | * root of the nesting declarations, this array omits the following items because they
|
69 | * would be redundant:
|
70 | * - symbols corresponding to parents of this declaration (e.g. a method that returns its own class)
|
71 | * - symbols already listed in the referencedAstSymbols property for parents of this declaration
|
72 | * (e.g. a method that returns its own class's base class)
|
73 | * - symbols that are referenced only by nested children of this declaration
|
74 | * (e.g. if a method returns an enum, this doesn't imply that the method's class references that enum)
|
75 | */
|
76 | get referencedAstEntities(): ReadonlyArray<AstEntity>;
|
77 | /**
|
78 | * This is an internal callback used when the AstSymbolTable attaches a new
|
79 | * child AstDeclaration to this object.
|
80 | * @internal
|
81 | */
|
82 | _notifyChildAttach(child: AstDeclaration): void;
|
83 | /**
|
84 | * Returns a diagnostic dump of the tree, which reports the hierarchy of
|
85 | * AstDefinition objects.
|
86 | */
|
87 | getDump(indent?: string): string;
|
88 | /**
|
89 | * Returns a diagnostic dump using Span.getDump(), which reports the detailed
|
90 | * compiler structure.
|
91 | */
|
92 | getSpanDump(indent?: string): string;
|
93 | /**
|
94 | * This is an internal callback used when AstSymbolTable.analyze() discovers a new
|
95 | * type reference associated with this declaration.
|
96 | * @internal
|
97 | */
|
98 | _notifyReferencedAstEntity(referencedAstEntity: AstEntity): void;
|
99 | /**
|
100 | * Visits all the current declaration and all children recursively in a depth-first traversal,
|
101 | * and performs the specified action for each one.
|
102 | */
|
103 | forEachDeclarationRecursive(action: (astDeclaration: AstDeclaration) => void): void;
|
104 | /**
|
105 | * Returns the list of child declarations whose `AstSymbol.localName` matches the provided `name`.
|
106 | *
|
107 | * @remarks
|
108 | * This is an efficient O(1) lookup.
|
109 | */
|
110 | findChildrenWithName(name: string): ReadonlyArray<AstDeclaration>;
|
111 | /**
|
112 | * This function determines which ts.Node kinds will generate an AstDeclaration.
|
113 | * These correspond to the definitions that we can add AEDoc to.
|
114 | */
|
115 | static isSupportedSyntaxKind(kind: ts.SyntaxKind): boolean;
|
116 | }
|
117 | //# sourceMappingURL=AstDeclaration.d.ts.map |
\ | No newline at end of file |