Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed "The partial literal could not be found" #41

Open
wants to merge 3 commits into
base: develop
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
156 changes: 140 additions & 16 deletions theme/v2/partials/type.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,61 @@ if an inner type may result in invalid output without them. For example:
<span class="tsd-signature-type">{{name}}</span>
{{/inline}}

{{#*inline 'literal'}}
<span class="tsd-signature-type">{{stringify value}}</span>
{{/inline}}

{{#*inline 'mapped'}}
<span class="tsd-signature-symbol">{</span>
{{#ifCond readonlyModifier '===' '+'}}
<span class="tsd-signature-symbol">readonly </span>
{{else}}
{{#ifCond readonlyModifier '===' '-'}}
<span class="tsd-signature-symbol">-readonly </span>
{{/ifCond}}
{{/ifCond}}

<span class="tsd-signature-symbol">[ </span>
<span class="tsd-signature-type">{{parameter}}</span>
<span class="tsd-signature-symbol"> in </span>

{{#with parameterType}}
{{>type}}
{{/with}}

{{#with nameType}}
<span class="tsd-signature-symbol"> as </span>
{{>type}}
{{/with}}

<span class="tsd-signature-symbol">]</span>
{{#ifCond readonlyModifier '===' '+'}}
<span class="tsd-signature-symbol">?: </span>
{{else}}
{{#ifCond readonlyModifier '===' '-'}}
<span class="tsd-signature-symbol">-?: </span>
{{else}}
<span class="tsd-signature-symbol">: </span>
{{/ifCond}}
{{/ifCond}}

{{#with templateType}}
{{>type}}
{{/with}}

<span class="tsd-signature-symbol"> }</span>
{{/inline}}

{{#*inline 'optional'}}
{{#with elementType}}
{{> type}}
{{/with}}
<span class="tsd-signature-symbol">?</span>
{{/inline}}

{{#*inline 'predicate'}}
{{#if asserts}}
<span class="tsd-signature-symbol">asserts</span>
<span class="tsd-signature-symbol">asserts </span>
{{/if}}
<span class="tsd-signature-type">{{name}}</span>
{{#if targetType}}
Expand All @@ -94,13 +146,13 @@ if an inner type may result in invalid output without them. For example:
{{/inline}}

{{#*inline 'reference'}}
{{#if reflection}}
<a href="{{relativeURL reflection.url}}" class="tsd-signature-type">
{{reflection.name}}
{{#with getReflection }}
<a href="{{relativeURL url}}" class="tsd-signature-type" data-tsd-kind="{{kindString}}">
{{name}}
</a>
{{else}}
<span class="tsd-signature-type">{{name}}</span>
{{/if}}
{{/with}}
{{#if typeArguments}}
<span class="tsd-signature-symbol">&lt;</span>
{{#each typeArguments}}
Expand All @@ -120,17 +172,56 @@ if an inner type may result in invalid output without them. For example:
{{#unless @first}}
<span class="tsd-signature-symbol">; </span>
{{/unless}}
{{name}}
{{#if flags.isOptional }}
<span class="tsd-signature-symbol">?: </span>

{{#if getSignature}}
{{#if setSignature}}
{{name}}
<span class="tsd-signature-symbol">: </span>
{{#with getSignature.type}}
{{> type}}
{{else}}
<span class="tsd-signature-type">any</span>
{{/with}}
{{else}}
<span class="tsd-signature-symbol">get </span>
{{name}}
<span class="tsd-signature-symbol">(): </span>
{{#with getSignature.type}}
{{> type}}
{{else}}
<span class="tsd-signature-type">any</span>
{{/with}}
{{/if}}
{{else}}
<span class="tsd-signature-symbol">: </span>
{{#if setSignature}}
<span class="tsd-signature-symbol">set </span>
{{name}}
<span class="tsd-signature-symbol">(</span>
{{! Rather hacky to use each here... but we know there is exactly one. }}
{{#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}}
{{name}}
{{#if flags.isOptional }}
<span class="tsd-signature-symbol">?: </span>
{{else}}
<span class="tsd-signature-symbol">: </span>
{{/if}}
{{#with type}}
{{> type}}
{{else}}
<span class="tsd-signature-type">any</span>
{{/with}}
{{/if}}
{{/if}}
{{#with type}}
{{> type}}
{{else}}
<span class="tsd-signature-type">any</span>
{{/with}}
{{/each}}
<span class="tsd-signature-symbol"> }</span>
{{else if declaration.signatures}}
Expand Down Expand Up @@ -159,8 +250,11 @@ if an inner type may result in invalid output without them. For example:
{{/if}}
{{/inline}}

{{#*inline 'stringLiteral'}}
<span class="tsd-signature-type">"{{value}}"</span>
{{#*inline 'rest'}}
<span class="tsd-signature-symbol">...</span>
{{#with elementType}}
{{> type}}
{{/with}}
{{/inline}}

{{#*inline 'tuple'}}
Expand All @@ -174,6 +268,24 @@ if an inner type may result in invalid output without them. For example:
<span class="tsd-signature-symbol">]</span>
{{/inline}}

{{#*inline 'template-literal'}}
<span class="tsd-signature-symbol">`</span>
{{#if head}}
<span class="tsd-signature-type">{{head}}</span>
{{/if}}
{{#each tail}}
<span class="tsd-signature-symbol">${</span>
{{#with this.[0]}}
{{>type}}
{{/with}}
<span class="tsd-signature-symbol">}</span>
{{#if this.[1]}}
<span class="tsd-signature-type">{{this.[1]}}</span>
{{/if}}
{{/each}}
<span class="tsd-signature-symbol">`</span>
{{/inline}}

{{#*inline 'typeOperator'}}
<span class="tsd-signature-symbol">{{operator}} </span>
{{#with target}}
Expand Down Expand Up @@ -204,6 +316,18 @@ if an inner type may result in invalid output without them. For example:
<span class="tsd-signature-type">{{name}}</span>
{{/inline}}

{{#*inline 'named-tuple-member'}}
{{name}}
{{#if isOptional}}
<span class="tsd-signature-symbol">?: </span>
{{else}}
<span class="tsd-signature-symbol">: </span>
{{/if}}
{{#with element}}
{{> type}}
{{/with}}
{{/inline}}

{{#if this}}
{{> (lookup . 'type') }}
{{else}}
Expand Down