Skip to content
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

How to describe interface with properties? #280

Open
VityaSchel opened this issue Apr 29, 2022 · 5 comments
Open

How to describe interface with properties? #280

VityaSchel opened this issue Apr 29, 2022 · 5 comments
Labels
more info More info required to reproduce typescript

Comments

@VityaSchel
Copy link

VityaSchel commented Apr 29, 2022

If I have an interface

interface Dog {
  name: string
  age: number
}

How to document it with JSDoc so this lib can parse it?

My failed attempt was

/**
 * An animal, human friend
 * @interface Dog
 * @property {string} name
 * @property {number} age
 * @memberof module:modulename
 */
interface Dog {
  name: string
  age: number
}
@75lb
Copy link
Member

75lb commented Apr 30, 2022

Does your failed attempt above work in jsdoc? If not, please ensure your docs generate correctly in jsdoc first (jsdoc2md works downstream of jsdoc)..

@aureq
Copy link

aureq commented Sep 19, 2023

I think @75lb the question has more to do with "How do I get an interface documentation in the resulting output" rather than something is not working.

In my situation, it all works fine but somehow interface is not where to be found in the output, and there's no error message either. Perhaps you have an example somewhere you could share? Or there's a specific setting that needs to be turned on?

Thank you

@75lb
Copy link
Member

75lb commented Aug 26, 2024

but somehow interface is not where to be found in the output

Does it render correctly in jsdoc? If so, could you post some code and a command I can run against it to see it failing, thanks.. Will be able to give a more precise answer then..

@75lb 75lb added more info More info required to reproduce typescript labels Aug 26, 2024
@johannes-lindgren
Copy link

johannes-lindgren commented Oct 7, 2024

@75lb, for me interfaces and type aliases don't seem to be rendered from jsdoc. I printed the output from getJsdocData. I probably need to use a different tool; I will go with tsdocs, and typedoc-plugin-markdown

@75lb
Copy link
Member

75lb commented Oct 7, 2024

This reply is directed at everyone experiencing this issue. As i've written in this thread twice already:

  1. Does your input code render correctly in jsdoc? If so, proceed to 2. If not, it's a jsdoc issue (jsdoc2md sits directly downstream of jsdoc output).
  2. This thread is about Typescript, not Javascript - jsdoc does not natively parse typescript code. So, please post an example of failing TS code, details of any third-party modules required and the jsdoc2md command and/or config required to process the input code. Once I have an executable, failing reproduction case I will be able to run it, debug and/or fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info More info required to reproduce typescript
Development

No branches or pull requests

4 participants