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 


alphaTrimmedFilePathreadonlystringSpecifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release.
apiJsonFilePathreadonlystringThe output path for the doc model file. The file extension should be ".api.json".
apiReportEnabledreadonlybooleanWhether to generate an API report.
betaTrimmedFilePathreadonlystringSpecifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
bundledPackagesreadonlystring[]A list of NPM package names whose exports should be treated as part of this package.
docModelEnabledreadonlybooleanWhether to generate a doc model file.
enumMemberOrderreadonlyEnumMemberOrderSpecifies how API Extractor sorts members of an enum when generating api.json.



stringThe config file name "api-extractor.json".



JsonSchemaThe JSON Schema for API Extractor config file (api-extractor.schema.json).
mainEntryPointFilePathreadonlystringSpecifies the .d.ts file to be used as the starting point for analysis. API Extractor analyzes the symbols exported by this module.
messagesreadonlyIExtractorMessagesConfigConfigures how API Extractor reports error and warning messages produced during analysis.
newlineKindreadonlyNewlineKindSpecifies what type of newlines API Extractor should use when writing output files. By default, the output files will be written with Windows-style newlines.
omitTrimmingCommentsreadonlybooleanWhen 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.
overrideTsconfigreadonly{} | undefinedProvides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
packageFolderreadonlystring | 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.
packageJsonreadonlyINodePackageJson | undefinedThe parsed package.json file for the working package, or undefined if API Extractor was invoked without a package.json file.
projectFolderreadonlystringDetermines 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.
publicTrimmedFilePathreadonlystringSpecifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
reportFilePathreadonlystringThe reportFolder path combined with the reportFileName.
reportTempFilePathreadonlystringThe reportTempFolder path combined with the reportFileName.
rollupEnabledreadonlybooleanWhether to generate the .d.ts rollup file.
skipLibCheckreadonlybooleanThis option causes the compiler to be invoked with the --skipLibCheck option.
testModereadonlybooleanSet to true when invoking API Extractor's test harness.
tsconfigFilePathreadonlystringSpecifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
tsdocConfigFilereadonlyTSDocConfigFileThe tsdoc.json configuration that will be used when parsing doc comments.
tsdocConfigurationreadonlyTSDocConfigurationThe TSDocConfiguration loaded from ExtractorConfig.tsdocConfigFile.
tsdocMetadataEnabledreadonlybooleanWhether to generate the tsdoc-metadata.json file.
tsdocMetadataFilePathreadonlystringSpecifies where the TSDoc metadata file should be written.
untrimmedFilePathreadonlystringSpecifies 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.