Home > @microsoft/api-extractor > ExtractorConfig

ExtractorConfig class

The ExtractorConfig class loads, validates, interprets, and represents the api-extractor.json config file.

Signature:

export declare class ExtractorConfig 

Properties

Property Modifiers Type Description
apiJsonFilePath   string The output path for the doc model file. The file extension should be “.api.json”.
apiReportEnabled   boolean Whether to generate an API report.
betaTrimmedFilePath   string Specifies the output path for a .d.ts rollup file to be generated with trimming for a “beta” release.
docModelEnabled   boolean Whether to generate a doc model file.
FILENAME static string The config file name “api-extractor.json”.
jsonSchema static JsonSchema The JSON Schema for API Extractor config file (api-extractor.schema.json).
mainEntryPointFilePath   string Specifies the .d.ts file to be used as the starting point for analysis. API Extractor analyzes the symbols exported by this module.
messages   IExtractorMessagesConfig Configures how API Extractor reports error and warning messages produced during analysis.
omitTrimmingComments   boolean When a declaration is trimmed, by default it will be replaced by a code comment such as “Excluded from this release type: exampleMember”. Set “omitTrimmingComments” to true to remove the declaration completely.
overrideTsconfig   {} | undefined Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
packageFolder   string | undefined The absolute path of the folder containing the package.json file for the working package, or undefined if API Extractor was invoked without a package.json file.
packageJson   INodePackageJson | undefined The parsed package.json file for the working package, or undefined if API Extractor was invoked without a package.json file.
projectFolder   string Determines the <projectFolder> token that can be used with other config file settings. The project folder typically contains the tsconfig.json and package.json config files, but the path is user-defined.
publicTrimmedFilePath   string Specifies the output path for a .d.ts rollup file to be generated with trimming for a “public” release.
reportFilePath   string The reportFolder path combined with the reportFileName.
reportTempFilePath   string The reportTempFolder path combined with the reportFileName.
rollupEnabled   boolean Whether to generate the .d.ts rollup file.
skipLibCheck   boolean This option causes the compiler to be invoked with the --skipLibCheck option.
testMode   boolean Set to true when invoking API Extractor’s test harness.
tsconfigFilePath   string Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
tsdocMetadataEnabled   boolean Whether to generate the tsdoc-metadata.json file.
tsdocMetadataFilePath   string Specifies where the TSDoc metadata file should be written.
untrimmedFilePath   string Specifies the output path for a .d.ts rollup file to be generated without any trimming.

Methods

Method Modifiers Description
getDiagnosticDump()   Returns a JSON-like string representing the ExtractorConfig state, which can be printed to a console for diagnostic purposes.
hasDtsFileExtension(filePath) static Returns true if the specified file path has the “.d.ts” file extension.
loadFile(jsonFilePath) static Performs only the first half of ExtractorConfig.loadFileAndPrepare(), providing an opportunity to modify the object before it is passed to ExtractorConfig.prepare().
loadFileAndPrepare(configJsonFilePath) static Loads the api-extractor.json config file from the specified file path, and prepares an ExtractorConfig object.
prepare(options) static Prepares an ExtractorConfig object using a configuration that is provided as a runtime object, rather than reading it from disk. This allows configurations to be constructed programmatically, loaded from an alternate source, and/or customized after loading.