node-nim 9.14.3 → 10.2.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 +7 -1
- package/dist/loader.js +35 -35
- package/dist/nim/client.js +184 -184
- package/dist/nim/client.js.map +1 -1
- package/dist/nim/data_sync.js +19 -19
- package/dist/nim/friend.js +150 -150
- package/dist/nim/global.js +131 -131
- package/dist/nim/msglog.js +687 -687
- package/dist/nim/nos.js +216 -180
- package/dist/nim/nos.js.map +1 -1
- package/dist/nim/online_session.js +85 -85
- package/dist/nim/pass_through_proxy.js +39 -39
- package/dist/nim/plugin.js +65 -65
- package/dist/nim/session.js +392 -392
- package/dist/nim/subscribe_event.js +142 -142
- package/dist/nim/super_team.js +592 -615
- package/dist/nim/super_team.js.map +1 -1
- package/dist/nim/sysmsg.js +194 -194
- package/dist/nim/talk.js +209 -209
- package/dist/nim/talk.js.map +1 -1
- package/dist/nim/talkex.js +191 -191
- package/dist/nim/team.js +818 -830
- package/dist/nim/team.js.map +1 -1
- package/dist/nim/tool.js +119 -119
- package/dist/nim/user.js +201 -201
- package/dist/nim_def/client_def.js +245 -245
- package/dist/nim_def/client_def.js.map +1 -1
- package/dist/nim_def/data_sync_def.js +20 -20
- package/dist/nim_def/doc_trans_def.js +16 -16
- package/dist/nim_def/friend_def.js +37 -37
- package/dist/nim_def/global_def.js +39 -39
- package/dist/nim_def/msglog_def.js +148 -148
- package/dist/nim_def/nos_def.js +16 -16
- package/dist/nim_def/online_session_def.js +2 -2
- package/dist/nim_def/pass_through_proxy_def.js +10 -10
- package/dist/nim_def/plugin_def.js +2 -2
- package/dist/nim_def/session_def.js +26 -26
- package/dist/nim_def/subscribe_event_def.js +52 -52
- package/dist/nim_def/super_team_def.js +64 -71
- package/dist/nim_def/super_team_def.js.map +1 -1
- package/dist/nim_def/sysmsg_def.js +28 -28
- package/dist/nim_def/talk_def.js +2 -2
- package/dist/nim_def/talkex_def.js +2 -2
- package/dist/nim_def/team_def.js +69 -76
- package/dist/nim_def/team_def.js.map +1 -1
- package/dist/nim_def/tool_def.js +11 -11
- package/dist/nim_def/user_def.js +22 -22
- package/dist/node-nim.js +171 -171
- package/dist/node-nim.js.map +1 -1
- package/dist/qchat/attachment.js +63 -63
- package/dist/qchat/channel.js +314 -314
- package/dist/qchat/channel_category.js +187 -187
- package/dist/qchat/instance.js +77 -77
- package/dist/qchat/message.js +285 -285
- package/dist/qchat/role.js +423 -423
- package/dist/qchat/server.js +453 -453
- package/dist/qchat/system_notification.js +74 -74
- package/dist/qchat_def/attachment_def.js +2 -2
- package/dist/qchat_def/channel_def.js +2 -2
- package/dist/qchat_def/instance_def.js +2 -2
- package/dist/qchat_def/message_def.js +2 -2
- package/dist/qchat_def/public_def.js +649 -649
- package/dist/qchat_def/public_def.js.map +1 -1
- package/dist/qchat_def/role_def.js +2 -2
- package/dist/qchat_def/server_def.js +2 -2
- package/dist/qchat_def/system_notification_def.js +2 -2
- package/dist/v2/v2_nim_chatroom_client.js +135 -0
- package/dist/v2/v2_nim_chatroom_client.js.map +1 -0
- package/dist/v2/v2_nim_chatroom_service.js +244 -0
- package/dist/v2/v2_nim_chatroom_service.js.map +1 -0
- package/dist/v2/v2_nim_client.js +138 -0
- package/dist/v2/v2_nim_client.js.map +1 -0
- package/dist/v2/v2_nim_conversation_group_service.js +116 -0
- package/dist/v2/v2_nim_conversation_group_service.js.map +1 -0
- package/dist/v2/v2_nim_conversation_service.js +236 -0
- package/dist/v2/v2_nim_conversation_service.js.map +1 -0
- package/dist/v2/v2_nim_friend_service.js +128 -0
- package/dist/v2/v2_nim_friend_service.js.map +1 -0
- package/dist/v2/v2_nim_login_service.js +119 -123
- package/dist/v2/v2_nim_login_service.js.map +1 -1
- package/dist/v2/v2_nim_message_service.js +382 -0
- package/dist/v2/v2_nim_message_service.js.map +1 -0
- package/dist/v2/v2_nim_notification_service.js +30 -0
- package/dist/v2/v2_nim_notification_service.js.map +1 -0
- package/dist/v2/v2_nim_setting_service.js +86 -0
- package/dist/v2/v2_nim_setting_service.js.map +1 -0
- package/dist/v2/v2_nim_storage_service.js +58 -0
- package/dist/v2/v2_nim_storage_service.js.map +1 -0
- package/dist/v2/v2_nim_team_service.js +360 -0
- package/dist/v2/v2_nim_team_service.js.map +1 -0
- package/dist/v2/v2_nim_user_service.js +76 -0
- package/dist/v2/v2_nim_user_service.js.map +1 -0
- package/dist/v2/v2_nim_utilities.js +276 -0
- package/dist/v2/v2_nim_utilities.js.map +1 -0
- package/dist/v2_def/v2_nim_callback_def.js +2 -2
- package/dist/v2_def/v2_nim_enum_def.js +1087 -325
- package/dist/v2_def/v2_nim_enum_def.js.map +1 -1
- package/dist/v2_def/v2_nim_struct_def.js +2 -2
- package/package.json +1 -1
- package/script/download-sdk.js +2 -2
- package/script/publish-to-netease-npm.js +3 -2
- package/types/loader.d.ts +2 -2
- package/types/nim/client.d.ts +123 -123
- package/types/nim/data_sync.d.ts +12 -12
- package/types/nim/friend.d.ts +82 -82
- package/types/nim/global.d.ts +69 -69
- package/types/nim/msglog.d.ts +392 -392
- package/types/nim/nos.d.ts +118 -118
- package/types/nim/online_session.d.ts +44 -44
- package/types/nim/pass_through_proxy.d.ts +24 -24
- package/types/nim/plugin.d.ts +39 -39
- package/types/nim/session.d.ts +212 -212
- package/types/nim/subscribe_event.d.ts +87 -87
- package/types/nim/super_team.d.ts +331 -342
- package/types/nim/sysmsg.d.ts +105 -105
- package/types/nim/talk.d.ts +94 -94
- package/types/nim/talkex.d.ts +95 -95
- package/types/nim/team.d.ts +461 -467
- package/types/nim/tool.d.ts +77 -77
- package/types/nim/user.d.ts +111 -111
- package/types/nim_def/client_def.d.ts +284 -284
- package/types/nim_def/data_sync_def.d.ts +19 -19
- package/types/nim_def/doc_trans_def.d.ts +11 -11
- package/types/nim_def/friend_def.d.ts +65 -65
- package/types/nim_def/global_def.d.ts +62 -62
- package/types/nim_def/msglog_def.d.ts +373 -373
- package/types/nim_def/nos_def.d.ts +72 -72
- package/types/nim_def/online_session_def.d.ts +34 -34
- package/types/nim_def/pass_through_proxy_def.d.ts +13 -13
- package/types/nim_def/plugin_def.d.ts +8 -8
- package/types/nim_def/session_def.d.ts +114 -114
- package/types/nim_def/subscribe_event_def.d.ts +83 -83
- package/types/nim_def/super_team_def.d.ts +144 -163
- package/types/nim_def/sysmsg_def.d.ts +70 -70
- package/types/nim_def/talk_def.d.ts +96 -96
- package/types/nim_def/talkex_def.d.ts +112 -112
- package/types/nim_def/team_def.d.ts +167 -184
- package/types/nim_def/tool_def.d.ts +28 -28
- package/types/nim_def/user_def.d.ts +59 -59
- package/types/node-nim.d.ts +90 -93
- package/types/qchat/attachment.d.ts +40 -40
- package/types/qchat/channel.d.ts +139 -139
- package/types/qchat/channel_category.d.ts +82 -82
- package/types/qchat/instance.d.ts +46 -46
- package/types/qchat/message.d.ts +128 -128
- package/types/qchat/role.d.ts +166 -166
- package/types/qchat/server.d.ts +198 -198
- package/types/qchat/system_notification.d.ts +39 -39
- package/types/qchat_def/attachment_def.d.ts +71 -71
- package/types/qchat_def/channel_def.d.ts +643 -643
- package/types/qchat_def/instance_def.d.ts +214 -214
- package/types/qchat_def/message_def.d.ts +565 -565
- package/types/qchat_def/public_def.d.ts +754 -754
- package/types/qchat_def/role_def.d.ts +413 -413
- package/types/qchat_def/server_def.d.ts +529 -529
- package/types/qchat_def/system_notification_def.d.ts +172 -172
- package/types/v2/v2_nim_chatroom_client.d.ts +73 -0
- package/types/v2/v2_nim_chatroom_service.d.ts +114 -0
- package/types/v2/v2_nim_client.d.ts +75 -0
- package/types/v2/v2_nim_conversation_group_service.d.ts +54 -0
- package/types/v2/v2_nim_conversation_service.d.ts +110 -0
- package/types/v2/v2_nim_friend_service.d.ts +58 -0
- package/types/v2/v2_nim_login_service.d.ts +80 -96
- package/types/v2/v2_nim_message_service.d.ts +143 -0
- package/types/v2/v2_nim_notification_service.d.ts +18 -0
- package/types/v2/v2_nim_setting_service.d.ts +43 -0
- package/types/v2/v2_nim_storage_service.d.ts +28 -0
- package/types/v2/v2_nim_team_service.d.ts +184 -0
- package/types/v2/v2_nim_user_service.d.ts +34 -0
- package/types/v2/v2_nim_utilities.d.ts +168 -0
- package/types/v2_def/v2_nim_callback_def.d.ts +7 -20
- package/types/v2_def/v2_nim_enum_def.d.ts +1009 -300
- package/types/v2_def/v2_nim_struct_def.d.ts +1539 -338
- package/dist/chatroom/chatroom.js +0 -263
- package/dist/chatroom/chatroom.js.map +0 -1
- package/dist/chatroom_def/chatroom_def.js +0 -120
- package/dist/chatroom_def/chatroom_def.js.map +0 -1
- package/dist/v2/v2_nim_instance.js +0 -44
- package/dist/v2/v2_nim_instance.js.map +0 -1
- package/types/chatroom/chatroom.d.ts +0 -55
- package/types/chatroom_def/chatroom_def.d.ts +0 -448
- package/types/v2/v2_nim_instance.d.ts +0 -25
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
import { QChatMessageUpdateInfo } from './message_def';
|
|
2
|
-
import { NIMQChatSystemNotificationType, NIMQChatSystemNotificationStatus, QChatBaseResp, NIMQChatSystemNotificationToType } from './public_def';
|
|
3
|
-
/** @interface QChatSystemNotification */
|
|
4
|
-
export interface QChatSystemNotification {
|
|
5
|
-
/** 消息通知目标 */
|
|
6
|
-
to_type: NIMQChatSystemNotificationToType;
|
|
7
|
-
/** 消息所属的server id */
|
|
8
|
-
server_id?: string;
|
|
9
|
-
/** 消息所属的channel id */
|
|
10
|
-
channel_id?: string;
|
|
11
|
-
/** 消息id */
|
|
12
|
-
msg_id?: string;
|
|
13
|
-
/** 系统消息类型 */
|
|
14
|
-
msg_type?: NIMQChatSystemNotificationType;
|
|
15
|
-
/** 消息内容 */
|
|
16
|
-
msg_body?: string;
|
|
17
|
-
/** 消息附件 */
|
|
18
|
-
msg_attach?: string;
|
|
19
|
-
/** 消息扩展字段 */
|
|
20
|
-
msg_ext?: string;
|
|
21
|
-
/** 重发标记,false:不是重发,true:是重发 */
|
|
22
|
-
resend_flag?: boolean;
|
|
23
|
-
/** 通知接受者账号列表 */
|
|
24
|
-
to_accids?: Array<string>;
|
|
25
|
-
/** false 或者 true, 是否存离线,只有 to_accids 不为空,才能设置为存离线,默认 false */
|
|
26
|
-
history_enable?: boolean;
|
|
27
|
-
/** 自定义的推送属性,限制json */
|
|
28
|
-
push_payload?: string;
|
|
29
|
-
/** 自定义的推送内容 */
|
|
30
|
-
push_content?: string;
|
|
31
|
-
/** 是否需要推送, false: 不需要, true: 需要, 默认 false */
|
|
32
|
-
push_enable?: boolean;
|
|
33
|
-
/** 是否需要消息计数, false: 不需要, true: 需要, 默认 true */
|
|
34
|
-
need_badge?: boolean;
|
|
35
|
-
/** 是否需要推送昵称, false: 不需要, true: 需要, 默认 true */
|
|
36
|
-
need_push_nick?: boolean;
|
|
37
|
-
/** 是否需要抄送, false: 不需要, true: 需要, 默认 true */
|
|
38
|
-
route_enable?: boolean;
|
|
39
|
-
/** 环境变量,用于指向不同的抄送、第三方回调等配置 */
|
|
40
|
-
env?: string;
|
|
41
|
-
/** 消息状态 */
|
|
42
|
-
status?: NIMQChatSystemNotificationStatus;
|
|
43
|
-
/** 消息服务器端id */
|
|
44
|
-
msg_server_id?: string;
|
|
45
|
-
/** 消息发送者的accid */
|
|
46
|
-
from_accid?: string;
|
|
47
|
-
/** 消息发送者的客户端类型 */
|
|
48
|
-
from_client_type?: number;
|
|
49
|
-
/** 消息发送者的设备id */
|
|
50
|
-
from_device_id?: string;
|
|
51
|
-
/** 消息发送者的昵称 */
|
|
52
|
-
from_nick?: string;
|
|
53
|
-
/** 消息发送时间戳 */
|
|
54
|
-
timestamp?: number;
|
|
55
|
-
/** 消息更新时间戳 */
|
|
56
|
-
update_timestamp?: number;
|
|
57
|
-
/** 回调扩展字段 */
|
|
58
|
-
callback_ext?: string;
|
|
59
|
-
}
|
|
60
|
-
/** @interface QChatTypingEvent */
|
|
61
|
-
export interface QChatTypingEvent {
|
|
62
|
-
/** 事件所属的server id */
|
|
63
|
-
server_id?: string;
|
|
64
|
-
/** 事件所属的channel id */
|
|
65
|
-
channel_id?: string;
|
|
66
|
-
/** 事件扩展字段 */
|
|
67
|
-
extension?: string;
|
|
68
|
-
/** 事件发送者的accid */
|
|
69
|
-
from_accid?: string;
|
|
70
|
-
/** 事件发送者的昵称 */
|
|
71
|
-
from_nick?: string;
|
|
72
|
-
/** 事件发送时间戳 */
|
|
73
|
-
timestamp?: number;
|
|
74
|
-
}
|
|
75
|
-
/** @interface QChatRecvSystemNotificationResp */
|
|
76
|
-
export interface QChatRecvSystemNotificationResp {
|
|
77
|
-
/** 系统消息 */
|
|
78
|
-
notification?: QChatSystemNotification;
|
|
79
|
-
}
|
|
80
|
-
/** @interface QChatSystemNotificationUpdatedResp */
|
|
81
|
-
export interface QChatSystemNotificationUpdatedResp {
|
|
82
|
-
/** 操作结果, 参考NIMResCode */
|
|
83
|
-
res_code?: number;
|
|
84
|
-
/** 消息更新信息 */
|
|
85
|
-
update_info?: QChatMessageUpdateInfo;
|
|
86
|
-
/** 消息体 */
|
|
87
|
-
notification?: QChatSystemNotification;
|
|
88
|
-
}
|
|
89
|
-
/** @interface QChatSendSystemNotificationResp */
|
|
90
|
-
export interface QChatSendSystemNotificationResp {
|
|
91
|
-
/** 操作结果, 参考NIMResCode */
|
|
92
|
-
res_code?: number;
|
|
93
|
-
/** 系统消息 */
|
|
94
|
-
notification?: QChatSystemNotification;
|
|
95
|
-
}
|
|
96
|
-
/** @interface QChatUpdateSystemNotificationResp */
|
|
97
|
-
export interface QChatUpdateSystemNotificationResp {
|
|
98
|
-
/** 操作结果, 参考NIMResCode */
|
|
99
|
-
res_code?: number;
|
|
100
|
-
/** 系统消息 */
|
|
101
|
-
notification?: QChatSystemNotification;
|
|
102
|
-
}
|
|
103
|
-
/** @interface QChatMarkReadSystemNotificationResp */
|
|
104
|
-
export type QChatMarkReadSystemNotificationResp = QChatBaseResp;
|
|
105
|
-
/** @interface QChatMarkSystemNotificationsReadResp */
|
|
106
|
-
export type QChatMarkSystemNotificationsReadResp = QChatBaseResp;
|
|
107
|
-
/** @interface QChatRecvTypingEventResp */
|
|
108
|
-
export interface QChatRecvTypingEventResp {
|
|
109
|
-
/** 圈组正在输入事件 */
|
|
110
|
-
typing_event?: QChatTypingEvent;
|
|
111
|
-
}
|
|
112
|
-
/** @interface QChatSendTypingEventResp */
|
|
113
|
-
export interface QChatSendTypingEventResp {
|
|
114
|
-
/** 操作结果, 参考NIMResCode */
|
|
115
|
-
res_code?: number;
|
|
116
|
-
/** 圈组正在输入事件 */
|
|
117
|
-
typing_event?: QChatTypingEvent;
|
|
118
|
-
}
|
|
119
|
-
/** 接收系统消息回调 */
|
|
120
|
-
export type RecvSystemNotificationCallback = (resp: QChatRecvSystemNotificationResp) => void;
|
|
121
|
-
/** 发送系统消息回调 */
|
|
122
|
-
export type SendSystemNotificationCallback = (resp: QChatSendSystemNotificationResp) => void;
|
|
123
|
-
/** 消息更新回调 */
|
|
124
|
-
export type SystemNotificationUpdatedCallback = (resp: QChatSystemNotificationUpdatedResp) => void;
|
|
125
|
-
/** 更新系统通知回调 */
|
|
126
|
-
export type UpdateSystemNotificationCallback = (resp: QChatUpdateSystemNotificationResp) => void;
|
|
127
|
-
/** 标记系统通知消息已读回调函数 */
|
|
128
|
-
export type MarkReadSystemNotificationCallback = (resp: QChatMarkSystemNotificationsReadResp) => void;
|
|
129
|
-
/** 接收圈组正在输入事件回调 */
|
|
130
|
-
export type RecvTypingEventCallback = (resp: QChatRecvTypingEventResp) => void;
|
|
131
|
-
/** 发送圈组正在输入事件回调 */
|
|
132
|
-
export type SendTypingEventCallback = (resp: QChatSendTypingEventResp) => void;
|
|
133
|
-
/** @interface QChatSendSystemNotificationParam */
|
|
134
|
-
export interface QChatSendSystemNotificationParam {
|
|
135
|
-
/** 系统消息体 */
|
|
136
|
-
notification?: QChatSystemNotification;
|
|
137
|
-
}
|
|
138
|
-
/** @interface QChatUpdateSystemNotificationParam */
|
|
139
|
-
export interface QChatUpdateSystemNotificationParam {
|
|
140
|
-
/** 系统通知服务器ID */
|
|
141
|
-
msg_server_id?: string;
|
|
142
|
-
/** 系统通知类型 */
|
|
143
|
-
msg_type?: NIMQChatSystemNotificationType;
|
|
144
|
-
/** 消息状态 */
|
|
145
|
-
status?: NIMQChatSystemNotificationStatus;
|
|
146
|
-
/** 消息内容 */
|
|
147
|
-
msg_body?: string;
|
|
148
|
-
/** 消息扩展字段 */
|
|
149
|
-
msg_ext?: string;
|
|
150
|
-
/** 更新信息 */
|
|
151
|
-
update_info?: QChatMessageUpdateInfo;
|
|
152
|
-
}
|
|
153
|
-
/** @interface NIMQChatSystemNotificationMarkReadInfo */
|
|
154
|
-
export interface NIMQChatSystemNotificationMarkReadInfo {
|
|
155
|
-
/** 消息服务器 id */
|
|
156
|
-
msg_server_id?: string;
|
|
157
|
-
/** 系统通知类型 */
|
|
158
|
-
msg_type?: NIMQChatSystemNotificationType;
|
|
159
|
-
}
|
|
160
|
-
/** @interface QChatMarkSystemNotificationsReadParam */
|
|
161
|
-
export interface QChatMarkSystemNotificationsReadParam {
|
|
162
|
-
cb?: MarkReadSystemNotificationCallback;
|
|
163
|
-
mark_read_infos?: Array<NIMQChatSystemNotificationMarkReadInfo>;
|
|
164
|
-
}
|
|
165
|
-
/** @interface QChatRegRecvTypingEventCbParam */
|
|
166
|
-
export interface QChatRegRecvTypingEventCbParam {
|
|
167
|
-
}
|
|
168
|
-
/** @interface QChatSendTypingEventParam */
|
|
169
|
-
export interface QChatSendTypingEventParam {
|
|
170
|
-
/** 圈组正在输入事件 */
|
|
171
|
-
typing_event?: QChatTypingEvent;
|
|
172
|
-
}
|
|
1
|
+
import { QChatMessageUpdateInfo } from './message_def';
|
|
2
|
+
import { NIMQChatSystemNotificationType, NIMQChatSystemNotificationStatus, QChatBaseResp, NIMQChatSystemNotificationToType } from './public_def';
|
|
3
|
+
/** @interface QChatSystemNotification */
|
|
4
|
+
export interface QChatSystemNotification {
|
|
5
|
+
/** 消息通知目标 */
|
|
6
|
+
to_type: NIMQChatSystemNotificationToType;
|
|
7
|
+
/** 消息所属的server id */
|
|
8
|
+
server_id?: string;
|
|
9
|
+
/** 消息所属的channel id */
|
|
10
|
+
channel_id?: string;
|
|
11
|
+
/** 消息id */
|
|
12
|
+
msg_id?: string;
|
|
13
|
+
/** 系统消息类型 */
|
|
14
|
+
msg_type?: NIMQChatSystemNotificationType;
|
|
15
|
+
/** 消息内容 */
|
|
16
|
+
msg_body?: string;
|
|
17
|
+
/** 消息附件 */
|
|
18
|
+
msg_attach?: string;
|
|
19
|
+
/** 消息扩展字段 */
|
|
20
|
+
msg_ext?: string;
|
|
21
|
+
/** 重发标记,false:不是重发,true:是重发 */
|
|
22
|
+
resend_flag?: boolean;
|
|
23
|
+
/** 通知接受者账号列表 */
|
|
24
|
+
to_accids?: Array<string>;
|
|
25
|
+
/** false 或者 true, 是否存离线,只有 to_accids 不为空,才能设置为存离线,默认 false */
|
|
26
|
+
history_enable?: boolean;
|
|
27
|
+
/** 自定义的推送属性,限制json */
|
|
28
|
+
push_payload?: string;
|
|
29
|
+
/** 自定义的推送内容 */
|
|
30
|
+
push_content?: string;
|
|
31
|
+
/** 是否需要推送, false: 不需要, true: 需要, 默认 false */
|
|
32
|
+
push_enable?: boolean;
|
|
33
|
+
/** 是否需要消息计数, false: 不需要, true: 需要, 默认 true */
|
|
34
|
+
need_badge?: boolean;
|
|
35
|
+
/** 是否需要推送昵称, false: 不需要, true: 需要, 默认 true */
|
|
36
|
+
need_push_nick?: boolean;
|
|
37
|
+
/** 是否需要抄送, false: 不需要, true: 需要, 默认 true */
|
|
38
|
+
route_enable?: boolean;
|
|
39
|
+
/** 环境变量,用于指向不同的抄送、第三方回调等配置 */
|
|
40
|
+
env?: string;
|
|
41
|
+
/** 消息状态 */
|
|
42
|
+
status?: NIMQChatSystemNotificationStatus;
|
|
43
|
+
/** 消息服务器端id */
|
|
44
|
+
msg_server_id?: string;
|
|
45
|
+
/** 消息发送者的accid */
|
|
46
|
+
from_accid?: string;
|
|
47
|
+
/** 消息发送者的客户端类型 */
|
|
48
|
+
from_client_type?: number;
|
|
49
|
+
/** 消息发送者的设备id */
|
|
50
|
+
from_device_id?: string;
|
|
51
|
+
/** 消息发送者的昵称 */
|
|
52
|
+
from_nick?: string;
|
|
53
|
+
/** 消息发送时间戳 */
|
|
54
|
+
timestamp?: number;
|
|
55
|
+
/** 消息更新时间戳 */
|
|
56
|
+
update_timestamp?: number;
|
|
57
|
+
/** 回调扩展字段 */
|
|
58
|
+
callback_ext?: string;
|
|
59
|
+
}
|
|
60
|
+
/** @interface QChatTypingEvent */
|
|
61
|
+
export interface QChatTypingEvent {
|
|
62
|
+
/** 事件所属的server id */
|
|
63
|
+
server_id?: string;
|
|
64
|
+
/** 事件所属的channel id */
|
|
65
|
+
channel_id?: string;
|
|
66
|
+
/** 事件扩展字段 */
|
|
67
|
+
extension?: string;
|
|
68
|
+
/** 事件发送者的accid */
|
|
69
|
+
from_accid?: string;
|
|
70
|
+
/** 事件发送者的昵称 */
|
|
71
|
+
from_nick?: string;
|
|
72
|
+
/** 事件发送时间戳 */
|
|
73
|
+
timestamp?: number;
|
|
74
|
+
}
|
|
75
|
+
/** @interface QChatRecvSystemNotificationResp */
|
|
76
|
+
export interface QChatRecvSystemNotificationResp {
|
|
77
|
+
/** 系统消息 */
|
|
78
|
+
notification?: QChatSystemNotification;
|
|
79
|
+
}
|
|
80
|
+
/** @interface QChatSystemNotificationUpdatedResp */
|
|
81
|
+
export interface QChatSystemNotificationUpdatedResp {
|
|
82
|
+
/** 操作结果, 参考NIMResCode */
|
|
83
|
+
res_code?: number;
|
|
84
|
+
/** 消息更新信息 */
|
|
85
|
+
update_info?: QChatMessageUpdateInfo;
|
|
86
|
+
/** 消息体 */
|
|
87
|
+
notification?: QChatSystemNotification;
|
|
88
|
+
}
|
|
89
|
+
/** @interface QChatSendSystemNotificationResp */
|
|
90
|
+
export interface QChatSendSystemNotificationResp {
|
|
91
|
+
/** 操作结果, 参考NIMResCode */
|
|
92
|
+
res_code?: number;
|
|
93
|
+
/** 系统消息 */
|
|
94
|
+
notification?: QChatSystemNotification;
|
|
95
|
+
}
|
|
96
|
+
/** @interface QChatUpdateSystemNotificationResp */
|
|
97
|
+
export interface QChatUpdateSystemNotificationResp {
|
|
98
|
+
/** 操作结果, 参考NIMResCode */
|
|
99
|
+
res_code?: number;
|
|
100
|
+
/** 系统消息 */
|
|
101
|
+
notification?: QChatSystemNotification;
|
|
102
|
+
}
|
|
103
|
+
/** @interface QChatMarkReadSystemNotificationResp */
|
|
104
|
+
export type QChatMarkReadSystemNotificationResp = QChatBaseResp;
|
|
105
|
+
/** @interface QChatMarkSystemNotificationsReadResp */
|
|
106
|
+
export type QChatMarkSystemNotificationsReadResp = QChatBaseResp;
|
|
107
|
+
/** @interface QChatRecvTypingEventResp */
|
|
108
|
+
export interface QChatRecvTypingEventResp {
|
|
109
|
+
/** 圈组正在输入事件 */
|
|
110
|
+
typing_event?: QChatTypingEvent;
|
|
111
|
+
}
|
|
112
|
+
/** @interface QChatSendTypingEventResp */
|
|
113
|
+
export interface QChatSendTypingEventResp {
|
|
114
|
+
/** 操作结果, 参考NIMResCode */
|
|
115
|
+
res_code?: number;
|
|
116
|
+
/** 圈组正在输入事件 */
|
|
117
|
+
typing_event?: QChatTypingEvent;
|
|
118
|
+
}
|
|
119
|
+
/** 接收系统消息回调 */
|
|
120
|
+
export type RecvSystemNotificationCallback = (resp: QChatRecvSystemNotificationResp) => void;
|
|
121
|
+
/** 发送系统消息回调 */
|
|
122
|
+
export type SendSystemNotificationCallback = (resp: QChatSendSystemNotificationResp) => void;
|
|
123
|
+
/** 消息更新回调 */
|
|
124
|
+
export type SystemNotificationUpdatedCallback = (resp: QChatSystemNotificationUpdatedResp) => void;
|
|
125
|
+
/** 更新系统通知回调 */
|
|
126
|
+
export type UpdateSystemNotificationCallback = (resp: QChatUpdateSystemNotificationResp) => void;
|
|
127
|
+
/** 标记系统通知消息已读回调函数 */
|
|
128
|
+
export type MarkReadSystemNotificationCallback = (resp: QChatMarkSystemNotificationsReadResp) => void;
|
|
129
|
+
/** 接收圈组正在输入事件回调 */
|
|
130
|
+
export type RecvTypingEventCallback = (resp: QChatRecvTypingEventResp) => void;
|
|
131
|
+
/** 发送圈组正在输入事件回调 */
|
|
132
|
+
export type SendTypingEventCallback = (resp: QChatSendTypingEventResp) => void;
|
|
133
|
+
/** @interface QChatSendSystemNotificationParam */
|
|
134
|
+
export interface QChatSendSystemNotificationParam {
|
|
135
|
+
/** 系统消息体 */
|
|
136
|
+
notification?: QChatSystemNotification;
|
|
137
|
+
}
|
|
138
|
+
/** @interface QChatUpdateSystemNotificationParam */
|
|
139
|
+
export interface QChatUpdateSystemNotificationParam {
|
|
140
|
+
/** 系统通知服务器ID */
|
|
141
|
+
msg_server_id?: string;
|
|
142
|
+
/** 系统通知类型 */
|
|
143
|
+
msg_type?: NIMQChatSystemNotificationType;
|
|
144
|
+
/** 消息状态 */
|
|
145
|
+
status?: NIMQChatSystemNotificationStatus;
|
|
146
|
+
/** 消息内容 */
|
|
147
|
+
msg_body?: string;
|
|
148
|
+
/** 消息扩展字段 */
|
|
149
|
+
msg_ext?: string;
|
|
150
|
+
/** 更新信息 */
|
|
151
|
+
update_info?: QChatMessageUpdateInfo;
|
|
152
|
+
}
|
|
153
|
+
/** @interface NIMQChatSystemNotificationMarkReadInfo */
|
|
154
|
+
export interface NIMQChatSystemNotificationMarkReadInfo {
|
|
155
|
+
/** 消息服务器 id */
|
|
156
|
+
msg_server_id?: string;
|
|
157
|
+
/** 系统通知类型 */
|
|
158
|
+
msg_type?: NIMQChatSystemNotificationType;
|
|
159
|
+
}
|
|
160
|
+
/** @interface QChatMarkSystemNotificationsReadParam */
|
|
161
|
+
export interface QChatMarkSystemNotificationsReadParam {
|
|
162
|
+
cb?: MarkReadSystemNotificationCallback;
|
|
163
|
+
mark_read_infos?: Array<NIMQChatSystemNotificationMarkReadInfo>;
|
|
164
|
+
}
|
|
165
|
+
/** @interface QChatRegRecvTypingEventCbParam */
|
|
166
|
+
export interface QChatRegRecvTypingEventCbParam {
|
|
167
|
+
}
|
|
168
|
+
/** @interface QChatSendTypingEventParam */
|
|
169
|
+
export interface QChatSendTypingEventParam {
|
|
170
|
+
/** 圈组正在输入事件 */
|
|
171
|
+
typing_event?: QChatTypingEvent;
|
|
172
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { V2NIMInitOption, V2NIMError, V2NIMChatroomEnterParams, V2NIMChatroomEnterResult, V2NIMChatroomInfo, V2NIMChatroomKickedInfo } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
|
+
import { EventEmitter } from 'eventemitter3';
|
|
3
|
+
import { V2NIMChatroomService } from './v2_nim_chatroom_service';
|
|
4
|
+
import { V2NIMStorageService } from './v2_nim_storage_service';
|
|
5
|
+
export declare interface V2NIMChatroomClientEvents {
|
|
6
|
+
/** @brief 聊天室状态 */
|
|
7
|
+
chatroomStatus: (status: number, error: V2NIMError) => void;
|
|
8
|
+
/** @brief 进入聊天室 */
|
|
9
|
+
chatroomEntered: () => void;
|
|
10
|
+
/** @brief 退出聊天室 */
|
|
11
|
+
chatroomExited: (error: V2NIMError) => void;
|
|
12
|
+
/** @brief 自己被踢出聊天室 */
|
|
13
|
+
chatroomKicked: (kickedInfo: V2NIMChatroomKickedInfo) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare class V2NIMChatroomClient extends EventEmitter<V2NIMChatroomClientEvents> {
|
|
16
|
+
instance: any;
|
|
17
|
+
chatroomService: V2NIMChatroomService;
|
|
18
|
+
storageService: V2NIMStorageService;
|
|
19
|
+
static chatroomSdk: any;
|
|
20
|
+
constructor(instanceId?: number);
|
|
21
|
+
/** @brief 初始化 */
|
|
22
|
+
/** @param option 初始化选项 */
|
|
23
|
+
/** @return V2NIMError */
|
|
24
|
+
static init(option: V2NIMInitOption): V2NIMError | null;
|
|
25
|
+
/** @brief 反初始化 */
|
|
26
|
+
/** @return void */
|
|
27
|
+
/** @warning 请在退出程序前调用此方法 */
|
|
28
|
+
static uninit(): void;
|
|
29
|
+
/** @brief 创建聊天室客户端实例 */
|
|
30
|
+
/** @return V2NIMChatroomClient */
|
|
31
|
+
/** @pre 必须在调用此方法前调用 V2NIMChatroomClient::init */
|
|
32
|
+
/** @note 建议保存持有实例 ID 而不是实例本身 */
|
|
33
|
+
static newInstance(): V2NIMChatroomClient;
|
|
34
|
+
/** @brief 销毁聊天室客户端实例 */
|
|
35
|
+
/** @param instanceId 聊天室客户端实例 ID */
|
|
36
|
+
/** @return void */
|
|
37
|
+
/** @pre 必须在调用此方法前调用 V2NIMChatroomClient::init */
|
|
38
|
+
/** @warning 严禁在调用此方法后访问对应的聊天室客户端实例 */
|
|
39
|
+
static destroyInstance(instanceId: number): void;
|
|
40
|
+
/** @brief 获取聊天室客户端实例 */
|
|
41
|
+
/** @return V2NIMChatroomClient */
|
|
42
|
+
/** @pre 必须在调用此方法前调用 V2NIMChatroomClient::init */
|
|
43
|
+
static getInstance(instanceId: number): V2NIMChatroomClient | null;
|
|
44
|
+
/** @brief 获取聊天室实例列表 */
|
|
45
|
+
/** @return Array<V2NIMChatroomClient> */
|
|
46
|
+
/** @pre 必须在调用此方法前调用 V2NIMChatroomClient::init */
|
|
47
|
+
static getInstanceList(): Array<V2NIMChatroomClient>;
|
|
48
|
+
/** @brief 销毁所有聊天室客户端实例 */
|
|
49
|
+
/** @return void */
|
|
50
|
+
/** @pre 必须在调用此方法前调用 V2NIMChatroomClient::init */
|
|
51
|
+
/** @warning 严禁在调用此方法后访问任何聊天室客户端实例, 此方法会退出聊天室, 耗时可能较长 */
|
|
52
|
+
static destroyAll(): void;
|
|
53
|
+
/** @brief 获取聊天室客户端实例 ID */
|
|
54
|
+
/** @return size_t */
|
|
55
|
+
getInstanceId(): number;
|
|
56
|
+
/** @brief 进入聊天室 */
|
|
57
|
+
/** @param roomId 聊天室 ID */
|
|
58
|
+
/** @param enterParams 进入聊天室相关参数 */
|
|
59
|
+
/** @return void */
|
|
60
|
+
enter(roomId: string, enterParams: V2NIMChatroomEnterParams): Promise<V2NIMChatroomEnterResult>;
|
|
61
|
+
/** @brief 退出聊天室 */
|
|
62
|
+
/** @return void */
|
|
63
|
+
exit(): void;
|
|
64
|
+
/** @brief 查询聊天室信息 */
|
|
65
|
+
/** @return V2NIMChatroomInfo */
|
|
66
|
+
getChatroomInfo(): V2NIMChatroomInfo;
|
|
67
|
+
/** @brief 获取聊天室服务 */
|
|
68
|
+
/** @return V2NIMChatroomService */
|
|
69
|
+
getChatroomService(): V2NIMChatroomService;
|
|
70
|
+
/** @brief 获取存储服务 */
|
|
71
|
+
/** @return V2NIMStorageService */
|
|
72
|
+
getStorageService(): V2NIMStorageService;
|
|
73
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import EventEmitter from 'eventemitter3';
|
|
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
|
+
export declare interface V2NIMChatroomServiceEvents {
|
|
4
|
+
/** 收到新消息 */
|
|
5
|
+
receiveMessages: [V2NIMChatroomMessage[]];
|
|
6
|
+
/** 聊天室成员进入 */
|
|
7
|
+
chatroomMemberEnter: [V2NIMChatroomMember];
|
|
8
|
+
/** 聊天室成员退出 */
|
|
9
|
+
chatroomMemberExit: [string];
|
|
10
|
+
/** 聊天室成员角色变更 */
|
|
11
|
+
chatroomMemberRoleUpdated: [V2NIMChatroomMemberRole, V2NIMChatroomMember];
|
|
12
|
+
/** 聊天室成员信息更新 */
|
|
13
|
+
chatroomMemberInfoUpdated: [V2NIMChatroomMember];
|
|
14
|
+
/** 自己的禁言状态变更 */
|
|
15
|
+
selfChatBannedUpdated: [boolean];
|
|
16
|
+
/** 自己的临时禁言状态变更 */
|
|
17
|
+
selfTempChatBannedUpdated: [boolean, number];
|
|
18
|
+
/** 聊天室信息更新 */
|
|
19
|
+
chatroomInfoUpdated: [V2NIMChatroomInfo];
|
|
20
|
+
/** 聊天室禁言状态更新 */
|
|
21
|
+
chatroomChatBannedUpdated: [boolean];
|
|
22
|
+
/** 消息撤回回调 */
|
|
23
|
+
messageRevokedNotification: [string, number];
|
|
24
|
+
/** 角色标签更新 */
|
|
25
|
+
chatroomTagsUpdated: [string[]];
|
|
26
|
+
}
|
|
27
|
+
/** @brief 聊天室服务 */
|
|
28
|
+
export declare class V2NIMChatroomService extends EventEmitter<V2NIMChatroomServiceEvents> {
|
|
29
|
+
instance: any;
|
|
30
|
+
constructor(instanceId: number);
|
|
31
|
+
/** @brief 发送消息 */
|
|
32
|
+
/** @param message 需要发送的消息体 */
|
|
33
|
+
/** @param params 发送消息相关配置参数 */
|
|
34
|
+
/** @return void */
|
|
35
|
+
sendMessage(message: V2NIMChatroomMessage, params: V2NIMSendChatroomMessageParams): Promise<V2NIMSendChatroomMessageResult>;
|
|
36
|
+
/** @brief 取消文件消息附件上传 */
|
|
37
|
+
/** @param message 要取消上传的文件消息 */
|
|
38
|
+
cancelMessageAttachmentUpload(message: V2NIMChatroomMessage): Promise<void>;
|
|
39
|
+
/** @brief 分页获取聊天室成员列表 */
|
|
40
|
+
/** @param queryOption 查询选项 */
|
|
41
|
+
/** @return void */
|
|
42
|
+
getMemberListByOption(queryOption: V2NIMChatroomMemberQueryOption): Promise<V2NIMChatroomMemberListResult>;
|
|
43
|
+
/** @brief 查询历史消息 */
|
|
44
|
+
/** @param option 查询选项 */
|
|
45
|
+
/** @return void */
|
|
46
|
+
getMessageList(option: V2NIMChatroomMessageListOption): Promise<Array<V2NIMChatroomMessage>>;
|
|
47
|
+
/** @brief 更新聊天室成员角色 */
|
|
48
|
+
/** @param accountId 聊天室成员 id */
|
|
49
|
+
/** @param upadateParams 更新参数 */
|
|
50
|
+
/** @return void */
|
|
51
|
+
updateMemberRole(accountId: string, upadateParams: V2NIMChatroomMemberRoleUpdateParams): Promise<void>;
|
|
52
|
+
/** @brief 设置聊天室成员黑名单状态 */
|
|
53
|
+
/** @param accountId 聊天室成员 id */
|
|
54
|
+
/** @param blocked 黑名单状态 */
|
|
55
|
+
/** @param notificationExtension 通知扩展字段 */
|
|
56
|
+
/** @return void */
|
|
57
|
+
setMemberBlockedStatus(accountId: string, blocked: boolean, notificationExtension: string): Promise<void>;
|
|
58
|
+
/** @brief 设置聊天室成员禁言状态 */
|
|
59
|
+
/** @param accountId 聊天室成员 id */
|
|
60
|
+
/** @param chatBanned 禁言状态 */
|
|
61
|
+
/** @param notificationExtension 通知扩展字段 */
|
|
62
|
+
/** @return void */
|
|
63
|
+
setMemberChatBannedStatus(accountId: string, chatBanned: boolean, notificationExtension: string): Promise<void>;
|
|
64
|
+
/** @brief 设置聊天室成员临时禁言状态 */
|
|
65
|
+
/** @param accountId 聊天室成员 id */
|
|
66
|
+
/** @param tempChatBannedDuration 临时禁言时长, 单位秒, 0 表示取消临时禁言 */
|
|
67
|
+
/** @param notificationEnabled 是否发送通知 */
|
|
68
|
+
/** @param notificationExtension 通知扩展字段 */
|
|
69
|
+
/** @return void */
|
|
70
|
+
setMemberTempChatBanned(accountId: string, tempChatBannedDuration: number, notificationEnabled: boolean, notificationExtension: string): Promise<void>;
|
|
71
|
+
/** @brief 更新聊天室信息 */
|
|
72
|
+
/** @param updateParams 更新参数 */
|
|
73
|
+
/** @param antispamConfig 反垃圾配置 */
|
|
74
|
+
/** @return void */
|
|
75
|
+
updateChatroomInfo(updateParams: V2NIMChatroomUpdateParams, antispamConfig: V2NIMAntispamConfig): Promise<void>;
|
|
76
|
+
/** @brief 更新自己在聊天室的成员信息 */
|
|
77
|
+
/** @param updateParams 更新参数 */
|
|
78
|
+
/** @param antispamConfig 反垃圾配置 */
|
|
79
|
+
/** @return void */
|
|
80
|
+
updateSelfMemberInfo(updateParams: V2NIMChatroomSelfMemberUpdateParams, antispamConfig: V2NIMAntispamConfig): Promise<void>;
|
|
81
|
+
/** @brief 根据账号列表查询成员信息 */
|
|
82
|
+
/** @param accountIds 账号列表 */
|
|
83
|
+
/** @return void */
|
|
84
|
+
getMemberByIds(accountIds: Array<string>): Promise<Array<V2NIMChatroomMember>>;
|
|
85
|
+
/** @brief 踢出聊天室成员 */
|
|
86
|
+
/** @param accountId 聊天室成员 id */
|
|
87
|
+
/** @param notificationExtension 通知扩展字段 */
|
|
88
|
+
/** @return void */
|
|
89
|
+
kickMember(accountId: string, notificationExtension: string): Promise<void>;
|
|
90
|
+
/** @brief 按聊天室标签临时禁言 */
|
|
91
|
+
/** @param params 设置标签禁言的参数 */
|
|
92
|
+
/** @return void */
|
|
93
|
+
setTempChatBannedByTag(params: V2NIMChatroomTagTempChatBannedParams): Promise<void>;
|
|
94
|
+
/** @brief 根据标签查询成员列表 */
|
|
95
|
+
/** @param option 查询成员列表的参数 */
|
|
96
|
+
/** @return void */
|
|
97
|
+
getMemberListByTag(option: V2NIMChatroomTagMemberOption): Promise<V2NIMChatroomMemberListResult>;
|
|
98
|
+
/** @brief 查询某个标签下的成员人数 */
|
|
99
|
+
/** @param tag 标签 */
|
|
100
|
+
/** @return void */
|
|
101
|
+
getMemberCountByTag(tag: string): Promise<number>;
|
|
102
|
+
/** @brief 更新坐标信息 */
|
|
103
|
+
/** @param locationConfig 坐标信息 */
|
|
104
|
+
/** @return void */
|
|
105
|
+
updateChatroomLocationInfo(locationConfig: V2NIMChatroomLocationConfig): Promise<void>;
|
|
106
|
+
/** @brief 更新聊天室 tag 信息 */
|
|
107
|
+
/** @param updateParams tag 更新的参数 */
|
|
108
|
+
/** @return void */
|
|
109
|
+
updateChatroomTags(updateParams: V2NIMChatroomTagsUpdateParams): Promise<void>;
|
|
110
|
+
/** @brief 根据标签查询消息列表 */
|
|
111
|
+
/** @param messageOption 查询参数 */
|
|
112
|
+
/** @return void */
|
|
113
|
+
getMessageListByTag(messageOption: V2NIMChatroomTagMessageOption): Promise<Array<V2NIMChatroomMessage>>;
|
|
114
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { V2NIMInitOption, V2NIMError } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
|
+
import { EventEmitter } from 'eventemitter3';
|
|
3
|
+
import { V2NIMLoginService } from './v2_nim_login_service';
|
|
4
|
+
import { V2NIMConversationGroupService } from './v2_nim_conversation_group_service';
|
|
5
|
+
import { V2NIMConversationService } from './v2_nim_conversation_service';
|
|
6
|
+
import { V2NIMMessageService } from './v2_nim_message_service';
|
|
7
|
+
import { V2NIMNotificationService } from './v2_nim_notification_service';
|
|
8
|
+
import { V2NIMStorageService } from './v2_nim_storage_service';
|
|
9
|
+
import { V2NIMConversationIdUtil, V2NIMMessageCreator, V2NIMClientAntispamUtil } from './v2_nim_utilities';
|
|
10
|
+
import { V2NIMTeamService } from './v2_nim_team_service';
|
|
11
|
+
import { V2NIMSettingService } from './v2_nim_setting_service';
|
|
12
|
+
import { V2NIMFriendService } from './v2_nim_friend_service';
|
|
13
|
+
import { V2NIMUserService } from './v2_nim_user_service';
|
|
14
|
+
export declare interface V2NIMClientEvents {
|
|
15
|
+
}
|
|
16
|
+
export declare class V2NIMClient extends EventEmitter<V2NIMClientEvents> {
|
|
17
|
+
instance: any;
|
|
18
|
+
conversationIdUtil: V2NIMConversationIdUtil | null;
|
|
19
|
+
messageCreator: V2NIMMessageCreator | null;
|
|
20
|
+
clientAntispamUtil: V2NIMClientAntispamUtil | null;
|
|
21
|
+
loginService: V2NIMLoginService | null;
|
|
22
|
+
conversationService: V2NIMConversationService | null;
|
|
23
|
+
conversationGroupService: V2NIMConversationGroupService | null;
|
|
24
|
+
messageService: V2NIMMessageService | null;
|
|
25
|
+
notificationService: V2NIMNotificationService | null;
|
|
26
|
+
storageService: V2NIMStorageService | null;
|
|
27
|
+
teamService: V2NIMTeamService | null;
|
|
28
|
+
settingService: V2NIMSettingService | null;
|
|
29
|
+
userService: V2NIMUserService | null;
|
|
30
|
+
friendService: V2NIMFriendService | null;
|
|
31
|
+
constructor();
|
|
32
|
+
/**
|
|
33
|
+
* 初始化
|
|
34
|
+
* @param option - 初始化选项
|
|
35
|
+
* @returns V2NIMError | null
|
|
36
|
+
* @example
|
|
37
|
+
*/
|
|
38
|
+
init(option: V2NIMInitOption): V2NIMError | null;
|
|
39
|
+
/** @brief 反初始化
|
|
40
|
+
* @return V2NIMError | null
|
|
41
|
+
*/
|
|
42
|
+
uninit(): V2NIMError | null;
|
|
43
|
+
/** @brief 获取登录服务
|
|
44
|
+
* @return V2NIMLoginService
|
|
45
|
+
*/
|
|
46
|
+
getLoginService(): V2NIMLoginService | null;
|
|
47
|
+
/** @brief 获取会话服务
|
|
48
|
+
/* @return V2NIMConversationService
|
|
49
|
+
*/
|
|
50
|
+
getConversationService(): V2NIMConversationService | null;
|
|
51
|
+
/** @brief 获取会话分组服务
|
|
52
|
+
* @return V2NIMConversationGroupService
|
|
53
|
+
*/
|
|
54
|
+
getConversationGroupService(): V2NIMConversationGroupService | null;
|
|
55
|
+
/** @brief 获取消息服务
|
|
56
|
+
* @return V2NIMMessageService
|
|
57
|
+
*/
|
|
58
|
+
getMessageService(): V2NIMMessageService | null;
|
|
59
|
+
/** @brief 获取通知服务
|
|
60
|
+
* @return V2NIMNotificationService
|
|
61
|
+
*/
|
|
62
|
+
getNotificationService(): V2NIMNotificationService | null;
|
|
63
|
+
/** @brief 获取存储服务
|
|
64
|
+
* @return V2NIMStorageService
|
|
65
|
+
*/
|
|
66
|
+
getStorageService(): V2NIMStorageService | null;
|
|
67
|
+
/** @brief 获取群组服务
|
|
68
|
+
* @return V2NIMTeamService
|
|
69
|
+
*/
|
|
70
|
+
getTeamService(): V2NIMTeamService | null;
|
|
71
|
+
/** @brief 获取设置服务
|
|
72
|
+
* @return V2NIMSettingService
|
|
73
|
+
*/
|
|
74
|
+
getSettingService(): V2NIMSettingService | null;
|
|
75
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { V2NIMConversationGroup, V2NIMConversation, V2NIMConversationGroupResult, V2NIMConversationOperationResult } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
|
+
import { EventEmitter } from 'eventemitter3';
|
|
3
|
+
export declare interface V2NIMConversationGroupServiceEvents {
|
|
4
|
+
/** 会话分组创建通知 */
|
|
5
|
+
conversationGroupCreated: [V2NIMConversationGroup];
|
|
6
|
+
/** 会话分组删除通知 */
|
|
7
|
+
conversationGroupDeleted: [string];
|
|
8
|
+
/** 会话分组更新通知 */
|
|
9
|
+
conversationGroupChanged: [V2NIMConversationGroup];
|
|
10
|
+
/** 会话加入会话分组通知 */
|
|
11
|
+
conversationsAddedToGroup: [string, Array<V2NIMConversation>];
|
|
12
|
+
/** 会话移出会话分组通知 */
|
|
13
|
+
conversationsRemovedFromGroup: [string, string[]];
|
|
14
|
+
}
|
|
15
|
+
export declare class V2NIMConversationGroupService extends EventEmitter<V2NIMConversationGroupServiceEvents> {
|
|
16
|
+
instance: any;
|
|
17
|
+
constructor();
|
|
18
|
+
/** @brief 创建会话分组
|
|
19
|
+
* @param name 会话分组名称
|
|
20
|
+
* @param conversationIds 会话 ID 列表
|
|
21
|
+
*/
|
|
22
|
+
createConversationGroup(name: string, serverExtension?: string, conversationIds?: string[]): Promise<V2NIMConversationGroupResult>;
|
|
23
|
+
/** @brief 删除会话分组
|
|
24
|
+
* @param groupId 会话分组 ID
|
|
25
|
+
*/
|
|
26
|
+
deleteConversationGroup(groupId: string): Promise<void>;
|
|
27
|
+
/** @brief 更新会话分组
|
|
28
|
+
* @param groupId 会话分组 ID
|
|
29
|
+
* @param name 新的会话分组名称
|
|
30
|
+
* @param serverExtension 扩展字段
|
|
31
|
+
*/
|
|
32
|
+
updateConversationGroup(groupId: string, name?: string, serverExtension?: string): Promise<void>;
|
|
33
|
+
/** @brief 添加会话到会话分组
|
|
34
|
+
* @param groupId 会话分组 ID
|
|
35
|
+
* @param conversationIds 会话 ID 列表
|
|
36
|
+
*/
|
|
37
|
+
addConversationsToGroup(groupId: string, conversationIds: string[]): Promise<Array<V2NIMConversationOperationResult>>;
|
|
38
|
+
/** @brief 从会话分组中移除会话
|
|
39
|
+
* @param groupId 会话分组 ID
|
|
40
|
+
* @param conversationIds 会话 ID 列表
|
|
41
|
+
*/
|
|
42
|
+
removeConversationsFromGroup(groupId: string, conversationIds: string[]): Promise<Array<V2NIMConversationOperationResult>>;
|
|
43
|
+
/** @brief 获取会话分组信息
|
|
44
|
+
* @param groupId 会话分组 ID
|
|
45
|
+
*/
|
|
46
|
+
getConversationGroup(groupId: string): Promise<V2NIMConversationGroup>;
|
|
47
|
+
/** @brief 获取会话分组列表
|
|
48
|
+
*/
|
|
49
|
+
getConversationGroupList(): Promise<Array<V2NIMConversationGroup>>;
|
|
50
|
+
/** @brief 根据会话分组 ID 获取会话分组
|
|
51
|
+
* @param groupId 会话分组 ID
|
|
52
|
+
*/
|
|
53
|
+
getConversationGroupListByIds(groupIds: string[]): Promise<Array<V2NIMConversationGroup>>;
|
|
54
|
+
}
|