0

I'm working on a Javascript project where the default export (i.e. what you get when you require the module) is an instance of a class that extends a class.

For example:

/**
 * @module my-module-name
 */

/**
 * Private so documentation doesn't mention DefaultRouter
 * @private
 */
class DefaultRouter extends Router {
    /**
     * Extra method docs
     */
    extreMethod() {}
}
export default new DefaultRouter();

The documentation for this (ideally) would include the Router class (as that's available to developers) and show the API surface for the module as including docs for the extended class Router as well as the extraMethod.

I can get extraMethod docs showing up by using @alias module:my-module-name.extraMethod but I can't find a clean way to expose the Router methods.

How can I do this in a simpler way, e.g. with some @ tag?

1 Answer 1

3

After playing around a little, I found the @borrows tag that seems to work how I wanted it to.

/**
 * @module my-module-name
 * @borrows module:my-module-name.Router#methodName as methodName
 */
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.