
- 0133技术站
- 联系QQ:18840023
  
- QQ交流群
 
- 微信公众号
 

描述: 这个标识实现一个接口。
版本: '>=3.3.0'
@implements {typeExpression}
@implements标签指示一个标识实现一个接口。
添加@implements标签到实现接口(例如,一个构造函数)的顶层标识。不需要将@implements标签添加到实现接口(例如,实现的实例方法)的每个成员上。
如果你没有在实现的接口中描述这个标识,JSDoc会自动使用该接口文档的标识。
在下面的例子中,TransparentColor类实现Color接口,并添加了TransparentColor#rgba方法。
例如,使用@implements标签:
/**
 * Interface for classes that represent a color.
 *
 * @interface
 */
function Color() {}
/**
 * Get the color as an array of red, green, and blue values, represented as
 * decimal numbers between 0 and 1.
 *
 * @returns {Array<number>} An array containing the red, green, and blue values,
 * in that order.
 */
Color.prototype.rgb = function() {
    throw new Error('not implemented');
};
/**
 * Class representing a color with transparency information.
 *
 * @class
 * @implements {Color}
 */
function TransparentColor() {}
// inherits the documentation from `Color#rgb`
TransparentColor.prototype.rgb = function() {
    // ...
};
/**
 * Get the color as an array of red, green, blue, and alpha values, represented
 * as decimal numbers between 0 and 1.
 *
 * @returns {Array<number>} An array containing the red, green, blue, and alpha
 * values, in that order.
 */
TransparentColor.prototype.rgba = function() {
    // ...
};
推荐手册