From 3ffe6ca07f8be350fbaf4f34a83e04066ff0b93e Mon Sep 17 00:00:00 2001 From: Maxim Gritsenko Date: Thu, 12 Oct 2017 23:52:10 +0300 Subject: [PATCH] Show the type of destructuring parameter in case it has type defined --- src/default/partials/type.hbs | 138 +++++++++++++++++----------------- 1 file changed, 71 insertions(+), 67 deletions(-) diff --git a/src/default/partials/type.hbs b/src/default/partials/type.hbs index 93f8d99b..4194f6db 100644 --- a/src/default/partials/type.hbs +++ b/src/default/partials/type.hbs @@ -1,83 +1,87 @@ -{{#if this}} - {{#if reflection}} - {{#compact}} - - {{reflection.name}} - - {{#if typeArguments}} - < +{{#if declaration.type}} + {{#with declaration.type}}{{> type}}{{/with}} +{{else}} + {{#if this}} + {{#if reflection}} + {{#compact}} + + {{reflection.name}} + + {{#if typeArguments}} + < - {{#each typeArguments}} - {{#if @index}} - , - {{/if}}{{> type}} - {{/each}} + {{#each typeArguments}} + {{#if @index}} + , + {{/if}}{{> type}} + {{/each}} - > - {{/if}} - {{/compact}} - {{else}} - {{#if elementType}} - {{#with elementType}} - {{#compact}} - {{#if types}} - ( - {{/if}} - {{> type}} - {{#if types}} - ) - {{/if}}[] - {{/compact}} - {{/with}} + > + {{/if}} + {{/compact}} {{else}} - {{#if types}} - {{#each types}} - {{#if @index}} - {{#ifCond ../type '==' 'intersection'}}&{{else}}|{{/ifCond}} - {{/if}}{{> type}} - {{/each}} - {{else}} - {{#if elements}} + {{#if elementType}} + {{#with elementType}} {{#compact}} - [ - - {{#each elements}} - {{#if @index}} - , - {{/if}}{{> type}} - {{/each}} - - ] + {{#if types}} + ( + {{/if}} + {{> type}} + {{#if types}} + ) + {{/if}}[] {{/compact}} + {{/with}} + {{else}} + {{#if types}} + {{#each types}} + {{#if @index}} + {{#ifCond ../type '==' 'intersection'}}&{{else}}|{{/ifCond}} + {{/if}}{{> type}} + {{/each}} {{else}} - {{#compact}} - - {{#if name}} - {{name}} - {{else}} - {{#if value}} - "{{value}}" - {{else}} - {{this}} - {{/if}} - {{/if}} - - {{#if typeArguments}} - < + {{#if elements}} + {{#compact}} + [ - {{#each typeArguments}} + {{#each elements}} {{#if @index}} , {{/if}}{{> type}} {{/each}} - > - {{/if}} - {{/compact}} + ] + {{/compact}} + {{else}} + {{#compact}} + + {{#if name}} + {{name}} + {{else}} + {{#if value}} + "{{value}}" + {{else}} + {{this}} + {{/if}} + {{/if}} + + {{#if typeArguments}} + < + + {{#each typeArguments}} + {{#if @index}} + , + {{/if}}{{> type}} + {{/each}} + + > + {{/if}} + {{/compact}} + {{/if}} {{/if}} {{/if}} {{/if}} + {{else}} + void {{/if}} -{{else}} - void -{{/if}} +{{/if}} \ No newline at end of file