@@ -5,6 +5,8 @@ import { DocBlock } from './DocBlock';
5
5
import { DocInheritDocTag } from './DocInheritDocTag' ;
6
6
import { StringBuilder } from '../emitters/StringBuilder' ;
7
7
import { DocParamCollection } from './DocParamCollection' ;
8
+ import { IModifierTagSetParameters } from '../details/ModifierTagSet' ;
9
+ import { StandardTags } from '../details/StandardTags' ;
8
10
9
11
/**
10
12
* Constructor parameters for {@link DocComment}.
@@ -87,6 +89,7 @@ export class DocComment extends DocNode {
87
89
*/
88
90
public readonly modifierTagSet : StandardModifierTagSet ;
89
91
92
+ private _seeBlocks : DocBlock [ ] ;
90
93
private _customBlocks : DocBlock [ ] ;
91
94
92
95
/**
@@ -105,6 +108,7 @@ export class DocComment extends DocNode {
105
108
this . returnsBlock = undefined ;
106
109
this . modifierTagSet = new StandardModifierTagSet ( { configuration : this . configuration } ) ;
107
110
111
+ this . _seeBlocks = [ ] ;
108
112
this . _customBlocks = [ ] ;
109
113
}
110
114
@@ -113,13 +117,30 @@ export class DocComment extends DocNode {
113
117
return DocNodeKind . Comment ;
114
118
}
115
119
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
+
116
127
/**
117
128
* The collection of all DocBlock nodes belonging to this doc comment.
118
129
*/
119
130
public get customBlocks ( ) : ReadonlyArray < DocBlock > {
120
131
return this . _customBlocks ;
121
132
}
122
133
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
+
123
144
/**
124
145
* Append an item to the customBlocks collection.
125
146
*/
@@ -138,6 +159,7 @@ export class DocComment extends DocNode {
138
159
this . typeParams . count > 0 ? this . typeParams : undefined ,
139
160
this . returnsBlock ,
140
161
...this . customBlocks ,
162
+ ...this . seeBlocks ,
141
163
this . inheritDocTag ,
142
164
...this . modifierTagSet . nodes
143
165
] ;
@@ -165,5 +187,4 @@ export class DocComment extends DocNode {
165
187
}
166
188
167
189
// Circular reference
168
- import { TSDocEmitter } from '../emitters/TSDocEmitter' ; import { IModifierTagSetParameters } from '../details/ModifierTagSet' ;
169
-
190
+ import { TSDocEmitter } from '../emitters/TSDocEmitter' ;
0 commit comments