Skip to content

Commit

Permalink
Fixed issues with optionals not rendering correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Sep 28, 2017
1 parent 262e863 commit 3290d25
Show file tree
Hide file tree
Showing 48 changed files with 134 additions and 263 deletions.
3 changes: 2 additions & 1 deletion src/theme/partials/member.signature.body.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@


{{#unless hideSources}}
{{ compileSources this}}
{{/unless}}

{{> comment}}

Expand Down
2 changes: 1 addition & 1 deletion src/theme/partials/member.signature.title.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#compact}}
{{#unless hideName}}{{getMemberSymbol kindString}}**{{{name}}}**{{/unless}}
{{getMemberSymbol kindString}}{{#unless hideName}}**{{{name}}}**{{/unless}}
{{#if typeParameters}}
{{#each typeParameters}}
{{#if @index}}, {{/if}}
Expand Down
32 changes: 5 additions & 27 deletions src/theme/partials/parameter.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@

{{#if indexSignature}}

{{#compact}}
[
{{#each indexSignature.parameters}}
{{#if flags.isRest}}...{{/if}}{{name}}: {{#with type}}{{>type}}{{/with}}
{{/each}}
]: 
{{#with indexSignature.type}}{{>type}}{{/with}}
{{/compact}}
[{{#each indexSignature.parameters}}{{#if flags.isRest}}...{{/if}}{{name}}: {{#with type}}{{>type}}{{/with}}{{/each}}]: {{#with indexSignature.type}}{{>type}}{{/with}}

{{#with indexSignature}}
{{> comment}}
Expand All @@ -33,29 +26,14 @@
{{/if}}

{{#each children}}
{{#if signatures}}
{{#compact}}
{{#if flags.isRest}}...{{/if}}
{{{ name}}}
{{#if isOptional}}?{{/if}}
: 
function
{{/compact}}

{{#if signatures}}
{{#if flags.isRest}}...{{/if}} {{{ name}}} {{#if isOptional}}?{{/if}}: function
{{> member.signatures}}
{{else}}
{{#compact}}
{{#each flags}}
{{this}}
{{/each}}

{{#if flags.isRest}}...{{/if}}
{{{ name}}}
{{else}}

{{#if flags.isOptional}}?{{/if}}
: 
{{#with type}}{{>type}}{{/with}}
{{/compact}}
{{#each flags}}«{{this}}» {{/each}} {{#if flags.isRest}}...{{/if}}{{{ name}}}{{#if flags.isOptional}}?{{/if}}: {{#with type}}{{>type}}{{/with}}

{{> comment}}

Expand Down
2 changes: 1 addition & 1 deletion src/theme/partials/type.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
{{#if value}}
"{{value}}"
{{else}}
{{this}}
`{{this}}`
{{/if}}
{{/if}}
{{#if typeArguments}}
Expand Down
72 changes: 48 additions & 24 deletions tests/mocks/bitbucket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
* [IPrintNameInterface](interfaces/iprintnameinterface.md)


### Type aliases

* [SomeOptions](#markdown-header-someoptions)


### Variables

* [Promise](#markdown-header-promise)
Expand Down Expand Up @@ -80,6 +85,43 @@


---
# Type aliases


### SomeOptions

**Τ SomeOptions**: *`object`*

*Defined in [basic-types.ts:49](https://bitbucket.org/owner/repository_name/src/master/src/basic-types.ts?fileviewer=file-view-default#basic-types.ts-49)*


#### Type declaration




«Optional» aFunction?: `function`




►(): `void`





**Returns:** `void`







___


# Variables


Expand Down Expand Up @@ -254,8 +296,7 @@ ___

### createSomething

**createSomething**(): object

**createSomething**(): `object`



Expand All @@ -268,7 +309,7 @@ A function that returns an object. Also no type information is given, the object



**Returns:** object
**Returns:** `object`



Expand All @@ -284,7 +325,6 @@ ___




*Defined in [functions.ts:11](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-11)*


Expand All @@ -310,7 +350,6 @@ ___




*Defined in [functions.ts:38](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-38)*


Expand Down Expand Up @@ -346,7 +385,6 @@ ___




*Defined in [functions.ts:58](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-58)*


Expand Down Expand Up @@ -386,7 +424,6 @@ ___




*Defined in [functions.ts:170](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-170)*


Expand Down Expand Up @@ -414,7 +451,6 @@ ___




*Defined in [functions.ts:48](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-48)*


Expand Down Expand Up @@ -449,7 +485,6 @@ ___




*Defined in [functions.ts:74](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-74)*


Expand Down Expand Up @@ -485,7 +520,6 @@ ___




*Defined in [functions.ts:116](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-116)*


Expand Down Expand Up @@ -527,7 +561,6 @@ ___




*Defined in [functions.ts:6](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-6)*


Expand All @@ -551,8 +584,7 @@ ___

**multipleSignatures**(value: *`string`*): `string`

**multipleSignatures**(value: *object*): `string`

**multipleSignatures**(value: *`object`*): `string`



Expand All @@ -577,7 +609,6 @@ This is the first signature of a function with multiple signatures.




*Defined in [functions.ts:91](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-91)*


Expand All @@ -589,7 +620,7 @@ This is the second signature of a function with multiple signatures.

| Param | Type | Description |
| ------ | ------ | ------ |
| value | object | An object containing the name value. |
| value | `object` | An object containing the name value. |



Expand All @@ -612,7 +643,6 @@ ___




*Defined in [private-members.ts:10](https://bitbucket.org/owner/repository_name/src/master/src/private-members.ts?fileviewer=file-view-default#private-members.ts-10)*


Expand All @@ -635,7 +665,6 @@ ___




*Defined in [functions.ts:191](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-191)*


Expand All @@ -658,7 +687,6 @@ ___




*Defined in [functions.ts:177](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-177)*


Expand All @@ -681,7 +709,6 @@ ___




*Defined in [functions.ts:183](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-183)*


Expand All @@ -700,8 +727,7 @@ ___

### returnTypeObject

**returnTypeObject**(properties: *`object`*): object

**returnTypeObject**(properties: *`object`*): `object`



Expand All @@ -719,7 +745,7 @@ ___



**Returns:** object
**Returns:** `object`



Expand All @@ -735,7 +761,6 @@ ___




*Defined in [functions.ts:23](https://bitbucket.org/owner/repository_name/src/master/src/functions.ts?fileviewer=file-view-default#functions.ts-23)*


Expand Down Expand Up @@ -806,7 +831,6 @@ ___




*Defined in [basic-types.ts:42](https://bitbucket.org/owner/repository_name/src/master/src/basic-types.ts?fileviewer=file-view-default#basic-types.ts-42)*


Expand Down
8 changes: 0 additions & 8 deletions tests/mocks/bitbucket/classes/baseclass.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ This is a simple example on how to use BaseClass.
### **new BaseClass**(source: *[BaseClass](baseclass.md)*): [BaseClass](baseclass.md)



*Defined in [classes.ts:70](https://bitbucket.org/owner/repository_name/src/master/src/classes.ts?fileviewer=file-view-default#classes.ts-70)*


Expand All @@ -85,7 +84,6 @@ This is a simple example on how to use BaseClass.

**Returns:** [BaseClass](baseclass.md)


*Defined in [classes.ts:72](https://bitbucket.org/owner/repository_name/src/master/src/classes.ts?fileviewer=file-view-default#classes.ts-72)*


Expand Down Expand Up @@ -152,7 +150,6 @@ ___




*Defined in [classes.ts:129](https://bitbucket.org/owner/repository_name/src/master/src/classes.ts?fileviewer=file-view-default#classes.ts-129)*


Expand Down Expand Up @@ -187,7 +184,6 @@ ___




*Implementation of [INameInterface](../interfaces/inameinterface.md).[getName](../interfaces/inameinterface.md#markdown-header-getname)*

*Defined in [classes.ts:94](https://bitbucket.org/owner/repository_name/src/master/src/classes.ts?fileviewer=file-view-default#classes.ts-94)*
Expand Down Expand Up @@ -219,7 +215,6 @@ ___




*Defined in [classes.ts:117](https://bitbucket.org/owner/repository_name/src/master/src/classes.ts?fileviewer=file-view-default#classes.ts-117)*


Expand Down Expand Up @@ -255,7 +250,6 @@ ___




*Defined in [classes.ts:153](https://bitbucket.org/owner/repository_name/src/master/src/classes.ts?fileviewer=file-view-default#classes.ts-153)*


Expand Down Expand Up @@ -292,7 +286,6 @@ ___




*Defined in [classes.ts:146](https://bitbucket.org/owner/repository_name/src/master/src/classes.ts?fileviewer=file-view-default#classes.ts-146)*


Expand Down Expand Up @@ -322,7 +315,6 @@ ___




*Defined in [classes.ts:106](https://bitbucket.org/owner/repository_name/src/master/src/classes.ts?fileviewer=file-view-default#classes.ts-106)*


Expand Down
Loading

0 comments on commit 3290d25

Please sign in to comment.