knitwork
knitwork copied to clipboard
Support jsdoc comments for interface fields
Describe the feature
Add support for jsdoc comments in the genInterface function to improve documentation of generated ts interfaces
console.log(genInterface(
'User',
{
id: {
type: 'string',
jsdoc: 'Unique identifier for the user',
},
email: {
type: 'string',
jsdoc: {
description: 'User email address',
example: '[email protected]',
},
},
password: 'string',
},
{
jsdoc: {
description: 'Represents a user in the system',
since: '1.0.0',
},
},
))
Output
/**
* Represents a user in the system
* @since 1.0.0
*/
interface User {
/** Unique identifier for the user */
id: string;
/**
* User email address
* @example [email protected]
*/
email: string;
password: string;
}
Additional information
- [x] Would you be willing to help implement this feature?