Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const scopedName: string = apiItem.getScopedNameWithinPackage();
// console.log(scopedName);
switch (apiItem.kind) {
case ApiItemKind.Class:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} class` }));
break;
case ApiItemKind.Enum:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} enum` }));
break;
case ApiItemKind.Interface:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} interface` }));
break;
case ApiItemKind.Method:
case ApiItemKind.MethodSignature:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} method` }));
break;
case ApiItemKind.Function:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} function` }));
break;
case ApiItemKind.Namespace:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} namespace` }));
break;
case ApiItemKind.Package:
const unscopedPackageName: string = PackageName.getUnscopedName(apiItem.displayName);
console.log(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` }));
switch (apiItem.kind) {
case ApiItemKind.Class:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} class` }));
break;
case ApiItemKind.Enum:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} enum` }));
break;
case ApiItemKind.Interface:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} interface` }));
break;
case ApiItemKind.Constructor:
case ApiItemKind.ConstructSignature:
output.appendNode(new DocHeading({ configuration, title: scopedName }));
break;
case ApiItemKind.Method:
case ApiItemKind.MethodSignature:
output.appendNode(new DocHeading({ configuration, title: `${scopedName} method` }));
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;
if (enumMember.initializerExcerpt.text.length > 0) {
yamlItem.numericValue = enumMember.initializerExcerpt.text;
}
break;
case ApiItemKind.Class:
yamlItem.type = 'class';
this._populateYamlClassOrInterface(yamlItem, apiItem as ApiClass);
break;
case ApiItemKind.Interface:
yamlItem.type = 'interface';
this._populateYamlClassOrInterface(yamlItem, apiItem as ApiInterface);
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) {
collectedData,
apiPropertySignature.excerptTokens,
apiPropertySignature.propertyTypeExcerpt.tokenRange
);
if (apiPropertySignature.tsdocComment) {
if (apiPropertySignature.tsdocComment.deprecatedBlock) {
tableRowJson.deprecated = true;
}
tableRowJson.description += renderDocNodeWithoutInlineTag(apiPropertySignature.tsdocComment.summarySection);
}
interfaceTableRowJson.push(tableRowJson);
break;
}
case ApiItemKind.MethodSignature: {
const apiMethodSignature: ApiMethodSignature = member as ApiMethodSignature;
const tableRowJson: ITableRowJson = {
name: apiMethodSignature.name,
typeTokens: [],
description: '',
deprecated: false
};
tableRowJson.typeTokens = getTokenHyperlinks(
collectedData,
apiMethodSignature.excerptTokens,
apiMethodSignature.excerpt.tokenRange
);
if (apiMethodSignature.tsdocComment) {
if (apiMethodSignature.tsdocComment.deprecatedBlock) {