UNPKG

@microsoft/api-extractor

Version:

Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups

53 lines 1.95 kB
"use strict"; // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.AstModule = void 0; /** * An internal data structure that represents a source file that is analyzed by AstSymbolTable. */ class AstModule { /** * The source file that declares this TypeScript module. In most cases, the source file's * top-level exports constitute the module. */ sourceFile; /** * The symbol for the module. Typically this corresponds to ts.SourceFile itself, however * in some cases the ts.SourceFile may contain multiple modules declared using the `module` keyword. */ moduleSymbol; /** * Example: "@rushstack/node-core-library/lib/FileSystem" * but never: "./FileSystem" */ externalModulePath; /** * A list of other `AstModule` objects that appear in `export * from "___";` statements. */ starExportedModules; /** * A partial map of entities exported by this module. The key is the exported name. */ cachedExportedEntities; // exportName --> entity /** * Additional state calculated by `AstSymbolTable.fetchWorkingPackageModule()`. */ astModuleExportInfo; constructor(options) { this.sourceFile = options.sourceFile; this.moduleSymbol = options.moduleSymbol; this.externalModulePath = options.externalModulePath; this.starExportedModules = new Set(); this.cachedExportedEntities = new Map(); this.astModuleExportInfo = undefined; } /** * If false, then this source file is part of the working package being processed by the `Collector`. */ get isExternal() { return this.externalModulePath !== undefined; } } exports.AstModule = AstModule; //# sourceMappingURL=AstModule.js.map