Skip to content

Commit e376a8d

Browse files
committed
Add support for TypeScript constructors
1 parent 4637b27 commit e376a8d

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎apps/api-documenter/src/documenters/MarkdownDocumenter.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ export class MarkdownDocumenter {
9898
case ApiItemKind.Interface:
9999
output.appendNode(new DocHeading({ configuration, title: `${scopedName} interface` }));
100100
break;
101+
case ApiItemKind.Constructor:
102+
case ApiItemKind.ConstructSignature:
103+
output.appendNode(new DocHeading({ configuration, title: `${scopedName} constructor` }));
104+
break;
101105
case ApiItemKind.Method:
102106
case ApiItemKind.MethodSignature:
103107
output.appendNode(new DocHeading({ configuration, title: `${scopedName} method` }));
@@ -182,6 +186,8 @@ export class MarkdownDocumenter {
182186
case ApiItemKind.Interface:
183187
this._writeInterfaceTables(output, apiItem as ApiInterface);
184188
break;
189+
case ApiItemKind.Constructor:
190+
case ApiItemKind.ConstructSignature:
185191
case ApiItemKind.Method:
186192
case ApiItemKind.MethodSignature:
187193
case ApiItemKind.Function:
@@ -387,6 +393,7 @@ export class MarkdownDocumenter {
387393
for (const apiMember of apiClass.members) {
388394

389395
switch (apiMember.kind) {
396+
case ApiItemKind.Constructor:
390397
case ApiItemKind.Method: {
391398
methodsTable.addRow(
392399
new DocTableRow({ configuration }, [
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/api-documenter",
5+
"comment": "allow constructor tsdocs to be generated",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/api-documenter",
10+
"email": "enjoyjava@gmail.com"
11+
}

0 commit comments

Comments
 (0)