UNPKG

2.33 kBTypeScriptView Raw
1import * as ts from 'typescript';
2import { AstEntity } from './AstEntity';
3/**
4 * Represents information collected by {@link AstSymbolTable.fetchAstModuleExportInfo}
5 */
6export declare class AstModuleExportInfo {
7 readonly exportedLocalEntities: Map<string, AstEntity>;
8 readonly starExportedExternalModules: Set<AstModule>;
9}
10/**
11 * Constructor parameters for AstModule
12 *
13 * @privateRemarks
14 * Our naming convention is to use I____Parameters for constructor options and
15 * I____Options for general function options. However the word "parameters" is
16 * confusingly similar to the terminology for function parameters modeled by API Extractor,
17 * so we use I____Options for both cases in this code base.
18 */
19export interface IAstModuleOptions {
20 sourceFile: ts.SourceFile;
21 moduleSymbol: ts.Symbol;
22 externalModulePath: string | undefined;
23}
24/**
25 * An internal data structure that represents a source file that is analyzed by AstSymbolTable.
26 */
27export declare class AstModule {
28 /**
29 * The source file that declares this TypeScript module. In most cases, the source file's
30 * top-level exports constitute the module.
31 */
32 readonly sourceFile: ts.SourceFile;
33 /**
34 * The symbol for the module. Typically this corresponds to ts.SourceFile itself, however
35 * in some cases the ts.SourceFile may contain multiple modules declared using the `module` keyword.
36 */
37 readonly moduleSymbol: ts.Symbol;
38 /**
39 * Example: "@rushstack/node-core-library/lib/FileSystem"
40 * but never: "./FileSystem"
41 */
42 readonly externalModulePath: string | undefined;
43 /**
44 * A list of other `AstModule` objects that appear in `export * from "___";` statements.
45 */
46 readonly starExportedModules: Set<AstModule>;
47 /**
48 * A partial map of entities exported by this module. The key is the exported name.
49 */
50 readonly cachedExportedEntities: Map<string, AstEntity>;
51 /**
52 * Additional state calculated by `AstSymbolTable.fetchWorkingPackageModule()`.
53 */
54 astModuleExportInfo: AstModuleExportInfo | undefined;
55 constructor(options: IAstModuleOptions);
56 /**
57 * If false, then this source file is part of the working package being processed by the `Collector`.
58 */
59 get isExternal(): boolean;
60}
61//# sourceMappingURL=AstModule.d.ts.map
\No newline at end of file