docs: mark deprecated methods (#12199)

This commit is contained in:
Alex Rudenko
2024-04-04 09:17:26 +02:00
committed by GitHub
parent d345055af3
commit 89eb9e633b
10 changed files with 140 additions and 24 deletions

View File

@@ -1266,6 +1266,20 @@ export class MarkdownDocumenter {
section,
apiItem.tsdocComment.summarySection
);
if (apiItem.tsdocComment.deprecatedBlock) {
section.appendNode(
new DocParagraph({configuration}, [
new DocEmphasisSpan({configuration, bold: true}, [
new DocPlainText({configuration, text: 'Deprecated: '}),
]),
])
);
section.appendNodes(
apiItem.tsdocComment.deprecatedBlock.content.getChildNodes()
);
}
}
}
@@ -1295,46 +1309,45 @@ export class MarkdownDocumenter {
const section: DocSection = new DocSection({configuration});
const codes = [];
if (ApiProtectedMixin.isBaseClassOf(apiItem)) {
if (apiItem.isProtected) {
section.appendNode(
new DocParagraph({configuration}, [
new DocCodeSpan({configuration, code: 'protected'}),
])
);
codes.push('protected');
}
}
if (ApiReadonlyMixin.isBaseClassOf(apiItem)) {
if (apiItem.isReadonly) {
section.appendNode(
new DocParagraph({configuration}, [
new DocCodeSpan({configuration, code: 'readonly'}),
])
);
codes.push('readonly');
}
}
if (ApiStaticMixin.isBaseClassOf(apiItem)) {
if (apiItem.isStatic) {
section.appendNode(
new DocParagraph({configuration}, [
new DocCodeSpan({configuration, code: 'static'}),
])
);
codes.push('static');
}
}
if (ApiOptionalMixin.isBaseClassOf(apiItem)) {
if (apiItem.isOptional) {
section.appendNode(
new DocParagraph({configuration}, [
new DocCodeSpan({configuration, code: 'optional'}),
])
);
codes.push('optional');
}
}
if (apiItem instanceof ApiDocumentedItem) {
if (apiItem.tsdocComment?.deprecatedBlock) {
codes.push('deprecated');
}
}
if (codes.length) {
section.appendNode(
new DocParagraph({configuration}, [
new DocCodeSpan({configuration, code: codes.join(', ')}),
])
);
}
return new DocTableCell({configuration}, section.nodes);
}