easemob-websdk 4.10.0 → 4.11.0

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.
@@ -97,6 +97,10 @@ export interface AudioMsgBody extends AudioMsgSetParameters {
97
97
  deliverOnlineOnly?: boolean;
98
98
  /** The list of message recipients. */
99
99
  receiverList?: string[];
100
+ /** Has the message been read (only single chat messages have this field). */
101
+ isRead?: boolean;
102
+ /** Has the message been delivered (only single chat messages have this field). */
103
+ isDelivered?: boolean;
100
104
  }
101
105
  export interface CreateAudioMsgParameters {
102
106
  /** The message type. */
package/message/cmd.d.ts CHANGED
@@ -82,6 +82,10 @@ export interface CmdMsgBody {
82
82
  deliverOnlineOnly?: boolean;
83
83
  /** The list of message recipients. */
84
84
  receiverList?: string[];
85
+ /** Has the message been read (only single chat messages have this field). */
86
+ isRead?: boolean;
87
+ /** Has the message been delivered (only single chat messages have this field). */
88
+ isDelivered?: boolean;
85
89
  }
86
90
  export interface CreateCmdMsgParameters {
87
91
  /** The message type. */
@@ -8,153 +8,111 @@ import {
8
8
  } from '../types/message';
9
9
  export interface CombineParameters {
10
10
  /** The message type. */
11
- /** 消息类型。 */
12
11
  type: 'combine';
13
12
  /** The message ID. */
14
- /** 消息 ID。*/
15
13
  id: string;
16
14
  }
17
15
  export interface CombineMsgBody {
18
16
  /** The message ID. */
19
- /** 消息 ID。*/
20
17
  id: string;
21
18
  /** The conversation type. */
22
- /** 会话类型。 */
23
19
  chatType: ChatType;
24
20
  /** The message type. */
25
- /** 消息类型。 */
26
21
  type: 'combine';
27
22
  /** The recipient. */
28
- /** 消息接收方。 */
29
23
  to: string;
30
24
  /** The sender, which can only be the current user and can not be changed.*/
31
- /** 消息发送方,只能是当前用户,无法修改。*/
32
25
  from?: string;
33
26
  /** @deprecated Whether the conversation type is chat room. */
34
- /** @deprecated 会话类型是否是聊天室。 */
35
27
  roomType?: boolean;
36
28
  /** @deprecated Whether the conversation type is group. */
37
- /** @deprecated 会话类型是否是群组。 */
38
29
  group?: string;
39
30
  /** Message extension. */
40
- /** 消息扩展。 */
41
31
  ext?: {
42
32
  [key: string]: any;
43
33
  };
44
34
  /** Whether read receipts are required during a group conversation. */
45
- /** 群组会话时是否需返回已读回执。*/
46
35
  msgConfig?: {
47
36
  allowGroupAck?: boolean;
48
37
  languages?: string[];
49
38
  };
50
39
  /** Time. */
51
- /** 时间。 */
52
40
  time: number;
53
41
  /** Whether the message is a threaded message. */
54
- /** 消息是否为子区消息 */
55
42
  isChatThread?: boolean;
56
43
  /** The message priority. */
57
- /** 消息优先级 */
58
44
  priority?: MessagePriority;
59
45
  /** Whether global notify message or not. */
60
- /** 判断是否是全局广播消息。 */
61
46
  broadcast?: boolean;
62
47
  /** Whether the message content is replaced. This property is valid only when `useReplacedMessageContent` is set to `true` during initialization. */
63
- /** 消息内容是否已被替换。该属性仅在初始化时开启 `useReplacedMessageContent` 后有效。*/
64
48
  isContentReplaced?: boolean;
65
49
  /** Whether the message is delivered only when the recipient(s) is/are online:
66
50
  * - `true`: The message is delivered only when the recipient(s) is/are online. If the recipient is offline, the message is discarded.
67
51
  * - (Default) `false`: The message is delivered when the recipient(s) is/are online. If the recipient(s) is/are offline, the message will not be delivered to them until they get online.
68
52
  */
69
- /** 消息是否只投递给在线用户:
70
- * - `true`: 只有消息接收方在线时才能投递成功。若接收方离线,则消息会被丢弃。
71
- * - (默认)`false`: 如果用户在线,则直接投递;如果用户离线,消息会在用户上线时投递。
72
- */
73
53
  deliverOnlineOnly?: boolean;
74
54
  /** The list of message recipients. */
75
- /** 消息接收方列表。 */
76
55
  receiverList?: string[];
77
56
  /** The compatibility information for combining message. */
78
- /** 合并消息的兼容信息。 */
79
57
  compatibleText: string;
80
58
  /** The title of the combined message. */
81
- /** 合并消息的标题。 */
82
59
  title: string;
83
60
  /** The summary list of the combined message. */
84
- /** 合并消息的摘要列表。 */
85
61
  summary: string;
86
62
  /** The message list of the combined message. */
87
- /** 合并消息列表。 */
88
63
  messageList: MessagesType[];
89
64
  /** The callback of a file upload error. */
90
- /** 文件上传错误的回调。 */
91
65
  onFileUploadError?: (error: any) => void;
92
66
  /** The callback of file upload completion. */
93
- /** 文件上传完成的回调。 */
94
67
  onFileUploadComplete?: (data: { url: string; secret: string }) => void;
68
+ /** Has the message been read (only single chat messages have this field). */
69
+ isRead?: boolean;
70
+ /** Has the message been delivered (only single chat messages have this field). */
71
+ isDelivered?: boolean;
95
72
  }
96
73
  export interface CreateCombineMsgParameters {
97
74
  /** The conversation type. */
98
- /** 会话类型。 */
99
75
  chatType: ChatType;
100
76
  /** The message type. */
101
- /** 消息类型。 */
102
77
  type: 'combine';
103
78
  /** The recipient. */
104
- /** 消息接收方。 */
105
79
  to: string;
106
80
  /** The sender, which can only be the current user and can not be changed. */
107
- /** 消息发送方,只能是当前用户,无法修改。*/
108
81
  from?: string;
109
82
  /** The message extension. */
110
- /** 消息扩展。 */
111
83
  ext?: {
112
84
  [key: string]: any;
113
85
  };
114
86
  /** Whether read receipts are required during a group conversation. */
115
- /** 群组会话时是否需返回已读回执。*/
116
87
  msgConfig?: {
117
88
  allowGroupAck?: boolean;
118
89
  languages?: string[];
119
90
  };
120
91
  /** Whether the message is a threaded message. */
121
- /** 消息是否为子区消息。 */
122
92
  isChatThread?: boolean;
123
93
  /** Message priority. */
124
- /** 消息优先级 */
125
94
  priority?: MessagePriority;
126
95
  /** Whether the message is delivered only when the recipient(s) is/are online:
127
96
  * - `true`: The message is delivered only when the recipient(s) is/are online. If the recipient is offline, the message is discarded.
128
97
  * - (Default) `false`: The message is delivered when the recipient(s) is/are online. If the recipient(s) is/are offline, the message will not be delivered to them until they get online.
129
98
  */
130
- /** 消息是否只投递给在线用户:
131
- * - `true`: 只有消息接收方在线时才能投递成功。若接收方离线,则消息会被丢弃。
132
- * - (默认)`false`: 如果用户在线,则直接投递;如果用户离线,消息会在用户上线时投递。
133
- */
134
99
  deliverOnlineOnly?: boolean;
135
100
  /** The list of message recipients. */
136
- /** 消息接收方列表。 */
137
101
  receiverList?: string[];
138
102
  /** The compatible text of the combined message. */
139
- /** 合并消息的兼容信息。 */
140
103
  compatibleText: string;
141
104
  /** The title of the combined message. */
142
- /** 合并消息的标题。 */
143
105
  title: string;
144
106
  /** The summary list of the combined message. */
145
- /** 合并消息摘要列表。 */
146
107
  summary: string;
147
108
  /** The message list of the combined message. */
148
- /** 合并消息的消息列表。 */
149
109
  messageList: Exclude<
150
110
  MessagesType,
151
111
  DeliveryMsgBody | ReadMsgBody | ChannelMsgBody
152
112
  >[];
153
113
  /** The callback of a file upload error. */
154
- /** 文件上传错误的回调。 */
155
114
  onFileUploadError?: (error: any) => void;
156
115
  /** The callback of file upload completion. */
157
- /** 文件上传完成的回调。 */
158
116
  onFileUploadComplete?: (data: { url: string; secret: string }) => void;
159
117
  }
160
118
  export declare class Combine {
@@ -70,6 +70,10 @@ export interface CustomMsgBody extends CreateCustomMsgParameters {
70
70
  deliverOnlineOnly?: boolean;
71
71
  /** Message modified info. */
72
72
  modifiedInfo?: ModifiedMsgInfo;
73
+ /** Has the message been read (only single chat messages have this field). */
74
+ isRead?: boolean;
75
+ /** Has the message been delivered (only single chat messages have this field). */
76
+ isDelivered?: boolean;
73
77
  }
74
78
  export interface CreateCustomMsgParameters {
75
79
  /** The message type. */
package/message/file.d.ts CHANGED
@@ -92,6 +92,10 @@ export interface FileMsgBody extends CreateFileMsgParameters {
92
92
  * - (Default) `false`: The message is delivered when the recipient(s) is/are online. If the recipient(s) is/are offline, the message will not be delivered to them until they get online.
93
93
  */
94
94
  deliverOnlineOnly?: boolean;
95
+ /** Has the message been read (only single chat messages have this field). */
96
+ isRead?: boolean;
97
+ /** Has the message been delivered (only single chat messages have this field). */
98
+ isDelivered?: boolean;
95
99
  }
96
100
  export interface CreateFileMsgParameters {
97
101
  /** The message type. */
package/message/img.d.ts CHANGED
@@ -105,6 +105,10 @@ export interface ImgMsgBody extends CreateImgMsgParameters {
105
105
  * - (Default) `false`: The message is delivered when the recipient(s) is/are online. If the recipient(s) is/are offline, the message will not be delivered to them until they get online.
106
106
  */
107
107
  deliverOnlineOnly?: boolean;
108
+ /** Has the message been read (only single chat messages have this field). */
109
+ isRead?: boolean;
110
+ /** Has the message been delivered (only single chat messages have this field). */
111
+ isDelivered?: boolean;
108
112
  }
109
113
  export interface CreateImgMsgParameters {
110
114
  /** The message type. */
@@ -64,6 +64,7 @@ import {
64
64
  FileMsgSetParameters,
65
65
  FileParameters,
66
66
  } from './file';
67
+ import { DownloadParams } from '../types/utils';
67
68
  export type MessageType =
68
69
  | 'read'
69
70
  | 'delivery'
@@ -144,18 +145,17 @@ declare class Message {
144
145
  /** @hidden */
145
146
  static createOldMsg(options: NewMessageParamters): any;
146
147
  /** Creates a message. */
147
- /** 创建消息。*/
148
148
  static create(options: CreateMsgType): MessageBody;
149
149
  /** When sending attachment messages, use this method to obtain the file path. */
150
150
  static getFileUrl: (fileInputId: string | HTMLInputElement) => FileObj;
151
+ /** Download file. */
152
+ static download: (params: DownloadParams) => void;
153
+ /** Convert the downloaded object into an object URL. */
154
+ static parseDownloadResponse: (res: any) => string;
151
155
  /**
152
156
  * @hidden
153
157
  * Set the message body.
154
158
  */
155
- /**
156
- * @hidden
157
- * 设置消息体。
158
- */
159
159
  set(options: MessageSetParameters): void;
160
160
  }
161
161
  export { Message };
@@ -68,6 +68,10 @@ export interface LocationMsgBody extends CreateLocationMsgParameters {
68
68
  * - (Default) `false`: The message is delivered when the recipient(s) is/are online. If the recipient(s) is/are offline, the message will not be delivered to them until they get online.
69
69
  */
70
70
  deliverOnlineOnly?: boolean;
71
+ /** Has the message been read (only single chat messages have this field). */
72
+ isRead?: boolean;
73
+ /** Has the message been delivered (only single chat messages have this field). */
74
+ isDelivered?: boolean;
71
75
  }
72
76
  export interface CreateLocationMsgParameters {
73
77
  /** The message type. */
package/message/text.d.ts CHANGED
@@ -86,6 +86,10 @@ export interface TextMsgBody {
86
86
  receiverList?: string[];
87
87
  /** Message modified info. */
88
88
  modifiedInfo?: ModifiedMsgInfo;
89
+ /** Has the message been read (only single chat messages have this field). */
90
+ isRead?: boolean;
91
+ /** Has the message been delivered (only single chat messages have this field). */
92
+ isDelivered?: boolean;
89
93
  }
90
94
  export interface CreateTextMsgParameters {
91
95
  /** The session type. */
@@ -95,6 +95,10 @@ export interface VideoMsgBody extends VideoMsgSetParameters {
95
95
  deliverOnlineOnly?: boolean;
96
96
  /** The list of message recipients. */
97
97
  receiverList?: string[];
98
+ /** Has the message been read (only single chat messages have this field). */
99
+ isRead?: boolean;
100
+ /** Has the message been delivered (only single chat messages have this field). */
101
+ isDelivered?: boolean;
98
102
  }
99
103
  export interface CreateVideoMsgParameters {
100
104
  /** The message type. */