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 do i document overloaded class constructor? #1307

Open
DigitalBrainJS opened this issue Feb 24, 2020 · 0 comments
Open

How do i document overloaded class constructor? #1307

DigitalBrainJS opened this issue Feb 24, 2020 · 0 comments

Comments

@DigitalBrainJS
Copy link

Is there any particular way to document overloaded constructor?
For example, I would like to document the following constructor:

class Pokemon{
    /**
     * @param {Object} options - some options
     *//**
     * @param {String} name - pokemon's name
     */
    constructor(arg0){
        const options = typeof arg0 === 'object' ? arg0 : {name: arg0};
        //do something with options
    };
}

I expect to get two entries in the documentation, ideally they should be grouped because they just overload the same constructor:

new Pokemon(options: Object)

Parameters

  • options (Object) some options
new Pokemon(name: String)

Parameters

  • name (String) pokemon's name

But currently i get something like this:

new Pokemon(arg0: any, name: String)

Parameters

  • arg0 (any)
  • name (String) pokemon's name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant