JsDoc Toolkitを使う!
@borrows
最終更新:
aias-jsdoctoolkit
トップページ > ドックコメントの書き方 > タグリファレンス >
@borrows
@borrowsタグは、このクラスが元々別のクラスで定義されたメソッドまたはプロパティを保持していることを示します。
別名
@inherits
構文
@borrows otherMemberName as thisMemberName
- otherMemberName -- 必須:借用元メンバへのネームパス
- thisMemberName -- 必須:借用したメンバの、このクラスにおける名前
例
function Remote() {
}
/** Connect to a remote address. */
Remote.prototype.transfer = function(address, data) {
}
/**
*
@constructor
*
@borrows
Remote#transfer
as
this.send
*/
function SpecialWriter() {
this.send = Remote.prototype.transfer;
}
Remote#transfer についてドキュメント化される全ての内容が、 SpecialWriter#send にも出力されます。
バージョン2.2.0より、"as ..."の記述を省略できる機能が試験的に導入されています。この部分を省略した場合、借用されたメンバは借用元と同じ名前、同じ属性(インスタンスメンバ/静的メンバ、public/private)を持つものとされます。
/** @constructor */