Closed cseas closed 1 year ago
Update:
I found this comment in a TSDoc issue that explains the use-case well: https://github.com/microsoft/tsdoc/issues/164#issuecomment-585052389
I see the author has already opened an issue for this but it didn't appear in any of my Google searches (check in Issue description)
Closing as #38106 captures the requirement well.
Suggestion
🔍 Search Terms
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
Support adding JSDoc comments for individual union constituents.
📃 Motivating Example
JSDoc comments for union members would appear in IDE IntelliSense (refer below example).
💻 Use Cases
Consider the following type for spacing tokens in a UI library.
We want the equivalent px values of these tokens to be visible in the IDE wherever this type is used in our components for spacing based props. This way our users wouldn't need to refer the library documentation for what the final value of a token is.
Currently this is only possible by building an extension for the IDE, something similar to Tailwind CSS IntelliSense.
We're discussing workarounds here: https://github.com/razorpay/blade/issues/1249
Similar use-case has also been asked on StackOverflow: https://stackoverflow.com/questions/63067208/writing-more-descriptive-intellisense-docs-for-typescript-union-types