-
Notifications
You must be signed in to change notification settings - Fork 82
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
[types] Add JSDoc based on website docs #436
[types] Add JSDoc based on website docs #436
Conversation
✅ Deploy Preview for colorjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
While not in the website, this could probably use some documentation for each property: Lines 4 to 27 in 4dcc46b
|
This comment was marked as resolved.
This comment was marked as resolved.
…or.js into types/jsdoc-from-site
Docs were based on the website and the JSDoc from the JavaScript files. Some types were actually inaccurate (or could be made a bit more specific), which I fixed.
Most other functions with more than a few options have their own interfaces for options, so IMO it makes sense that that should follow for this function as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @MysteryBlokHed!
Oops, it looks like there's a formatting problem that made CI fail. I'll open a new PR to fix that. |
Related to #424
This is a work-in-progress PR to add documentation from the website to the types. This will not only allow for better developer experience by providing more informative in-editor documentation, but will also allow the docs to be auto-generated with a tool like TypeDoc in the future.
I've started by adding docs for the
Hooks
andColorSpace
classes, but docs for other classes/functions/properties should be added too.If there are any classes or functions in particular that anyone thinks should have documentation brought over from the website, I'm open to suggestions. Some things seem relatively self-explanatory with their types, so I don't think that every method and property needs to include super-detailed docs.
Note: In the
toGamut.d.ts
file, I did actually modify the types themselves a bit in order to make them more accurate, and to make it easier to access the types for the function's options.