Skip to content

The @internal doc flag recognised by tsc should be an alias for @hidden #364

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

Closed
thombles opened this issue Dec 22, 2016 · 6 comments · Fixed by #1114
Closed

The @internal doc flag recognised by tsc should be an alias for @hidden #364

thombles opened this issue Dec 22, 2016 · 6 comments · Fixed by #1114

Comments

@thombles
Copy link

The @internal flag is used by tsc --stripInternal to exclude a particular property from a generated declaration file. If you're producing a documented library with public methods for consumption this is basically the same as the @hidden flag you'll want to use in your typedoc.

It would be great if I could just use @internal and have it work on both my .d.ts and typedoc output.

I realise PRs are needed to make progress on typedoc at the moment but I thought I'd put this up as an issue in case anybody has any better ideas!

@aciccarello
Copy link
Collaborator

Great idea! Looks like these lines are where the @hidden tag is recognized.

Should the @internal docs only be ignored with the --stripInternal flag?

@aciccarello
Copy link
Collaborator

Should consider adding @ignore to the possible aliases. See #198

@christopherthielen
Copy link
Contributor

christopherthielen commented Oct 27, 2017

I wrote a plugin for my project which allows me to mark specific code as @internal or @external.

https://github.com/christopherthielen/typedoc-plugin-internal-external

The plugin also allows you to specify aliases for each annotation.

https://github.com/christopherthielen/typedoc-plugin-internal-external#annotation-aliases

@aciccarello
Copy link
Collaborator

@christopherthielen I noticed your plugin just this week. The aliases look like a great opt-in way to workaround this so thanks for sharing. I think it would be great to have some documentation pointing people to 3rd party plugins like this.

I've been hesitant to merge #525 because @internal was designed by Microsoft with a slightly different use case. My understanding of the TypeScript feature is limited and I want to avoid aliasing it to a concept which may not be the same. Additionally, TypeScript has a --stripInternal flag which I think TypeDoc should respect. Users may have the @internal doc flag used in their code but the strip internal flag turned off. Or users may want simpler declaration files but a more complete documentation website.

Actions steps I think should be taken

  • Symbols with @internal doc flag should be removed when the TypeScript --stripInternal flag is set
  • Look into allowing themes tracking/setting the visibility of internal apis (based on the @internal flag)
  • Review and document how external/internal code (as TypeDoc currently defines) is distinguished

@waterplea
Copy link

waterplea commented Oct 1, 2019

Does @internal still work? I don't see it on the compiler options page and when I use it in my Angular library and set stripInternal to true in tsconfig.json — marked properties still get to the final .d.ts file.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 12, 2019

TypeDoc doesn't produce declaration files, so I don't think it's a TypeDoc issue.

The TypeScript compiler options page doesn't list all options, nor does tsc --help. If you want to see all options (which does list --stripInternal) you have to run tsc --help --all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants