@remarks
タグタイプ: ブロックタグ
TSDoc標準化: コア
API項目のメインドキュメントは、簡潔な「概要」セクションと、オプションで、より詳細な「備考」セクションに分かれています。ドキュメントWebサイトでは、インデックスページ(例:クラスのメンバーを表示する)には簡潔な概要のみが表示され、詳細ページ(例:単一のメンバーを説明する)には概要と備考が表示されます。@remarks
ブロックタグは概要セクションを終了し、ドキュメントコメントの備考セクションを開始します。
注:この設計は、オプションの@summary
タグを使用して完全なドキュメントの要約を提供するJSDocのアプローチとは異なります。私たちはこれを試しましたが、よく書かれた記事にはすでに最初の1、2文に「概要」が含まれていることがわかりました。
使用例
/**
* Represents an employee.
*
* @public
*/
export class Employee {
/**
* The employee's first name.
*
* @remarks
* The first name may contain Unicode characters.
*/
public firstName: string;
/**
* The employee's last name.
*
* @remarks
* The last name may contain Unicode characters.
*/
public lastName: string;
/**
* The employee's full name.
*
* @remarks
* Returns the first name followed by the last name.
*/
public getFullName(): string {
return `${this.firstName} ${this.lastName}`;
}
}
クラスのインデックスページには、次のような表で概要が表示される場合があります。
プロパティ
プロパティ名 修飾子 型 説明 firstName string
従業員の氏名。 lastName string
従業員の姓。 メソッド
メソッド名 修飾子 説明 getFullName() 従業員のフルネーム。
一方、getFullName()
の詳細ページには、概要と備考が表示されます。
Employee.getFullName()メソッド従業員のフルネーム。
シグネチャ戻り値: `string`getFullName(): string;
備考氏名と姓を返します。