typedoc
typedoc copied to clipboard
Is there a way to inline a type into a function? without creating another page for the type?
Search terms
inline, function, type, merge, expand
Question
I have a react NovaProvider and its pros NovaProviderProps. I'd like to display the NovaProviderProps expanded / inlined directly into the NovaProvider , without a separated page, because those props are used only by the provider.
is it possible? maybe some plugin?
I can try to create one plugin if you can give me some hints about the steps to follow and where to hook.
Function Page
Interface Page
This would require a plugin, the way I'd approach it is to listen to Converter.EVENT_CREATE_PARAMETER to collect parameters whose type needs to be overwritten (everything with the refl.name === "props"?) and then in a listener for Converter.EVENT_RESOLVE_BEGIN, replace refl.type with a ReflectionType which describes that interface.
Notes:
- ReflectionType expects that the DeclarationReflection passed to its constructor is owned by it, not a reference to something somewhere else in the site. If you do that, it might mostly work, but will likely break some links
- The
DeclarationReflectioncreated must be passed to ProjectReflection.registerReflection or links between reflections will break. - The
DeclarationReflection'skindshould be ReflectionKind.TypeLiteral
Great i'll give it a try, and let you know Thanks for help