Skip to content
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

Provide type information for Enum members #1942

Closed
vladfrangu opened this issue May 29, 2022 · 2 comments
Closed

Provide type information for Enum members #1942

vladfrangu opened this issue May 29, 2022 · 2 comments
Labels
enhancement Improved functionality

Comments

@vladfrangu
Copy link

Search Terms

enum, enum members, missing type in enum members

Problem

While generating documentation for enums, they never include the type of the variable in the enum (for instance a literal type object, so we have more clues), which can cause problems if you want to render that in a custom way. You can see this in the JSON linked below.

https://github.com/vladfrangu/typedoc-number-enum-lacks-type-information/blob/674a128da9d715023ebfeaedef6a34f5655e0bf4/out/doc.json#L16-L29

Suggested Solution

Ideally, typedoc should either append type information for the enum members (otherwise we have to take a wild guess and just default it to literal which is less than ideal) or maybe it should add a flag instead. Would also help to know if the defaultValue is a number/string without having to check if defaultValue[0] === '"' or other detection methods

@vladfrangu vladfrangu added the enhancement Improved functionality label May 29, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 29, 2022

Your provided link is private.

I'm guessing that the highlighted lines show that the type is a reference type - if you resolve said reference type, you should then have access to the enum it refers to. Setting the type property on the enum member reflection seems like a reasonable request to me, along with an update to the default theme so that it isn't rendered.

@vladfrangu
Copy link
Author

vladfrangu commented May 29, 2022

Woops. Sorry about the private link, forgot to set the repo to public once I set it up 😅

Other than that, you are correct. It links to the enum children, where type is missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality
Projects
None yet
Development

No branches or pull requests

2 participants