UNPKG

1.67 kBJavaScriptView Raw
1"use strict";
2// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3// See LICENSE in the project root for license information.
4Object.defineProperty(exports, "__esModule", { value: true });
5exports.AstSyntheticEntity = exports.AstEntity = void 0;
6/**
7 * `AstEntity` is the abstract base class for analyzer objects that can become a `CollectorEntity`.
8 *
9 * @remarks
10 *
11 * The subclasses are:
12 * ```
13 * - AstEntity
14 * - AstSymbol
15 * - AstSyntheticEntity
16 * - AstImport
17 * - AstNamespaceImport
18 * ```
19 */
20class AstEntity {
21}
22exports.AstEntity = AstEntity;
23/**
24 * `AstSyntheticEntity` is the abstract base class for analyzer objects whose emitted declarations
25 * are not text transformations performed by the `Span` helper.
26 *
27 * @remarks
28 * Most of API Extractor's output is produced by using the using the `Span` utility to regurgitate strings from
29 * the input .d.ts files. If we need to rename an identifier, the `Span` visitor can pick out an interesting
30 * node and rewrite its string, but otherwise the transformation operates on dumb text and not compiler concepts.
31 * (Historically we did this because the compiler's emitter was an internal API, but it still has some advantages,
32 * for example preserving syntaxes generated by an older compiler to avoid incompatibilities.)
33 *
34 * This strategy does not work for cases where the output looks very different from the input. Today these
35 * cases are always kinds of `import` statements, but that may change in the future.
36 */
37class AstSyntheticEntity extends AstEntity {
38}
39exports.AstSyntheticEntity = AstSyntheticEntity;
40//# sourceMappingURL=AstEntity.js.map
\No newline at end of file