-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Document inheritance hierarchy #2879
Conversation
Thanks @icholy. Anyone have thoughts here? This is fine with me, but there are a lot more places we would want it, e.g., |
@pjcozzi if I get the thumbs up, I'll go and update all of them. I just didn't want to waste my time in case it wasn't something that was going to get accepted. Yeah, there are |
This is something I've actually been meaning to look into, so thanks @icholy for getting the ball rolling. Since Cesium doesn't use actual inheritance, I think I think making this change one set of classes at a time would be the way to do it, so if you want to change Appearance to |
That is not actually inheritance, it's just code sharing. Inheritance would mean that |
Meh, tomato, tomato. You're not using the standard mechanism, but the end result is pretty similar. I agree that it's not a perfect fit, but I think However, it won't really matter if it's an interface or class in the typescript definitions. I'll update it to use interfaces. |
@mramato seems like your jsdoc template doesn't support interfaces. I stripped down edit: to clarify, the whole |
No, the result is very different, it's only superficial on the surface. If this was really inheritance, the functions would not need to be defined at all in the object implementing them because they would get them automatically.
This may be true, but I also noticed you deleted a bunch of code in the |
Yeah that's what I tried first. After that didn't work I deleted everything in Appearance to see if it was some of the other annotations messing with it. |
Okay, I'll take a look at this if I get a chance. Modifying our template is definitely an option, but I won't know how easy/hard it is without looking more into it. |
@mramato are the templates a modified version of a publicly available theme? Or is it written from scratch for caesium? |
I'm honestly not sure. I think it was at some point, but it was a 2.x version of jsDoc. It's in |
I created the current template when we upgraded to jsDoc 3.3 which was PR #1745 The template was based on the default at the time, but I ended up making huge changes to make it match our desired output. |
@shunter I've made several attempts at this but I'm not getting anywhere. What are the odds you could update the template with support for interfaces? |
@mramato soo uhh, can I just do them as base classes instead of interfaces? Better than nothing. |
@mramato this has been a blocker for generating typescript definitions for almost a year now. I want to get this conversation going again. |
@mramato can @icholy move forward with this, #2879 (comment)?
|
@mramato Can we please get this merged... I need typescript definitions... 😢 |
You're currently using
@see
tags to point from the parent to the child but not linking the child to the parent in any way.This is problem for me while generating TypeScript definition files.
MaterialAppearance
shouldextend
Appearance
but I have no way of figuring that out from the annotations in your source.jsdoc has a an @extends tag which can be used to document the relationship between a parent and child class.
Here's what I looks like in the docs

Would you consider accepting a change like this?