Synonyms
extends
Syntax
@augments <namepath>
Overview
The @augments
or @extends
tag indicates that a symbol inherits from, and potentially adds to, a
parent symbol. You can use this tag to document both class-based and prototype-based inheritance.
In JSDoc 3.3.0 and later, if a symbol inherits from multiple parents, and both parents have identically named members, JSDoc uses the documentation from the last parent that is listed in the JSDoc comment.
Examples
In the following example, the Duck
class is defined as a subclass of Animal
. Duck
instances
have the same properties as Animal
instances, as well as a speak
method that is unique to Duck
instances.
In the following example, the Duck
class inherits from both the Flyable
and Bird
classes, both
of which define a takeOff
method. Because the documentation for Duck
lists @augments Bird
last, JSDoc automatically documents Duck#takeOff
using the comment from Bird#takeOff
.