-
-
Notifications
You must be signed in to change notification settings - Fork 734
Merge documentation for nested types #2128
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
Comments
That's good to know, thanks. I will try to use this approach where applicable as a workaround.
Please allow me to disagree. Using "reflective" typing, type aliases and type helpers is so common in TypeScript, that I believe that it's not only must be a core feature, but it is actually a critical feature. In my case, I don't see any use for documentation generated by TypeDoc, because it's impractical to use by the end users. I have had to change the structure of my library and have spend couple of days refactoring it just to allow TypeDoc to generate somewhat useful docs. |
There's nothing to disagree with - it's more a statement of that I'm unlikely to ever get around to implementing it. I've been more and more busy with non-typedoc projects. |
Closing in favor of #1519 |
Thanks Garrett |
Search Terms
merge types / merge declarations / merge properties / merge documentation
Problem
Hello!
I've created a repository to demonstrate my problem. Please, take a look at this source file:
It defines a simple function
myFunc
that has a single argument of typeMyFuncOptions
, which builds upon two other types:ParamsBag
andMyFuncParams
. So there are three types involved when it comes to the function argument, but the final merged type declaration is quite simple:However, typedoc will generate 3-4 pages for this function and it's argument where each type is declared separately. This is quite precise, but from the end-user perspective who will read the documentation this is absolutely unreadable. The user will have to build the merged type declaration in it's head to understand the structure of the function's argument.
Suggested Solution
Instead, it would be much better to merge all this type information to generate a single page that will describe the function argument. Ideally, it should look somewhat like this.
Is it possible to do? Would this be hard to implement? The thing is that it is pretty common in TypeScript projects to have resulting type built from dozen of other generics and type-helpers. Currently the documentation generated for such types are practically useless and I can't use typedoc to document my libraries.
Thank you!
The text was updated successfully, but these errors were encountered: