Skip to content

How do i document overloaded class constructor? #1307

Description

@DigitalBrainJS

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions