forked from SkeldJS/Hindenburg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypedoc-plugin-pages-pr-41.diff
209 lines (203 loc) · 7.08 KB
/
typedoc-plugin-pages-pr-41.diff
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
diff --git a/dist/theme/v2/partials/type.hbs b/dist/theme/v2/partials/type.hbs
index f226d52..1e19959 100644
--- a/dist/theme/v2/partials/type.hbs
+++ b/dist/theme/v2/partials/type.hbs
@@ -73,9 +73,61 @@ if an inner type may result in invalid output without them. For example:
<span class="tsd-signature-type">{{name}}</span>
{{/inline}}
+{{#*inline 'literal'}}
+ <span class="tsd-signature-type">{{stringify value}}</span>
+{{/inline}}
+
+{{#*inline 'mapped'}}
+ <span class="tsd-signature-symbol">{</span>
+ {{#ifCond readonlyModifier '===' '+'}}
+ <span class="tsd-signature-symbol">readonly </span>
+ {{else}}
+ {{#ifCond readonlyModifier '===' '-'}}
+ <span class="tsd-signature-symbol">-readonly </span>
+ {{/ifCond}}
+ {{/ifCond}}
+
+ <span class="tsd-signature-symbol">[ </span>
+ <span class="tsd-signature-type">{{parameter}}</span>
+ <span class="tsd-signature-symbol"> in </span>
+
+ {{#with parameterType}}
+ {{>type}}
+ {{/with}}
+
+ {{#with nameType}}
+ <span class="tsd-signature-symbol"> as </span>
+ {{>type}}
+ {{/with}}
+
+ <span class="tsd-signature-symbol">]</span>
+ {{#ifCond readonlyModifier '===' '+'}}
+ <span class="tsd-signature-symbol">?: </span>
+ {{else}}
+ {{#ifCond readonlyModifier '===' '-'}}
+ <span class="tsd-signature-symbol">-?: </span>
+ {{else}}
+ <span class="tsd-signature-symbol">: </span>
+ {{/ifCond}}
+ {{/ifCond}}
+
+ {{#with templateType}}
+ {{>type}}
+ {{/with}}
+
+ <span class="tsd-signature-symbol"> }</span>
+{{/inline}}
+
+{{#*inline 'optional'}}
+ {{#with elementType}}
+ {{> type}}
+ {{/with}}
+ <span class="tsd-signature-symbol">?</span>
+{{/inline}}
+
{{#*inline 'predicate'}}
{{#if asserts}}
- <span class="tsd-signature-symbol">asserts</span>
+ <span class="tsd-signature-symbol">asserts </span>
{{/if}}
<span class="tsd-signature-type">{{name}}</span>
{{#if targetType}}
@@ -94,13 +146,13 @@ if an inner type may result in invalid output without them. For example:
{{/inline}}
{{#*inline 'reference'}}
- {{#if reflection}}
- <a href="{{relativeURL reflection.url}}" class="tsd-signature-type">
- {{reflection.name}}
+ {{#with getReflection }}
+ <a href="{{relativeURL url}}" class="tsd-signature-type" data-tsd-kind="{{kindString}}">
+ {{name}}
</a>
{{else}}
<span class="tsd-signature-type">{{name}}</span>
- {{/if}}
+ {{/with}}
{{#if typeArguments}}
<span class="tsd-signature-symbol"><</span>
{{#each typeArguments}}
@@ -120,17 +172,56 @@ if an inner type may result in invalid output without them. For example:
{{#unless @first}}
<span class="tsd-signature-symbol">; </span>
{{/unless}}
- {{name}}
- {{#if flags.isOptional }}
- <span class="tsd-signature-symbol">?: </span>
+
+ {{#if getSignature}}
+ {{#if setSignature}}
+ {{name}}
+ <span class="tsd-signature-symbol">: </span>
+ {{#with getSignature.type}}
+ {{> type}}
+ {{else}}
+ <span class="tsd-signature-type">any</span>
+ {{/with}}
+ {{else}}
+ <span class="tsd-signature-symbol">get </span>
+ {{name}}
+ <span class="tsd-signature-symbol">(): </span>
+ {{#with getSignature.type}}
+ {{> type}}
+ {{else}}
+ <span class="tsd-signature-type">any</span>
+ {{/with}}
+ {{/if}}
{{else}}
- <span class="tsd-signature-symbol">: </span>
+ {{#if setSignature}}
+ <span class="tsd-signature-symbol">set </span>
+ {{name}}
+ <span class="tsd-signature-symbol">(</span>
+ {{! Rather hacky to use each here... but we know there is exactly one. }}
+ {{#each setSignature.parameters}}
+ {{name}}
+ <span class="tsd-signature-symbol">: </span>
+ {{#with type}}
+ {{> type}}
+ {{else}}
+ <span class="tsd-signature-type">any</span>
+ {{/with}}
+ {{/each}}
+ <span class="tsd-signature-symbol">)</span>
+ {{else}}
+ {{name}}
+ {{#if flags.isOptional }}
+ <span class="tsd-signature-symbol">?: </span>
+ {{else}}
+ <span class="tsd-signature-symbol">: </span>
+ {{/if}}
+ {{#with type}}
+ {{> type}}
+ {{else}}
+ <span class="tsd-signature-type">any</span>
+ {{/with}}
+ {{/if}}
{{/if}}
- {{#with type}}
- {{> type}}
- {{else}}
- <span class="tsd-signature-type">any</span>
- {{/with}}
{{/each}}
<span class="tsd-signature-symbol"> }</span>
{{else if declaration.signatures}}
@@ -159,8 +250,11 @@ if an inner type may result in invalid output without them. For example:
{{/if}}
{{/inline}}
-{{#*inline 'stringLiteral'}}
- <span class="tsd-signature-type">"{{value}}"</span>
+{{#*inline 'rest'}}
+ <span class="tsd-signature-symbol">...</span>
+ {{#with elementType}}
+ {{> type}}
+ {{/with}}
{{/inline}}
{{#*inline 'tuple'}}
@@ -174,6 +268,24 @@ if an inner type may result in invalid output without them. For example:
<span class="tsd-signature-symbol">]</span>
{{/inline}}
+{{#*inline 'template-literal'}}
+ <span class="tsd-signature-symbol">`</span>
+ {{#if head}}
+ <span class="tsd-signature-type">{{head}}</span>
+ {{/if}}
+ {{#each tail}}
+ <span class="tsd-signature-symbol">${</span>
+ {{#with this.[0]}}
+ {{>type}}
+ {{/with}}
+ <span class="tsd-signature-symbol">}</span>
+ {{#if this.[1]}}
+ <span class="tsd-signature-type">{{this.[1]}}</span>
+ {{/if}}
+ {{/each}}
+ <span class="tsd-signature-symbol">`</span>
+{{/inline}}
+
{{#*inline 'typeOperator'}}
<span class="tsd-signature-symbol">{{operator}} </span>
{{#with target}}
@@ -204,6 +316,18 @@ if an inner type may result in invalid output without them. For example:
<span class="tsd-signature-type">{{name}}</span>
{{/inline}}
+{{#*inline 'named-tuple-member'}}
+ {{name}}
+ {{#if isOptional}}
+ <span class="tsd-signature-symbol">?: </span>
+ {{else}}
+ <span class="tsd-signature-symbol">: </span>
+ {{/if}}
+ {{#with element}}
+ {{> type}}
+ {{/with}}
+{{/inline}}
+
{{#if this}}
{{> (lookup . 'type') }}
{{else}}