This task invokes the API Extractor tool which reads TypeScript declarations (.d.ts files) as inputs and produces three types of outputs:
1. API Report - API Extractor can trace all exports from your project's main entry point and generate a report to be used as the basis for an API review workflow.
3. API Documentation - API Extractor can generate a "doc model" JSON file for each of your projects. This JSON file contains the extracted type signatures and doc comments. The api-documenter companion tool can use these files to generate an API reference website, or you can use them as inputs for a custom documentation pipeline.
See the API Extractor documentation for details about how it works.
When to use it
We recommend to use API Extractor for every TypeScript library project, especially if it is published as an NPM package.
You will need to add the
@microsoft/api-extractor package to your project:
rush add --package @microsoft/api-extractor --dev
Alternatively, you can avoid this dependency by loading it from a rig, as described in the Using rig packages article.
For advanced scenarios, the optional api-extractor-task.json config file provides some additional Heft-specific settings.