-
Notifications
You must be signed in to change notification settings - Fork 708
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
Documenting Vue 3 components / Pinia stores #2409
Comments
export class WWTAwareComponent extends defineComponent({}) {} May be better, though in general, highly dynamic code like this is nearly impossible to document in a reasonable way for all cases. A while ago I threw together a plugin which uses The |
The
leads to
(And I don't think I can use an abstract class since I'd need multiple inheritance, I think ...) edit: ah, |
I got nerd sniped... https://github.com/Gerrit0/typedoc-plugin-vue should make your docs a lot nicer without needing the |
Incredible, thank you! With a little bit of futzing I was able to use your new plugin to get our docs back in order. |
Search terms
Vue, Pinia, components
Question
I have a package that uses TypeScript and Vue 3. We define a component class using Vue.defineComponent(), which has a complex type signature but is basically returning a constructor for a class whose properties are defined by the function arguments.
Unfortunately, Typedoc interprets the resulting value as a variable with a type that, in my case, is unreadable:
https://docs.worldwidetelescope.org/webgl-reference/latest/apiref/engine-pinia/variables/WWTAwareComponent.html
Is there a way to get this to show up as a proper class instead? I wouldn't be surprised if a plugin was required, but I've searched around and nothing seems to be available. I'm willing to contemplate writing one, but if there's a different documentation system that would handle this case better, that might honestly be the better approach :-/
Would there perhaps be some way to define a type associated with
typeof WWTAwareComponent
that could express it as a documentable class? Or some other workaround?Similarly we have a variable created via pinia.defineStore() that also fails badly:
https://docs.worldwidetelescope.org/webgl-reference/latest/apiref/engine-pinia/functions/engineStore.html
Here, there seems to be some type inference happening so that TypeDoc decides to categorize this variable as a function.
If it's useful, here's the source code: WWTAwareComponent, engineStore.
Thanks for any advice.
The text was updated successfully, but these errors were encountered: