feat(website): add support for function overloads (#8474)

Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
Suneet Tipirneni
2022-08-13 14:14:23 -04:00
committed by GitHub
parent 8e69efde04
commit fd4844ddb9
10 changed files with 114 additions and 39 deletions

View File

@@ -15,6 +15,7 @@ export class DocItem<T extends ApiDeclaredItem = ApiDeclaredItem> {
public readonly kind: string;
public readonly remarks: CommentNodeContainer | null;
public readonly summary: CommentNodeContainer | null;
public readonly containerKey: string;
public constructor(model: ApiModel, item: T) {
this.item = item;
@@ -30,6 +31,23 @@ export class DocItem<T extends ApiDeclaredItem = ApiDeclaredItem> {
this.summary = item.tsdocComment?.summarySection
? new CommentNodeContainer(item.tsdocComment.summarySection, model, item.parent)
: null;
this.containerKey = item.containerKey;
}
public get path() {
const path = [];
for (const item of this.item.getHierarchy()) {
switch (item.kind) {
case 'None':
case 'EntryPoint':
case 'Model':
break;
default:
path.push(resolveName(item));
}
}
return path;
}
public toJSON() {
@@ -41,6 +59,8 @@ export class DocItem<T extends ApiDeclaredItem = ApiDeclaredItem> {
excerptTokens: this.excerptTokens,
kind: this.kind,
remarks: this.remarks?.toJSON() ?? null,
path: this.path,
containerKey: this.containerKey,
};
}
}