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
TypeScript utility types are not processed #1509
Comments
This happens because right now TypeDoc determines optionality based on if the member's declaration has a typedoc/src/lib/converter/symbols.ts Lines 908 to 911 in e3aa04f
|
Thanks! That would incredibly boost our workflow with the generated docs! |
@Gerrit0 After some further digging (tried your suggestion) I noticed, that the derived interface's property apparently also gets assigned the original Maybe thats useful for you when you have a look on it. |
Checking the symbol flags works for optional - but fails for readonly... unfortunately I've been unable to find a non- |
Fix released in 0.20.26 :) |
@Gerrit0 Thank you so much for the quick fix! Our workflow with the docs just got incredibly boosted. |
Search terms
utility types, Partial
Expected Behavior
Extending the interface
Foo
withPartial<Foo>
should cause all properties inBar
to be optional.Actual Behavior
Typedoc successfully extends the interface
Foo
and shows the properties inBar
but they are required instead of optional.Steps to reproduce the bug
Minimal repo:
https://github.com/kamekazemaster/typedoc-utility-types-demo
Basically boils down to the following:
I have already done some digging in the source code and I think it has something to do with how the reflections are modeled. I didn't have the time to dig in deeper but the
ImplementsPlugin
checks in theanalyzeInheritance
function if the reflection isinstanceof DeclarationReflection
. While debuggingtype.reflection
returnsundefined
in the case of extendingPartial<Foo>
. In the case of just extendingFoo
it returns aDeclarationReflection
.Even though I made this observation, it seems not logical because the actual documentation includes the extended properties from
Foo
.Any help on this is appreciated.
Environment
The text was updated successfully, but these errors were encountered: