@pageproof/sdk-pr 383.0.1638410948188 → 383.0.1638412977466

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -164,6 +164,21 @@ declare class Comments extends API {
164
164
  * @returns {Promise<Array<Comment>>}
165
165
  */
166
166
  load(_options: any): Promise<Comment[]>;
167
+ /**
168
+ * @typedef {object} CreateCommentOptions The options for creating a new comment
169
+ * @property {string} [raw] The comment text (plain text)
170
+ * @property {object} [tokens] The comment tokens (rich text)
171
+ * @property {string} [proofId] The proof ID the comment should be attached to
172
+ * @property {number} [pageNumber=1] For comments (not replies) - the page number the comment was placed on
173
+ * @property {Pin} [pin] For comments (not replies) - the comment's pin coordinates (deprecated: provide an array of pins instead)
174
+ * @property {Pin[]} [pins] For comments (not replies) - the comment's pin(s) coordinates
175
+ * @property {number} [mediaTime] For audio/video proofs - the time (in seconds) that the pin was placed (deprecated: set the time within the pin object)
176
+ * @property {number} [mediaDuration] For audio/video proofs - the duration (in seconds) that the pin spans (deprecated: set the duration within the pin object)
177
+ * @property {string} [parentCommentId] For replies - the parent comment ID
178
+ * @property {object} [metadata] For web proofs - additional metadata relating to the comment snapshot. It is recommended that you do not provide metadata through the SDK currently, as the format for the metadata is not documented (and is subject to change).
179
+ * @property {string} [state] For comments (not replies) - The state of the comment (currently only supports to-dos)
180
+ * @property {string} [creationToken] Only required if you're retrying (token can be extracted from the error object which is resolved (rejected, in this case) from the Promise)
181
+ */
167
182
  /**
168
183
  * Creates a new comment (or reply).
169
184
  *
@@ -217,71 +232,57 @@ declare class Comments extends API {
217
232
  * }
218
233
  *
219
234
  * @since v2.0.0-beta.46
220
- * @param {{ raw?: string, tokens?: object, proofId: string, pageNumber?: number, pin?: { x: number, y: number, x2: number | null, y2: number | null, time: number | null, duration: number | null, fill: { type: string, image: string } | null }, pins?: { x: number, y: number, x2: number | null, y2: number | null, time: number | null, duration: number | null, fill: ({ type: string, image: string } | null) }[], mediaTime?: number, mediaDuration?: number, parentCommentId?: string, metadata?: object, state?: string, creationToken?: string }} comment The comment options
221
- * @param {string} [comment.raw] The raw comment text (rich text is not supported)
222
- * @param {object} [comment.tokens] The comment tokens (with rich-text support). If you are creating legacy-style comments (just plain text) then use the "raw" option. Please note that while PageProof will continue to support plain text comments for the foreseeable future, it's recommended that you use the new "tokenized" comments.
223
- * @param {string} comment.proofId The proof id the comment should be attached to
224
- * @param {number} [comment.pageNumber=1] For comments (not replies) - the page number the comment should be attached to
225
- * @param {object} [comment.pin] For comments (not replies) - the comment's pin coordinates (deprecated: provide an array of pins instead)
226
- * @param {number} [comment.pin.x] The pin's x coordinate
227
- * @param {number} [comment.pin.y] The pin's y coordinate
228
- * @param {number} [comment.pin.x2] For boxes or lines - the pin's x2 coordinate
229
- * @param {number} [comment.pin.y2] For boxes or lines - the pin's y2 coordinate
230
- * @param {string} [comment.pin.fill.image] For pin fill images - the pin's fill image if pin is different then a dot or box type (like draw or text)
231
- * @param {string} [comment.pin.fill.type] For pin fill images - the pin's fill image type
232
- * @param {number} [comment.pin.time] For video & audio - the start time
233
- * @param {number} [comment.pin.duration] For video & audio - the duration
234
- * @param {object[]} [comment.pins] For comments (not replies) - the comment's pin(s) coordinates
235
- * @param {number} [comment.pin[].x] The pin's x coordinate
236
- * @param {number} [comment.pin[].y] The pin's y coordinate
237
- * @param {number} [comment.pin[].x2] For boxes or lines - the pin's x2 coordinate
238
- * @param {number} [comment.pin[].y2] For boxes or lines - the pin's y2 coordinate
239
- * @param {string} [comment.pin[].fill.image] For pin fill images - the pin's fill image if pin is different then a dot or box type (like draw or text)
240
- * @param {string} [comment.pin[].fill.type] For pin fill images - the pin's fill image type
241
- * @param {number} [comment.pin[].time] For video & audio - the start time
242
- * @param {number} [comment.pin[].duration] For video & audio - the duration
243
- * @param {number} [comment.mediaTime] For video & audio - the start time (deprecated: set the time within the pin object)
244
- * @param {number} [comment.mediaDuration] For video & audio - the duration (deprecated: set the duration within the pin object)
245
- * @param {string} [comment.parentCommentId] For replies - the parent comment id
246
- * @param {object} [comment.metadata] For web proofs - additional metadata relating to the comment snapshot. It is recommended that you do not provide metadata through the SDK currently, as the format for the metadata is not documented (and is subject to change).
247
- * @param {CommentState} [comment.state] For comments (not replies) - The state of the comment (currently only supports to-dos)
248
- * @param {string} [comment.creationToken] Only required if you're retrying (token can be extracted from the error object which is resolved (rejected, in this case) from the Promise)
235
+ * @param {CreateCommentOptions} options The creation options
249
236
  * @returns {Promise<Comment>}
250
237
  */
251
238
  create({ raw, tokens, proofId, pageNumber, pin, pins, mediaTime, mediaDuration, parentCommentId, metadata, state, creationToken: retryCreationToken, }: {
239
+ /**
240
+ * The comment text (plain text)
241
+ */
252
242
  raw?: string;
243
+ /**
244
+ * The comment tokens (rich text)
245
+ */
253
246
  tokens?: any;
254
- proofId: string;
247
+ /**
248
+ * The proof ID the comment should be attached to
249
+ */
250
+ proofId?: string;
251
+ /**
252
+ * For comments (not replies) - the page number the comment was placed on
253
+ */
255
254
  pageNumber?: number;
256
- pin?: {
257
- x: number;
258
- y: number;
259
- x2: number;
260
- y2: number;
261
- time: number;
262
- duration: number;
263
- fill: {
264
- type: string;
265
- image: string;
266
- };
267
- };
268
- pins?: {
269
- x: number;
270
- y: number;
271
- x2: number;
272
- y2: number;
273
- time: number;
274
- duration: number;
275
- fill: {
276
- type: string;
277
- image: string;
278
- };
279
- }[];
255
+ /**
256
+ * For comments (not replies) - the comment's pin coordinates (deprecated: provide an array of pins instead)
257
+ */
258
+ pin?: Pin;
259
+ /**
260
+ * For comments (not replies) - the comment's pin(s) coordinates
261
+ */
262
+ pins?: Pin[];
263
+ /**
264
+ * For audio/video proofs - the time (in seconds) that the pin was placed (deprecated: set the time within the pin object)
265
+ */
280
266
  mediaTime?: number;
267
+ /**
268
+ * For audio/video proofs - the duration (in seconds) that the pin spans (deprecated: set the duration within the pin object)
269
+ */
281
270
  mediaDuration?: number;
271
+ /**
272
+ * For replies - the parent comment ID
273
+ */
282
274
  parentCommentId?: string;
275
+ /**
276
+ * For web proofs - additional metadata relating to the comment snapshot. It is recommended that you do not provide metadata through the SDK currently, as the format for the metadata is not documented (and is subject to change).
277
+ */
283
278
  metadata?: any;
279
+ /**
280
+ * For comments (not replies) - The state of the comment (currently only supports to-dos)
281
+ */
284
282
  state?: string;
283
+ /**
284
+ * Only required if you're retrying (token can be extracted from the error object which is resolved (rejected, in this case) from the Promise)
285
+ */
285
286
  creationToken?: string;
286
287
  }): Promise<Comment>;
287
288
  }