Skip to content

[api-extractor] Re-exported namespace members not included in the report #2145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 2 tasks
hiranya911 opened this issue Aug 27, 2020 · 3 comments
Open
1 of 2 tasks

Comments

@hiranya911
Copy link
Contributor

Is this a feature or a bug?

  • Feature
  • Bug

Please describe the actual behavior.

Consider the following entrypoint implementation:

import * as _auth from './auth/auth';

export namespace auth {
    export import Auth = _auth.Auth;
    export import UserRecord = _auth.UserRecord;
}

Note that the auth namespace re-exports several types from another module. I expect definitions of Auth and UserRecord to be included in the generated API report. But this is all I get:

// @public (undocumented)
export namespace auth {
    import Auth = _auth.Auth;
    import UserRecord = _auth.UserRecord;
}


// (No @packageDocumentation comment for this package)

If this is a bug, please provide the tool version, Node.js version, and OS.

  • Tool: API Extractor
  • Tool Version: v7.9.11
  • Node Version: v10.22.0
  • OS: Mac OS
@hiranya911
Copy link
Contributor Author

Seeing the same problem with symbol re-exports from inside a namespace.

Input:

import { credential } from './credential';

export namespace admin {
  export { credential }
}

Generated report:

// @public (undocumented)
export namespace admin {
  { credential }
}


// (No @packageDocumentation comment for this package)

@pedroteixeira
Copy link

pedroteixeira commented Mar 14, 2022

Hi, is this a known limitation, not considered best practice?

hmm I guess one can omit the export namespace and just declare it?

@github-project-automation github-project-automation bot moved this to Needs triage in Bug Triage Feb 26, 2024
@iclanton iclanton moved this from Needs triage to AE/AD in Bug Triage Feb 26, 2024
@maximzavadskiy
Copy link

maximzavadskiy commented Apr 15, 2024

`

Hi, is this a known limitation, not considered best practice?

hmm I guess one can omit the export namespace and just declare it?

api-exporter would then omit un-exported namespaces from the final API report / d.ts bundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: AE/AD
Development

No branches or pull requests

3 participants