@@ -5,6 +5,8 @@ import { DocBlock } from './DocBlock';
55import { DocInheritDocTag } from './DocInheritDocTag' ;
66import { StringBuilder } from '../emitters/StringBuilder' ;
77import { DocParamCollection } from './DocParamCollection' ;
8+ import { IModifierTagSetParameters } from '../details/ModifierTagSet' ;
9+ import { StandardTags } from '../details/StandardTags' ;
810
911/**
1012 * Constructor parameters for {@link DocComment}.
@@ -87,6 +89,7 @@ export class DocComment extends DocNode {
8789 */
8890 public readonly modifierTagSet : StandardModifierTagSet ;
8991
92+ private _seeBlocks : DocBlock [ ] ;
9093 private _customBlocks : DocBlock [ ] ;
9194
9295 /**
@@ -105,6 +108,7 @@ export class DocComment extends DocNode {
105108 this . returnsBlock = undefined ;
106109 this . modifierTagSet = new StandardModifierTagSet ( { configuration : this . configuration } ) ;
107110
111+ this . _seeBlocks = [ ] ;
108112 this . _customBlocks = [ ] ;
109113 }
110114
@@ -113,13 +117,30 @@ export class DocComment extends DocNode {
113117 return DocNodeKind . Comment ;
114118 }
115119
120+ /**
121+ * The collection of all `@see` DocBlockTag nodes belonging to this doc comment.
122+ */
123+ public get seeBlocks ( ) : ReadonlyArray < DocBlock > {
124+ return this . _seeBlocks ;
125+ }
126+
116127 /**
117128 * The collection of all DocBlock nodes belonging to this doc comment.
118129 */
119130 public get customBlocks ( ) : ReadonlyArray < DocBlock > {
120131 return this . _customBlocks ;
121132 }
122133
134+ /**
135+ * Append an item to the seeBlocks collection.
136+ */
137+ public appendSeeBlock ( block : DocBlock ) : void {
138+ if ( ! StandardTags . see . isDefinitionOfTag ( block . blockTag ) ) {
139+ throw new Error ( "Provided block is not a @see block." ) ;
140+ }
141+ this . _seeBlocks . push ( block ) ;
142+ }
143+
123144 /**
124145 * Append an item to the customBlocks collection.
125146 */
@@ -138,6 +159,7 @@ export class DocComment extends DocNode {
138159 this . typeParams . count > 0 ? this . typeParams : undefined ,
139160 this . returnsBlock ,
140161 ...this . customBlocks ,
162+ ...this . seeBlocks ,
141163 this . inheritDocTag ,
142164 ...this . modifierTagSet . nodes
143165 ] ;
@@ -165,5 +187,4 @@ export class DocComment extends DocNode {
165187}
166188
167189// Circular reference
168- import { TSDocEmitter } from '../emitters/TSDocEmitter' ; import { IModifierTagSetParameters } from '../details/ModifierTagSet' ;
169-
190+ import { TSDocEmitter } from '../emitters/TSDocEmitter' ;
0 commit comments