Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
break;
case ApiItemKind.Function:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} function` }));
break;
case ApiItemKind.Model:
output.appendNode(new DocHeading({ configuration, title: `API Reference` }));
break;
case ApiItemKind.Namespace:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} namespace` }));
break;
case ApiItemKind.Package:
console.log(`Writing ${apiItem.displayName} package`);
const unscopedPackageName: string = PackageName.getUnscopedName(apiItem.displayName);
output.appendNode(new DocHeading({ configuration, title: `${unscopedPackageName} package` }));
break;
case ApiItemKind.Property:
case ApiItemKind.PropertySignature:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} property` }));
break;
case ApiItemKind.TypeAlias:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} type` }));
break;
case ApiItemKind.Variable:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} variable` }));
break;
default:
throw new Error('Unsupported API item kind: ' + apiItem.kind);
}
if (ApiReleaseTagMixin.isBaseClassOf(apiItem)) {
if (apiItem.releaseTag === ReleaseTag.Beta) {
this._writeBetaWarning(output);
for (const apiMember of apiClass.members) {
switch (apiMember.kind) {
case ApiItemKind.Method: {
methodsTable.addRow(
new DocTableRow({ configuration }, [
this._createTitleCell(apiMember),
this._createModifiersCell(apiMember),
this._createDescriptionCell(apiMember),
]),
);
this._writeApiItemPage(apiMember);
break;
}
case ApiItemKind.Property: {
if ((apiMember as ApiPropertyItem).isEventProperty) {
eventsTable.addRow(
new DocTableRow({ configuration }, [
this._createTitleCell(apiMember),
this._createModifiersCell(apiMember),
this._createPropertyTypeCell(apiMember),
this._createDescriptionCell(apiMember),
]),
);
} else {
propertiesTable.addRow(
new DocTableRow({ configuration }, [
this._createTitleCell(apiMember),
this._createModifiersCell(apiMember),
this._createPropertyTypeCell(apiMember),
this._createDescriptionCell(apiMember),
if (classItem.tsdocComment) {
tableJson.description += renderDocNodeWithoutInlineTag(classItem.tsdocComment.summarySection);
}
if (classItem.extendsType) {
const tokenRange = classItem.extendsType.excerpt.tokenRange;
for (let i: number = tokenRange.startIndex; i < tokenRange.endIndex; ++i) {
const token: ExcerptToken = classItem.extendsType.excerpt.tokens[i];
tableJson.extendsTokens.push({ text: token.text });
}
}
for (const member of classItem.members) {
switch (member.kind) {
case ApiItemKind.Property: {
const apiProperty: ApiProperty = member as ApiProperty;
const tableRowJson: ITableRowJson = {
name: apiProperty.name,
typeTokens: [],
description: '',
deprecated: false,
kind: 'Property'
};
if (classItem.tsdocComment) {
const defaultValue =
getBlockTagByName('@defaultValue', classItem.tsdocComment) ||
getBlockTagByName('@defaultvalue', classItem.tsdocComment) ||
getBlockTagByName('@default', classItem.tsdocComment);
tableRowJson.defaultValue = defaultValue ? renderDefaultValue(defaultValue) : '';
break;
case ApiItemKind.Method:
case ApiItemKind.MethodSignature:
yamlItem.type = 'method';
this._populateYamlFunctionLike(yamlItem, apiItem as ApiMethod | ApiMethodSignature);
break;
case ApiItemKind.Constructor:
yamlItem.type = 'constructor';
this._populateYamlFunctionLike(yamlItem, apiItem as ApiConstructor);
break;
case ApiItemKind.Package:
yamlItem.type = 'package';
break;
case ApiItemKind.Property:
case ApiItemKind.PropertySignature:
const apiProperty: ApiPropertyItem = apiItem as ApiPropertyItem;
if (apiProperty.isEventProperty) {
yamlItem.type = 'event';
} else {
yamlItem.type = 'property';
}
this._populateYamlProperty(yamlItem, apiProperty);
break;
case ApiItemKind.Function:
yamlItem.type = 'function';
this._populateYamlFunctionLike(yamlItem, apiItem as ApiFunction);
break;
default: