Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _writeBetaWarning(output: DocSection): void {
const configuration: TSDocConfiguration = this._tsdocConfiguration;
const betaWarning: string =
'This API is provided as a preview for developers and may change' +
' based on feedback that we receive. Do not use this API in a production environment.';
output.appendNode(
new DocNoteBox({ configuration }, [
new DocParagraph({ configuration }, [new DocPlainText({ configuration, text: betaWarning })]),
]),
);
}
]),
]),
new DocTableCell({ configuration }, parameterDescription.nodes),
]),
);
}
if (parametersTable.rows.length > 0) {
output.appendNode(new DocHeading({ configuration: this._tsdocConfiguration, title: 'Parameters' }));
output.appendNode(parametersTable);
}
if (ApiReturnTypeMixin.isBaseClassOf(apiParameterListMixin)) {
const returnTypeExcerpt: Excerpt = apiParameterListMixin.returnTypeExcerpt;
output.appendNode(
new DocParagraph({ configuration }, [
new DocEmphasisSpan({ configuration, bold: true }, [
new DocPlainText({ configuration, text: 'Returns:' }),
]),
]),
);
output.appendNode(
new DocParagraph({ configuration }, [
new DocCodeSpan({ configuration, code: returnTypeExcerpt.text.trim() || '(not declared)' }),
]),
);
if (apiParameterListMixin instanceof ApiDocumentedItem) {
if (apiParameterListMixin.tsdocComment && apiParameterListMixin.tsdocComment.returnsBlock) {
this._appendSection(output, apiParameterListMixin.tsdocComment.returnsBlock.content);
}
if (!classMetadata.tsdocComment) {
classMetadata.tsdocComment = new tsdoc.DocComment({ configuration });
}
if (classMetadata.tsdocComment.remarksBlock === undefined) {
classMetadata.tsdocComment.remarksBlock = new tsdoc.DocBlock({
configuration,
blockTag: new tsdoc.DocBlockTag({
configuration,
tagName: tsdoc.StandardTags.remarks.tagName
})
});
}
classMetadata.tsdocComment.remarksBlock.content.appendNode(
new tsdoc.DocParagraph({ configuration }, [
new tsdoc.DocPlainText({
configuration,
text: `The constructor for this class is marked as internal. Third-party code should not`
+ ` call the constructor directly or create subclasses that extend the `
}),
new tsdoc.DocCodeSpan({
configuration,
code: classDeclaration.astSymbol.localName
}),
new tsdoc.DocPlainText({ configuration, text: ' class.' })
])
);
}
return;
}
private _createTitleCell(apiItem: ApiItem): DocTableCell {
const configuration: TSDocConfiguration = this._tsdocConfiguration;
return new DocTableCell({ configuration }, [
new DocParagraph({ configuration }, [
new DocLinkTag({
configuration,
tagName: '@link',
linkText: Utilities.getConciseSignature(apiItem),
urlDestination: this._getLinkFilenameForApiItem(apiItem),
}),
]),
]);
}
private _createTitleCell(apiItem: ApiItem): DocTableCell {
const configuration: TSDocConfiguration = this._tsdocConfiguration;
return new DocTableCell({ configuration }, [
new DocParagraph({ configuration }, [
new DocLinkTag({
configuration,
tagName: '@link',
linkText: Utilities.getConciseSignature(apiItem),
urlDestination: this._getLinkFilenameForApiItem(apiItem)
})
])
]);
}
for (const apiParameter of apiParameterListMixin.parameters) {
const parameterDescription: DocSection = new DocSection({ configuration });
if (apiParameter.tsdocParamBlock) {
this._appendSection(parameterDescription, apiParameter.tsdocParamBlock.content);
}
parametersTable.addRow(
new DocTableRow({ configuration }, [
new DocTableCell({ configuration }, [
new DocParagraph({ configuration }, [
new DocPlainText({ configuration, text: apiParameter.name }),
]),
]),
new DocTableCell({ configuration }, [
new DocParagraph({ configuration }, [
new DocCodeSpan({ configuration, code: apiParameter.parameterTypeExcerpt.text }),
]),
]),
new DocTableCell({ configuration }, parameterDescription.nodes),
]),
);
}
if (parametersTable.rows.length > 0) {
output.appendNode(new DocHeading({ configuration: this._tsdocConfiguration, title: 'Parameters' }));
output.appendNode(parametersTable);
}
if (ApiReturnTypeMixin.isBaseClassOf(apiParameterListMixin)) {
const returnTypeExcerpt: Excerpt = apiParameterListMixin.returnTypeExcerpt;
output.appendNode(
if (ApiReleaseTagMixin.isBaseClassOf(apiItem)) {
if (apiItem.releaseTag === ReleaseTag.Beta) {
this._writeBetaWarning(output);
}
}
if (apiItem instanceof ApiDocumentedItem) {
const tsdocComment: DocComment | undefined = apiItem.tsdocComment;
if (tsdocComment) {
if (tsdocComment.deprecatedBlock) {
output.appendNode(
new DocNoteBox({ configuration: this._tsdocConfiguration },
[
new DocParagraph({ configuration: this._tsdocConfiguration }, [
new DocPlainText({
configuration: this._tsdocConfiguration,
text: 'Warning: This API is now obsolete. '
})
]),
...tsdocComment.deprecatedBlock.content.nodes
]
)
);
}
this._appendSection(output, tsdocComment.summarySection);
}
}
if (apiItem instanceof ApiDeclaredItem) {
})
]),
...tsdocComment.deprecatedBlock.content.nodes
]
)
);
}
this._appendSection(output, tsdocComment.summarySection);
}
}
if (apiItem instanceof ApiDeclaredItem) {
if (apiItem.excerpt.text.length > 0) {
output.appendNode(
new DocParagraph({ configuration }, [
new DocEmphasisSpan({ configuration, bold: true}, [
new DocPlainText({ configuration, text: 'Signature:' })
])
])
);
output.appendNode(
new DocFencedCode({ configuration, code: apiItem.getExcerptWithModifiers(), language: 'typescript' })
);
}
}
let appendRemarks: boolean = true;
switch (apiItem.kind) {
case ApiItemKind.Class:
case ApiItemKind.Interface:
case ApiItemKind.Namespace:
for (const apiParameter of apiParameterListMixin.parameters) {
const parameterDescription: DocSection = new DocSection({ configuration } );
if (apiParameter.tsdocParamBlock) {
this._appendSection(parameterDescription, apiParameter.tsdocParamBlock.content);
}
parametersTable.addRow(
new DocTableRow({ configuration }, [
new DocTableCell({configuration}, [
new DocParagraph({ configuration }, [
new DocPlainText({ configuration, text: apiParameter.name })
])
]),
new DocTableCell({configuration}, [
new DocParagraph({ configuration }, [
new DocCodeSpan({ configuration, code: apiParameter.parameterTypeExcerpt.text })
])
]),
new DocTableCell({configuration}, parameterDescription.nodes)
])
);
}
if (parametersTable.rows.length > 0) {
output.appendNode(new DocHeading({ configuration: this._tsdocConfiguration, title: 'Parameters' }));
output.appendNode(parametersTable);
}
if (ApiReturnTypeMixin.isBaseClassOf(apiParameterListMixin)) {
const returnTypeExcerpt: Excerpt = apiParameterListMixin.returnTypeExcerpt;
output.appendNode(