Skip to main content

Home > @microsoft/api-extractor > ExtractorConfig

ExtractorConfig class

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

export declare class ExtractorConfig


apiJsonFilePathstringThe output path for the doc model file. The file extension should be ".api.json".
apiReportEnabledbooleanWhether to generate an API report.
betaTrimmedFilePathstringSpecifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
bundledPackagesstring[]A list of NPM package names whose exports should be treated as part of this package.
docModelEnabledbooleanWhether to generate a doc model file.
FILENAMEstaticstringThe config file name "api-extractor.json".
jsonSchemastaticJsonSchemaThe JSON Schema for API Extractor config file (api-extractor.schema.json).
mainEntryPointFilePathstringSpecifies the .d.ts file to be used as the starting point for analysis. API Extractor analyzes the symbols exported by this module.
messagesIExtractorMessagesConfigConfigures how API Extractor reports error and warning messages produced during analysis.
newlineKindNewlineKindSpecifies what type of newlines API Extractor should use when writing output files. By default, the output files will be written with Windows-style newlines.
omitTrimmingCommentsbooleanWhen 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{} | undefinedProvides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
packageFolderstring | undefinedThe 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.
packageJsonINodePackageJson | undefinedThe parsed package.json file for the working package, or undefined if API Extractor was invoked without a package.json file.
projectFolderstringDetermines 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.
publicTrimmedFilePathstringSpecifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
reportFilePathstringThe reportFolder path combined with the reportFileName.
reportTempFilePathstringThe reportTempFolder path combined with the reportFileName.
rollupEnabledbooleanWhether to generate the .d.ts rollup file.
skipLibCheckbooleanThis option causes the compiler to be invoked with the --skipLibCheck option.
testModebooleanSet to true when invoking API Extractor's test harness.
tsconfigFilePathstringSpecifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
tsdocConfigFileTSDocConfigFileThe tsdoc.json configuration that will be used when parsing doc comments.
tsdocConfigurationTSDocConfigurationThe TSDocConfiguration loaded from ExtractorConfig.tsdocConfigFile .
tsdocMetadataEnabledbooleanWhether to generate the tsdoc-metadata.json file.
tsdocMetadataFilePathstringSpecifies where the TSDoc metadata file should be written.
untrimmedFilePathstringSpecifies the output path for a .d.ts rollup file to be generated without any trimming.


getDiagnosticDump()Returns a JSON-like string representing the ExtractorConfig state, which can be printed to a console for diagnostic purposes.
hasDtsFileExtension(filePath)staticReturns true if the specified file path has the ".d.ts" file extension.
loadFile(jsonFilePath)staticPerforms only the first half of ExtractorConfig.loadFileAndPrepare() , providing an opportunity to modify the object before it is passed to ExtractorConfig.prepare() .
loadFileAndPrepare(configJsonFilePath)staticLoads the api-extractor.json config file from the specified file path, and prepares an ExtractorConfig object.
prepare(options)staticPrepares 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.
tryLoadForFolder(options)staticSearches for the api-extractor.json config file associated with the specified starting folder, and loads the file if found. This lookup supports rig packages .