node-nim 10.5.2 → 10.6.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.
- package/dist/nim/msglog.js +8 -0
- package/dist/nim/msglog.js.map +1 -1
- package/dist/v2/v2_nim_ai_service.js.map +1 -1
- package/dist/v2/v2_nim_chatroom_client.js +153 -40
- package/dist/v2/v2_nim_chatroom_client.js.map +1 -1
- package/dist/v2/v2_nim_chatroom_queue_service.js +148 -0
- package/dist/v2/v2_nim_chatroom_queue_service.js.map +1 -0
- package/dist/v2/v2_nim_chatroom_service.js +201 -65
- package/dist/v2/v2_nim_chatroom_service.js.map +1 -1
- package/dist/v2/v2_nim_client.js +116 -25
- package/dist/v2/v2_nim_client.js.map +1 -1
- package/dist/v2/v2_nim_conversation_group_service.js +57 -9
- package/dist/v2/v2_nim_conversation_group_service.js.map +1 -1
- package/dist/v2/v2_nim_conversation_service.js +149 -27
- package/dist/v2/v2_nim_conversation_service.js.map +1 -1
- package/dist/v2/v2_nim_friend_service.js +152 -36
- package/dist/v2/v2_nim_friend_service.js.map +1 -1
- package/dist/v2/v2_nim_login_service.js +66 -14
- package/dist/v2/v2_nim_login_service.js.map +1 -1
- package/dist/v2/v2_nim_message_service.js +335 -93
- package/dist/v2/v2_nim_message_service.js.map +1 -1
- package/dist/v2/v2_nim_notification_service.js +11 -4
- package/dist/v2/v2_nim_notification_service.js.map +1 -1
- package/dist/v2/v2_nim_passthrough_service.js +39 -0
- package/dist/v2/v2_nim_passthrough_service.js.map +1 -0
- package/dist/v2/v2_nim_setting_service.js +81 -29
- package/dist/v2/v2_nim_setting_service.js.map +1 -1
- package/dist/v2/v2_nim_signalling_service.js +172 -44
- package/dist/v2/v2_nim_signalling_service.js.map +1 -1
- package/dist/v2/v2_nim_storage_service.js +116 -37
- package/dist/v2/v2_nim_storage_service.js.map +1 -1
- package/dist/v2/v2_nim_subscription_service.js +42 -12
- package/dist/v2/v2_nim_subscription_service.js.map +1 -1
- package/dist/v2/v2_nim_team_service.js +349 -140
- package/dist/v2/v2_nim_team_service.js.map +1 -1
- package/dist/v2/v2_nim_user_service.js +62 -19
- package/dist/v2/v2_nim_user_service.js.map +1 -1
- package/dist/v2/v2_nim_utilities.js +306 -129
- package/dist/v2/v2_nim_utilities.js.map +1 -1
- package/dist/v2_def/v2_nim_enum_def.js +14 -3
- package/dist/v2_def/v2_nim_enum_def.js.map +1 -1
- package/dist/v2_def/v2_nim_struct_def.js +0 -2
- package/dist/v2_def/v2_nim_struct_def.js.map +1 -1
- package/package.json +1 -1
- package/types/nim/msglog.d.ts +7 -1
- package/types/nim_def/msglog_def.d.ts +2 -0
- package/types/v2/v2_nim_ai_service.d.ts +3 -3
- package/types/v2/v2_nim_chatroom_client.d.ts +153 -42
- package/types/v2/v2_nim_chatroom_queue_service.d.ts +96 -0
- package/types/v2/v2_nim_chatroom_service.d.ts +203 -67
- package/types/v2/v2_nim_client.d.ts +117 -30
- package/types/v2/v2_nim_conversation_group_service.d.ts +59 -11
- package/types/v2/v2_nim_conversation_service.d.ts +151 -29
- package/types/v2/v2_nim_friend_service.d.ts +139 -39
- package/types/v2/v2_nim_login_service.d.ts +70 -15
- package/types/v2/v2_nim_message_service.d.ts +337 -95
- package/types/v2/v2_nim_notification_service.d.ts +13 -6
- package/types/v2/v2_nim_passthrough_service.d.ts +25 -0
- package/types/v2/v2_nim_setting_service.d.ts +83 -31
- package/types/v2/v2_nim_signalling_service.d.ts +174 -46
- package/types/v2/v2_nim_storage_service.d.ts +119 -40
- package/types/v2/v2_nim_subscription_service.d.ts +44 -14
- package/types/v2/v2_nim_team_service.d.ts +335 -142
- package/types/v2/v2_nim_user_service.d.ts +64 -21
- package/types/v2/v2_nim_utilities.d.ts +306 -129
- package/types/v2_def/v2_nim_enum_def.d.ts +10 -0
- package/types/v2_def/v2_nim_struct_def.d.ts +48 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
2
|
import { V2NIMChatroomMessage, V2NIMChatroomMember, V2NIMChatroomInfo, V2NIMSendChatroomMessageParams, V2NIMSendChatroomMessageResult, V2NIMChatroomMemberQueryOption, V2NIMChatroomMemberListResult, V2NIMChatroomMessageListOption, V2NIMChatroomMemberRoleUpdateParams, V2NIMChatroomUpdateParams, V2NIMAntispamConfig, V2NIMChatroomSelfMemberUpdateParams, V2NIMChatroomTagTempChatBannedParams, V2NIMChatroomTagMemberOption, V2NIMChatroomLocationConfig, V2NIMChatroomTagsUpdateParams, V2NIMChatroomTagMessageOption } from 'ts/v2_def/v2_nim_struct_def';
|
|
3
3
|
import { V2NIMChatroomMemberRole } from 'ts/v2_def/v2_nim_enum_def';
|
|
4
|
-
export declare interface
|
|
4
|
+
export declare interface V2NIMChatroomListener {
|
|
5
5
|
/** 收到新消息 */
|
|
6
6
|
receiveMessages: [V2NIMChatroomMessage[]];
|
|
7
7
|
/** 聊天室成员进入 */
|
|
@@ -28,90 +28,226 @@ export declare interface V2NIMChatroomServiceEvents {
|
|
|
28
28
|
sendMessage: [V2NIMChatroomMessage];
|
|
29
29
|
}
|
|
30
30
|
/** @brief 聊天室服务 */
|
|
31
|
-
export declare class V2NIMChatroomService extends EventEmitter<
|
|
31
|
+
export declare class V2NIMChatroomService extends EventEmitter<V2NIMChatroomListener> {
|
|
32
32
|
instance: any;
|
|
33
33
|
constructor(instanceId: number);
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @brief 发送消息
|
|
36
|
+
* @param message 需要发送的消息体
|
|
37
|
+
* @param params 发送消息相关配置参数
|
|
38
|
+
* @returns void
|
|
39
|
+
* @example
|
|
40
|
+
* ```javascript
|
|
41
|
+
* const message = V2NIMChatroomMessageCreator.createTextMessage('Hello NTES IM')
|
|
42
|
+
* await chatroomService.sendMessage(message, {})
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
38
45
|
sendMessage(message: V2NIMChatroomMessage, params: V2NIMSendChatroomMessageParams): Promise<V2NIMSendChatroomMessageResult>;
|
|
39
|
-
/**
|
|
40
|
-
|
|
46
|
+
/**
|
|
47
|
+
* @brief 取消上传消息附件
|
|
48
|
+
* @param message 要取消上传的文件消息
|
|
49
|
+
* @returns void
|
|
50
|
+
* @example
|
|
51
|
+
* ```javascript
|
|
52
|
+
* await chatroomService.cancelMessageAttachmentUpload(message)
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
41
55
|
cancelMessageAttachmentUpload(message: V2NIMChatroomMessage): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @brief 查询聊天室成员列表
|
|
58
|
+
* @param queryOption 查询选项
|
|
59
|
+
* @returns V2NIMChatroomMemberListResult
|
|
60
|
+
* @example
|
|
61
|
+
* ```javascript
|
|
62
|
+
* const result = await chatroomService.getMemberListByOption({
|
|
63
|
+
* limit: 10
|
|
64
|
+
* })
|
|
65
|
+
* console.log(result)
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
45
68
|
getMemberListByOption(queryOption: V2NIMChatroomMemberQueryOption): Promise<V2NIMChatroomMemberListResult>;
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
69
|
+
/**
|
|
70
|
+
* @brief 查询聊天室消息列表
|
|
71
|
+
* @param option 查询选项
|
|
72
|
+
* @returns Array<V2NIMChatroomMessage>
|
|
73
|
+
* @example
|
|
74
|
+
* ```javascript
|
|
75
|
+
* const result = await chatroomService.getMessageList({
|
|
76
|
+
* limit: 10
|
|
77
|
+
* })
|
|
78
|
+
* console.log(result)
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
49
81
|
getMessageList(option: V2NIMChatroomMessageListOption): Promise<Array<V2NIMChatroomMessage>>;
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
82
|
+
/**
|
|
83
|
+
* @brief 更新聊天室成员角色
|
|
84
|
+
* @param accountId 聊天室成员 id
|
|
85
|
+
* @param upadateParams 更新参数
|
|
86
|
+
* @returns void
|
|
87
|
+
* @example
|
|
88
|
+
* ```javascript
|
|
89
|
+
* await chatroomService.updateMemberRole('accountId', {
|
|
90
|
+
* memberRole: 2
|
|
91
|
+
* })
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
54
94
|
updateMemberRole(accountId: string, upadateParams: V2NIMChatroomMemberRoleUpdateParams): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
95
|
+
/**
|
|
96
|
+
* @brief 设置聊天室成员黑名单状态
|
|
97
|
+
* @param accountId 聊天室成员 id
|
|
98
|
+
* @param blocked 黑名单状态
|
|
99
|
+
* @param notificationExtension 通知扩展字段
|
|
100
|
+
* @returns void
|
|
101
|
+
* @example
|
|
102
|
+
* ```javascript
|
|
103
|
+
* await chatroomService.setMemberBlockedStatus('accountId', true, 'your notification extension')
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
60
106
|
setMemberBlockedStatus(accountId: string, blocked: boolean, notificationExtension: string): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
107
|
+
/**
|
|
108
|
+
* @brief 设置聊天室成员禁言状态
|
|
109
|
+
* @param accountId 聊天室成员 id
|
|
110
|
+
* @param chatBanned 禁言状态
|
|
111
|
+
* @param notificationExtension 通知扩展字段
|
|
112
|
+
* @returns void
|
|
113
|
+
* @example
|
|
114
|
+
* ```javascript
|
|
115
|
+
* await chatroomService.setMemberChatBannedStatus('accountId', true, 'your notification extension')
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
66
118
|
setMemberChatBannedStatus(accountId: string, chatBanned: boolean, notificationExtension: string): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
119
|
+
/**
|
|
120
|
+
* @brief 设置聊天室成员临时禁言状态
|
|
121
|
+
* @param accountId 聊天室成员 id
|
|
122
|
+
* @param tempChatBannedDuration 临时禁言时长, 单位秒, 0 表示取消临时禁言
|
|
123
|
+
* @param notificationEnabled 是否发送通知
|
|
124
|
+
* @param notificationExtension 通知扩展字段
|
|
125
|
+
* @returns void
|
|
126
|
+
* @example
|
|
127
|
+
* ```javascript
|
|
128
|
+
* await chatroomService.setMemberTempChatBanned('accountId', 10, true, 'your notification extension')
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
73
131
|
setMemberTempChatBanned(accountId: string, tempChatBannedDuration: number, notificationEnabled: boolean, notificationExtension: string): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
132
|
+
/**
|
|
133
|
+
* @brief 更新聊天室信息
|
|
134
|
+
* @param updateParams 更新参数
|
|
135
|
+
* @param antispamConfig 反垃圾配置
|
|
136
|
+
* @returns void
|
|
137
|
+
* @example
|
|
138
|
+
* ```javascript
|
|
139
|
+
* await chatroomService.updateChatroomInfo({
|
|
140
|
+
* roomName: 'new room name'
|
|
141
|
+
* }, {})
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
78
144
|
updateChatroomInfo(updateParams: V2NIMChatroomUpdateParams, antispamConfig: V2NIMAntispamConfig): Promise<void>;
|
|
79
|
-
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
145
|
+
/**
|
|
146
|
+
* @brief 更新自己在聊天室的成员信息
|
|
147
|
+
* @param updateParams 更新参数
|
|
148
|
+
* @param antispamConfig 反垃圾配置
|
|
149
|
+
* @returns void
|
|
150
|
+
* @example
|
|
151
|
+
* ```javascript
|
|
152
|
+
* await chatroomService.updateSelfMemberInfo({
|
|
153
|
+
* roomNick: 'new room nickname'
|
|
154
|
+
* }, {})
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
83
157
|
updateSelfMemberInfo(updateParams: V2NIMChatroomSelfMemberUpdateParams, antispamConfig: V2NIMAntispamConfig): Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
|
|
158
|
+
/**
|
|
159
|
+
* @param accountIds 账号列表
|
|
160
|
+
* @returns Array<V2NIMChatroomMember>
|
|
161
|
+
* @example
|
|
162
|
+
* ```javascript
|
|
163
|
+
* const result = await chatroomService.getMemberByIds(['accountId1', 'accountId2'])
|
|
164
|
+
* console.log(result)
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
87
167
|
getMemberByIds(accountIds: Array<string>): Promise<Array<V2NIMChatroomMember>>;
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
168
|
+
/**
|
|
169
|
+
* @brief 踢出聊天室成员
|
|
170
|
+
* @param accountId 聊天室成员 id
|
|
171
|
+
* @param notificationExtension 通知扩展字段
|
|
172
|
+
* @returns void
|
|
173
|
+
* @example
|
|
174
|
+
* ```javascript
|
|
175
|
+
* await chatroomService.kickMember('accountId', 'your notification extension')
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
92
178
|
kickMember(accountId: string, notificationExtension: string): Promise<void>;
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
|
|
179
|
+
/**
|
|
180
|
+
* @brief 按聊天室标签临时禁言
|
|
181
|
+
* @param params 设置标签禁言的参数
|
|
182
|
+
* @returns void
|
|
183
|
+
* @example
|
|
184
|
+
* ```javascript
|
|
185
|
+
* await chatroomService.setTempChatBannedByTag({
|
|
186
|
+
* targetTag: 'tag',
|
|
187
|
+
* duration: 10
|
|
188
|
+
* })
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
96
191
|
setTempChatBannedByTag(params: V2NIMChatroomTagTempChatBannedParams): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
|
|
99
|
-
|
|
192
|
+
/**
|
|
193
|
+
* @brief 根据标签查询成员列表
|
|
194
|
+
* @param option 查询成员列表的参数
|
|
195
|
+
* @returns V2NIMChatroomMemberListResult
|
|
196
|
+
* @example
|
|
197
|
+
* ```javascript
|
|
198
|
+
* const result = await chatroomService.getMemberListByTag({
|
|
199
|
+
* tag: 'tag',
|
|
200
|
+
* limit: 10
|
|
201
|
+
* })
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
100
204
|
getMemberListByTag(option: V2NIMChatroomTagMemberOption): Promise<V2NIMChatroomMemberListResult>;
|
|
101
|
-
/**
|
|
102
|
-
|
|
103
|
-
|
|
205
|
+
/**
|
|
206
|
+
* @brief 查询某个标签下的成员人数
|
|
207
|
+
* @param tag 标签
|
|
208
|
+
* @returns number
|
|
209
|
+
* @example
|
|
210
|
+
* ```javascript
|
|
211
|
+
* const count = await chatroomService.getMemberCountByTag('tag')
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
104
214
|
getMemberCountByTag(tag: string): Promise<number>;
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
|
|
215
|
+
/**
|
|
216
|
+
* @brief 更新坐标信息
|
|
217
|
+
* @param locationConfig 坐标信息
|
|
218
|
+
* @returns void
|
|
219
|
+
* @example
|
|
220
|
+
* ```javascript
|
|
221
|
+
* await chatroomService.updateChatroomLocationInfo({
|
|
222
|
+
* latitude: 30.5,
|
|
223
|
+
* longitude: 120.5
|
|
224
|
+
* })
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
108
227
|
updateChatroomLocationInfo(locationConfig: V2NIMChatroomLocationConfig): Promise<void>;
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
|
|
228
|
+
/**
|
|
229
|
+
* @brief 更新聊天室 tag 信息
|
|
230
|
+
* @param updateParams tag 更新的参数
|
|
231
|
+
* @returns void
|
|
232
|
+
* @example
|
|
233
|
+
* ```javascript
|
|
234
|
+
* await chatroomService.updateChatroomTags({
|
|
235
|
+
* tags: ['tag1', 'tag2']
|
|
236
|
+
* })
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
112
239
|
updateChatroomTags(updateParams: V2NIMChatroomTagsUpdateParams): Promise<void>;
|
|
113
|
-
/**
|
|
114
|
-
|
|
115
|
-
|
|
240
|
+
/**
|
|
241
|
+
* @brief 根据标签查询消息列表
|
|
242
|
+
* @param messageOption 查询参数
|
|
243
|
+
* @returns Array<V2NIMChatroomMessage>
|
|
244
|
+
* @example
|
|
245
|
+
* ```javascript
|
|
246
|
+
* const result = await chatroomService.getMessageListByTag({
|
|
247
|
+
* tags: ['tag1', 'tag2'],
|
|
248
|
+
* limit: 10
|
|
249
|
+
* })
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
116
252
|
getMessageListByTag(messageOption: V2NIMChatroomTagMessageOption): Promise<Array<V2NIMChatroomMessage>>;
|
|
117
253
|
}
|
|
@@ -10,13 +10,14 @@ import { V2NIMTeamService } from './v2_nim_team_service';
|
|
|
10
10
|
import { V2NIMSettingService } from './v2_nim_setting_service';
|
|
11
11
|
import { V2NIMFriendService } from './v2_nim_friend_service';
|
|
12
12
|
import { V2NIMUserService } from './v2_nim_user_service';
|
|
13
|
-
import { V2NIMAIService } from
|
|
14
|
-
import { V2NIMSignallingService } from
|
|
15
|
-
import { V2NIMSubscriptionService } from
|
|
13
|
+
import { V2NIMAIService } from './v2_nim_ai_service';
|
|
14
|
+
import { V2NIMSignallingService } from './v2_nim_signalling_service';
|
|
15
|
+
import { V2NIMSubscriptionService } from './v2_nim_subscription_service';
|
|
16
|
+
import { V2NIMPassthroughService } from './v2_nim_passthrough_service';
|
|
16
17
|
import { V2NIMConversationIdUtil, V2NIMMessageCreator, V2NIMMessageConverter, V2NIMClientAntispamUtil, V2NIMStorageUtil, V2NIMMessageAttachmentCreator } from './v2_nim_utilities';
|
|
17
|
-
export declare interface
|
|
18
|
+
export declare interface V2NIMClientListener {
|
|
18
19
|
}
|
|
19
|
-
export declare class V2NIMClient extends EventEmitter<
|
|
20
|
+
export declare class V2NIMClient extends EventEmitter<V2NIMClientListener> {
|
|
20
21
|
instance: any;
|
|
21
22
|
conversationIdUtil: V2NIMConversationIdUtil | null;
|
|
22
23
|
messageCreator: V2NIMMessageCreator | null;
|
|
@@ -37,68 +38,154 @@ export declare class V2NIMClient extends EventEmitter<V2NIMClientEvents> {
|
|
|
37
38
|
aiService: V2NIMAIService | null;
|
|
38
39
|
signallingService: V2NIMSignallingService | null;
|
|
39
40
|
subscriptionService: V2NIMSubscriptionService | null;
|
|
41
|
+
passthroughService: V2NIMPassthroughService | null;
|
|
40
42
|
constructor();
|
|
41
43
|
/**
|
|
42
|
-
* 初始化
|
|
44
|
+
* @brief 初始化
|
|
43
45
|
* @param option - 初始化选项
|
|
44
46
|
* @returns V2NIMError | null
|
|
45
47
|
* @example
|
|
48
|
+
* ```javascript
|
|
49
|
+
* await client.init({
|
|
50
|
+
* appkey: 'your app key'
|
|
51
|
+
* })
|
|
52
|
+
* if (error) {
|
|
53
|
+
* console.error(error)
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
46
56
|
*/
|
|
47
57
|
init(option: V2NIMInitOption): V2NIMError | null;
|
|
48
|
-
/**
|
|
49
|
-
* @
|
|
58
|
+
/**
|
|
59
|
+
* @brief 反初始化
|
|
60
|
+
* @returns V2NIMError | null
|
|
61
|
+
* @example
|
|
62
|
+
* ```javascript
|
|
63
|
+
* await client.uninit()
|
|
64
|
+
* if (error) {
|
|
65
|
+
* console.error(error)
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
50
68
|
*/
|
|
51
69
|
uninit(): V2NIMError | null;
|
|
52
70
|
/**
|
|
53
71
|
* @brief 更新 appKey
|
|
54
72
|
* @param appKey - 新的 App key
|
|
55
|
-
* @
|
|
73
|
+
* @returns V2NIMError | null
|
|
74
|
+
* @example
|
|
75
|
+
* ```javascript
|
|
76
|
+
* await client.updateAppKey('your new app key')
|
|
77
|
+
* if (error) {
|
|
78
|
+
* console.error(error)
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
56
81
|
*/
|
|
57
82
|
updateAppKey(appKey: string): V2NIMError | null;
|
|
58
|
-
/**
|
|
59
|
-
* @
|
|
83
|
+
/**
|
|
84
|
+
* @brief 获取登录服务
|
|
85
|
+
* @returns V2NIMLoginService
|
|
86
|
+
* @example
|
|
87
|
+
* ```javascript
|
|
88
|
+
* const loginService = client.getLoginService()
|
|
89
|
+
* ```
|
|
60
90
|
*/
|
|
61
91
|
getLoginService(): V2NIMLoginService | null;
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
|
|
92
|
+
/**
|
|
93
|
+
* @brief 获取会话服务
|
|
94
|
+
* @returns V2NIMConversationService
|
|
95
|
+
* @example
|
|
96
|
+
* ```javascript
|
|
97
|
+
* const conversationService = client.getConversationService()
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
65
100
|
getConversationService(): V2NIMConversationService | null;
|
|
66
|
-
/**
|
|
67
|
-
* @
|
|
101
|
+
/**
|
|
102
|
+
* @brief 获取会话分组服务
|
|
103
|
+
* @returns V2NIMConversationGroupService
|
|
104
|
+
* @example
|
|
105
|
+
* ```javascript
|
|
106
|
+
* const conversationGroupService = client.getConversationGroupService()
|
|
107
|
+
* ```
|
|
68
108
|
*/
|
|
69
109
|
getConversationGroupService(): V2NIMConversationGroupService | null;
|
|
70
|
-
/**
|
|
71
|
-
* @
|
|
110
|
+
/**
|
|
111
|
+
* @brief 获取消息服务
|
|
112
|
+
* @returns V2NIMMessageService
|
|
113
|
+
* @example
|
|
114
|
+
* ```javascript
|
|
115
|
+
* const messageService = client.getMessageService()
|
|
116
|
+
* ```
|
|
72
117
|
*/
|
|
73
118
|
getMessageService(): V2NIMMessageService | null;
|
|
74
|
-
/**
|
|
75
|
-
* @
|
|
119
|
+
/**
|
|
120
|
+
* @brief 获取ai服务
|
|
121
|
+
* @returns V2NIMAIService
|
|
122
|
+
* @example
|
|
123
|
+
* ```javascript
|
|
124
|
+
* const aiService = client.getAIService()
|
|
125
|
+
* ```
|
|
76
126
|
*/
|
|
77
127
|
getAIService(): V2NIMAIService | null;
|
|
78
|
-
/**
|
|
79
|
-
* @
|
|
128
|
+
/**
|
|
129
|
+
* @brief 获取通知服务
|
|
130
|
+
* @returns V2NIMNotificationService
|
|
131
|
+
* @example
|
|
132
|
+
* ```javascript
|
|
133
|
+
* const notificationService = client.getNotificationService()
|
|
134
|
+
* ```
|
|
80
135
|
*/
|
|
81
136
|
getNotificationService(): V2NIMNotificationService | null;
|
|
82
|
-
/**
|
|
83
|
-
* @
|
|
137
|
+
/**
|
|
138
|
+
* @brief 获取存储服务
|
|
139
|
+
* @returns V2NIMStorageService
|
|
140
|
+
* @example
|
|
141
|
+
* ```javascript
|
|
142
|
+
* const storageService = client.getStorageService()
|
|
143
|
+
* ```
|
|
84
144
|
*/
|
|
85
145
|
getStorageService(): V2NIMStorageService | null;
|
|
86
|
-
/**
|
|
87
|
-
* @
|
|
146
|
+
/**
|
|
147
|
+
* @brief 获取群组服务
|
|
148
|
+
* @returns V2NIMTeamService
|
|
149
|
+
* @example
|
|
150
|
+
* ```javascript
|
|
151
|
+
* const teamService = client.getTeamService()
|
|
152
|
+
* ```
|
|
88
153
|
*/
|
|
89
154
|
getTeamService(): V2NIMTeamService | null;
|
|
90
|
-
/**
|
|
91
|
-
* @
|
|
155
|
+
/**
|
|
156
|
+
* @brief 获取设置服务
|
|
157
|
+
* @returns V2NIMSettingService
|
|
158
|
+
* @example
|
|
159
|
+
* ```javascript
|
|
160
|
+
* const settingService = client.getSettingService()
|
|
161
|
+
* ```
|
|
92
162
|
*/
|
|
93
163
|
getSettingService(): V2NIMSettingService | null;
|
|
94
164
|
/**
|
|
95
165
|
* @brief 获取独立信令服务
|
|
96
|
-
* @
|
|
166
|
+
* @returns V2NIMSignallingService
|
|
167
|
+
* @example
|
|
168
|
+
* ```javascript
|
|
169
|
+
* const signallingService = client.getSignallingService()
|
|
170
|
+
* ```
|
|
97
171
|
*/
|
|
98
172
|
getSignallingService(): V2NIMSignallingService | null;
|
|
99
173
|
/**
|
|
100
174
|
* @brief 获取订阅服务
|
|
101
|
-
* @
|
|
175
|
+
* @returns V2NIMSubscriptionService
|
|
176
|
+
* @example
|
|
177
|
+
* ```javascript
|
|
178
|
+
* const subscriptionService = client.getSubscriptionService()
|
|
179
|
+
* ```
|
|
102
180
|
*/
|
|
103
181
|
getSubscriptionService(): V2NIMSubscriptionService | null;
|
|
182
|
+
/**
|
|
183
|
+
* @brief 获取透传服务
|
|
184
|
+
* @returns V2NIMPassthroughService
|
|
185
|
+
* @example
|
|
186
|
+
* ```javascript
|
|
187
|
+
* const passthroughService = client.getPasseThroughService()
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
getPasseThroughService(): V2NIMPassthroughService | null;
|
|
104
191
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { V2NIMConversationGroup, V2NIMConversation, V2NIMConversationGroupResult, V2NIMConversationOperationResult } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
2
|
import { EventEmitter } from 'eventemitter3';
|
|
3
|
-
export declare interface
|
|
3
|
+
export declare interface V2NIMConversationGroupListener {
|
|
4
4
|
/** 会话分组创建通知 */
|
|
5
5
|
conversationGroupCreated: [V2NIMConversationGroup];
|
|
6
6
|
/** 会话分组删除通知 */
|
|
@@ -12,43 +12,91 @@ export declare interface V2NIMConversationGroupServiceEvents {
|
|
|
12
12
|
/** 会话移出会话分组通知 */
|
|
13
13
|
conversationsRemovedFromGroup: [string, string[]];
|
|
14
14
|
}
|
|
15
|
-
export declare class V2NIMConversationGroupService extends EventEmitter<
|
|
15
|
+
export declare class V2NIMConversationGroupService extends EventEmitter<V2NIMConversationGroupListener> {
|
|
16
16
|
instance: any;
|
|
17
17
|
constructor();
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @brief 创建会话分组
|
|
19
20
|
* @param name 会话分组名称
|
|
20
21
|
* @param conversationIds 会话 ID 列表
|
|
22
|
+
* @returns V2NIMConversationGroupResult
|
|
23
|
+
* @example
|
|
24
|
+
* ```javascript
|
|
25
|
+
* const result = await v2.conversationGroupService.createConversationGroup('group1', 'extension', ['conversation1', 'conversation2'])
|
|
26
|
+
* ```
|
|
21
27
|
*/
|
|
22
28
|
createConversationGroup(name: string, serverExtension?: string, conversationIds?: string[]): Promise<V2NIMConversationGroupResult>;
|
|
23
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @brief 删除会话分组
|
|
24
31
|
* @param groupId 会话分组 ID
|
|
32
|
+
* @returns void
|
|
33
|
+
* @example
|
|
34
|
+
* ```javascript
|
|
35
|
+
* await v2.conversationGroupService.deleteConversationGroup('group1')
|
|
36
|
+
* ```
|
|
25
37
|
*/
|
|
26
38
|
deleteConversationGroup(groupId: string): Promise<void>;
|
|
27
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @brief 更新会话分组
|
|
28
41
|
* @param groupId 会话分组 ID
|
|
29
42
|
* @param name 新的会话分组名称
|
|
30
43
|
* @param serverExtension 扩展字段
|
|
44
|
+
* @returns void
|
|
45
|
+
* @example
|
|
46
|
+
* ```javascript
|
|
47
|
+
* await v2.conversationGroupService.updateConversationGroup('group1', 'newName', 'newExtension')
|
|
48
|
+
* ```
|
|
31
49
|
*/
|
|
32
50
|
updateConversationGroup(groupId: string, name?: string, serverExtension?: string): Promise<void>;
|
|
33
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @brief 添加会话到会话分组
|
|
34
53
|
* @param groupId 会话分组 ID
|
|
35
54
|
* @param conversationIds 会话 ID 列表
|
|
55
|
+
* @returns Array<V2NIMConversationOperationResult>
|
|
56
|
+
* @example
|
|
57
|
+
* ```javascript
|
|
58
|
+
* const result = await v2.conversationGroupService.addConversationsToGroup('group1', ['conversation1', 'conversation2'])
|
|
59
|
+
* ```
|
|
36
60
|
*/
|
|
37
61
|
addConversationsToGroup(groupId: string, conversationIds: string[]): Promise<Array<V2NIMConversationOperationResult>>;
|
|
38
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* @brief 从会话分组中移除会话
|
|
39
64
|
* @param groupId 会话分组 ID
|
|
40
65
|
* @param conversationIds 会话 ID 列表
|
|
66
|
+
* @returns Array<V2NIMConversationOperationResult>
|
|
67
|
+
* @example
|
|
68
|
+
* ```javascript
|
|
69
|
+
* const result = await v2.conversationGroupService.removeConversationsFromGroup('group1', ['conversation1', 'conversation2'])
|
|
70
|
+
* ```
|
|
41
71
|
*/
|
|
42
72
|
removeConversationsFromGroup(groupId: string, conversationIds: string[]): Promise<Array<V2NIMConversationOperationResult>>;
|
|
43
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* @brief 获取会话分组信息
|
|
44
75
|
* @param groupId 会话分组 ID
|
|
76
|
+
* @returns V2NIMConversationGroup
|
|
77
|
+
* @example
|
|
78
|
+
* ```javascript
|
|
79
|
+
* const group = await v2.conversationGroupService.getConversationGroup('group1')
|
|
80
|
+
* ```
|
|
45
81
|
*/
|
|
46
82
|
getConversationGroup(groupId: string): Promise<V2NIMConversationGroup>;
|
|
47
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* @brief 获取会话分组列表
|
|
85
|
+
* @returns Array<V2NIMConversationGroup>
|
|
86
|
+
* @example
|
|
87
|
+
* ```javascript
|
|
88
|
+
* const list = await v2.conversationGroupService.getConversationGroupList()
|
|
89
|
+
* ```
|
|
48
90
|
*/
|
|
49
91
|
getConversationGroupList(): Promise<Array<V2NIMConversationGroup>>;
|
|
50
|
-
/**
|
|
51
|
-
* @
|
|
92
|
+
/**
|
|
93
|
+
* @brief 根据会话分组 ID 获取会话分组
|
|
94
|
+
* @param groupIds 会话分组 ID 列表
|
|
95
|
+
* @returns Array<V2NIMConversationGroup>
|
|
96
|
+
* @example
|
|
97
|
+
* ```javascript
|
|
98
|
+
* const list = await v2.conversationGroupService.getConversationGroupListByIds(['group1', 'group2'])
|
|
99
|
+
* ```
|
|
52
100
|
*/
|
|
53
101
|
getConversationGroupListByIds(groupIds: string[]): Promise<Array<V2NIMConversationGroup>>;
|
|
54
102
|
}
|