From 375f8b4f569f0ea04d9adc3dd9db1956a53a94b6 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sun, 31 Jan 2021 12:33:28 -0700 Subject: [PATCH] fix: Better handling for getters/setters in object literals Resolves TypeStrong/typedoc#1475 --- src/default/partials/parameter.hbs | 92 +++++++++++++++++------------- 1 file changed, 52 insertions(+), 40 deletions(-) diff --git a/src/default/partials/parameter.hbs b/src/default/partials/parameter.hbs index 6ca8850..d732ae2 100644 --- a/src/default/partials/parameter.hbs +++ b/src/default/partials/parameter.hbs @@ -39,8 +39,8 @@ {{/if}} {{#each children}} -
  • - {{#if signatures}} + {{#if signatures}} +
  • {{#compact}} {{#if flags.isRest}}...{{/if}} {{{wbr name}}} @@ -52,7 +52,9 @@ {{/compact}}
    {{> member.signatures}} - {{else}} +
  • + {{else}}{{#if type}} {{! standard type }} +
  • {{#compact}} {{#each flags}} {{this}}  @@ -65,41 +67,6 @@ :  {{>type}} - {{else}} - {{#if getSignature}} - {{#if setSignature}} - {{{wbr name}}} - - {{#with getSignature.type}} - {{> type}} - {{/with}} - {{else}} - get  - {{{wbr name}}} - ():  - {{#with getSignature.type}} - {{> type}} - {{/with}} - {{/if}} - {{else}} - {{#if setSignature}} - set  - {{{wbr name}}} - ( - {{#each setSignature.parameters}} - {{name}} - : - {{#with type}} - {{> type}} - {{else}} - any - {{/with}} - {{/each}} - ) - {{else}} - any - {{/if}} - {{/if}} {{/with}} {{/compact}}
    @@ -114,7 +81,52 @@ {{> parameter}} {{/with}} {{/if}} - {{/if}} -
  • + + {{else}} {{! getter/setter }} + {{#with getSignature}} {{! getter }} +
  • +
    {{#compact}} + {{#each flags}} + {{this}}  + {{/each}} + get  + {{{wbr ../name}}} + ():  + {{#with type}} + {{> type}} + {{/with}} + {{/compact}}
    + + {{> comment }} +
  • + {{/with}} + {{#with setSignature}} {{! setter }} +
  • +
    {{#compact}} + {{#each flags}} + {{this}}  + {{/each}} + set  + {{{wbr ../name}}} + ( + {{#each parameters}} + {{name}} + : + {{#with type}} + {{> type}} + {{else}} + any + {{/with}} + {{/each}} + ):  + {{#with type}} + {{> type}} + {{/with}} + {{/compact}}
    + + {{> comment }} +
  • + {{/with}} + {{/if}}{{/if}} {{/each}}