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

Show the type of destructuring parameter in case it has type defined #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 71 additions & 67 deletions src/default/partials/type.hbs
Original file line number Diff line number Diff line change
@@ -1,83 +1,87 @@
{{#if this}}
{{#if reflection}}
{{#compact}}
<a href="{{relativeURL reflection.url}}" class="tsd-signature-type">
{{reflection.name}}
</a>
{{#if typeArguments}}
<span class="tsd-signature-symbol">&lt;</span>
{{#if declaration.type}}
{{#with declaration.type}}{{> type}}{{/with}}
{{else}}
{{#if this}}
{{#if reflection}}
{{#compact}}
<a href="{{relativeURL reflection.url}}" class="tsd-signature-type">
{{reflection.name}}
</a>
{{#if typeArguments}}
<span class="tsd-signature-symbol">&lt;</span>

{{#each typeArguments}}
{{#if @index}}
<span class="tsd-signature-symbol">, </span>
{{/if}}{{> type}}
{{/each}}
{{#each typeArguments}}
{{#if @index}}
<span class="tsd-signature-symbol">, </span>
{{/if}}{{> type}}
{{/each}}

<span class="tsd-signature-symbol">&gt;</span>
{{/if}}
{{/compact}}
{{else}}
{{#if elementType}}
{{#with elementType}}
{{#compact}}
{{#if types}}
<span class="tsd-signature-symbol">(</span>
{{/if}}
{{> type}}
{{#if types}}
<span class="tsd-signature-symbol">)</span>
{{/if}}<span class="tsd-signature-symbol">[]</span>
{{/compact}}
{{/with}}
<span class="tsd-signature-symbol">&gt;</span>
{{/if}}
{{/compact}}
{{else}}
{{#if types}}
{{#each types}}
{{#if @index}}
<span class="tsd-signature-symbol"> {{#ifCond ../type '==' 'intersection'}}&amp;{{else}}|{{/ifCond}} </span>
{{/if}}{{> type}}
{{/each}}
{{else}}
{{#if elements}}
{{#if elementType}}
{{#with elementType}}
{{#compact}}
<span class="tsd-signature-symbol">[</span>

{{#each elements}}
{{#if @index}}
<span class="tsd-signature-symbol">, </span>
{{/if}}{{> type}}
{{/each}}

<span class="tsd-signature-symbol">]</span>
{{#if types}}
<span class="tsd-signature-symbol">(</span>
{{/if}}
{{> type}}
{{#if types}}
<span class="tsd-signature-symbol">)</span>
{{/if}}<span class="tsd-signature-symbol">[]</span>
{{/compact}}
{{/with}}
{{else}}
{{#if types}}
{{#each types}}
{{#if @index}}
<span class="tsd-signature-symbol"> {{#ifCond ../type '==' 'intersection'}}&amp;{{else}}|{{/ifCond}} </span>
{{/if}}{{> type}}
{{/each}}
{{else}}
{{#compact}}
<span class="tsd-signature-type">
{{#if name}}
{{name}}
{{else}}
{{#if value}}
"{{value}}"
{{else}}
{{this}}
{{/if}}
{{/if}}
</span>
{{#if typeArguments}}
<span class="tsd-signature-symbol">&lt;</span>
{{#if elements}}
{{#compact}}
<span class="tsd-signature-symbol">[</span>

{{#each typeArguments}}
{{#each elements}}
{{#if @index}}
<span class="tsd-signature-symbol">, </span>
{{/if}}{{> type}}
{{/each}}

<span class="tsd-signature-symbol">&gt;</span>
{{/if}}
{{/compact}}
<span class="tsd-signature-symbol">]</span>
{{/compact}}
{{else}}
{{#compact}}
<span class="tsd-signature-type">
{{#if name}}
{{name}}
{{else}}
{{#if value}}
"{{value}}"
{{else}}
{{this}}
{{/if}}
{{/if}}
</span>
{{#if typeArguments}}
<span class="tsd-signature-symbol">&lt;</span>

{{#each typeArguments}}
{{#if @index}}
<span class="tsd-signature-symbol">, </span>
{{/if}}{{> type}}
{{/each}}

<span class="tsd-signature-symbol">&gt;</span>
{{/if}}
{{/compact}}
{{/if}}
{{/if}}
{{/if}}
{{/if}}
{{else}}
<span class="tsd-signature-type">void</span>
{{/if}}
{{else}}
<span class="tsd-signature-type">void</span>
{{/if}}
{{/if}}