Clone this wiki locally
@inheritdoc @inheritdoc ClassName @inheritdoc #memberName @inheritdoc ClassName#memberName @inheritdoc ClassName#static-type-memberName
Provides means for copying documentation from another class or member.
For example you have documented a config option extensively in parent class:
/** * @cfg * Some very long documentation... */ shape: 'line',
But in subclass you want to change the default value of the config. Now it would be good if the documentation of subclass reflected this change, but you don't want to duplicate the long documentation again. That's where
@inheritdoc steps in:
/** * @cfg * @inheritdoc */ shape: 'rectangle'
Another common use of
@inheritdoc is defining an alias for some method. For example
Ext.each is alias for
Ext.Array.each. In such case specify the class and member to inherit:
/** * @member Ext * @method each * @inheritdoc Ext.Array#each */ Ext.each = Ext.Array.each
Or you can reference a member from the current class:
/** * @method each * @inheritdoc #forEach */
Finally as an odd case you can inherit from a different type of member:
/** * @method foo * @inheritdoc #event-bar */
The whole syntax of the reference following the
@inheritdoc is the same as with @link tags.
See also @localdoc (only available in JSDuck 5.x).
Use of @alias as @inheritdoc
Old versions of JSDuck used @alias in place of
@alias was re-purposed for documenting Ext4 class name aliases. For backwards compatibility the old way is still supported when the following form is used:
@alias can't be followed by only class name or member name. For new code, always use