-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Include usage documentations in JSDoc #34
Comments
That's interesting idea. What are the best practices to implement that, can you link to some examples? The main concern is maintainability of these JSDoc comments, like for example when we update usage examples they should stay up to date. |
You probably want to use the JSDoc as the source of truth and then use tools like tsdoc to generate your README and/or website from it. |
@issuehuntfest has funded $20.00 to this issue. See it on IssueHunt |
@mohsen1 @piotrwitek I would like to take this, can you get me started please. |
@gurungrahul2 That's awesome!
/**
* SetIntersection (same as Extract)
* @desc Set intersection of given union types `A` and `B`
* @example
* ```
* // Expect: "2" | "3"
* type ResultSet = SetIntersection<'1' | '2' | '3', '2' | '3' | '4'>;
* // Expect: () => void
* type ResultSetMixed = SetIntersection<string | number | (() => void), Function>;
* ```
*/
export type SetIntersection<A, B> = A extends B ? A : never;
Additional finds:
Now notice that this issue is only about (1). Let me know what you think! |
@piotrwitek I am working on 1, and I will take 2 after it, I will ping you if I have queries, on it. |
@gurungrahul2 that's cool! Let me know when you'll be approaching (2), I'll try to help as much as I can. |
note that the JSDoc markdown doesn't support triple backtick code blocks. You must indent code blocks. |
JSDoc is not that well specified but in most tools I have used the triple backtick was not working. It's not specific to a single directive like |
Thanks @mohsen1, I got it now. |
@piotrwitek has rewarded $14.00 to @gurungrahul2. See it on IssueHunt
|
All types have nice usage docs. Would be nice to have them in JSDoc to show up in text editors.
The text was updated successfully, but these errors were encountered: