@typeParam
| 标准化 | 核心 |
| 语法种类 | 块标签 |
用法
用于记录泛型参数。 @typeParam 标签后跟参数名称,然后是连字符,然后是描述。 TSDoc 解析器识别此语法,并将其提取到 DocParamBlock 节点中。
示例
/**
* Alias for array
*
* @typeParam T - Type of objects the list contains
*/
type List<T> = Array<T>;
/**
* Wrapper for an HTTP Response
* @typeParam B - Response body
* @param <H> - Headers
*/
interface HttpResponse<B, H> {
body: B;
headers: H;
statusCode: number;
}
另请参阅
- RFC #72: 支持使用
@typeparam或@template记录泛型参数