UNPKG

@microsoft/api-extractor

Version:

Validate, document, and review the exported API for a TypeScript library

26 lines (25 loc) 1.05 kB
import * as ts from 'typescript'; import { ExtractorContext } from '../ExtractorContext'; import AstModule from './AstModule'; /** * This class is part of the AstItem abstract syntax tree. It represents the top-level * exports for an Rush package. This object acts as the root of the Extractor's tree. */ export default class AstPackage extends AstModule { private _exportedNormalizedSymbols; private static _getOptions(context, rootFile); constructor(context: ExtractorContext, rootFile: ts.SourceFile); /** * Finds and returns the original symbol name. * * For example, suppose a class is defined as "export default class MyClass { }" * but exported from the package's index.ts like this: * * export { default as _MyClass } from './MyClass'; * * In this example, given the symbol for _MyClass, getExportedSymbolName() will return * the string "MyClass". */ tryGetExportedSymbolName(symbol: ts.Symbol): string | undefined; shouldHaveDocumentation(): boolean; }