Skip to content

Commit e813cac

Browse files
authored
Merge pull request microsoft#1057 from Microsoft/octogonz/ad-issue-1055
[api-documenter] Generate docs for function parameters and return types
2 parents f6b14dd + 0d68d8d commit e813cac

File tree

9 files changed

+139
-87
lines changed

9 files changed

+139
-87
lines changed

apps/api-documenter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@microsoft/api-extractor": "7.0.13",
1919
"@microsoft/node-core-library": "3.9.0",
2020
"@microsoft/ts-command-line": "4.2.3",
21-
"@microsoft/tsdoc": "0.12.4",
21+
"@microsoft/tsdoc": "0.12.5",
2222
"colors": "~1.2.1",
2323
"js-yaml": "~3.9.1"
2424
},

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,8 @@ export class MarkdownDocumenter {
184184
break;
185185
case ApiItemKind.Method:
186186
case ApiItemKind.MethodSignature:
187-
this._writeParameterTables(output, apiItem as ApiParameterListMixin);
188-
break;
189187
case ApiItemKind.Function:
188+
this._writeParameterTables(output, apiItem as ApiParameterListMixin);
190189
break;
191190
case ApiItemKind.Namespace:
192191
this._writePackageOrNamespaceTables(output, apiItem as ApiNamespace);

apps/api-extractor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"dependencies": {
3434
"@microsoft/node-core-library": "3.9.0",
3535
"@microsoft/ts-command-line": "4.2.3",
36-
"@microsoft/tsdoc": "0.12.4",
36+
"@microsoft/tsdoc": "0.12.5",
3737
"@types/node": "8.5.8",
3838
"@types/z-schema": "3.16.31",
3939
"colors": "~1.2.1",

build-tests/api-documenter-test/etc/markdown/api-documenter-test.globalfunction.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,14 @@ An exported function
99
```typescript
1010
export declare function globalFunction(x: number): number;
1111
```
12+
13+
## Parameters
14+
15+
| Parameter | Type | Description |
16+
| --- | --- | --- |
17+
| x | `number` | |
18+
19+
<b>Returns:</b>
20+
21+
`number`
22+

build-tests/api-documenter-test/etc/markdown/api-documenter-test.outernamespace.innernamespace.nestedfunction.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,14 @@ A function inside a namespace
99
```typescript
1010
function nestedFunction(x: number): number;
1111
```
12+
13+
## Parameters
14+
15+
| Parameter | Type | Description |
16+
| --- | --- | --- |
17+
| x | `number` | |
18+
19+
<b>Returns:</b>
20+
21+
`number`
22+
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": "Fix issue where docs were not generated for function parameters and return types (GitHub #1055)",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/api-documenter",
10+
"email": "octogonz@users.noreply.github.com"
11+
}
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": "Upgrade to TSDoc 0.12.5",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/api-documenter",
10+
"email": "octogonz@users.noreply.github.com"
11+
}
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-extractor",
5+
"comment": "Upgrade to TSDoc 0.12.5, which allows `$` in `@param` names",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor",
10+
"email": "octogonz@users.noreply.github.com"
11+
}

0 commit comments

Comments
 (0)