Skip to content

mweidner037/mwe-typedoc-returned-function

Repository files navigation

Typedoc returned function MWE

When a class method returns another function, typedoc documents the returned function weirdly: it copies the outer method's docs.

Code (src/index.ts):

export class ClassVersion {
  /**
   * This is the outer function.
   *
   * @returns The inner function.
   */
  outer(): () => void {
    /** Docs for the inner function? */
    return () => {};
  }
}

Generated docs (docs/classes/ClassVersion.html):

screenshot

If the outer function is a standalone function instead of a class method, it behaves as I would expect:

/**
 * This is the outer function.
 *
 * @returns The inner function.
 */
export function outerAsFunction(): () => void {
  /** Docs for the inner function? */
  return () => {};
}

screenshot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published