-
Notifications
You must be signed in to change notification settings - Fork 0
Add types via JSDoc #40
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
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
/** | ||
* @ignore |
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.
@ignore
stops the typedef from getting added to docs.md
@josiasds Initial commit with essentially the unchanged code from my demo earlier today. Give it a spin and let me know what you think! |
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.
I'm still learning the JSDoc syntax but it makes sense to me.
|
||
/** | ||
* @ignore | ||
* @callback SliceSelector |
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.
I'm not sure I understand the difference between using a @callback
tag vs a @typedef
. Are both valid options for SliceSelector
?
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.
Typdef doesn't work for functions 😭 .
Refer to https://github.com/LaunchPadLab/client-template/pull/436 for more details. It's a little over my head 😆 😅
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.
Right. I just re-read the docs.
I thought they were using @typedef
to type functions, but it was actually the function params being typed with @typedef
. Functions should use @callback
.
Work in progress branch to add types to this library (via JSDoc). First iteration will for the most part just be geared toward generating types from existing comments. Subsequent PRs can add enhanced custom types (e.g., things like
SliceSelector
) and even possibly generics (if we're feeling wild)