-
Notifications
You must be signed in to change notification settings - Fork 64
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
Support type aliases in class declaration JSDoc tags #152
Comments
Hi Caleb, thanks for opening this issue :-) I use |
Unfortunately my example is on my company’s GitHub. What’s funny is when I was running the command without an outFile, I was seeing the right text. Adding outFile seemed th change that. I’ll try to put together a reproduction. |
Hey @runem, here's the reproduction for this issue. |
Thank you so much for the repro :-) First of all, I think the JSDoc notation is invalid: That should be the reason for why it doesn't find the attribute. In addition, you could remove the constructor() {
super();
/**
* Who should we greet?
* @attr
* @type {Greeting}
*/
this.greeting = '';
} And just to be clear, do you expect the output to be this?
or would this be what you want?
|
I would expect option one above where type is set as To be clear, changing the code to what you've added above still has type set as |
Yes, this is actually the intended behavior :-) However, here you can see a feature request requesting a way to inline types: #140, which sounds like what you want. This functionality will be implemented behind the flag I like the point you made about having a section of the markdown docs for non-standard types. I just yet haven't found out how this would best be implemented. Finally, I think if you just use the JSDoc tag like this: |
Yeah, that's great. I'm more than happy having it actually say Side question, how does |
That's a good question. In the existing experimental JSON format, the type is just a You can also read this comment which I just wrote regarding adding methods to the JSON. I think gives a good summary :-)
|
I realize this is outside the scope of this particular issue, but with custom-elements.json, I would imagine there would be a types field outside of tags. This way the type could be referenced by potentially multiple tags. The question then, of course, is how you model the relationship and how you model the custom type. JSON Schema, has syntax that's been tested fairly well, I believe … |
I might have missed this in the docs somewhere, but I would love the ability to define my types using TypeScript but write my source in good ol' ES files with JSDoc. TypeScript already provides type checking for this set up. I'd love it if I could tell
wca
to look at TS files for complex type definitions and interfaces to keep my JS relatively clean. Is there a way to accomplish this?The text was updated successfully, but these errors were encountered: