Skip to content

Commit 1a9f07e

Browse files
Add property declarations from constructor to basic example
1 parent cf3dcdc commit 1a9f07e

File tree

4 files changed

+252
-4
lines changed

4 files changed

+252
-4
lines changed

examples/basic/src/classes.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,18 @@ export class GenericClass<T extends BaseClass>
275275
public value:T;
276276

277277

278+
/**
279+
* Constructor short text.
280+
*
281+
* @param p1 Constructor param
282+
* @param p2 Private string property
283+
* @param p3 Public number property
284+
* @param p4 Public implicit any property
285+
*/
286+
constructor(p1, protected p2:T, public p3:number, private p4:number) {
287+
}
288+
289+
278290
public setValue(value:T) {
279291
this.value = value;
280292
}

src/td/converter/converters/convertNode.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ module td.converter
431431
return member;
432432
}
433433

434+
434435
/**
435436
* Analyze parameters in given constructor declaration node and create a suitable reflection.
436437
*
@@ -462,6 +463,7 @@ module td.converter
462463
});
463464
}
464465

466+
465467
/**
466468
* Analyze the given constructor declaration node and create a suitable reflection.
467469
*

test/renderer/specs/classes/_classes_.genericclass.html

Lines changed: 128 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,18 @@ <h3>Hierarchy</h3>
107107
<h2>Index</h2>
108108
<section class="tsd-panel tsd-index-panel">
109109
<div class="tsd-index-content">
110+
<section class="tsd-index-section ">
111+
<h3>Constructors</h3>
112+
<ul class="tsd-index-list">
113+
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="_classes_.genericclass.html#constructor" class="tsd-kind-icon">constructor</a></li>
114+
</ul>
115+
</section>
110116
<section class="tsd-index-section ">
111117
<h3>Properties</h3>
112118
<ul class="tsd-index-list">
119+
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><a href="_classes_.genericclass.html#p2" class="tsd-kind-icon">p2</a></li>
120+
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_classes_.genericclass.html#p3" class="tsd-kind-icon">p3</a></li>
121+
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><a href="_classes_.genericclass.html#p4" class="tsd-kind-icon">p4</a></li>
113122
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_classes_.genericclass.html#value" class="tsd-kind-icon">value</a></li>
114123
</ul>
115124
</section>
@@ -123,8 +132,113 @@ <h3>Methods</h3>
123132
</div>
124133
</section>
125134
</section>
135+
<section class="tsd-panel-group tsd-member-group ">
136+
<h2>Constructors</h2>
137+
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
138+
<a name="constructor" class="tsd-anchor"></a>
139+
<h3>constructor</h3>
140+
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
141+
<li class="tsd-signature tsd-kind-icon">new <wbr>Generic<wbr>Class<span class="tsd-signature-symbol">(</span>p1<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, p2<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">T</span>, p3<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, p4<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_classes_.genericclass.html" class="tsd-signature-type">GenericClass</a></li>
142+
</ul>
143+
<ul class="tsd-descriptions">
144+
<li class="tsd-description">
145+
<aside class="tsd-sources">
146+
<ul>
147+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L275">classes.ts:275</a></li>
148+
</ul>
149+
</aside>
150+
<div class="tsd-comment tsd-typography">
151+
<div class="lead">
152+
<p>Constructor short text.</p>
153+
</div>
154+
</div>
155+
<h4 class="tsd-parameters-title">Parameters</h4>
156+
<ul class="tsd-parameters">
157+
<li>
158+
<h5>p1: <span class="tsd-signature-type">any</span></h5>
159+
<div class="tsd-comment tsd-typography">
160+
<div class="lead">
161+
<p>Constructor param</p>
162+
</div>
163+
</div>
164+
</li>
165+
<li>
166+
<h5>p2: <span class="tsd-signature-type">T</span></h5>
167+
<div class="tsd-comment tsd-typography">
168+
<div class="lead">
169+
<p>Private string property</p>
170+
</div>
171+
</div>
172+
</li>
173+
<li>
174+
<h5>p3: <span class="tsd-signature-type">number</span></h5>
175+
<div class="tsd-comment tsd-typography">
176+
<div class="lead">
177+
<p>Public number property</p>
178+
</div>
179+
</div>
180+
</li>
181+
<li>
182+
<h5>p4: <span class="tsd-signature-type">number</span></h5>
183+
<div class="tsd-comment tsd-typography">
184+
<div class="lead">
185+
<p>Public implicit any property</p>
186+
</div>
187+
</div>
188+
</li>
189+
</ul>
190+
<h4 class="tsd-returns-title">Returns <a href="_classes_.genericclass.html" class="tsd-signature-type">GenericClass</a></h4>
191+
</li>
192+
</ul>
193+
</section>
194+
</section>
126195
<section class="tsd-panel-group tsd-member-group ">
127196
<h2>Properties</h2>
197+
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-protected">
198+
<a name="p2" class="tsd-anchor"></a>
199+
<h3><span class="tsd-flag ts-flagProtected">Protected</span> p2</h3>
200+
<div class="tsd-signature tsd-kind-icon">p2<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">T</span></div>
201+
<aside class="tsd-sources">
202+
<ul>
203+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L286">classes.ts:286</a></li>
204+
</ul>
205+
</aside>
206+
<div class="tsd-comment tsd-typography">
207+
<div class="lead">
208+
<p>Private string property</p>
209+
</div>
210+
</div>
211+
</section>
212+
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
213+
<a name="p3" class="tsd-anchor"></a>
214+
<h3>p3</h3>
215+
<div class="tsd-signature tsd-kind-icon">p3<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
216+
<aside class="tsd-sources">
217+
<ul>
218+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L286">classes.ts:286</a></li>
219+
</ul>
220+
</aside>
221+
<div class="tsd-comment tsd-typography">
222+
<div class="lead">
223+
<p>Public number property</p>
224+
</div>
225+
</div>
226+
</section>
227+
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-private">
228+
<a name="p4" class="tsd-anchor"></a>
229+
<h3><span class="tsd-flag ts-flagPrivate">Private</span> p4</h3>
230+
<div class="tsd-signature tsd-kind-icon">p4<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
231+
<aside class="tsd-sources">
232+
<ul>
233+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L286">classes.ts:286</a></li>
234+
</ul>
235+
</aside>
236+
<div class="tsd-comment tsd-typography">
237+
<div class="lead">
238+
<p>Public implicit any property</p>
239+
</div>
240+
</div>
241+
</section>
128242
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
129243
<a name="value" class="tsd-anchor"></a>
130244
<h3>value</h3>
@@ -148,7 +262,7 @@ <h3>get<wbr>Value</h3>
148262
<li class="tsd-description">
149263
<aside class="tsd-sources">
150264
<ul>
151-
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L283">classes.ts:283</a></li>
265+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L295">classes.ts:295</a></li>
152266
</ul>
153267
</aside>
154268
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">T</span></h4>
@@ -165,7 +279,7 @@ <h3>set<wbr>Value</h3>
165279
<li class="tsd-description">
166280
<aside class="tsd-sources">
167281
<ul>
168-
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L278">classes.ts:278</a></li>
282+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L290">classes.ts:290</a></li>
169283
</ul>
170284
</aside>
171285
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -228,6 +342,18 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
228342
<li class="current tsd-kind-class tsd-parent-kind-external-module tsd-has-type-parameter">
229343
<a href="_classes_.genericclass.html" class="tsd-kind-icon">Generic<wbr>Class</a>
230344
<ul>
345+
<li class=" tsd-kind-constructor tsd-parent-kind-class">
346+
<a href="_classes_.genericclass.html#constructor" class="tsd-kind-icon">constructor</a>
347+
</li>
348+
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-protected">
349+
<a href="_classes_.genericclass.html#p2" class="tsd-kind-icon">p2</a>
350+
</li>
351+
<li class=" tsd-kind-property tsd-parent-kind-class">
352+
<a href="_classes_.genericclass.html#p3" class="tsd-kind-icon">p3</a>
353+
</li>
354+
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-private">
355+
<a href="_classes_.genericclass.html#p4" class="tsd-kind-icon">p4</a>
356+
</li>
231357
<li class=" tsd-kind-property tsd-parent-kind-class">
232358
<a href="_classes_.genericclass.html#value" class="tsd-kind-icon">value</a>
233359
</li>

test/renderer/specs/classes/_classes_.nongenericclass.html

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,16 @@ <h2>Index</h2>
8888
<section class="tsd-panel tsd-index-panel">
8989
<div class="tsd-index-content">
9090
<section class="tsd-index-section tsd-is-inherited">
91+
<h3>Constructors</h3>
92+
<ul class="tsd-index-list">
93+
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><a href="_classes_.nongenericclass.html#constructor" class="tsd-kind-icon">constructor</a></li>
94+
</ul>
95+
</section>
96+
<section class="tsd-index-section ">
9197
<h3>Properties</h3>
9298
<ul class="tsd-index-list">
99+
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><a href="_classes_.nongenericclass.html#p2" class="tsd-kind-icon">p2</a></li>
100+
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_classes_.nongenericclass.html#p3" class="tsd-kind-icon">p3</a></li>
93101
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="_classes_.nongenericclass.html#value" class="tsd-kind-icon">value</a></li>
94102
</ul>
95103
</section>
@@ -104,7 +112,98 @@ <h3>Methods</h3>
104112
</section>
105113
</section>
106114
<section class="tsd-panel-group tsd-member-group tsd-is-inherited">
115+
<h2>Constructors</h2>
116+
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited">
117+
<a name="constructor" class="tsd-anchor"></a>
118+
<h3>constructor</h3>
119+
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited">
120+
<li class="tsd-signature tsd-kind-icon">new <wbr>Non<wbr>Generic<wbr>Class<span class="tsd-signature-symbol">(</span>p1<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span>, p2<span class="tsd-signature-symbol">: </span><a href="_classes_.subclassb.html" class="tsd-signature-type">SubClassB</a>, p3<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, p4<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_classes_.nongenericclass.html" class="tsd-signature-type">NonGenericClass</a></li>
121+
</ul>
122+
<ul class="tsd-descriptions">
123+
<li class="tsd-description">
124+
<aside class="tsd-sources">
125+
<p>Inherited from <a href="_classes_.genericclass.html">GenericClass</a>.<a href="_classes_.genericclass.html#constructor">constructor</a></p>
126+
<ul>
127+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L275">classes.ts:275</a></li>
128+
</ul>
129+
</aside>
130+
<div class="tsd-comment tsd-typography">
131+
<div class="lead">
132+
<p>Constructor short text.</p>
133+
</div>
134+
</div>
135+
<h4 class="tsd-parameters-title">Parameters</h4>
136+
<ul class="tsd-parameters">
137+
<li>
138+
<h5>p1: <span class="tsd-signature-type">any</span></h5>
139+
<div class="tsd-comment tsd-typography">
140+
<div class="lead">
141+
<p>Constructor param</p>
142+
</div>
143+
</div>
144+
</li>
145+
<li>
146+
<h5>p2: <a href="_classes_.subclassb.html" class="tsd-signature-type">SubClassB</a></h5>
147+
<div class="tsd-comment tsd-typography">
148+
<div class="lead">
149+
<p>Private string property</p>
150+
</div>
151+
</div>
152+
</li>
153+
<li>
154+
<h5>p3: <span class="tsd-signature-type">number</span></h5>
155+
<div class="tsd-comment tsd-typography">
156+
<div class="lead">
157+
<p>Public number property</p>
158+
</div>
159+
</div>
160+
</li>
161+
<li>
162+
<h5>p4: <span class="tsd-signature-type">number</span></h5>
163+
<div class="tsd-comment tsd-typography">
164+
<div class="lead">
165+
<p>Public implicit any property</p>
166+
</div>
167+
</div>
168+
</li>
169+
</ul>
170+
<h4 class="tsd-returns-title">Returns <a href="_classes_.nongenericclass.html" class="tsd-signature-type">NonGenericClass</a></h4>
171+
</li>
172+
</ul>
173+
</section>
174+
</section>
175+
<section class="tsd-panel-group tsd-member-group ">
107176
<h2>Properties</h2>
177+
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-protected">
178+
<a name="p2" class="tsd-anchor"></a>
179+
<h3><span class="tsd-flag ts-flagProtected">Protected</span> p2</h3>
180+
<div class="tsd-signature tsd-kind-icon">p2<span class="tsd-signature-symbol">:</span> <a href="_classes_.subclassb.html" class="tsd-signature-type">SubClassB</a></div>
181+
<aside class="tsd-sources">
182+
<ul>
183+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L286">classes.ts:286</a></li>
184+
</ul>
185+
</aside>
186+
<div class="tsd-comment tsd-typography">
187+
<div class="lead">
188+
<p>Private string property</p>
189+
</div>
190+
</div>
191+
</section>
192+
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
193+
<a name="p3" class="tsd-anchor"></a>
194+
<h3>p3</h3>
195+
<div class="tsd-signature tsd-kind-icon">p3<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
196+
<aside class="tsd-sources">
197+
<ul>
198+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L286">classes.ts:286</a></li>
199+
</ul>
200+
</aside>
201+
<div class="tsd-comment tsd-typography">
202+
<div class="lead">
203+
<p>Public number property</p>
204+
</div>
205+
</div>
206+
</section>
108207
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
109208
<a name="value" class="tsd-anchor"></a>
110209
<h3>value</h3>
@@ -130,7 +229,7 @@ <h3>get<wbr>Value</h3>
130229
<aside class="tsd-sources">
131230
<p>Inherited from <a href="_classes_.genericclass.html">GenericClass</a>.<a href="_classes_.genericclass.html#getvalue">getValue</a></p>
132231
<ul>
133-
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L283">classes.ts:283</a></li>
232+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L295">classes.ts:295</a></li>
134233
</ul>
135234
</aside>
136235
<h4 class="tsd-returns-title">Returns <a href="_classes_.subclassb.html" class="tsd-signature-type">SubClassB</a></h4>
@@ -148,7 +247,7 @@ <h3>set<wbr>Value</h3>
148247
<aside class="tsd-sources">
149248
<p>Inherited from <a href="_classes_.genericclass.html">GenericClass</a>.<a href="_classes_.genericclass.html#setvalue">setValue</a></p>
150249
<ul>
151-
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L278">classes.ts:278</a></li>
250+
<li>Defined in <a href="https://github.com/sebastian-lenz/typedoc/blob/master/examples/basic/src/classes.ts#L290">classes.ts:290</a></li>
152251
</ul>
153252
</aside>
154253
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -217,6 +316,15 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
217316
<li class="current tsd-kind-class tsd-parent-kind-external-module">
218317
<a href="_classes_.nongenericclass.html" class="tsd-kind-icon">Non<wbr>Generic<wbr>Class</a>
219318
<ul>
319+
<li class=" tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited">
320+
<a href="_classes_.nongenericclass.html#constructor" class="tsd-kind-icon">constructor</a>
321+
</li>
322+
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-protected">
323+
<a href="_classes_.nongenericclass.html#p2" class="tsd-kind-icon">p2</a>
324+
</li>
325+
<li class=" tsd-kind-property tsd-parent-kind-class">
326+
<a href="_classes_.nongenericclass.html#p3" class="tsd-kind-icon">p3</a>
327+
</li>
220328
<li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
221329
<a href="_classes_.nongenericclass.html#value" class="tsd-kind-icon">value</a>
222330
</li>

0 commit comments

Comments
 (0)