forked from TypeStrong/typedoc
/
typeParameters.tsx
36 lines (35 loc) · 1.5 KB
/
typeParameters.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
import type { TypeParameterReflection } from "../../../../models";
import { JSX } from "../../../../utils";
export function typeParameters(context: DefaultThemeRenderContext, typeParameters: TypeParameterReflection[]) {
return (
<>
<section class="tsd-panel tsd-type-parameters">
<h4>Type Parameters</h4>
<ul class="tsd-type-parameters">
{typeParameters?.map((item) => (
<li>
<h4>
{item.varianceModifier ? `${item.varianceModifier} ` : ""}
{item.name}
{!!item.type && (
<>
<span class="tsd-signature-symbol"> extends </span>
{context.type(item.type)}
</>
)}
{!!item.default && (
<>
{" = "}
{context.type(item.default)}
</>
)}
</h4>
{context.comment(item)}
</li>
))}
</ul>
</section>
</>
);
}