2018-05-23 21:56:05 +00:00
{% import "lib/githubLinks.html" as github -%}
2017-06-29 21:23:27 +00:00
{% import "lib/paramList.html" as params -%}
{%- macro renderHeritage(exportDoc) -%}
{%- if exportDoc.extendsClauses.length %} extends {% for clause in exportDoc.extendsClauses -%}
2022-03-07 18:37:51 +00:00
{$ clause.text | escape $}{% if not loop.last %}, {% endif -%}
2017-06-29 21:23:27 +00:00
{% endfor %}{% endif %}
{%- if exportDoc.implementsClauses.length %} implements {% for clause in exportDoc.implementsClauses -%}
2022-03-07 18:37:51 +00:00
{$ clause.text | escape $}{% if not loop.last %}, {% endif -%}
2017-06-29 21:23:27 +00:00
{% endfor %}{% endif %}
{%- endmacro -%}
2017-08-28 16:46:32 +00:00
{%- macro renderMembers(doc) -%}
2018-02-25 10:40:21 +00:00
{%- for member in doc.staticProperties %}{% if not member.internal %}
2019-12-04 00:57:41 +00:00
< a class = "code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href = "{$ doc.path $}#{$ member.anchor | urlencode $}" > {$ renderMemberSyntax(member, 1) $}< / a > {% endif %}{% endfor -%}
2018-02-25 10:40:21 +00:00
{% for member in doc.staticMethods %}{% if not member.internal %}
2019-12-04 00:57:41 +00:00
< a class = "code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href = "{$ doc.path $}#{$ member.anchor | urlencode $}" > {$ renderMemberSyntax(member, 1) $}< / a > {% endif %}{% endfor -%}
2018-02-25 10:40:21 +00:00
{% if doc.constructorDoc and not doc.constructorDoc.internal %}
2019-12-04 00:57:41 +00:00
< a class = "code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href = "{$ doc.path $}#{$ doc.constructorDoc.anchor | urlencode $}" > {$ renderMemberSyntax(doc.constructorDoc, 1) $}< / a > {% endif -%}
2018-02-25 10:40:21 +00:00
{% for member in doc.properties %}{% if not member.internal %}
2019-12-04 00:57:41 +00:00
< a class = "code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href = "{$ doc.path $}#{$ member.anchor | urlencode $}" > {$ renderMemberSyntax(member, 1) $}< / a > {% endif %}{% endfor -%}
2024-01-24 15:57:34 +00:00
{%- for member in doc.methods -%}
{%- if not member.internal -%}
< br / > < a class = "code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href = "{$ doc.path $}#{$ member.anchor | urlencode $}" >
{$- renderMemberSyntax(member, 1) -$}
< / a >
{%- for overload in member.overloads -%}
< br / > < a class = "code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href = "{$ doc.path $}#{$ member.anchor | urlencode $}" >
{$- renderMemberSyntax(overload, 1) -$}
< / a >
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
2018-02-25 10:40:21 +00:00
{%- 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 16:46:32 +00:00
{%- endmacro -%}
2018-02-08 15:00:53 +00:00
{%- macro renderMemberSyntax(member, truncateLines) -%}
2023-10-03 21:12:04 +00:00
{%- if member.boundTo %}< span class = "property-binding" > @ {$ member.boundTo.type $}(
2018-09-21 13:06:57 +00:00
{%- if member.boundTo.propertyName != member.boundTo.bindingName %}'{$ member.boundTo.bindingName $}'{% endif -%}
)< / span > < br > {% endif -%}
2017-06-29 21:23:27 +00:00
{%- if member.accessibility !== 'public' %}{$ member.accessibility $} {% endif -%}
2018-03-02 22:53:50 +00:00
{%- if member.isAbstract %}abstract {% endif -%}
{%- if member.isStatic %}static {% endif -%}
2018-09-21 13:06:57 +00:00
< span class = "member-name" > {$ member.name $}< / span > {$ member.typeParameters | escape $}{% if not member.isGetAccessor %}{$ params.paramList(member.parameters, truncateLines) | trim $}{% endif %}
2017-06-29 21:23:27 +00:00
{%- if member.isOptional %}?{% endif -%}
2017-07-13 12:33:48 +00:00
{$ params.returnType(member.type) | trim | truncateCode(truncateLines) $}
2017-06-29 21:23:27 +00:00
{%- endmacro -%}
2018-02-08 15:00:53 +00:00
{%- macro renderOverloadInfo(overload, cssClass, method) -%}
2018-10-18 19:53:07 +00:00
< div class = "overload-info" >
2021-09-14 10:59:19 +00:00
{% if overload.shortDescription and (overload.shortDescription != method.shortDescription) -%}
2018-10-18 19:53:07 +00:00
< div class = "short-description" >
{$ overload.shortDescription | marked $}
2021-09-14 10:59:19 +00:00
< / div >
{% endif -%}
2018-02-08 15:00:53 +00:00
2019-12-04 00:57:41 +00:00
< code-example language = "ts" hideCopy = "true" class = "no-box api-heading{% if overload.deprecated %} deprecated-api-item{% endif %}" > {$ renderMemberSyntax(overload) $}< / code-example >
2018-02-08 15:00:53 +00:00
2021-09-14 10:59:19 +00:00
{%- if overload.deprecated !== undefined %}
2018-10-18 19:53:07 +00:00
< div class = "deprecated" >
{$ ('**Deprecated** ' + overload.deprecated) | marked $}
< / div > {% endif %}
2018-06-14 21:06:59 +00:00
2018-10-18 19:53:07 +00:00
< h6 class = "no-anchor" > Parameters< / h6 >
{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter', true) $}
2018-08-25 14:44:56 +00:00
2021-09-14 10:59:19 +00:00
{%- if overload.type or overload.returns.type %}
2018-10-18 19:53:07 +00:00
< h6 class = "no-anchor" > Returns< / h6 >
{% marked %}`{$ (overload.type or overload.returns.type) $}`{% if overload.returns %}: {$ overload.returns.description $}{% endif %}{% endmarked %}
2021-09-14 10:59:19 +00:00
{%- endif %}
2018-03-04 20:57:42 +00:00
2021-09-14 10:59:19 +00:00
{%- if overload.throws.length %}
2018-10-18 19:53:07 +00:00
< h6 class = "no-anchor" > Throws< / h6 >
2021-09-14 10:59:19 +00:00
{%- for error in overload.throws %}
2018-10-18 19:53:07 +00:00
{% marked %}`{$ (error.typeList or 'Error') $}` {$ error.description $}{% endmarked %}
2021-09-14 10:59:19 +00:00
{%- endfor %}
{%- endif %}
2018-03-04 20:57:42 +00:00
2021-09-14 10:59:19 +00:00
{%- if overload.description and (overload.description != method.description) %}
2018-10-18 19:53:07 +00:00
< div class = "description" >
2021-09-14 10:59:19 +00:00
{$ overload.description | marked | trim $}
2018-10-18 19:53:07 +00:00
< / div >
{%- endif %}
2018-03-04 20:57:42 +00:00
< / div >
2018-02-08 15:00:53 +00:00
{%- endmacro -%}
2018-05-23 21:56:05 +00:00
{%- macro renderMethodDetail(versionInfo, method, cssClass) -%}
2018-02-08 15:00:53 +00:00
< a id = "{$ method.anchor $}" > < / a >
< table class = "is-full-width method-table {$ cssClass $}" >
2021-09-14 10:59:19 +00:00
{%- if method.name !== 'constructor' %}
< thead > < tr > < th >
2018-07-17 09:14:18 +00:00
< div class = "with-github-links" >
2023-05-14 09:10:38 +00:00
< h3 { % if method . deprecated % } class = "deprecated-api-item" { % endif % } >
2021-09-14 10:59:19 +00:00
{%- if method.isCallMember %}< i > call signature< / i >
{%- elseif method.isNewMember %}< i > construct signature< / i >
{%- else %}{$ method.name $}()
{%- endif -%}
< / h3 >
2022-10-19 16:55:16 +00:00
{%- if method.developerPreview %}
< label class = "api-status-label dev-preview" title = "This API is in Developer Preview" >
< a href = "guide/releases#developer-preview" > developer preview< / a >
< / label >
{% endif %}
2023-09-08 18:52:03 +00:00
{%- if doc.experimental !== undefined %}
< label class = "api-status-label experimental" >
< a href = "guide/releases#experimental" > experimental< / a >
experimental
< / label >
{% endif %}
2023-05-14 09:10:38 +00:00
{%- if method.deprecated %}
< label class = "api-status-label deprecated" title = "This API is deprecated" > Deprecated< / label >
{% endif %}
2021-09-14 10:59:19 +00:00
{$ github.githubLinks(method, versionInfo) $}
2018-07-17 09:14:18 +00:00
< / div >
2021-09-14 10:59:19 +00:00
< / th > < / tr > < / thead >
{%- endif %}
2018-02-08 15:00:53 +00:00
< tbody >
2021-09-14 10:59:19 +00:00
{%- if method.shortDescription %}
< tr >
2018-03-04 20:57:42 +00:00
< td class = "short-description" >
{$ method.shortDescription | marked $}
2021-07-09 14:29:29 +00:00
2021-09-14 10:59:19 +00:00
{%- if method.containerDoc.docType === 'class' and method.name === 'constructor' and not method.containerDoc.isAbstract and method.containerDoc.extensible !== true %}
2021-07-09 14:29:29 +00:00
< p class = "final-message" >
This class is "final" and should not be extended.
See the < a href = "{$ github.githubVersionedUrl(versionInfo) $}/docs/PUBLIC_API.md#final-classes" > public API notes< / a > .
< / p >
2021-09-14 10:59:19 +00:00
{% endif -%}
2021-07-09 14:29:29 +00:00
2019-01-11 11:16:27 +00:00
{%- if method.see.length %}
< p > See also:< / p >
< ul >
2021-09-14 10:59:19 +00:00
{%- for see in method.see %}
< li > {$ see | marked $}< / li >
{%- endfor %}
2019-01-11 11:16:27 +00:00
< / ul >
2021-09-14 10:59:19 +00:00
{% endif -%}
2018-02-08 15:00:53 +00:00
< / td >
2021-09-14 10:59:19 +00:00
< / tr > {% endif -%}
{%- if method.overloads.length == 0 %}
2018-02-08 15:00:53 +00:00
< tr >
< td >
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
< / td >
< / tr >
2021-09-14 10:59:19 +00:00
{%- elseif method.overloads.length < 3 - % }
2021-10-06 12:52:33 +00:00
{%- if method.isAbstract or method.containerDoc.docType === 'interface' or method.containerDoc.isPseudoClass %}
2021-09-14 10:59:19 +00:00
< tr >
< td >
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
< / td >
< / tr >
{%- endif %}
{%- for overload in method.overloads %}
2018-02-08 15:00:53 +00:00
< tr >
< td >
{$ renderOverloadInfo(overload, cssClass + '-overload', method) $}
< / td >
< / tr >
2021-09-14 10:59:19 +00:00
{%- endfor -%}
{%- else %}
2018-02-08 15:00:53 +00:00
< tr >
< td >
< details class = "overloads" >
2018-07-18 18:34:59 +00:00
< summary >
2021-06-22 18:46:19 +00:00
< h4 class = "no-anchor" > {$ method.overloads.length $} overloads...< / h4 >
< span class = "actions" >
< span class = "action-expand" > Show All< / span >
< span class = "action-collapse" > Hide All< / span >
< i class = "material-icons expand" > expand_more< / i >
< / span >
2018-07-18 18:34:59 +00:00
< / summary >
2021-06-22 18:46:19 +00:00
< div class = "details-content" >
2021-09-14 10:59:19 +00:00
{%- if method.isAbstract %}
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
< hr class = "hr-margin fullwidth" >
{%- endif %}
{%- for overload in method.overloads %}
< h5 class = "no-anchor" > Overload #{$ loop.index $}< / h5 >
{$ renderOverloadInfo(overload, cssClass + '-overload', method) $}
{%- if not loop.last %}
< hr class = "hr-margin" > {% endif %}
{%- endfor %}
2018-02-08 15:00:53 +00:00
< / div >
< / details >
< / td >
< / tr >
2021-09-14 10:59:19 +00:00
{%- endif %}
2018-05-18 14:07:11 +00:00
2021-09-14 10:59:19 +00:00
{%- if method.description %}
2018-05-18 14:07:11 +00:00
< tr >
2018-03-04 20:57:42 +00:00
< td class = "description" >
2018-08-13 07:13:03 +00:00
{$ method.description | marked({ h3: 'h5' }) $}
2018-03-04 20:57:42 +00:00
< / td >
2018-05-18 14:07:11 +00:00
< / tr >
{%- endif %}
2021-09-14 10:59:19 +00:00
{%- if method.usageNotes %}
2018-05-18 14:07:11 +00:00
< tr >
< td class = "usage-notes" >
2018-08-13 07:13:03 +00:00
< h4 id = "{$ method.anchor $}-usage-notes" > Usage Notes< / h4 >
{$ method.usageNotes | marked({ h3: 'h5' }) $}
2018-05-18 14:07:11 +00:00
< / td >
< / tr >
{%- endif %}
2021-09-14 10:59:19 +00:00
< / tbody >
2018-02-08 15:00:53 +00:00
< / table >
2021-09-14 10:59:19 +00:00
{%- endmacro -%}
2017-06-29 21:23:27 +00:00
2018-05-23 21:56:05 +00:00
{%- macro renderMethodDetails(versionInfo, methods, containerClass, itemClass, headingText) -%}
2021-09-14 10:59:19 +00:00
{%- set nonInternalMethods = methods | filterByPropertyValue('internal', undefined) -%}
{%- if nonInternalMethods.length %}
2017-06-29 21:23:27 +00:00
< section class = "{$ containerClass $}" >
2018-02-08 15:00:53 +00:00
< h2 > {$ headingText $}< / h2 >
2021-09-14 10:59:19 +00:00
{%- for member in nonInternalMethods %}
{$ renderMethodDetail(versionInfo, member, itemClass) $}
{%- endfor %}
2017-06-29 21:23:27 +00:00
< / section >
2021-09-14 10:59:19 +00:00
{%- endif %}
2018-02-08 15:00:53 +00:00
{%- endmacro -%}
2018-09-20 11:57:34 +00:00
{%- macro renderProperties(properties, containerClass, propertyClass, headingText, headings, headingLevel = 2) -%}
2021-09-14 10:59:19 +00:00
{%- set nonInternalProperties = properties | filterByPropertyValue('internal', undefined) -%}
{%- if nonInternalProperties.length %}
2018-02-27 09:07:29 +00:00
< section class = "{$ containerClass $}" >
2018-09-20 11:57:34 +00:00
< h { $ headingLevel $ } > {$ headingText $}< /h{$ headingLevel $}>
2018-05-23 17:31:54 +00:00
< table class = "is-full-width list-table property-table" >
2018-02-27 09:07:29 +00:00
< thead >
2018-05-12 12:30:19 +00:00
< tr >
< th > {$ headings[0] or 'Property' $}< / th >
2018-09-26 12:31:52 +00:00
< th > {$ headings[1] or 'Description' $}< / th >
2018-05-12 12:30:19 +00:00
< / tr >
2018-02-27 09:07:29 +00:00
< / thead >
< tbody >
2021-09-14 10:59:19 +00:00
{%- for property in nonInternalProperties %}
2018-02-27 09:07:29 +00:00
< tr class = "{$ propertyClass $}" >
2018-09-19 20:25:30 +00:00
< td >
2018-09-21 13:06:57 +00:00
< a id = "{$ property.anchor $}" > < / a >
2019-11-27 16:22:50 +00:00
< code class = "{% if property.deprecated %} deprecated-api-item{% endif %}" > {$ renderMemberSyntax(property) $}< / code >
2018-09-19 20:25:30 +00:00
< / td >
2018-02-27 09:07:29 +00:00
< td >
2022-10-19 16:55:16 +00:00
{%- if property.developerPreview %}
< label class = "api-status-label dev-preview" title = "This API is in Developer Preview" >
< a href = "guide/releases#developer-preview" > developer preview< / a >
< / label >
{% endif %}
2023-09-08 18:52:03 +00:00
{%- if doc.experimental !== undefined %}
< label class = "api-status-label experimental" >
< a href = "guide/releases#experimental" > experimental< / a >
experimental
< / label >
{% endif %}
2023-05-14 09:10:38 +00:00
{%- if property.deprecated %}
< label class = "api-status-label deprecated" title = "This API is deprecated" > Deprecated< / label >
{% endif %}
2022-10-19 16:55:16 +00:00
2021-09-14 10:59:19 +00:00
{%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}
< span class = 'read-only-property' > Read-Only< / span > {% endif %}
{%- if property.isSetAccessor and not property.isGetAccessor %}
< span class = 'write-only-property' > Write-Only< / span > {% endif %}
{%- if property.constructorParamDoc %}
< span class = 'from-constructor' > Declared in Constructor< / span > {% endif %}
{%- if property.shortDescription %}
{$ property.shortDescription | marked | trim $}{% endif %}
2018-02-27 09:07:29 +00:00
{$ (property.description or property.constructorParamDoc.description) | marked $}
2021-09-14 10:59:19 +00:00
2021-09-24 10:45:58 +00:00
{%- if property.deprecated !== undefined %}
{$ ('**Deprecated** ' + property.deprecated) | marked | trim $}
{%- endif %}
2019-01-11 11:16:27 +00:00
{%- if property.see.length %}
< p > See also:< / p >
< ul >
2021-09-14 10:59:19 +00:00
{%- for see in property.see %}
2019-01-11 11:16:27 +00:00
< li > {$ see | marked $}< / li > {% endfor %}
< / ul >
2021-09-14 10:59:19 +00:00
{%- endif %}
< / td >
< / tr >
{%- endfor %}
2018-02-27 09:07:29 +00:00
< / tbody >
< / table >
< / section >
2018-02-08 15:00:53 +00:00
{%- endif -%}
{%- endmacro -%}
2018-09-21 13:06:57 +00:00
2021-09-14 10:59:19 +00:00
{%- macro renderDirectiveAncestors(doc, collectionName) -%}
{%- for ancestor in doc.extendsClauses %}{% if ancestor.doc -%}
{%- set nonInternalMembers = ancestor.doc[collectionName] | filterByPropertyValue('internal', undefined) -%}
{%- if nonInternalMembers.length %}
2018-09-21 13:06:57 +00:00
< section class = "inherited-members-list" >
2018-10-11 06:58:07 +00:00
< h3 > Inherited from < code > < a class = "code-anchor" href = "{$ ancestor.doc.path $}" > {$ ancestor.doc.name $}< / a > < / code > < / h3 >
2018-09-21 13:06:57 +00:00
< ul >
2021-09-14 10:59:19 +00:00
{%- for member in nonInternalMembers %}
2018-09-21 13:06:57 +00:00
< li >
2021-09-14 10:59:19 +00:00
< code > < a class = "code-anchor" href = "{$ ancestor.doc.path $}#{$ member.anchor | urlencode $}" > {$ renderMemberSyntax(member) $}< / a > < / code >
2018-09-21 13:06:57 +00:00
< / li >
2021-09-14 10:59:19 +00:00
{%- endfor %}
2018-09-21 13:06:57 +00:00
< / ul >
< / section >
2021-09-14 10:59:19 +00:00
{%- endif %}
2018-09-21 13:06:57 +00:00
{$ renderDirectiveAncestors(ancestor.doc, collectionName) $}
2021-09-14 10:59:19 +00:00
{%- endif %}{% endfor -%}
{%- endmacro -%}
2018-09-21 13:06:57 +00:00
2021-09-14 10:59:19 +00:00
{%- macro renderDirectiveProperties(doc, heading) -%}
2018-09-21 13:06:57 +00:00
{$ renderProperties(doc.properties, 'instance-properties', 'instance-property', heading) $}
{$ renderDirectiveAncestors(doc, 'properties') $}
2021-09-14 10:59:19 +00:00
{%- endmacro -%}