Skip to content
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.

Commit

Permalink
fix: Better handling for getters/setters in object literals
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jan 31, 2021
1 parent 9fa0243 commit 375f8b4
Showing 1 changed file with 52 additions and 40 deletions.
92 changes: 52 additions & 40 deletions src/default/partials/parameter.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
</li>
{{/if}}
{{#each children}}
<li class="tsd-parameter">
{{#if signatures}}
{{#if signatures}}
<li class="tsd-parameter">
<h5>{{#compact}}
{{#if flags.isRest}}<span class="tsd-signature-symbol">...</span>{{/if}}
{{{wbr name}}}
Expand All @@ -52,7 +52,9 @@
{{/compact}}</h5>

{{> member.signatures}}
{{else}}
</li>
{{else}}{{#if type}} {{! standard type }}
<li class="tsd-parameter">
<h5>{{#compact}}
{{#each flags}}
<span class="tsd-flag ts-flag{{this}}">{{this}}</span>&nbsp;
Expand All @@ -65,41 +67,6 @@
:&nbsp;
</span>
{{>type}}
{{else}}
{{#if getSignature}}
{{#if setSignature}}
{{{wbr name}}}
<span class="tsd-signature-symbol">:&nbsp;</span>
{{#with getSignature.type}}
{{> type}}
{{/with}}
{{else}}
<span class="tsd-signature-symbol">get&nbsp;</span>
{{{wbr name}}}
<span class="tsd-signature-symbol">():&nbsp;</span>
{{#with getSignature.type}}
{{> type}}
{{/with}}
{{/if}}
{{else}}
{{#if setSignature}}
<span class="tsd-signature-symbol">set&nbsp;</span>
{{{wbr name}}}
<span class="tsd-signature-symbol">(</span>
{{#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}}
<span class="tsd-signature-type">any</span>
{{/if}}
{{/if}}
{{/with}}
{{/compact}}</h5>

Expand All @@ -114,7 +81,52 @@
{{> parameter}}
{{/with}}
{{/if}}
{{/if}}
</li>
</li>
{{else}} {{! getter/setter }}
{{#with getSignature}} {{! getter }}
<li class="tsd-parameter">
<h5>{{#compact}}
{{#each flags}}
<span class="tsd-flag ts-flag{{this}}">{{this}}</span>&nbsp;
{{/each}}
<span class="tsd-signature-symbol">get&nbsp;</span>
{{{wbr ../name}}}
<span class="tsd-signature-symbol">():&nbsp;</span>
{{#with type}}
{{> type}}
{{/with}}
{{/compact}}</h5>

{{> comment }}
</li>
{{/with}}
{{#with setSignature}} {{! setter }}
<li class="tsd-parameter">
<h5>{{#compact}}
{{#each flags}}
<span class="tsd-flag ts-flag{{this}}">{{this}}</span>&nbsp;
{{/each}}
<span class="tsd-signature-symbol">set&nbsp;</span>
{{{wbr ../name}}}
<span class="tsd-signature-symbol">(</span>
{{#each 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">):&nbsp;</span>
{{#with type}}
{{> type}}
{{/with}}
{{/compact}}</h5>

{{> comment }}
</li>
{{/with}}
{{/if}}{{/if}}
{{/each}}
</ul>

0 comments on commit 375f8b4

Please sign in to comment.