RFC: Support for @typeparam or @template for documenting generic parameters
See original GitHub issueIn https://github.com/Microsoft/tsdoc/issues/8#issuecomment-424751850 @aciccarello wrote:
For a generic type definition, it can be helpful to document what the generic type is used for. Using @template was mentioned in some previous comments but I wonder if
@typeparam
would be better. Either way, I think this would be a good candidate for inclusion of the standard tags.VS Code already has some support for
@template
and there has been a request for TypeDoc to support that as well (TypeStrong/typedoc#860). TypeDoc currently supports@typeparam T - Description
and@param <T> - Description
./** * 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; }
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:8 (4 by maintainers)
Top Results From Across the Web
TSDoc: @typeParam
Used to document a generic parameter. The @typeParam tag is followed by a parameter name, followed by a hyphen, followed by a description....
Read more >How to document generic type parameters? - Stack Overflow
You can declare type parameters with the @template tag. ... are looking the TsDoc, you can use the https://tsdoc.org/pages/tags/typeparam/.
Read more >vCard Format Specification RFC 6350 - IETF Datatracker
Document, Type, RFC - Proposed Standard (August 2011) Errata ... Registration Template for Parameters . ... Only the basic format is supported. 4.3.1....
Read more >RFC 2426: vCard MIME Directory Profile
The profile definition is independent of any particular directory service or ... entry within the MIME Content-Type defined by the [MIME-DIR] document.
Read more >1598-generic_associated_types - The Rust RFC Book
Type arguments can be used to encode other forms of higher kinded polymorphism using the "family" pattern. For example, Using the PointerFamily trait, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also, the Closure Annotated JavaScript syntax is
@template T
(1, 2), which is already supported by TypeScript for hover/quick-info comments in both JavaScript and TypeScript files:But
@typeParam
(or even@typeparam
) is not currently supported:I used @template in previous codebases. I think the word came from c++.
@typeParam make more sense in TypeScript context.