Skip to content

feat(plugin-apidocs): improved method signature display #105

@sgtcoolguy

Description

@sgtcoolguy

Our current display of method signatures leaves out any means of marking varargs and optional args.

A quick few examples:

  • a single optional vararg (optional: true, repeatable: true) should be:
    console.log([...data]) but is console.log(data)
  • a single optional arg (optional: true) should be:
    console.log(data) but is console.log(data)
  • a single vararg (repeatable: true) should be:
    console.log(...data) but is console.log(data)

There's more complex cases like multiple optional arguments:

  • for example, Node shows:
    util.inspect(object[, showHidden[, depth[, colors]]])
    As you can see, they typically nest the optional brackets. There's other cases where they don't:
    console.timeLog([label][, ...data])
    It's not clear to me if they don't nest when the last optional arg is varargs, or in other cases too? (We don't really have a means of relating optional arguments to one another in our doc structure to control nesting here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions