{% import "lib/githubLinks.html" as github -%} {% import "lib/paramList.html" as params -%} {%- macro renderHeritage(exportDoc) -%} {%- if exportDoc.extendsClauses.length %} extends {% for clause in exportDoc.extendsClauses -%} {$ clause.text $}{% if not loop.last %}, {% endif -%} {% endfor %}{% endif %} {%- if exportDoc.implementsClauses.length %} implements {% for clause in exportDoc.implementsClauses -%} {$ clause.text $}{% if not loop.last %}, {% endif -%} {% endfor %}{% endif %} {%- endmacro -%} {%- macro renderMembers(doc) -%} {%- for member in doc.staticProperties %}{% if not member.internal %} {$ renderMemberSyntax(member, 1) $}{% endif %}{% endfor -%} {% for member in doc.staticMethods %}{% if not member.internal %} {$ renderMemberSyntax(member, 1) $}{% endif %}{% endfor -%} {% if doc.constructorDoc and not doc.constructorDoc.internal %} {$ renderMemberSyntax(doc.constructorDoc, 1) $}{% endif -%} {% for member in doc.properties %}{% if not member.internal %} {$ renderMemberSyntax(member, 1) $}{% endif %}{% endfor -%} {% for member in doc.methods %}{% if not member.internal %} {$ renderMemberSyntax(member, 1) $}{% endif %}{% endfor -%} {%- for ancestor in doc.extendsClauses %}{% if ancestor.doc %} // inherited from {$ ancestor.doc.id $}{$ renderMembers(ancestor.doc) $}{% endif %}{% endfor -%} {%- endmacro -%} {%- macro renderMemberSyntax(member, truncateLines) -%} {%- if member.boundTo %}@{$ member.boundTo.type $}( {%- if member.boundTo.propertyName != member.boundTo.bindingName %}'{$ member.boundTo.bindingName $}'{% endif -%} )
{% endif -%} {%- if member.accessibility !== 'public' %}{$ member.accessibility $} {% endif -%} {%- if member.isAbstract %}abstract {% endif -%} {%- if member.isStatic %}static {% endif -%} {$ member.name $}{$ member.typeParameters | escape $}{% if not member.isGetAccessor %}{$ params.paramList(member.parameters, truncateLines) | trim $}{% endif %} {%- if member.isOptional %}?{% endif -%} {$ params.returnType(member.type) | trim | truncateCode(truncateLines) $} {%- endmacro -%} {%- macro renderOverloadInfo(overload, cssClass, method) -%} {% if overload.shortDescription and (overload.shortDescription != method.shortDescription) %}
{$ overload.shortDescription | marked $}
{% endif %} {$ renderMemberSyntax(overload) $} {% if overload.deprecated !== undefined %}
{$ ('**Deprecated** ' + overload.deprecated) | marked $}
{% endif %}
Parameters
{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter', true) $} {% if overload.type or overload.returns.type %}
Returns
{% marked %}`{$ (overload.type or overload.returns.type) $}`{% if overload.returns %}: {$ overload.returns.description $}{% endif %}{% endmarked %} {% endif %} {% if overload.throws.length %}
Throws
{% for error in overload.throws %} {% marked %}`{$ (error.typeList or 'Error') $}` {$ error.description $}{% endmarked %} {% endfor %} {% endif %} {% if overload.description and (overload.description != method.description) -%}
{$ overload.description | marked $}
{%- endif %} {%- endmacro -%} {%- macro renderMethodDetail(versionInfo, method, cssClass) -%} {% if method.name !== 'constructor' %}{% endif %} {% if method.shortDescription %}{% endif %} {% if method.overloads.length == 0 %} {% elseif method.overloads.length < 3 -%} {% if method.isAbstract %} {% endif %} {% for overload in method.overloads -%} {% endfor -%} {% else -%} {% endif %} {% if method.description -%} {%- endif %} {% if method.usageNotes -%} {%- endif %}
{$ method.shortDescription | marked $}
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
{$ renderOverloadInfo(overload, cssClass + '-overload', method) $}
{% if method.isAbstract %} {$ renderOverloadInfo(method, cssClass + '-overload', method) $}
{% endif %} {% for overload in method.overloads %}
Overload #{$ loop.index $} of {$ method.overloads.length $}
expand_more
{$ renderOverloadInfo(overload, cssClass + '-overload', method) $} {% if not loop.last %}
{% endif %}
{% endfor %}
{$ method.description | marked({ h3: 'h5' }) $}

Usage Notes

{$ method.usageNotes | marked({ h3: 'h5' }) $}
{% endmacro -%} {%- macro renderMethodDetails(versionInfo, methods, containerClass, itemClass, headingText) -%} {% set nonInternalMethods = methods | filterByPropertyValue('internal', undefined) %} {% if nonInternalMethods.length %}

{$ headingText $}

{% for member in nonInternalMethods %} {$ renderMethodDetail(versionInfo, member, itemClass) $} {% endfor %}
{% endif %} {%- endmacro -%} {%- macro renderProperties(properties, containerClass, propertyClass, headingText, headings, headingLevel = 2) -%} {% set nonInternalProperties = properties | filterByPropertyValue('internal', undefined) %} {% if nonInternalProperties.length -%}
{$ headingText $} {% for property in nonInternalProperties %} {% endfor %}
{$ headings[0] or 'Property' $} {$ headings[1] or 'Description' $}
{$ renderMemberSyntax(property) $} {%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}Read-only.{% endif %} {%- if property.isSetAccessor and not property.isGetAccessor %}Write-only.{% endif %} {% if property.shortDescription %}{$ property.shortDescription | marked $}{% endif %} {$ (property.description or property.constructorParamDoc.description) | marked $} {% if property.constructorParamDoc %} Declared in constructor.{% endif %}
{%- endif -%} {%- endmacro -%} {% macro renderDirectiveAncestors(doc, collectionName) %} {%- for ancestor in doc.extendsClauses %}{% if ancestor.doc %} {% set nonInternalMembers = ancestor.doc[collectionName] | filterByPropertyValue('internal', undefined) %} {% if nonInternalMembers.length -%}

Inherited from {$ ancestor.doc.name $}

{% endif %} {$ renderDirectiveAncestors(ancestor.doc, collectionName) $} {% endif %}{% endfor -%} {% endmacro %} {% macro renderDirectiveProperties(doc, heading) %} {$ renderProperties(doc.properties, 'instance-properties', 'instance-property', heading) $} {$ renderDirectiveAncestors(doc, 'properties') $} {% endmacro %}