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 -%}
|
2018-03-02 17:53:50 -05:00
|
|
|
{%- if member.isAbstract %}abstract {% endif -%}
|
|
|
|
{%- if member.isStatic %}static {% 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-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) -%}
|
|
|
|
|
2018-03-04 15:57:42 -05:00
|
|
|
<code-example language="ts" hideCopy="true" class="no-box api-heading">{$ renderMemberSyntax(overload) $}</code-example>
|
2018-02-08 10:00:53 -05:00
|
|
|
|
2018-03-04 15:57:42 -05:00
|
|
|
{% if overload.shortDescription and (overload.shortDescription != method.shortDescription) %}
|
|
|
|
<div class="short-description">
|
|
|
|
{$ overload.shortDescription | marked $}
|
|
|
|
</div>{% endif %}
|
2018-02-08 10:00:53 -05:00
|
|
|
|
2018-03-04 15:57:42 -05:00
|
|
|
<h4 class="no-anchor">Parameters</h4>
|
|
|
|
{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter') $}
|
2018-02-08 10:00:53 -05:00
|
|
|
|
2018-03-04 15:57:42 -05:00
|
|
|
{% 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 %}
|
|
|
|
|
|
|
|
{% if overload.description and (overload.description != method.description) -%}
|
|
|
|
<div class="description">
|
|
|
|
{$ overload.description | marked $}
|
|
|
|
</div>
|
|
|
|
{%- endif %}
|
2018-02-08 10:00:53 -05:00
|
|
|
{%- 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-03-04 15:57:42 -05:00
|
|
|
{% if method.shortDescription %}<tr>
|
|
|
|
<td class="short-description">
|
|
|
|
{$ method.shortDescription | 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 %}
|
2018-03-04 15:57:42 -05:00
|
|
|
{% if method.description %}<tr>
|
|
|
|
<td class="description">
|
|
|
|
{$ method.description | marked $}
|
|
|
|
</td>
|
|
|
|
</tr>{% endif %}
|
2018-02-08 10:00:53 -05:00
|
|
|
</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) -%}
|
2018-02-27 04:07:29 -05:00
|
|
|
{% set nonInternalMethods = methods | filterByPropertyValue('internal', undefined) %}
|
|
|
|
{% if nonInternalMethods.length %}
|
2017-06-29 17:23:27 -04:00
|
|
|
<section class="{$ containerClass $}">
|
2018-02-08 10:00:53 -05:00
|
|
|
<h2>{$ headingText $}</h2>
|
2018-02-27 04:07:29 -05:00
|
|
|
{% for member in nonInternalMethods %}
|
2018-02-08 10:00:53 -05:00
|
|
|
{$ renderMethodDetail(member, itemClass) $}
|
2018-02-27 04:07:29 -05:00
|
|
|
{% endfor %}
|
2017-06-29 17:23:27 -04:00
|
|
|
</section>
|
|
|
|
{% endif %}
|
2018-02-08 10:00:53 -05:00
|
|
|
{%- endmacro -%}
|
|
|
|
|
|
|
|
|
2018-05-12 08:30:19 -04:00
|
|
|
{%- macro renderProperties(properties, containerClass, propertyClass, headingText, headings) -%}
|
2018-02-27 04:07:29 -05:00
|
|
|
{% set nonInternalProperties = properties | filterByPropertyValue('internal', undefined) %}
|
2018-05-12 08:30:19 -04:00
|
|
|
{% set hasTypes = properties | hasValues('type') %}
|
2018-02-27 04:07:29 -05:00
|
|
|
{% if nonInternalProperties.length -%}
|
|
|
|
<section class="{$ containerClass $}">
|
|
|
|
<h2>{$ headingText $}</h2>
|
|
|
|
<table class="is-full-width list-table properties-table">
|
|
|
|
<thead>
|
2018-05-12 08:30:19 -04:00
|
|
|
<tr>
|
|
|
|
<th>{$ headings[0] or 'Property' $}</th>
|
|
|
|
{% if hasTypes %}<th>{$ headings[1] or 'Type' $}</th>{% endif %}
|
|
|
|
<th>{$ headings[2] or 'Description' $}</th>
|
|
|
|
</tr>
|
2018-02-27 04:07:29 -05:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for property in nonInternalProperties %}
|
|
|
|
<tr class="{$ propertyClass $}">
|
|
|
|
<td><a id="{$ property.anchor $}"></a>{$ property.name $}</td>
|
2018-05-12 08:30:19 -04:00
|
|
|
{% if hasTypes %}<td><label class="property-type-label"><code>{$ property.type | escape $}</code></label></td>{% endif %}
|
2018-02-27 04:07:29 -05:00
|
|
|
<td>
|
2018-03-04 16:11:54 -05:00
|
|
|
{%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}<span class='read-only-property'>Read-only.</span>{% endif %}
|
2018-03-04 15:57:42 -05:00
|
|
|
{% if property.shortDescription %}{$ property.shortDescription | marked $}{% endif %}
|
2018-02-27 04:07:29 -05:00
|
|
|
{$ (property.description or property.constructorParamDoc.description) | marked $}
|
|
|
|
{% if property.constructorParamDoc %} <span class='from-constructor'>Declared in constructor.</span>{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</section>
|
2018-02-08 10:00:53 -05:00
|
|
|
{%- endif -%}
|
|
|
|
{%- endmacro -%}
|