2017-06-29 17:23:27 -04:00
|
|
|
{% import "lib/paramList.html" as params -%}
|
|
|
|
|
|
|
|
{%- macro renderHeritage(exportDoc) -%}
|
|
|
|
{%- if exportDoc.extendsClauses.length %} extends {% for clause in exportDoc.extendsClauses -%}
|
2017-08-28 12:46:32 -04:00
|
|
|
<a class="code-anchor" href="{$ clause.doc.path $}">{$ clause.text $}</a>{% if not loop.last %}, {% endif -%}
|
2017-06-29 17:23:27 -04:00
|
|
|
{% endfor %}{% endif %}
|
|
|
|
{%- if exportDoc.implementsClauses.length %} implements {% for clause in exportDoc.implementsClauses -%}
|
2017-08-28 12:46:32 -04:00
|
|
|
<a class="code-anchor" href="{$ clause.doc.path $}">{$ clause.text $}</a>{% if not loop.last %}, {% endif -%}
|
2017-06-29 17:23:27 -04:00
|
|
|
{% endfor %}{% endif %}
|
|
|
|
{%- endmacro -%}
|
|
|
|
|
2017-08-28 12:46:32 -04:00
|
|
|
{%- macro renderMembers(doc) -%}
|
2018-02-25 05:40:21 -05:00
|
|
|
{%- for member in doc.staticProperties %}{% if not member.internal %}
|
|
|
|
<a class="code-anchor" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
|
|
|
|
{% for member in doc.staticMethods %}{% if not member.internal %}
|
|
|
|
<a class="code-anchor" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
|
|
|
|
{% if doc.constructorDoc and not doc.constructorDoc.internal %}
|
|
|
|
<a class="code-anchor" href="{$ doc.path $}#{$ doc.constructorDoc.anchor | urlencode $}">{$ renderMemberSyntax(doc.constructorDoc, 1) $}</a>{% endif -%}
|
|
|
|
{% for member in doc.properties %}{% if not member.internal %}
|
|
|
|
<a class="code-anchor" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
|
|
|
|
{% for member in doc.methods %}{% if not member.internal %}
|
|
|
|
<a class="code-anchor" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
|
|
|
|
|
|
|
|
{%- for ancestor in doc.extendsClauses %}{% if ancestor.doc %}
|
|
|
|
|
|
|
|
// inherited from <a class="code-anchor" href="{$ ancestor.doc.path $}">{$ ancestor.doc.id $}</a>{$ renderMembers(ancestor.doc) $}{% endif %}{% endfor -%}
|
2017-08-28 12:46:32 -04:00
|
|
|
{%- endmacro -%}
|
|
|
|
|
2018-02-08 10:00:53 -05:00
|
|
|
{%- macro renderMemberSyntax(member, truncateLines) -%}
|
2017-06-29 17:23:27 -04:00
|
|
|
{%- if member.accessibility !== 'public' %}{$ member.accessibility $} {% endif -%}
|
2017-10-10 08:25:26 -04:00
|
|
|
{%- if (member.isGetAccessor or member.isReadonly) and not member.isSetAccessor %}get {% endif -%}
|
|
|
|
{%- if member.isSetAccessor and not member.isGetAccessor %}set {% endif -%}
|
2017-06-29 17:23:27 -04:00
|
|
|
{%- if member.isStatic %}static {% endif -%}
|
2017-09-28 08:01:37 -04:00
|
|
|
{$ member.name $}{$ member.typeParameters | escape $}{% if not member.isGetAccessor %}{$ params.paramList(member.parameters, truncateLines) | trim $}{% endif %}
|
2017-06-29 17:23:27 -04:00
|
|
|
{%- if member.isOptional %}?{% endif -%}
|
2017-07-13 08:33:48 -04:00
|
|
|
{$ params.returnType(member.type) | trim | truncateCode(truncateLines) $}
|
2017-06-29 17:23:27 -04:00
|
|
|
{%- endmacro -%}
|
|
|
|
|
2018-02-08 10:00:53 -05:00
|
|
|
{%- macro renderOverloadInfo(overload, cssClass, method) -%}
|
|
|
|
{% if overload.description and (overload.description != method.description) %}{$ overload.description | marked $}{% endif %}
|
|
|
|
|
|
|
|
<code-example language="ts" hideCopy="true" class="no-box api-heading">{$ renderMemberSyntax(overload) $}</code-example>
|
|
|
|
|
|
|
|
<h4 class="no-anchor">Parameters</h4>
|
|
|
|
{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter') $}
|
|
|
|
|
|
|
|
{% if overload.type or overload.returns.type %}
|
|
|
|
<h4 class="no-anchor">Returns</h4>
|
|
|
|
{% marked %}`{$ (overload.type or overload.returns.type) $}`{% if overload.returns %}: {$ overload.returns.description $}{% endif %}{% endmarked %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if overload.throws.length %}
|
|
|
|
<h4 class="no-anchor">Throws</h4>
|
|
|
|
{% for error in overload.throws %}
|
|
|
|
{% marked %}`{$ (error.typeList or 'Error') $}` {$ error.description $}{% endmarked %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{%- endmacro -%}
|
|
|
|
|
|
|
|
{%- macro renderMethodDetail(method, cssClass) -%}
|
|
|
|
<a id="{$ method.anchor $}"></a>
|
|
|
|
<table class="is-full-width method-table {$ cssClass $}">
|
2018-02-22 15:54:38 -05:00
|
|
|
{% if method.name !== 'constructor' %}<thead><tr><th><h3>
|
2018-02-24 07:07:53 -05:00
|
|
|
{% if method.isCallMember %}<i>call signature</i>
|
|
|
|
{% elseif method.isNewMember %}<i>construct signature</i>
|
|
|
|
{% else %}{$ method.name $}()
|
|
|
|
{% endif %}
|
2018-02-22 15:54:38 -05:00
|
|
|
</h3></th></tr></thead>{% endif %}
|
2018-02-08 10:00:53 -05:00
|
|
|
<tbody>
|
2018-02-22 15:54:38 -05:00
|
|
|
{% if method.description %}<tr>
|
2018-02-08 10:00:53 -05:00
|
|
|
<td>
|
2018-02-22 15:54:38 -05:00
|
|
|
{$ method.description | marked $}
|
2018-02-08 10:00:53 -05:00
|
|
|
</td>
|
2018-02-22 15:54:38 -05:00
|
|
|
</tr>{% endif %}
|
2018-02-08 10:00:53 -05:00
|
|
|
{% if method.overloads.length == 0 %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% elseif method.overloads.length < 3 -%}
|
|
|
|
{% for overload in method.overloads -%}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{$ renderOverloadInfo(overload, cssClass + '-overload', method) $}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor -%}
|
|
|
|
{% else -%}
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<details class="overloads">
|
|
|
|
<summary><h4 class="no-anchor">{$ method.overloads.length $} overloads...</h4></summary>
|
|
|
|
<div class="detail-contents">
|
|
|
|
{% for overload in method.overloads %}
|
|
|
|
{$ renderOverloadInfo(overload, cssClass + '-overload', method) $}
|
|
|
|
{% if not loop.last %}<hr class="hr-margin fullwidth">{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</details>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-06-29 17:23:27 -04:00
|
|
|
{% endmacro -%}
|
|
|
|
|
2018-02-08 10:00:53 -05:00
|
|
|
{%- macro renderMethodDetails(methods, containerClass, itemClass, headingText) -%}
|
|
|
|
{% if methods.length %}
|
2017-06-29 17:23:27 -04:00
|
|
|
<section class="{$ containerClass $}">
|
2018-02-08 10:00:53 -05:00
|
|
|
<h2>{$ headingText $}</h2>
|
|
|
|
{% for member in methods %}{% if not member.internal %}
|
|
|
|
{$ renderMethodDetail(member, itemClass) $}
|
2017-06-29 17:23:27 -04:00
|
|
|
{% endif %}{% endfor %}
|
|
|
|
</section>
|
|
|
|
{% endif %}
|
2018-02-08 10:00:53 -05:00
|
|
|
{%- endmacro -%}
|
|
|
|
|
|
|
|
|
|
|
|
{%- macro renderProperties(properties, containerClass, propertyClass, headingText) -%}
|
|
|
|
{%- if properties.length -%}
|
|
|
|
<h2>{$ headingText $}</h2>
|
|
|
|
<table class="is-full-width list-table properties-table">
|
|
|
|
<thead>
|
|
|
|
<tr><th>Property</th><th>Type</th><th>Description</th></tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for property in properties %}{% if not property.internal %}
|
|
|
|
<tr class="{$ propertyClass $}">
|
|
|
|
<td><a id="{$ property.anchor $}"></a>{$ property.name $}</td>
|
|
|
|
<td><label class="property-type-label"><code>{$ property.type | escape $}</code></label></td>
|
|
|
|
<td>
|
|
|
|
{$ (property.description or property.constructorParamDoc.description) | marked $}
|
|
|
|
{% if property.constructorParamDoc %} <span class='from-constructor'>Declared in constructor.</span>{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{%- endif -%}
|
|
|
|
{%- endmacro -%}
|