Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _initApiItemsByTypeNameRecursive(apiItem: ApiItem, ambiguousNames: Set): void {
switch (apiItem.kind) {
case ApiItemKind.Class:
case ApiItemKind.Enum:
case ApiItemKind.Interface:
// Attempt to register both the fully qualified name and the short name
const namesForType: string[] = [apiItem.displayName];
// Note that nameWithDot cannot conflict with apiItem.name (because apiItem.name
// cannot contain a dot)
const nameWithDot: string | undefined = this._getTypeNameWithDot(apiItem);
if (nameWithDot) {
namesForType.push(nameWithDot);
}
// Register all names
for (const typeName of namesForType) {
if (ambiguousNames.has(typeName)) {
break;
}
function collectPageData(collectedData: CollectedData, apiItem: ApiItem, kind: PageKind): void {
if (apiItem instanceof ApiDocumentedItem) {
switch (apiItem.kind) {
case ApiItemKind.Interface:
case ApiItemKind.Enum:
case ApiItemKind.Class:
case ApiItemKind.TypeAlias: {
console.log('Analyzing ' + apiItem.displayName);
if (apiItem.tsdocComment !== undefined) {
const docCategoryTag: DocInlineTag | undefined = findInlineTagByName('@docCategory', apiItem.tsdocComment);
if (docCategoryTag !== undefined) {
const pageName: string = docCategoryTag.tagContent.trim();
let pageData: PageData | undefined = collectedData.pageDataByPageName.get(pageName);
if (pageData === undefined) {
collectedData.pageDataByPageName.set(pageName, new PageData(pageName, 'References'));
pageData = collectedData.pageDataByPageName.get(pageName);
collectedData.apiToPage.set(apiItem.displayName, { pageName, kind: 'References' });
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:
case ApiItemKind.Package:
this._writeRemarksSection(output, apiItem);
appendRemarks = false;
break;
}
switch (apiItem.kind) {
case ApiItemKind.Class:
this._writeClassTables(output, apiItem as ApiClass);
break;
case ApiItemKind.Enum:
this._writeEnumTables(output, apiItem as ApiEnum);
break;
case ApiItemKind.Interface:
this._writeInterfaceTables(output, apiItem as ApiInterface);
this._createTitleCell(apiMember),
this._createDescriptionCell(apiMember),
]);
switch (apiMember.kind) {
case ApiItemKind.Class:
classesTable.addRow(row);
this._writeApiItemPage(apiMember);
break;
case ApiItemKind.Enum:
enumerationsTable.addRow(row);
this._writeApiItemPage(apiMember);
break;
case ApiItemKind.Interface:
interfacesTable.addRow(row);
this._writeApiItemPage(apiMember);
break;
case ApiItemKind.Namespace:
namespacesTable.addRow(row);
this._writeApiItemPage(apiMember);
break;
case ApiItemKind.Function:
functionsTable.addRow(row);
this._writeApiItemPage(apiMember);
break;
case ApiItemKind.TypeAlias:
typeAliasesTable.addRow(row);