Search code examples
javascriptdocumentationjsdoc

How can I use JSDoc to document class methods inherited from an external package?


I am working on a library. This library contains several classes that extend a parent class from another package.

To make it easy for my users, I would like the documentation of my library to include the methods that are inherited from the external package.

Is there a way to do that? I haven't found one so far.

I tried copying the jsdoc from the external class (which I'm also the author of) into my new library but it does not work since the method isn't defined in the library.

I could do the following but it seems silly to add code in my library only for the sake of documentation:

  /**
   * This is a method that's actually inherited from the parent class. 
   * I'm simply copying the jsdoc over into my own lib.
   */
  doThis() {
    super.doThis()
  };

Is there a way to inject documentation coming from somewhere else? Other ideas?

Cheers!


Solution

  • well, it seems that if I simply add the source file of the external class (which contains jsdoc) to the files to parse, my problem is solved. Yeah!