easemob-websdk 4.1.1 → 4.1.2

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.
@@ -287,19 +287,16 @@ export interface Contact {
287
287
  * getReactionDetail({messageId: 'messageId', reaction: 'reaction', cursor: '', pageSize: 20})
288
288
  * ```
289
289
  */
290
- getReactionDetail(
291
- this: Connection,
292
- params: {
293
- /** The message ID. */
294
- messageId: string;
295
- /** The reactions to retrieve. */
296
- reaction: string;
297
- /** The cursor that specifies where to start to get data. If there will be data on the next page, this method will return the value of this field to indicate the position to start to get data of the next page. If it is null, the data of the first page will be retrieved.*/
298
- cursor?: string;
299
- /** The number of reactions per page. The default value is 20, and the maximum value is 100. */
300
- pageSize?: number;
301
- }
302
- ): Promise<AsyncResult<ReactonTypes.GetReactionDetailResult>>;
290
+ getReactionDetail(params: {
291
+ /** The message ID. */
292
+ messageId: string;
293
+ /** The reactions to retrieve. */
294
+ reaction: string;
295
+ /** The cursor that specifies where to start to get data. If there will be data on the next page, this method will return the value of this field to indicate the position to start to get data of the next page. If it is null, the data of the first page will be retrieved.*/
296
+ cursor?: string;
297
+ /** The number of reactions per page. The default value is 20, and the maximum value is 100. */
298
+ pageSize?: number;
299
+ }): Promise<AsyncResult<ReactonTypes.GetReactionDetailResult>>;
303
300
 
304
301
  /**
305
302
  * Reports a message.
@@ -308,15 +305,36 @@ export interface Contact {
308
305
  * reportMessage()
309
306
  * ```
310
307
  */
311
- reportMessage(
312
- this: Connection,
313
- params: {
314
- /** The type of report. */
315
- reportType: string;
316
- /** The reason for reporting. */
317
- reportReason: string;
318
- /** ID of the message to be reported. */
319
- messageId: string;
320
- }
321
- ): Promise<void>;
308
+ reportMessage(params: {
309
+ /** The type of report. */
310
+ reportType: string;
311
+ /** The reason for reporting. */
312
+ reportReason: string;
313
+ /** ID of the message to be reported. */
314
+ messageId: string;
315
+ }): Promise<void>;
316
+
317
+ /**
318
+ * Delete roaming messages.
319
+ *
320
+ * ```typescript
321
+ * connection.removeHistoryMessages({targetId: 'userId', chatType: 'singleChat', beforeTimeStamp: Date.now()})
322
+ *
323
+ * connection.removeHistoryMessages({targetId: 'userId', chatType: 'singleChat', messageIds: ['messageId']})
324
+ * ```
325
+ */
326
+ removeHistoryMessages(options: {
327
+ /** The ID of the peer user or group ID. */
328
+ targetId: string;
329
+ /**
330
+ * The conversation type:
331
+ * - `singleChat`: one-to-one chat;
332
+ * - `groupChat`: group chat.
333
+ */
334
+ chatType: 'singleChat' | 'groupChat';
335
+ /** The ID list of messages to be deleted. A maximum of 20 message IDs can be passed. */
336
+ messageIds?: Array<string>;
337
+ /** The starting timestamp for message deletion. Messages with the timestamp before the specified one will be deleted. */
338
+ beforeTimeStamp?: number;
339
+ }): Promise<void>;
322
340
  }