Skip to content

[api-extractor]: support custom access modifiers for API stripping  #3558

@Hotell

Description

@Hotell

Summary

API-Documenter already custom tags via TSDoc. We need similar functionality for access modifier annotations to leverage api stripping based on our needs.

Please check following RFC for more details.

In short we would like to leverage additional acces modifiers for API stripping such as:

  • @rc for Release Candidate
  • @unstable to express @alpha/@beta/@rc via one tag which is all we need

To implement this dtsRollup API config will need to be extended to something like following:

{
"dtsRollup": {
    "enabled": true,
    "untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts",
    "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",,
    "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts"
    "customTrimmedFilePaths": {
         // custom annotation key needs to match with custom tsdoc
         "@rc":  "<projectFolder>/dist/rc/index.d.ts"
         "@unstable":  "<projectFolder>/dist/unstable/index.d.ts"
          ...
      }
  }
}

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.18.1
Operating system? macos 12
API Extractor scenario? reporting (.api.md) / rollups (.d.ts) / docs (.api.json)
Would you consider contributing a PR? Maybe
TypeScript compiler version? 4.3.5
Node.js version (node -v)? 16

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    AE/AD

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions