-
|
Hi, I’m trying to use My very simplified target use case is something like: export type ButtonProps = {
/**
* Button size.
*
* @default m
*/
size?: ButtonSize;
}What I want is a structured, easy-to-traverse result that includes both: the original TypeScript declaration structure For example, for size I’d like to get something like:
From what I understand so far:
So my question is: Can this be done out of the box by oxc-parser today, especially in Node.js, or is the intended approach to manually match comments to AST nodes by spans/ranges and then parse the JSDoc separately? More specifically: Is there already a supported way to get structured JSDoc for TS properties/interfaces/type literals from oxc-parser? My goal is to build a prop/type documentation extractor, so having this available directly from the parser would be very useful. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, unfortunately we do not parse jsdoc comments yet. The best solution to your problem at present it probably to use oxc-parser to parse the ast + get all comments, then use a jsdoc parsing library to parse the content within the comment.
not at present (this may change if we see increased demand for this requirement) |
Beta Was this translation helpful? Give feedback.
Hi, unfortunately we do not parse jsdoc comments yet.
The best solution to your problem at present it probably to use oxc-parser to parse the ast + get all comments, then use a jsdoc parsing library to parse the content within the comment.