Skip to content

Commit 20f6e13

Browse files
authored
Merge pull request microsoft#837 from Microsoft/pgonzal/ae-default-tag
[api-extractor] Add support for "@DefaultValue"
2 parents 90437aa + 26e37b4 commit 20f6e13

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

apps/api-extractor/src/aedoc/ApiDocumentation.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export class ApiDocumentation {
4848
'@alpha',
4949
'@beta',
5050
'@betadocumentation',
51+
'@defaultvalue',
5152
'@eventproperty',
5253
'@internal',
5354
'@internalremarks',
@@ -340,6 +341,12 @@ export class ApiDocumentation {
340341
tokenizer.getToken();
341342
this.isOverride = true;
342343
break;
344+
case '@defaultvalue':
345+
// Accept this for now, but don't process it.
346+
// We'll implement it fully when the TSDoc engine is merged.
347+
tokenizer.getToken();
348+
DocElementParser.parse(this, tokenizer);
349+
break;
343350
default:
344351
tokenizer.getToken();
345352
this._reportBadAedocTag(token);

build-tests/api-extractor-test-05/src/DocClass1.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class SystemEvent {
1616
*
1717
* @remarks
1818
* These are some remarks.
19+
* @defaultvalue a default value for this function
1920
* @public
2021
*/
2122
export class DocClass1 {
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": "Allow doc comments to use TSDoc's \"@defaultvalue\" tag (but the value is not yet passed to the documentation pipeline)",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor",
10+
"email": "pgonzal@users.noreply.github.com"
11+
}

0 commit comments

Comments
 (0)