Generic Type documentation
Is there a better way to comment on a generic type declaration?
/**
* Some function that does something.
* @param T The item type
* @param a The item
*/
public someFunction<T>(a: T): void {
...
}
At the moment we are treating T as a @param, which seems to generate the correct documentation; it doesn't sit too well with me however lol.
Yes, currently this is the only way to comment a type parameter. I have to admit this was a quick and dirty one. Any suggestions for a better tag? Maybe like this:
/**
* Some function that does something.
* @type T The item type
* @param a The item
*/
public someFunction<T>(a: T): void {
...
}
I wouldn't mind having the @type tag.
Just asked Google, @type is used to annotate variables, see http://usejsdoc.org/tags-type.html. Maybe we should use another tag to avoid irritations. In this discussion they tend to use the form @param <T>. I tend to add support for
@param T@param <T>@typeparam T