Way to expand type aliases when auto generating docs
See original GitHub issueThe problem
When Styleguidist is generating docs from Typescript annotations for component props, it does not expand type aliases and thus displays the Type name (i.e., TSomeThing). This is an issue because it requires the user to open up the code and track down the type declaration to figure out the prop’s actual type.
Proposed solution
It would be great if Styleguidist could automatically expand Type aliases at least one level. So, for example the following type declaration:
type TSomeThing = 'option1' | 'option2' | 'option3'
Would show up as 'option1' | 'option2' | 'option3' in Styleguidist instead of just TSomeThing.
It probably shouldn’t expand beyond the first level to prevent large or recursive objects from causing issues, but it could also be useful to be able to specify the number of levels to expand.
Alternative solutions
A way to override the automatically generated type would be a good alternative. It’s just not very useful for our designs to see TSomeThing when reviewing our components.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)

Top Related StackOverflow Question
Hello,
I wanted to add a couple additional similar use cases to this issue that my team encountered when working with TS Vue with Class Components + Storybook argsTable (via vue-docgen-api):
@Prop() styleObject!: { [key: string]: string };, the result isTSTypeLiteral.@Prop() frameConfig!: FrameConfigInterface[], the result isArrayrather than the expectedFrameConfigInterface[].If these are sufficiently different issues, I can file a separate issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.