UNPKG

8.87 kBTypeScriptView Raw
1import VSSInterfaces = require("../interfaces/common/VSSInterfaces");
2/**
3 * Comment on an artifact like Work Item or Wiki, etc.
4 */
5export interface Comment extends CommentResourceReference {
6 /**
7 * The id of the artifact this comment belongs to
8 */
9 artifactId?: string;
10 /**
11 * IdentityRef of the creator of the comment.
12 */
13 createdBy?: VSSInterfaces.IdentityRef;
14 /**
15 * The creation date of the comment.
16 */
17 createdDate?: Date;
18 /**
19 * The id assigned to the comment.
20 */
21 id?: number;
22 /**
23 * Indicates if the comment has been deleted.
24 */
25 isDeleted?: boolean;
26 /**
27 * The mentions of the comment.
28 */
29 mentions?: CommentMention[];
30 /**
31 * IdentityRef of the user who last modified the comment.
32 */
33 modifiedBy?: VSSInterfaces.IdentityRef;
34 /**
35 * The last modification date of the comment.
36 */
37 modifiedDate?: Date;
38 /**
39 * The comment id of the parent comment, if any
40 */
41 parentId?: number;
42 /**
43 * The reactions on the comment.
44 */
45 reactions?: CommentReaction[];
46 /**
47 * The rendered text of the comment
48 */
49 renderedText?: string;
50 /**
51 * Replies for this comment
52 */
53 replies?: CommentList;
54 /**
55 * Indicates the current state of the comment
56 */
57 state?: CommentState;
58 /**
59 * The plaintext/markdown version of the comment
60 */
61 text?: string;
62 /**
63 * The current version of the comment
64 */
65 version?: number;
66}
67/**
68 * Represents an attachment to a comment.
69 */
70export interface CommentAttachment extends CommentResourceReference {
71 /**
72 * IdentityRef of the creator of the attachment.
73 */
74 createdBy?: VSSInterfaces.IdentityRef;
75 /**
76 * The creation date of the attachment.
77 */
78 createdDate?: Date;
79 /**
80 * Unique Id of the attachment.
81 */
82 id?: string;
83}
84/**
85 * Represents a request to create a work item comment.
86 */
87export interface CommentCreateParameters {
88 /**
89 * Optional CommentId of the parent in order to add a reply for an existing comment
90 */
91 parentId?: number;
92 /**
93 * Text of the comment
94 */
95 text: string;
96}
97/**
98 * Specifies the additional data retrieval options for comments.
99 */
100export declare enum CommentExpandOptions {
101 /**
102 * Include comments only, no mentions, reactions or rendered text
103 */
104 None = 0,
105 /**
106 * Include comment reactions
107 */
108 Reactions = 1,
109 /**
110 * Include the rendered text (html) in addition to markdown text
111 */
112 RenderedText = 8,
113 /**
114 * If specified, then ONLY rendered text (html) will be returned, w/o markdown. Supposed to be used internally from data provides for optimization purposes.
115 */
116 RenderedTextOnly = 16,
117 /**
118 * If specified, then responses will be expanded in the results
119 */
120 Children = 32,
121 /**
122 * Expand everything including Reactions, Mentions and also include RenderedText (HTML) for markdown comments
123 */
124 All = -17
125}
126/**
127 * Format of the comment. Ex. Markdown, Html.
128 */
129export declare enum CommentFormat {
130 Markdown = 0,
131 Html = 1
132}
133/**
134 * Represents a list of comments.
135 */
136export interface CommentList extends CommentResourceReference {
137 /**
138 * List of comments in the current batch.
139 */
140 comments?: Comment[];
141 /**
142 * A string token that can be used to retrieving next page of comments if available. Otherwise null.
143 */
144 continuationToken?: string;
145 /**
146 * The count of comments in the current batch.
147 */
148 count?: number;
149 /**
150 * Uri to the next page of comments if it is available. Otherwise null.
151 */
152 nextPage?: string;
153 /**
154 * Total count of comments on a work item.
155 */
156 totalCount?: number;
157}
158/**
159 * Contains information about various artifacts mentioned in the comment
160 */
161export interface CommentMention extends CommentResourceReference {
162 /**
163 * Id of the artifact this mention belongs to
164 */
165 artifactId?: string;
166 /**
167 * Id of the comment associated with this mention. Nullable to support legacy mentions which can potentially have null commentId
168 */
169 commentId?: number;
170 /**
171 * Value of the mentioned artifact. Expected Value varies by CommentMentionType: Person: VSID associated with the identity Work Item: ID of the work item Pull Request: ID of the Pull Request
172 */
173 mentionedArtifact?: string;
174 /**
175 * The context which represent where this mentioned was parsed from
176 */
177 type?: CommentMentionType;
178}
179export declare enum CommentMentionType {
180 /**
181 * An identity was mentioned by using the format @{VSID}
182 */
183 Person = 0,
184 /**
185 * A work item was mentioned by using the format #{Work Item ID}
186 */
187 WorkItem = 1,
188 /**
189 * A Pull Request was mentioned by using the format !{PR Number}
190 */
191 PullRequest = 2
192}
193/**
194 * Contains information about comment reaction for a particular reaction type.
195 */
196export interface CommentReaction extends CommentResourceReference {
197 /**
198 * The id of the comment this reaction belongs to.
199 */
200 commentId?: number;
201 /**
202 * Total number of reactions for the CommentReactionType.
203 */
204 count?: number;
205 /**
206 * Flag to indicate if the current user has engaged on this particular EngagementType (e.g. if they liked the associated comment).
207 */
208 isCurrentUserEngaged?: boolean;
209 /**
210 * Type of the reaction.
211 */
212 type?: CommentReactionType;
213}
214/**
215 * Represents different reaction types for a comment
216 */
217export declare enum CommentReactionType {
218 Like = 0,
219 Dislike = 1,
220 Heart = 2,
221 Hooray = 3,
222 Smile = 4,
223 Confused = 5
224}
225/**
226 * Base class for comment resource references
227 */
228export interface CommentResourceReference {
229 /**
230 * REST URL for the resource.
231 */
232 url?: string;
233}
234export declare enum CommentSortOrder {
235 /**
236 * The results will be sorted in Ascending order.
237 */
238 Asc = 1,
239 /**
240 * The results will be sorted in Descending order.
241 */
242 Desc = 2
243}
244/**
245 * Represents the possible comment states.
246 */
247export declare enum CommentState {
248 Active = 0,
249 Resolved = 1,
250 Closed = 2
251}
252/**
253 * Represents a request to update a comment.
254 */
255export interface CommentUpdateParameters {
256 /**
257 * Set the current state of the comment
258 */
259 state?: CommentState;
260 /**
261 * The updated text of the comment
262 */
263 text: string;
264}
265/**
266 * Represents a specific version of a comment on a work item.
267 */
268export interface CommentVersion extends CommentResourceReference {
269 /**
270 * IdentityRef of the creator of the comment.
271 */
272 createdBy?: VSSInterfaces.IdentityRef;
273 /**
274 * The creation date of the comment.
275 */
276 createdDate?: Date;
277 /**
278 * The id assigned to the comment.
279 */
280 id?: number;
281 /**
282 * Indicates if the comment has been deleted at this version.
283 */
284 isDeleted?: boolean;
285 /**
286 * IdentityRef of the user who modified the comment at this version.
287 */
288 modifiedBy?: VSSInterfaces.IdentityRef;
289 /**
290 * The modification date of the comment for this version.
291 */
292 modifiedDate?: Date;
293 /**
294 * The rendered content of the comment at this version.
295 */
296 renderedText?: string;
297 /**
298 * Indicates the current state of the comment
299 */
300 state?: CommentState;
301 /**
302 * The text of the comment at this version.
303 */
304 text?: string;
305 /**
306 * The version number.
307 */
308 version?: number;
309}
310export declare var TypeInfo: {
311 Comment: any;
312 CommentAttachment: any;
313 CommentExpandOptions: {
314 enumValues: {
315 none: number;
316 reactions: number;
317 renderedText: number;
318 renderedTextOnly: number;
319 children: number;
320 all: number;
321 };
322 };
323 CommentFormat: {
324 enumValues: {
325 markdown: number;
326 html: number;
327 };
328 };
329 CommentList: any;
330 CommentMention: any;
331 CommentMentionType: {
332 enumValues: {
333 person: number;
334 workItem: number;
335 pullRequest: number;
336 };
337 };
338 CommentReaction: any;
339 CommentReactionType: {
340 enumValues: {
341 like: number;
342 dislike: number;
343 heart: number;
344 hooray: number;
345 smile: number;
346 confused: number;
347 };
348 };
349 CommentSortOrder: {
350 enumValues: {
351 asc: number;
352 desc: number;
353 };
354 };
355 CommentState: {
356 enumValues: {
357 active: number;
358 resolved: number;
359 closed: number;
360 };
361 };
362 CommentUpdateParameters: any;
363 CommentVersion: any;
364};