tsdoc
tsdoc copied to clipboard
How to denote that a @typeparam should extends another type?
I want to tell others that a type param should follow some rules for example:
/**
* @typeparam T - some desc
*/
interface A<T extends string> {
name: T;
}
How can I add description like "should extend from string" for @typeparam T?
The playground https://microsoft.github.io/tsdoc seems not supports display @typeparam information in the output.
Visual Studio / TypeScript supports @template for that:
https://github.com/microsoft/TypeScript/issues/1178.
I don't think you can or should do this. The documentation is not for declaring types, just for describing. In the same way, you wouldn't put the type of a param in the TSDoc comment.