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
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { V2NIMCreateTeamParams, V2NIMAntispamConfig, V2NIMCreateTeamResult, V2NIMError, V2NIMUpdateTeamInfoParams, V2NIMTeam, V2NIMUpdateSelfMemberInfoParams, V2NIMTeamMemberQueryOption, V2NIMTeamMemberListResult, V2NIMTeamMember, V2NIMTeamJoinActionInfo, V2NIMTeamJoinActionInfoResult, V2NIMTeamJoinActionInfoQueryOption } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
|
+
import { EventEmitter } from 'eventemitter3';
|
|
3
|
+
export declare interface V2NIMTeamServiceEvents {
|
|
4
|
+
/** 群组信息同步开始 */
|
|
5
|
+
syncStarted: [];
|
|
6
|
+
/** 群组信息同步完成 */
|
|
7
|
+
syncFinished: [];
|
|
8
|
+
/** 群组信息同步失败 */
|
|
9
|
+
syncFailed: [V2NIMError];
|
|
10
|
+
/** 群组创建 */
|
|
11
|
+
teamCreated: [V2NIMTeam];
|
|
12
|
+
/** 加入群组 */
|
|
13
|
+
teamDismissed: [Array<V2NIMTeam>];
|
|
14
|
+
/** 群组创建 */
|
|
15
|
+
teamJoined: [V2NIMTeam];
|
|
16
|
+
/** 离开群组 */
|
|
17
|
+
teamLeft: [team: V2NIMTeam, isKicked: boolean];
|
|
18
|
+
/** 群组信息更新 */
|
|
19
|
+
teamInfoUpdated: [V2NIMTeam];
|
|
20
|
+
/** 群组成员加入 */
|
|
21
|
+
teamMemberJoined: [Array<V2NIMTeamMember>];
|
|
22
|
+
/** 群组成员被踢 */
|
|
23
|
+
teamMemberKicked: [operateAccountId: string, teamMembers: Array<V2NIMTeamMember>];
|
|
24
|
+
/** 群组成员退出群组 */
|
|
25
|
+
teamMemberLeft: [Array<V2NIMTeamMember>];
|
|
26
|
+
/** 群组成员信息变更 */
|
|
27
|
+
teamMemberInfoUpdated: [Array<V2NIMTeamMember>];
|
|
28
|
+
/** 收到入群信息 */
|
|
29
|
+
receiveTeamJoinActionInfo: [V2NIMTeamJoinActionInfo];
|
|
30
|
+
}
|
|
31
|
+
/** @brief 存储服务 */
|
|
32
|
+
export declare class V2NIMTeamService extends EventEmitter<V2NIMTeamServiceEvents> {
|
|
33
|
+
instance: any;
|
|
34
|
+
constructor();
|
|
35
|
+
/** @brief 创建群组 */
|
|
36
|
+
/** @param createTeamParams 创建群组参数 */
|
|
37
|
+
/** @param inviteeAccountIds 群组创建时, 同时被邀请加入群的成员列表 */
|
|
38
|
+
/** @param postscript 群组创建时, 邀请入群的附言 */
|
|
39
|
+
/** @param antispamConfig 反垃圾配置 */
|
|
40
|
+
/** @return void */
|
|
41
|
+
createTeam(createTeamParams: V2NIMCreateTeamParams, inviteeAccountIds: Array<string>, postscript: string, antispamConfig: V2NIMAntispamConfig): Promise<V2NIMCreateTeamResult>;
|
|
42
|
+
/** @brief 修改群组信息 */
|
|
43
|
+
/** @param teamId 群组 id */
|
|
44
|
+
/** @param teamType 群组类型 */
|
|
45
|
+
/** @param updateTeamInfoParams 修改群组信息参数 */
|
|
46
|
+
/** @param antispamConfig 反垃圾配置 */
|
|
47
|
+
/** @return void */
|
|
48
|
+
updateTeamInfo(teamId: string, teamType: V2NIMTeamType, updateTeamInfoParams: V2NIMUpdateTeamInfoParams, antispamConfig: V2NIMAntispamConfig): Promise<void>;
|
|
49
|
+
/** @brief 退出群组 */
|
|
50
|
+
/** @param teamId 群组 id */
|
|
51
|
+
/** @param teamType 群组类型 */
|
|
52
|
+
/** @return void */
|
|
53
|
+
leaveTeam(teamId: string, teamType: V2NIMTeamType): Promise<void>;
|
|
54
|
+
/** @brief 获取群组信息 */
|
|
55
|
+
/** @param teamId 群组 id */
|
|
56
|
+
/** @param teamType 群组类型 */
|
|
57
|
+
/** @return void */
|
|
58
|
+
getTeamInfo(teamId: string, teamType: V2NIMTeamType): Promise<V2NIMTeam>;
|
|
59
|
+
/** @brief 根据群组 ID 获取群组信息 */
|
|
60
|
+
/** @param teamIds 群组 id 列表 */
|
|
61
|
+
/** @param teamType 群组类型 */
|
|
62
|
+
/** @return void */
|
|
63
|
+
getTeamInfoByIds(teamIds: Array<string>, teamType: V2NIMTeamType): Promise<Array<V2NIMTeam>>;
|
|
64
|
+
/** @brief 解散群组 */
|
|
65
|
+
/** @param teamId 群组 id */
|
|
66
|
+
/** @param teamType 群组类型 */
|
|
67
|
+
/** @return void */
|
|
68
|
+
dismissTeam(teamId: string, teamType: V2NIMTeamType): Promise<void>;
|
|
69
|
+
/** @brief 邀请成员加入群组 */
|
|
70
|
+
/** @param teamId 群组 id */
|
|
71
|
+
/** @param teamType 群组类型 */
|
|
72
|
+
/** @param inviteeAccountIds 被邀请人 id 列表 */
|
|
73
|
+
/** @param postscript 邀请附言 */
|
|
74
|
+
/** @return void */
|
|
75
|
+
inviteMember(teamId: string, teamType: V2NIMTeamType, inviteeAccountIds: Array<string>, postscript: string): Promise<Array<string>>;
|
|
76
|
+
/** @brief 同意邀请入群 */
|
|
77
|
+
/** @param teamId 群组 id */
|
|
78
|
+
/** @param teamType 群组类型 */
|
|
79
|
+
/** @param invitorAccountId 邀请人 id */
|
|
80
|
+
/** @return void */
|
|
81
|
+
acceptInvitation(invitationInfo: V2NIMTeamJoinActionInfo): Promise<V2NIMTeam>;
|
|
82
|
+
/** @brief 拒绝邀请入群 */
|
|
83
|
+
/** @param teamId 群组 id */
|
|
84
|
+
/** @param teamType 群组类型 */
|
|
85
|
+
/** @param invitorAccountId 邀请人 id */
|
|
86
|
+
/** @param postscript 拒绝邀请的理由附言 */
|
|
87
|
+
/** @return void */
|
|
88
|
+
rejectInvitation(invitationInfo: V2NIMTeamJoinActionInfo, postscript: string): Promise<void>;
|
|
89
|
+
/** @brief 踢出群组成员 */
|
|
90
|
+
/** @param teamId 群组 id */
|
|
91
|
+
/** @param teamType 群组类型 */
|
|
92
|
+
/** @param memberAccountIds 踢出群组的成员账号列表 */
|
|
93
|
+
/** @return void */
|
|
94
|
+
kickMember(teamId: string, teamType: V2NIMTeamType, memberAccountIds: Array<string>): Promise<void>;
|
|
95
|
+
/** @brief 申请加入群组 */
|
|
96
|
+
/** @param teamId 群组 id */
|
|
97
|
+
/** @param teamType 群组类型 */
|
|
98
|
+
/** @param postscript 申请入群的附言 */
|
|
99
|
+
/** @return void */
|
|
100
|
+
applyJoinTeam(teamId: string, teamType: V2NIMTeamType, postscript: string): Promise<V2NIMTeam>;
|
|
101
|
+
/** @brief 接受入群申请 */
|
|
102
|
+
/** @param teamId 群组 id */
|
|
103
|
+
/** @param teamType 群组类型 */
|
|
104
|
+
/** @param applyAccountId 申请人 id */
|
|
105
|
+
/** @return void */
|
|
106
|
+
acceptJoinApplication(applicationInfo: V2NIMTeamJoinActionInfo): Promise<void>;
|
|
107
|
+
/** @brief 拒绝入群申请 */
|
|
108
|
+
/** @param teamId 群组 id */
|
|
109
|
+
/** @param teamType 群组类型 */
|
|
110
|
+
/** @param applyAccountId 申请人 id */
|
|
111
|
+
/** @param postscript 拒绝入群申请的附言 */
|
|
112
|
+
/** @return void */
|
|
113
|
+
rejectJoinApplication(applicationInfo: V2NIMTeamJoinActionInfo, postscript: string): Promise<void>;
|
|
114
|
+
/** @brief 设置成员角色 */
|
|
115
|
+
/** @param teamId 群组 id */
|
|
116
|
+
/** @param teamType 群组类型 */
|
|
117
|
+
/** @param memberAccountId 成员 id */
|
|
118
|
+
/** @param memberRole 设置新的角色类型 */
|
|
119
|
+
/** @return void */
|
|
120
|
+
updateTeamMemberRole(teamId: string, teamType: V2NIMTeamType, memberAccountIds: Array<string>, memberRole: V2NIMTeamMemberRole): Promise<void>;
|
|
121
|
+
/** @brief 移交群主 */
|
|
122
|
+
/** @param teamId 群组 id */
|
|
123
|
+
/** @param teamType 群组类型 */
|
|
124
|
+
/** @param accountId 新群主 id */
|
|
125
|
+
/** @param leave 是否同时退出群组 */
|
|
126
|
+
/** @return void */
|
|
127
|
+
transferTeamOwner(teamId: string, teamType: V2NIMTeamType, accountId: string, leave: boolean): Promise<void>;
|
|
128
|
+
/** @brief 修改自己的群成员信息 */
|
|
129
|
+
/** @param teamId 群组 id */
|
|
130
|
+
/** @param teamType 群组类型 */
|
|
131
|
+
/** @param memberInfoParams 修改群成员信息参数 */
|
|
132
|
+
/** @return void */
|
|
133
|
+
updateSelfTeamMemberInfo(teamId: string, teamType: V2NIMTeamType, memberInfoParams: V2NIMUpdateSelfMemberInfoParams): Promise<void>;
|
|
134
|
+
/** @brief 修改群成员昵称 */
|
|
135
|
+
/** @param teamId 群组 id */
|
|
136
|
+
/** @param teamType 群组类型 */
|
|
137
|
+
/** @param accountId 群成员 id */
|
|
138
|
+
/** @param nick 群成员昵称 */
|
|
139
|
+
/** @return void */
|
|
140
|
+
updateTeamMemberNick(teamId: string, teamType: V2NIMTeamType, accountId: string, teamNick: string): Promise<void>;
|
|
141
|
+
/** @brief 设置群组禁言模式 */
|
|
142
|
+
/** @param teamId 群组 id */
|
|
143
|
+
/** @param teamType 群组类型 */
|
|
144
|
+
/** @param chatBannedMode 群组禁言模式 */
|
|
145
|
+
/** @return void */
|
|
146
|
+
setTeamChatBannedMode(teamId: string, teamType: V2NIMTeamType, chatBannedMode: V2NIMTeamChatBannedMode): Promise<void>;
|
|
147
|
+
/** @brief 设置群组成员聊天禁言状态 */
|
|
148
|
+
/** @param teamId 群组 id */
|
|
149
|
+
/** @param teamType 群组类型 */
|
|
150
|
+
/** @param accountId 群成员 id */
|
|
151
|
+
/** @param chatBanned 是否禁言 */
|
|
152
|
+
/** @return void */
|
|
153
|
+
setTeamMemberChatBannedStatus(teamId: string, teamType: V2NIMTeamType, accountId: string, chatBanned: boolean): Promise<void>;
|
|
154
|
+
/** @brief 获取当前已经加入的群组列表 */
|
|
155
|
+
/** @param teamType 群组类型 */
|
|
156
|
+
/** @return void */
|
|
157
|
+
getJoinedTeamList(teamTypes: Array<V2NIMTeamType>): Promise<Array<V2NIMTeam>>;
|
|
158
|
+
/** @brief 获取当前已经加入的群组数量 */
|
|
159
|
+
/** @param teamTypes 群组类型列表, 为空表示查询所有群类型 */
|
|
160
|
+
/** @return number */
|
|
161
|
+
getJoinedTeamCount(teamTypes: Array<V2NIMTeamType>): number;
|
|
162
|
+
/** @brief 获取群组成员列表 */
|
|
163
|
+
/** @param teamId 群组 id */
|
|
164
|
+
/** @param teamType 群组类型 */
|
|
165
|
+
/** @param queryOption 群组成员查询选项 */
|
|
166
|
+
/** @return void */
|
|
167
|
+
getTeamMemberList(teamId: string, teamType: V2NIMTeamType, queryOption: V2NIMTeamMemberQueryOption): Promise<V2NIMTeamMemberListResult>;
|
|
168
|
+
/** @brief 根据账号 ID 列表获取群组成员列表 */
|
|
169
|
+
/** @param teamId 群组 id */
|
|
170
|
+
/** @param teamType 群组类型 */
|
|
171
|
+
/** @param accountIds 账号 ID 列表 */
|
|
172
|
+
/** @return void */
|
|
173
|
+
getTeamMemberListByIds(teamId: string, teamType: V2NIMTeamType, accountIds: Array<string>): Promise<Array<V2NIMTeamMember>>;
|
|
174
|
+
/** @brief 根据账号 ID 列表获取群组成员邀请人 */
|
|
175
|
+
/** @param teamId 群组 id */
|
|
176
|
+
/** @param teamType 群组类型 */
|
|
177
|
+
/** @param accountIds 账号 ID 列表 */
|
|
178
|
+
/** @return void */
|
|
179
|
+
getTeamMemberInvitor(teamId: string, teamType: V2NIMTeamType, accountIds: Array<string>): Promise<Map<string, string>>;
|
|
180
|
+
/** @brief 获取群加入相关信息 */
|
|
181
|
+
/** @param option 查询参数 */
|
|
182
|
+
/** @return void */
|
|
183
|
+
getTeamJoinActionInfoList(option: V2NIMTeamJoinActionInfoQueryOption): Promise<V2NIMTeamJoinActionInfoResult>;
|
|
184
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { V2NIMUser, V2NIMUserUpdateParams } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
|
+
import { EventEmitter } from 'eventemitter3';
|
|
3
|
+
export declare interface V2NIMUserServiceEvents {
|
|
4
|
+
/** 用户资料变更 */
|
|
5
|
+
userProfileChanged: [Array<V2NIMUser>];
|
|
6
|
+
/** 添加黑名单 */
|
|
7
|
+
blockListAdded: [V2NIMUser];
|
|
8
|
+
/** 移除黑名单 */
|
|
9
|
+
blockListRemoved: [string];
|
|
10
|
+
}
|
|
11
|
+
/** @brief 用户资料服务 */
|
|
12
|
+
export declare class V2NIMUserService extends EventEmitter<V2NIMUserServiceEvents> {
|
|
13
|
+
instance: any;
|
|
14
|
+
constructor();
|
|
15
|
+
/** @brief 根据用户账号列表获取用户资料 */
|
|
16
|
+
/** @param accountIds 用户账号列表 */
|
|
17
|
+
/** @return void */
|
|
18
|
+
getUserList(accountIds: Array<string>): Promise<Array<V2NIMUser>>;
|
|
19
|
+
/** @brief 更新自己的用户资料 */
|
|
20
|
+
/** @param updateParams 更新参数 */
|
|
21
|
+
/** @return void */
|
|
22
|
+
updateSelfUserProfile(updateParams: V2NIMUserUpdateParams): Promise<void>;
|
|
23
|
+
/** @brief 添加用户到黑名单中 */
|
|
24
|
+
/** @param accountId 用户账号 */
|
|
25
|
+
/** @return void */
|
|
26
|
+
addUserToBlockList(accountId: string): Promise<void>;
|
|
27
|
+
/** @brief 从黑名单中移除用户 */
|
|
28
|
+
/** @param accountId 用户账号 */
|
|
29
|
+
/** @return void */
|
|
30
|
+
removeUserFromBlockList(accountId: string): Promise<void>;
|
|
31
|
+
/** @brief 获取黑名单列表 */
|
|
32
|
+
/** @return void */
|
|
33
|
+
getBlockList(): Promise<Array<string>>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { V2NIMMessage, V2NIMClientAntispamResult, V2NIMChatroomMessage } from 'ts/v2_def/v2_nim_struct_def';
|
|
2
|
+
import { EventEmitter } from 'eventemitter3';
|
|
3
|
+
/** @brief 消息创建器 */
|
|
4
|
+
export declare class V2NIMMessageCreator {
|
|
5
|
+
/** @brief 创建文本消息 */
|
|
6
|
+
/** @param text 文本内容 */
|
|
7
|
+
/** @return V2NIMMessage */
|
|
8
|
+
static createTextMessage(text: string): V2NIMMessage | null;
|
|
9
|
+
createTextMessage(text: string): V2NIMMessage | null;
|
|
10
|
+
/** @brief 创建图片消息 */
|
|
11
|
+
/** @param imagePath 图片路径 */
|
|
12
|
+
/** @param name 文件显示名称, 为空则使用文件名 */
|
|
13
|
+
/** @param sceneName 文件存储场景 */
|
|
14
|
+
/** @param width 图片宽度 */
|
|
15
|
+
/** @param height 图片高度 */
|
|
16
|
+
/** @return V2NIMMessage */
|
|
17
|
+
static createImageMessage(imagePath: string, name: string, sceneName: string, width: number, height: number): V2NIMMessage | null;
|
|
18
|
+
createImageMessage(imagePath: string, name: string, sceneName: string, width: number, height: number): V2NIMMessage | null;
|
|
19
|
+
/** @brief 创建音频消息 */
|
|
20
|
+
/** @param audioPath 音频路径 */
|
|
21
|
+
/** @param name 文件显示名称, 为空则使用文件名 */
|
|
22
|
+
/** @param sceneName 文件存储场景 */
|
|
23
|
+
/** @param duration 音频时长 */
|
|
24
|
+
/** @return V2NIMMessage */
|
|
25
|
+
static createAudioMessage(audioPath: string, name: string, sceneName: string, duration: number): V2NIMMessage | null;
|
|
26
|
+
createAudioMessage(audioPath: string, name: string, sceneName: string, duration: number): V2NIMMessage | null;
|
|
27
|
+
/** @brief 创建视频消息 */
|
|
28
|
+
/** @param videoPath 视频路径 */
|
|
29
|
+
/** @param name 文件显示名称, 为空则使用文件名 */
|
|
30
|
+
/** @param sceneName 文件存储场景 */
|
|
31
|
+
/** @param duration 视频时长 */
|
|
32
|
+
/** @param width 视频宽度 */
|
|
33
|
+
/** @param height 视频高度 */
|
|
34
|
+
/** @return V2NIMMessage */
|
|
35
|
+
static createVideoMessage(videoPath: string, name: string, sceneName: string, duration: number, width: number, height: number): V2NIMMessage | null;
|
|
36
|
+
createVideoMessage(videoPath: string, name: string, sceneName: string, duration: number, width: number, height: number): V2NIMMessage | null;
|
|
37
|
+
/** @brief 创建文件消息 */
|
|
38
|
+
/** @param filePath 文件路径 */
|
|
39
|
+
/** @param name 文件显示名称, 为空则使用文件名 */
|
|
40
|
+
/** @param sceneName 文件存储场景 */
|
|
41
|
+
/** @return V2NIMMessage */
|
|
42
|
+
static createFileMessage(filePath: string, name: string, sceneName: string): V2NIMMessage | null;
|
|
43
|
+
createFileMessage(filePath: string, name: string, sceneName: string): V2NIMMessage | null;
|
|
44
|
+
/** @brief 创建位置消息 */
|
|
45
|
+
/** @param latitude 纬度 */
|
|
46
|
+
/** @param longitude 经度 */
|
|
47
|
+
/** @param address 详细位置信息 */
|
|
48
|
+
/** @return V2NIMMessage */
|
|
49
|
+
static createLocationMessage(latitude: number, longitude: number, address: string): V2NIMMessage | null;
|
|
50
|
+
createLocationMessage(latitude: number, longitude: number, address: string): V2NIMMessage | null;
|
|
51
|
+
/** @brief 创建自定义消息 */
|
|
52
|
+
/** @param text 文本内容 */
|
|
53
|
+
/** @param rawAttachment 附件 */
|
|
54
|
+
/** @return V2NIMMessage */
|
|
55
|
+
static createCustomMessage(text: string, rawAttachment: string): V2NIMMessage | null;
|
|
56
|
+
createCustomMessage(text: string, rawAttachment: string): V2NIMMessage | null;
|
|
57
|
+
/** @brief 创建提示消息 */
|
|
58
|
+
/** @param text 文本内容 */
|
|
59
|
+
/** @return V2NIMMessage */
|
|
60
|
+
static createTipsMessage(text: string): V2NIMMessage | null;
|
|
61
|
+
createTipsMessage(text: string): V2NIMMessage | null;
|
|
62
|
+
/** @brief 创建转发消息 */
|
|
63
|
+
/** @param message 原消息 */
|
|
64
|
+
/** @return V2NIMMessage */
|
|
65
|
+
static createForwardMessage(message: V2NIMMessage): V2NIMMessage | null;
|
|
66
|
+
createForwardMessage(message: V2NIMMessage): V2NIMMessage | null;
|
|
67
|
+
}
|
|
68
|
+
/** @brief 会话ID工具 */
|
|
69
|
+
export declare class V2NIMConversationIdUtil {
|
|
70
|
+
/** @brief 获取点对点会话ID */
|
|
71
|
+
/** @param accountId 账号ID */
|
|
72
|
+
/** @return string */
|
|
73
|
+
static p2pConversationId(accountId: string): string;
|
|
74
|
+
p2pConversationId(accountId: string): string;
|
|
75
|
+
/** @brief 获取群组会话ID */
|
|
76
|
+
/** @param teamId 群组ID */
|
|
77
|
+
/** @return string */
|
|
78
|
+
static teamConversationId(teamId: string): string;
|
|
79
|
+
teamConversationId(teamId: string): string;
|
|
80
|
+
/** @brief 获取超级群会话ID */
|
|
81
|
+
/** @param superTeamId 超级群ID */
|
|
82
|
+
/** @return string */
|
|
83
|
+
static superTeamConversationId(superTeamId: string): string;
|
|
84
|
+
superTeamConversationId(superTeamId: string): string;
|
|
85
|
+
/** @brief 获取会话ID对应的会话类型 */
|
|
86
|
+
/** @param conversationId 会话ID */
|
|
87
|
+
/** @return V2NIMConversationType */
|
|
88
|
+
static parseConversationType(conversationId: string): V2NIMConversationType;
|
|
89
|
+
parseConversationType(conversationId: string): V2NIMConversationType;
|
|
90
|
+
/** @brief 获取会话ID对应的目标ID */
|
|
91
|
+
/** @param conversationId 会话ID */
|
|
92
|
+
/** @return string */
|
|
93
|
+
static parseConversationTargetId(conversationId: string): string;
|
|
94
|
+
parseConversationTargetId(conversationId: string): string;
|
|
95
|
+
}
|
|
96
|
+
/** @brief 本地反垃圾工具 */
|
|
97
|
+
export declare class V2NIMClientAntispamUtil {
|
|
98
|
+
/** @brief 文本本地反垃圾 */
|
|
99
|
+
/** @param text 需要本地反垃圾check的文本 */
|
|
100
|
+
/** @param replace 敏感内容替换词 */
|
|
101
|
+
/** @return V2NIMMessage */
|
|
102
|
+
static checkTextAntispam(text: string, replace: string): V2NIMClientAntispamResult;
|
|
103
|
+
checkTextAntispam(text: string, replace: string): V2NIMClientAntispamResult;
|
|
104
|
+
}
|
|
105
|
+
/** @brief 聊天室消息创建器 */
|
|
106
|
+
export declare class V2NIMChatroomMessageCreator extends EventEmitter {
|
|
107
|
+
/** @brief 创建文本消息 */
|
|
108
|
+
/** @param text 文本内容 */
|
|
109
|
+
/** @return V2NIMChatroomMessage */
|
|
110
|
+
static createTextMessage(text: string): V2NIMChatroomMessage | null;
|
|
111
|
+
createTextMessage(text: string): V2NIMChatroomMessage | null;
|
|
112
|
+
/** @brief 创建图片消息 */
|
|
113
|
+
/** @param imagePath 图片路径 */
|
|
114
|
+
/** @param name 文件显示名称, 为空则使用文件名 */
|
|
115
|
+
/** @param sceneName 文件存储场景 */
|
|
116
|
+
/** @param width 图片宽度 */
|
|
117
|
+
/** @param height 图片高度 */
|
|
118
|
+
/** @return V2NIMChatroomMessage */
|
|
119
|
+
static createImageMessage(imagePath: string, name: string, sceneName: string, width: number, height: number): V2NIMChatroomMessage | null;
|
|
120
|
+
createImageMessage(imagePath: string, name: string, sceneName: string, width: number, height: number): V2NIMChatroomMessage | null;
|
|
121
|
+
/** @brief 创建音频消息 */
|
|
122
|
+
/** @param audioPath 音频路径 */
|
|
123
|
+
/** @param name 文件显示名称, 为空则使用文件名 */
|
|
124
|
+
/** @param sceneName 文件存储场景 */
|
|
125
|
+
/** @param duration 音频时长 */
|
|
126
|
+
/** @return V2NIMChatroomMessage */
|
|
127
|
+
static createAudioMessage(audioPath: string, name: string, sceneName: string, duration: number): V2NIMChatroomMessage | null;
|
|
128
|
+
createAudioMessage(audioPath: string, name: string, sceneName: string, duration: number): V2NIMChatroomMessage | null;
|
|
129
|
+
/** @brief 创建视频消息 */
|
|
130
|
+
/** @param videoPath 视频路径 */
|
|
131
|
+
/** @param name 文件显示名称, 为空则使用文件名 */
|
|
132
|
+
/** @param sceneName 文件存储场景 */
|
|
133
|
+
/** @param duration 视频时长 */
|
|
134
|
+
/** @param width 视频宽度 */
|
|
135
|
+
/** @param height 视频高度 */
|
|
136
|
+
/** @return V2NIMChatroomMessage */
|
|
137
|
+
static createVideoMessage(videoPath: string, name: string, sceneName: string, duration: number, width: number, height: number): V2NIMChatroomMessage | null;
|
|
138
|
+
createVideoMessage(videoPath: string, name: string, sceneName: string, duration: number, width: number, height: number): V2NIMChatroomMessage | null;
|
|
139
|
+
/** @brief 创建文件消息 */
|
|
140
|
+
/** @param filePath 文件路径 */
|
|
141
|
+
/** @param name 文件显示名称, 为空则使用文件名 */
|
|
142
|
+
/** @param sceneName 文件存储场景 */
|
|
143
|
+
/** @return V2NIMChatroomMessage */
|
|
144
|
+
static createFileMessage(filePath: string, name: string, sceneName: string): V2NIMChatroomMessage | null;
|
|
145
|
+
createFileMessage(filePath: string, name: string, sceneName: string): V2NIMChatroomMessage | null;
|
|
146
|
+
/** @brief 创建位置消息 */
|
|
147
|
+
/** @param latitude 纬度 */
|
|
148
|
+
/** @param longitude 经度 */
|
|
149
|
+
/** @param address 详细位置信息 */
|
|
150
|
+
/** @return V2NIMChatroomMessage */
|
|
151
|
+
static createLocationMessage(latitude: number, longitude: number, address: string): V2NIMChatroomMessage | null;
|
|
152
|
+
createLocationMessage(latitude: number, longitude: number, address: string): V2NIMChatroomMessage | null;
|
|
153
|
+
/** @brief 创建自定义消息 */
|
|
154
|
+
/** @param rawAttachment 自定义附件 */
|
|
155
|
+
/** @return V2NIMChatroomMessage */
|
|
156
|
+
static createCustomMessage(rawAttachment: string): V2NIMChatroomMessage | null;
|
|
157
|
+
createCustomMessage(rawAttachment: string): V2NIMChatroomMessage | null;
|
|
158
|
+
/** @brief 创建提示消息 */
|
|
159
|
+
/** @param text 文本内容 */
|
|
160
|
+
/** @return V2NIMChatroomMessage */
|
|
161
|
+
static createTipsMessage(text: string): V2NIMChatroomMessage | null;
|
|
162
|
+
createTipsMessage(text: string): V2NIMChatroomMessage | null;
|
|
163
|
+
/** @brief 创建转发消息 */
|
|
164
|
+
/** @param message 原消息 */
|
|
165
|
+
/** @return V2NIMChatroomMessage */
|
|
166
|
+
static createForwardMessage(message: V2NIMChatroomMessage): V2NIMChatroomMessage | null;
|
|
167
|
+
createForwardMessage(message: V2NIMChatroomMessage): V2NIMChatroomMessage | null;
|
|
168
|
+
}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
/** @
|
|
3
|
-
export type
|
|
4
|
-
/** @brief
|
|
5
|
-
/** @param
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/** @param progress 进度, 0-100 */
|
|
9
|
-
export type V2NIMProgressCallback = (progress: number) => void;
|
|
10
|
-
/** @brief 消息发送成功回调 */
|
|
11
|
-
/** @param message 消息 */
|
|
12
|
-
/** @param result 消息发送结果 */
|
|
13
|
-
export type V2NIMSendMessageSuccessCallback = (message: V2NIMMessage, result: V2NIMSendMessageResult) => void;
|
|
14
|
-
/** @brief 消息数组成功回调 */
|
|
15
|
-
/** @param messages 消息数组 */
|
|
16
|
-
export type V2NIMMessageListSuccessCallback = (messages: Array<V2NIMMessage>) => void;
|
|
17
|
-
/** @brief 获取重连延时回调 */
|
|
18
|
-
/** @param defaultDelay 默认延时, 单位毫秒 */
|
|
19
|
-
/** @return number 延时, 单位毫秒 */
|
|
20
|
-
export type V2NIMReconnectDelayProvider = (defaultDelay: number) => number;
|
|
1
|
+
/** @brief 通用进度回调 */
|
|
2
|
+
/** @param progress 进度, 0-100 */
|
|
3
|
+
export type V2NIMProgressCallback = (progress: number) => void;
|
|
4
|
+
/** @brief 获取重连延时回调 */
|
|
5
|
+
/** @param defaultDelay 默认延时, 单位毫秒 */
|
|
6
|
+
/** @return number 延时, 单位毫秒 */
|
|
7
|
+
export type V2NIMReconnectDelayProvider = (defaultDelay: number) => number;
|