Skip to content

How to document object composition? #1459

@plasticrake

Description

@plasticrake

I'm trying to figure out how to pull in method documentation from an object to show inside another object.

My code used to look like:

class Main {
  doIt () {}
  doThis () {}
  doThat () {}
}

And jsdoc was great! However I've moved things around:

class Main {
  constructor () {
    this.sub = new Sub();
  }
  doIt () {}
}

class Sub {
  doThis () {}
  doThat () {}
}

I'd like to have the documentation show the Sub members under Main.sub (and pull the documentation from Sub)

  • Main#doIt()
  • Main.sub#doThis()
  • Main.sub#doIt()

I don't mind if I need to write out all the function names above this.sub as long as the documentation from under Sub is pulled in. I'm just not sure the syntax or if this is supported.

Thanks!

Your environment

Software Version
JSDoc v3.5.5
Node.js v8.6.0

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