8000 Support jsdoc comments for interface fields · Issue #110 · unjs/knitwork · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support jsdoc comments for interface fields #110

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

Open
1 task done
blasdfaa opened this issue Mar 16, 2025 · 0 comments · May be fixed by #115
Open
1 task done

Support jsdoc comments for interface fields #110

blasdfaa opened this issue Mar 16, 2025 · 0 comments · May be fixed by #115
Labels
enhancement New feature or request

Comments

@blasdfaa
Copy link

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: 'user@example.com',
      },
    },
    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 user@example.com
   */
  email: string;
  password: string;
}

Additional information

  • Would you be willing to help implement this feature?
@blasdfaa blasdfaa added the enhancement New feature or request label Mar 16, 2025
@luxass luxass linked a pull request May 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0