/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/dgeni/templates/method.template.html
85 строк
3 KB
Ruslan Lekhman
docs: improve properties and methods template (#32071)
02 янв 2026, 11:12
Не верифицирован
02 янв 2026, 11:12
869d4f8
Код
Авторство
О чём код?
{% import "macros.html" as macros %} <div class="docs-api-method-card"> <table class="docs-api-method-table"> <thead> <tr class="docs-api-method-name-row"> <th colspan="2" class="docs-api-method-name-cell"> {%- if method.isDeprecated -%} <div class="docs-api-deprecated-marker" {$ macros.deprecationTitle(method) $}> Deprecated </div> {%- endif -%} {%- if method.isStatic -%} <div class="docs-api-modifier-method-marker"> static </div> {%- endif -%} {%- if method.isAsync -%} <div class="docs-api-modifier-method-marker"> async </div> {%- endif -%} {$ method.name $} ({%- for param in method.params -%} <span class="docs-api-method-parameter-name">{$ param.name $}{% if param.isOptional %}<span class="docs-api-method-parameter-optional-marker">?</span>{% endif %}: </span> <code class="docs-api-method-parameter-type">{$ param.type $}</code>{% if not loop.last %}, {% endif %} {%- endfor -%} ): <code class="docs-api-method-returns-type">{$ method.type $}</code> </th> </tr> </thead> {%- if method.description -%} <tr class="docs-api-method-description-row"> <td colspan="2" class="docs-api-method-description-cell"> {$ method.description | marked | safe $} </td> </tr> {%- endif -%} {%- if method.params.length -%} <thead> <tr class="docs-api-method-parameters-header-row"> <th colspan="2" class="docs-api-method-parameters-header-cell">Parameters</th> </tr> </thead> {% for parameter in method.params %} <tr class="docs-api-method-parameter-row"> <td class="docs-api-method-parameter-cell"> <p class="docs-api-method-parameter-name"> {$ parameter.name $} {%- if parameter.isOptional -%} <span class="docs-api-method-parameter-optional-marker">?</span> {%- endif -%} </p> <code class="docs-api-method-parameter-type">{$ parameter.type $}</code> </td> <td class="docs-api-method-parameter-description-cell"> <p class="docs-api-method-parameter-description"> {$ parameter.description | marked | safe $} </p> </td> </tr> {% endfor %} {%- endif -%} {%- if method.type and method.type !== "void" -%} <thead> <tr class="docs-api-method-returns-header-row"> <th colspan="2" class="docs-api-method-returns-header-cell">Returns</th> </tr> </thead> <tr> <td class="docs-api-method-returns-type-cell"> <code class="docs-api-method-returns-type">{$ method.type $}</code> </td> <td class="docs-api-method-returns-description-cell"> <p class="docs-api-method-returns-description"> {$ method.returns.description | marked | safe $} </p> </td> </tr> {%- endif -%} </table> </div>