node-nim 10.4.0-beta.1 → 10.6.0-beta.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/README.md +58 -44
- package/dist/chatroom/chatroom.js +482 -0
- package/dist/chatroom/chatroom.js.map +1 -0
- package/dist/chatroom_def/chatroom_def.js +146 -73
- package/dist/chatroom_def/chatroom_def.js.map +1 -1
- package/dist/loader.js +2 -2
- package/dist/loader.js.map +1 -1
- package/dist/nim/ai.js +44 -0
- package/dist/nim/ai.js.map +1 -0
- package/dist/nim/client.js +4 -4
- package/dist/nim/client.js.map +1 -1
- package/dist/nim/data_sync.js.map +1 -1
- package/dist/nim/friend.js +9 -9
- package/dist/nim/friend.js.map +1 -1
- package/dist/nim/global.js.map +1 -1
- package/dist/nim/msglog.js +9 -1
- package/dist/nim/msglog.js.map +1 -1
- package/dist/nim/nos.js.map +1 -1
- package/dist/nim/online_session.js.map +1 -1
- package/dist/nim/pass_through_proxy.js +7 -7
- package/dist/nim/pass_through_proxy.js.map +1 -1
- package/dist/nim/plugin.js +3 -3
- package/dist/nim/plugin.js.map +1 -1
- package/dist/nim/session.js +52 -52
- package/dist/nim/session.js.map +1 -1
- package/dist/nim/subscribe_event.js +15 -15
- package/dist/nim/subscribe_event.js.map +1 -1
- package/dist/nim/super_team.js +63 -63
- package/dist/nim/super_team.js.map +1 -1
- package/dist/nim/sysmsg.js +14 -14
- package/dist/nim/sysmsg.js.map +1 -1
- package/dist/nim/talk.js +31 -10
- package/dist/nim/talk.js.map +1 -1
- package/dist/nim/talkex.js +27 -27
- package/dist/nim/talkex.js.map +1 -1
- package/dist/nim/team.js +86 -86
- package/dist/nim/team.js.map +1 -1
- package/dist/nim/tool.js +1 -1
- package/dist/nim/tool.js.map +1 -1
- package/dist/nim/user.js +2 -2
- package/dist/nim/user.js.map +1 -1
- package/dist/nim_def/ai_def.js +25 -0
- package/dist/nim_def/ai_def.js.map +1 -0
- package/dist/nim_def/client_def.js +145 -118
- package/dist/nim_def/client_def.js.map +1 -1
- package/dist/nim_def/data_sync_def.js +18 -9
- package/dist/nim_def/data_sync_def.js.map +1 -1
- package/dist/nim_def/doc_trans_def.js +10 -5
- package/dist/nim_def/doc_trans_def.js.map +1 -1
- package/dist/nim_def/friend_def.js +28 -14
- package/dist/nim_def/friend_def.js.map +1 -1
- package/dist/nim_def/global_def.js +32 -16
- package/dist/nim_def/global_def.js.map +1 -1
- package/dist/nim_def/msglog_def.js +203 -117
- package/dist/nim_def/msglog_def.js.map +1 -1
- package/dist/nim_def/nos_def.js +12 -6
- package/dist/nim_def/nos_def.js.map +1 -1
- package/dist/nim_def/pass_through_proxy_def.js +5 -0
- package/dist/nim_def/pass_through_proxy_def.js.map +1 -1
- package/dist/nim_def/session_def.js +30 -15
- package/dist/nim_def/session_def.js.map +1 -1
- package/dist/nim_def/subscribe_event_def.js +32 -15
- package/dist/nim_def/subscribe_event_def.js.map +1 -1
- package/dist/nim_def/super_team_def.js +52 -27
- package/dist/nim_def/super_team_def.js.map +1 -1
- package/dist/nim_def/sysmsg_def.js +32 -17
- package/dist/nim_def/sysmsg_def.js.map +1 -1
- package/dist/nim_def/team_def.js +56 -29
- package/dist/nim_def/team_def.js.map +1 -1
- package/dist/nim_def/tool_def.js +8 -4
- package/dist/nim_def/tool_def.js.map +1 -1
- package/dist/nim_def/user_def.js +16 -8
- package/dist/nim_def/user_def.js.map +1 -1
- package/dist/node-nim.js +32 -1
- package/dist/node-nim.js.map +1 -1
- package/dist/qchat/attachment.js.map +1 -1
- package/dist/qchat/channel.js.map +1 -1
- package/dist/qchat/channel_category.js.map +1 -1
- package/dist/qchat/instance.js.map +1 -1
- package/dist/qchat/message.js.map +1 -1
- package/dist/qchat/role.js.map +1 -1
- package/dist/qchat/server.js.map +1 -1
- package/dist/qchat/system_notification.js.map +1 -1
- package/dist/qchat_def/public_def.js +9 -2
- package/dist/qchat_def/public_def.js.map +1 -1
- package/dist/v2/v2_nim_ai_service.js.map +1 -1
- package/dist/v2/v2_nim_chatroom_client.js +160 -39
- 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 +126 -24
- 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 +72 -13
- 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 +367 -130
- 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 +313 -125
- package/dist/v2/v2_nim_utilities.js.map +1 -1
- package/dist/v2_def/v2_nim_enum_def.js +76 -62
- 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 +9 -6
- package/script/download-sdk.js +1 -1
- package/types/chatroom/chatroom.d.ts +274 -0
- package/types/chatroom_def/chatroom_def.d.ts +150 -74
- package/types/nim/ai.d.ts +25 -0
- package/types/nim/client.d.ts +8 -8
- package/types/nim/friend.d.ts +9 -9
- package/types/nim/msglog.d.ts +8 -2
- package/types/nim/pass_through_proxy.d.ts +7 -7
- package/types/nim/plugin.d.ts +3 -3
- package/types/nim/session.d.ts +50 -50
- package/types/nim/subscribe_event.d.ts +15 -15
- package/types/nim/super_team.d.ts +63 -63
- package/types/nim/sysmsg.d.ts +14 -14
- package/types/nim/talk.d.ts +28 -11
- package/types/nim/talkex.d.ts +27 -27
- package/types/nim/team.d.ts +86 -86
- package/types/nim/tool.d.ts +1 -1
- package/types/nim/user.d.ts +2 -2
- package/types/nim_def/ai_def.d.ts +79 -0
- package/types/nim_def/client_def.d.ts +322 -127
- package/types/nim_def/data_sync_def.d.ts +18 -9
- package/types/nim_def/doc_trans_def.d.ts +10 -5
- package/types/nim_def/friend_def.d.ts +52 -26
- package/types/nim_def/global_def.d.ts +32 -16
- package/types/nim_def/msglog_def.d.ts +466 -217
- package/types/nim_def/nos_def.d.ts +62 -31
- package/types/nim_def/online_session_def.d.ts +21 -9
- package/types/nim_def/pass_through_proxy_def.d.ts +5 -0
- package/types/nim_def/session_def.d.ts +92 -46
- package/types/nim_def/subscribe_event_def.d.ts +75 -35
- package/types/nim_def/super_team_def.d.ts +75 -37
- package/types/nim_def/sysmsg_def.d.ts +78 -40
- package/types/nim_def/talk_def.d.ts +85 -20
- package/types/nim_def/talkex_def.d.ts +92 -46
- package/types/nim_def/team_def.d.ts +93 -39
- package/types/nim_def/tool_def.d.ts +16 -8
- package/types/nim_def/user_def.d.ts +52 -26
- package/types/node-nim.d.ts +29 -2
- package/types/qchat_def/message_def.d.ts +1 -1
- package/types/qchat_def/public_def.d.ts +6 -0
- package/types/qchat_def/role_def.d.ts +3 -1
- package/types/v2/v2_nim_ai_service.d.ts +3 -3
- package/types/v2/v2_nim_chatroom_client.d.ts +158 -41
- package/types/v2/v2_nim_chatroom_queue_service.d.ts +96 -0
- package/types/v2/v2_nim_chatroom_service.d.ts +204 -67
- package/types/v2/v2_nim_client.d.ts +124 -30
- package/types/v2/v2_nim_conversation_group_service.d.ts +59 -11
- package/types/v2/v2_nim_conversation_service.d.ts +152 -29
- package/types/v2/v2_nim_friend_service.d.ts +140 -39
- package/types/v2/v2_nim_login_service.d.ts +75 -14
- 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 +84 -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 +338 -132
- package/types/v2/v2_nim_user_service.d.ts +64 -21
- package/types/v2/v2_nim_utilities.d.ts +311 -125
- package/types/v2_def/v2_nim_enum_def.d.ts +72 -62
- package/types/v2_def/v2_nim_struct_def.d.ts +56 -7
|
@@ -10,17 +10,19 @@ 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
|
|
16
|
-
import {
|
|
17
|
-
|
|
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';
|
|
17
|
+
import { V2NIMConversationIdUtil, V2NIMMessageCreator, V2NIMMessageConverter, V2NIMClientAntispamUtil, V2NIMStorageUtil, V2NIMMessageAttachmentCreator } from './v2_nim_utilities';
|
|
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;
|
|
23
24
|
messageConverter: V2NIMMessageConverter | null;
|
|
25
|
+
messageAttachmentCreator: V2NIMMessageAttachmentCreator | null;
|
|
24
26
|
clientAntispamUtil: V2NIMClientAntispamUtil | null;
|
|
25
27
|
storageUtil: V2NIMStorageUtil | null;
|
|
26
28
|
loginService: V2NIMLoginService | null;
|
|
@@ -36,62 +38,154 @@ export declare class V2NIMClient extends EventEmitter<V2NIMClientEvents> {
|
|
|
36
38
|
aiService: V2NIMAIService | null;
|
|
37
39
|
signallingService: V2NIMSignallingService | null;
|
|
38
40
|
subscriptionService: V2NIMSubscriptionService | null;
|
|
41
|
+
passthroughService: V2NIMPassthroughService | null;
|
|
39
42
|
constructor();
|
|
40
43
|
/**
|
|
41
|
-
* 初始化
|
|
44
|
+
* @brief 初始化
|
|
42
45
|
* @param option - 初始化选项
|
|
43
46
|
* @returns V2NIMError | null
|
|
44
47
|
* @example
|
|
48
|
+
* ```javascript
|
|
49
|
+
* await client.init({
|
|
50
|
+
* appkey: 'your app key'
|
|
51
|
+
* })
|
|
52
|
+
* if (error) {
|
|
53
|
+
* console.error(error)
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
45
56
|
*/
|
|
46
57
|
init(option: V2NIMInitOption): V2NIMError | null;
|
|
47
|
-
/**
|
|
48
|
-
* @
|
|
58
|
+
/**
|
|
59
|
+
* @brief 反初始化
|
|
60
|
+
* @returns V2NIMError | null
|
|
61
|
+
* @example
|
|
62
|
+
* ```javascript
|
|
63
|
+
* await client.uninit()
|
|
64
|
+
* if (error) {
|
|
65
|
+
* console.error(error)
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
49
68
|
*/
|
|
50
69
|
uninit(): V2NIMError | null;
|
|
51
|
-
/**
|
|
52
|
-
* @
|
|
70
|
+
/**
|
|
71
|
+
* @brief 更新 appKey
|
|
72
|
+
* @param appKey - 新的 App key
|
|
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
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
updateAppKey(appKey: string): V2NIMError | null;
|
|
83
|
+
/**
|
|
84
|
+
* @brief 获取登录服务
|
|
85
|
+
* @returns V2NIMLoginService
|
|
86
|
+
* @example
|
|
87
|
+
* ```javascript
|
|
88
|
+
* const loginService = client.getLoginService()
|
|
89
|
+
* ```
|
|
53
90
|
*/
|
|
54
91
|
getLoginService(): V2NIMLoginService | null;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
92
|
+
/**
|
|
93
|
+
* @brief 获取会话服务
|
|
94
|
+
* @returns V2NIMConversationService
|
|
95
|
+
* @example
|
|
96
|
+
* ```javascript
|
|
97
|
+
* const conversationService = client.getConversationService()
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
58
100
|
getConversationService(): V2NIMConversationService | null;
|
|
59
|
-
/**
|
|
60
|
-
* @
|
|
101
|
+
/**
|
|
102
|
+
* @brief 获取会话分组服务
|
|
103
|
+
* @returns V2NIMConversationGroupService
|
|
104
|
+
* @example
|
|
105
|
+
* ```javascript
|
|
106
|
+
* const conversationGroupService = client.getConversationGroupService()
|
|
107
|
+
* ```
|
|
61
108
|
*/
|
|
62
109
|
getConversationGroupService(): V2NIMConversationGroupService | null;
|
|
63
|
-
/**
|
|
64
|
-
* @
|
|
110
|
+
/**
|
|
111
|
+
* @brief 获取消息服务
|
|
112
|
+
* @returns V2NIMMessageService
|
|
113
|
+
* @example
|
|
114
|
+
* ```javascript
|
|
115
|
+
* const messageService = client.getMessageService()
|
|
116
|
+
* ```
|
|
65
117
|
*/
|
|
66
118
|
getMessageService(): V2NIMMessageService | null;
|
|
67
|
-
/**
|
|
68
|
-
* @
|
|
119
|
+
/**
|
|
120
|
+
* @brief 获取ai服务
|
|
121
|
+
* @returns V2NIMAIService
|
|
122
|
+
* @example
|
|
123
|
+
* ```javascript
|
|
124
|
+
* const aiService = client.getAIService()
|
|
125
|
+
* ```
|
|
69
126
|
*/
|
|
70
127
|
getAIService(): V2NIMAIService | null;
|
|
71
|
-
/**
|
|
72
|
-
* @
|
|
128
|
+
/**
|
|
129
|
+
* @brief 获取通知服务
|
|
130
|
+
* @returns V2NIMNotificationService
|
|
131
|
+
* @example
|
|
132
|
+
* ```javascript
|
|
133
|
+
* const notificationService = client.getNotificationService()
|
|
134
|
+
* ```
|
|
73
135
|
*/
|
|
74
136
|
getNotificationService(): V2NIMNotificationService | null;
|
|
75
|
-
/**
|
|
76
|
-
* @
|
|
137
|
+
/**
|
|
138
|
+
* @brief 获取存储服务
|
|
139
|
+
* @returns V2NIMStorageService
|
|
140
|
+
* @example
|
|
141
|
+
* ```javascript
|
|
142
|
+
* const storageService = client.getStorageService()
|
|
143
|
+
* ```
|
|
77
144
|
*/
|
|
78
145
|
getStorageService(): V2NIMStorageService | null;
|
|
79
|
-
/**
|
|
80
|
-
* @
|
|
146
|
+
/**
|
|
147
|
+
* @brief 获取群组服务
|
|
148
|
+
* @returns V2NIMTeamService
|
|
149
|
+
* @example
|
|
150
|
+
* ```javascript
|
|
151
|
+
* const teamService = client.getTeamService()
|
|
152
|
+
* ```
|
|
81
153
|
*/
|
|
82
154
|
getTeamService(): V2NIMTeamService | null;
|
|
83
|
-
/**
|
|
84
|
-
* @
|
|
155
|
+
/**
|
|
156
|
+
* @brief 获取设置服务
|
|
157
|
+
* @returns V2NIMSettingService
|
|
158
|
+
* @example
|
|
159
|
+
* ```javascript
|
|
160
|
+
* const settingService = client.getSettingService()
|
|
161
|
+
* ```
|
|
85
162
|
*/
|
|
86
163
|
getSettingService(): V2NIMSettingService | null;
|
|
87
164
|
/**
|
|
88
165
|
* @brief 获取独立信令服务
|
|
89
|
-
* @
|
|
166
|
+
* @returns V2NIMSignallingService
|
|
167
|
+
* @example
|
|
168
|
+
* ```javascript
|
|
169
|
+
* const signallingService = client.getSignallingService()
|
|
170
|
+
* ```
|
|
90
171
|
*/
|
|
91
172
|
getSignallingService(): V2NIMSignallingService | null;
|
|
92
173
|
/**
|
|
93
174
|
* @brief 获取订阅服务
|
|
94
|
-
* @
|
|
175
|
+
* @returns V2NIMSubscriptionService
|
|
176
|
+
* @example
|
|
177
|
+
* ```javascript
|
|
178
|
+
* const subscriptionService = client.getSubscriptionService()
|
|
179
|
+
* ```
|
|
95
180
|
*/
|
|
96
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;
|
|
97
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
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { V2NIMError, V2NIMConversation, V2NIMConversationFilter, V2NIMConversationOperationResult, V2NIMConversationUpdate, V2NIMConversationResult, V2NIMConversationOption } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
2
|
import { EventEmitter } from 'eventemitter3';
|
|
3
|
-
|
|
3
|
+
import { V2NIMConversationType } from 'ts/v2_def/v2_nim_enum_def';
|
|
4
|
+
export declare interface V2NIMConversationListener {
|
|
4
5
|
/** 会话同步开始通知 */
|
|
5
6
|
syncStarted: [];
|
|
6
7
|
/** 会话同步完成通知 */
|
|
@@ -20,101 +21,223 @@ export declare interface V2NIMConversationServiceEvents {
|
|
|
20
21
|
/** 同账号多端标记会话 ACK 通知时间戳变更 */
|
|
21
22
|
conversationReadTimeUpdated: [string, number];
|
|
22
23
|
}
|
|
23
|
-
export declare class V2NIMConversationService extends EventEmitter<
|
|
24
|
+
export declare class V2NIMConversationService extends EventEmitter<V2NIMConversationListener> {
|
|
24
25
|
instance: any;
|
|
25
26
|
constructor();
|
|
26
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @brief 创建空会话
|
|
27
29
|
* @param conversationId 会话 ID
|
|
30
|
+
* @returns V2NIMConversation
|
|
31
|
+
* @example
|
|
32
|
+
* ```javascript
|
|
33
|
+
* const conversation = await v2.conversationService.createConversation('conversation1')
|
|
34
|
+
* ```
|
|
28
35
|
*/
|
|
29
36
|
createConversation(conversationId: string): Promise<V2NIMConversation>;
|
|
30
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* @brief 删除会话
|
|
31
39
|
* @param conversationId 会话 ID
|
|
32
40
|
* @param clearMessage 是否清除会话消息
|
|
41
|
+
* @returns void
|
|
42
|
+
* @example
|
|
43
|
+
* ```javascript
|
|
44
|
+
* await v2.conversationService.deleteConversation('conversation1', true)
|
|
45
|
+
* ```
|
|
33
46
|
*/
|
|
34
47
|
deleteConversation(conversationId: string, clearMessage: boolean): Promise<void>;
|
|
35
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* @brief 批量删除会话
|
|
36
50
|
* @param conversationIds 会话ID列表
|
|
37
51
|
* @param clearMessage 是否清除会话消息
|
|
52
|
+
* @returns Array<V2NIMConversationOperationResult>
|
|
53
|
+
* @example
|
|
54
|
+
* ```javascript
|
|
55
|
+
* const result = await v2.conversationService.deleteConversationListByIds(['conversation1', 'conversation2'], true)
|
|
56
|
+
* ```
|
|
38
57
|
*/
|
|
39
58
|
deleteConversationListByIds(conversationIds: string[], clearMessage: boolean): Promise<Array<V2NIMConversationOperationResult>>;
|
|
40
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* @brief 置顶会话
|
|
41
61
|
* @param conversationId 会话 ID
|
|
42
62
|
* @param stickTop 是否置顶
|
|
63
|
+
* @returns void
|
|
64
|
+
* @example
|
|
65
|
+
* ```javascript
|
|
66
|
+
* await v2.conversationService.stickTopConversation('conversation1', true)
|
|
67
|
+
* ```
|
|
43
68
|
*/
|
|
44
69
|
stickTopConversation(conversationId: string, stickTop: boolean): Promise<void>;
|
|
45
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* @brief 更新会话
|
|
46
72
|
* @param conversationId 会话 ID
|
|
47
73
|
* @param updateInfo 更新参数
|
|
74
|
+
* @returns void
|
|
75
|
+
* @example
|
|
76
|
+
* ```javascript
|
|
77
|
+
* await v2.conversationService.updateConversation('conversation1', { name: 'newName' })
|
|
78
|
+
* ```
|
|
48
79
|
*/
|
|
49
80
|
updateConversation(conversationId: string, updateInfo: V2NIMConversationUpdate): Promise<void>;
|
|
50
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* @brief 更新会话本地扩展
|
|
51
83
|
* @param conversationId 会话 ID
|
|
52
84
|
* @param localExtension 本地扩展
|
|
85
|
+
* @returns void
|
|
86
|
+
* @example
|
|
87
|
+
* ```javascript
|
|
88
|
+
* await v2.conversationService.updateConversationLocalExtension('conversation1', 'newExtension')
|
|
89
|
+
* ```
|
|
53
90
|
*/
|
|
54
91
|
updateConversationLocalExtension(conversationId: string, localExtension: string): Promise<void>;
|
|
55
92
|
/** @brief 获取会话
|
|
56
93
|
* @param conversationId 会话 ID
|
|
94
|
+
* @returns V2NIMConversation
|
|
95
|
+
* @example
|
|
96
|
+
* ```javascript
|
|
97
|
+
* const conversation = await v2.conversationService.getConversation('conversation1')
|
|
98
|
+
* ```
|
|
57
99
|
*/
|
|
58
100
|
getConversation(conversationId: string): Promise<V2NIMConversation>;
|
|
59
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* @brief 分页获取会话列表
|
|
60
103
|
* @param offset 分页偏移, 首页传 0, 后续拉取采用上一次返还的 offset
|
|
61
104
|
* @param limit 分页数量
|
|
105
|
+
* @returns V2NIMConversationResult
|
|
106
|
+
* @example
|
|
107
|
+
* ```javascript
|
|
108
|
+
* const result = await v2.conversationService.getConversationList(0, 10)
|
|
109
|
+
* ```
|
|
62
110
|
*/
|
|
63
111
|
getConversationList(offset: number, limit: number): Promise<V2NIMConversationResult>;
|
|
64
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* @brief 根据会话ID获取会话列表
|
|
65
114
|
* @param conversationIds 会话ID列表
|
|
115
|
+
* @returns Array<V2NIMConversation>
|
|
116
|
+
* @example
|
|
117
|
+
* ```javascript
|
|
118
|
+
* const list = await v2.conversationService.getConversationListByIds(['conversation1', 'conversation2'])
|
|
119
|
+
* ```
|
|
66
120
|
*/
|
|
67
121
|
getConversationListByIds(conversationIds: string[]): Promise<Array<V2NIMConversation>>;
|
|
68
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* @brief 根据条件筛选分页获取会话列表
|
|
69
124
|
* @param offset 分页偏移, 首页传 0, 后续拉取采用上一次返还的 offset
|
|
70
125
|
* @param limit 分页数量
|
|
71
126
|
* @param option 查询参数
|
|
127
|
+
* @returns V2NIMConversationResult
|
|
128
|
+
* @example
|
|
129
|
+
* ```javascript
|
|
130
|
+
* const result = await v2.conversationService.getConversationListByOption(0, 10, {
|
|
131
|
+
* conversationTypes: [1, 2]
|
|
132
|
+
* })
|
|
133
|
+
* ```
|
|
72
134
|
*/
|
|
73
135
|
getConversationListByOption(offset: number, limit: number, option: V2NIMConversationOption): Promise<V2NIMConversationResult>;
|
|
74
|
-
/**
|
|
75
|
-
* @
|
|
76
|
-
* @
|
|
136
|
+
/**
|
|
137
|
+
* @brief 获取会话未读总数
|
|
138
|
+
* @returns number
|
|
139
|
+
* @example
|
|
140
|
+
* ```javascript
|
|
141
|
+
* const count = await v2.conversationService.getTotalUnreadCount()
|
|
142
|
+
* ```
|
|
77
143
|
*/
|
|
78
144
|
getTotalUnreadCount(): number;
|
|
79
145
|
/** @brief 根据会话 ID 列表获取未读总数
|
|
80
146
|
* @param conversationIds 会话 ID 列表
|
|
147
|
+
* @returns number
|
|
148
|
+
* @example
|
|
149
|
+
* ```javascript
|
|
150
|
+
* const count = await v2.conversationService.getUnreadCountByIds(['conversation1', 'conversation2'])
|
|
151
|
+
* ```
|
|
81
152
|
*/
|
|
82
153
|
getUnreadCountByIds(conversationIds: string[]): Promise<number>;
|
|
83
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* @brief 根据过滤条件获取会话未读总数
|
|
84
156
|
* @param filter 过滤条件
|
|
157
|
+
* @returns number
|
|
158
|
+
* @example
|
|
159
|
+
* ```javascript
|
|
160
|
+
* const count = await v2.conversationService.getUnreadCountByFilter({ conversationTypes: [1, 2] })
|
|
161
|
+
* ```
|
|
85
162
|
*/
|
|
86
163
|
getUnreadCountByFilter(filter: V2NIMConversationFilter): Promise<number>;
|
|
87
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* @brief 清除会话总未读数
|
|
166
|
+
* @returns void
|
|
167
|
+
* @example
|
|
168
|
+
* ```javascript
|
|
169
|
+
* await v2.conversationService.clearTotalUnreadCount()
|
|
170
|
+
* ```
|
|
88
171
|
*/
|
|
89
172
|
clearTotalUnreadCount(): Promise<void>;
|
|
90
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* @brief 根据会话 ID 列表清除会话未读数
|
|
91
175
|
* @param conversationIds 会话 ID 列表
|
|
176
|
+
* @returns Array<V2NIMConversationOperationResult>
|
|
177
|
+
* @example
|
|
178
|
+
* ```javascript
|
|
179
|
+
* const result = await v2.conversationService.clearUnreadCountByIds(['conversation1', 'conversation2'])
|
|
180
|
+
* ```
|
|
92
181
|
*/
|
|
93
182
|
clearUnreadCountByIds(conversationIds: string[]): Promise<Array<V2NIMConversationOperationResult>>;
|
|
94
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* @brief 根据会话类型清除会话未读数
|
|
95
185
|
* @param conversationTypes 会话类型列表
|
|
186
|
+
* @returns void
|
|
187
|
+
* @example
|
|
188
|
+
* ```javascript
|
|
189
|
+
* await v2.conversationService.clearUnreadCountByTypes([1, 2])
|
|
190
|
+
* ```
|
|
96
191
|
*/
|
|
97
192
|
clearUnreadCountByTypes(conversationTypes: V2NIMConversationType[]): Promise<void>;
|
|
98
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* @brief 根据会话分组清除会话未读数
|
|
99
195
|
* @param groupId 会话分组ID
|
|
196
|
+
* @returns void
|
|
197
|
+
* @example
|
|
198
|
+
* ```javascript
|
|
199
|
+
* await v2.conversationService.clearUnreadCountByGroupId('groupId')
|
|
200
|
+
* ```
|
|
100
201
|
*/
|
|
101
202
|
clearUnreadCountByGroupId(groupId: string): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
203
|
+
/**
|
|
204
|
+
* @brief 标记会话已读时间戳
|
|
205
|
+
* @param conversationId 要标记的会话 ID
|
|
206
|
+
* @returns number
|
|
207
|
+
* @example
|
|
208
|
+
* ```javascript
|
|
209
|
+
* const time = await v2.conversationService.markConversationRead('conversation1')
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
105
212
|
markConversationRead(conversationId: string): Promise<number>;
|
|
106
|
-
/**
|
|
107
|
-
|
|
108
|
-
|
|
213
|
+
/**
|
|
214
|
+
* @brief 获取会话已读时间戳
|
|
215
|
+
* @param conversationId 会话 ID
|
|
216
|
+
* @returns Promise<number> 时间戳
|
|
217
|
+
* @example
|
|
218
|
+
* ```javascript
|
|
219
|
+
* const time = await v2.conversationService.getConversationReadTime('conversation1')
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
109
222
|
getConversationReadTime(conversationId: string): Promise<number>;
|
|
110
|
-
/**
|
|
223
|
+
/**
|
|
224
|
+
* @brief 订阅指定过滤条件的会话未读数
|
|
111
225
|
* @param filter 过滤条件
|
|
112
|
-
* @
|
|
226
|
+
* @returns null | V2NIMError
|
|
227
|
+
* @example
|
|
228
|
+
* ```javascript
|
|
229
|
+
* await v2.conversationService.subscribeUnreadCountByFilter({ conversationTypes: [1, 2] })
|
|
230
|
+
* ```
|
|
113
231
|
*/
|
|
114
232
|
subscribeUnreadCountByFilter(filter: V2NIMConversationFilter): null | V2NIMError;
|
|
115
|
-
/**
|
|
233
|
+
/**
|
|
234
|
+
* @brief 取消订阅指定过滤条件的会话未读数
|
|
116
235
|
* @param filter 过滤条件
|
|
117
|
-
* @
|
|
236
|
+
* @returns null | V2NIMError
|
|
237
|
+
* @example
|
|
238
|
+
* ```javascript
|
|
239
|
+
* await v2.conversationService.unsubscribeUnreadCountByFilter({ conversationTypes: [1, 2] })
|
|
240
|
+
* ```
|
|
118
241
|
*/
|
|
119
242
|
unsubscribeUnreadCountByFilter(filter: V2NIMConversationFilter): null | V2NIMError;
|
|
120
243
|
}
|