UNPKG

1.91 kBTypeScriptView Raw
1/**
2 * `AstEntity` is the abstract base class for analyzer objects that can become a `CollectorEntity`.
3 *
4 * @remarks
5 *
6 * The subclasses are:
7 * ```
8 * - AstEntity
9 * - AstSymbol
10 * - AstSyntheticEntity
11 * - AstImport
12 * - AstNamespaceImport
13 * ```
14 */
15export declare abstract class AstEntity {
16 /**
17 * The original name of the symbol, as exported from the module (i.e. source file)
18 * containing the original TypeScript definition. Constructs such as
19 * `import { X as Y } from` may introduce other names that differ from the local name.
20 *
21 * @remarks
22 * For the most part, `localName` corresponds to `followedSymbol.name`, but there
23 * are some edge cases. For example, the ts.Symbol.name for `export default class X { }`
24 * is actually `"default"`, not `"X"`.
25 */
26 abstract readonly localName: string;
27}
28/**
29 * `AstSyntheticEntity` is the abstract base class for analyzer objects whose emitted declarations
30 * are not text transformations performed by the `Span` helper.
31 *
32 * @remarks
33 * Most of API Extractor's output is produced by using the using the `Span` utility to regurgitate strings from
34 * the input .d.ts files. If we need to rename an identifier, the `Span` visitor can pick out an interesting
35 * node and rewrite its string, but otherwise the transformation operates on dumb text and not compiler concepts.
36 * (Historically we did this because the compiler's emitter was an internal API, but it still has some advantages,
37 * for example preserving syntaxes generated by an older compiler to avoid incompatibilities.)
38 *
39 * This strategy does not work for cases where the output looks very different from the input. Today these
40 * cases are always kinds of `import` statements, but that may change in the future.
41 */
42export declare abstract class AstSyntheticEntity extends AstEntity {
43}
44//# sourceMappingURL=AstEntity.d.ts.map
\No newline at end of file