Skip to content

Instantly share code, notes, and snippets.

@drazisil
Created April 11, 2023 14:49
Show Gist options
  • Save drazisil/da0552e3d06f56bea9600f14aa0a55b4 to your computer and use it in GitHub Desktop.
Save drazisil/da0552e3d06f56bea9600f14aa0a55b4 to your computer and use it in GitHub Desktop.

Using JavaScript/JSDoc (not TypeScript), is there a way to document a class method as returning a generic type that extends a base type?

/** @extends {BaseType}
class SubType {
  /** @return {} */
  makeNew() {
    // return <T extends BaseType>
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment