@augments
Syntax
@augments ClassName
@extends ClassName
Overview
@augments documents that a class extends another class, creating an inheritance relationship. JSDoc uses this information to build a class hierarchy in the documentation.
For ES2015 class … extends syntax, JSDoc detects the relationship automatically — @augments is still useful to provide a link in the documentation when JSDoc cannot infer it.
TSTypeScript Supported
TypeScript uses @extends (synonym of @augments) to specify the parent class type in JavaScript files.
Example
Pre-ES2015 style (requires @augments)
/**
* @class
* @augments Animal
*/
function Dog(name) {
Animal.call(this, name);
}
Dog.prototype = Object.create(Animal.prototype);
ES2015 class (auto-detected, optional @augments)
/**
* @augments Animal
*/
class Dog extends Animal {
constructor(name) {
super(name);
}
}
Multiple inheritance
@augments can appear more than once to document multiple parents (mixins are more common for this — see @mixes):
/**
* @augments Base
* @augments EventEmitter
*/
class Widget extends Base {}
See also
Official reference: jsdoc.app/tags-augments