node-nim 7.8.3 → 9.1.0-rc.1
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 +83 -36
- package/download-sdk.mjs +59 -0
- package/js/api/client.js +147 -80
- package/js/api/client.js.map +1 -0
- package/js/api/data_sync.js +20 -20
- package/js/api/data_sync.js.map +1 -0
- package/js/api/friend.js +101 -38
- package/js/api/friend.js.map +1 -0
- package/js/api/global.js +90 -38
- package/js/api/global.js.map +1 -0
- package/js/api/msglog.js +455 -104
- package/js/api/msglog.js.map +1 -0
- package/js/api/nos.js +140 -50
- package/js/api/nos.js.map +1 -0
- package/js/api/online_session.js +58 -32
- package/js/api/online_session.js.map +1 -0
- package/js/api/pass_through_proxy.js +33 -20
- package/js/api/pass_through_proxy.js.map +1 -0
- package/js/api/plugin.js +52 -16
- package/js/api/plugin.js.map +1 -0
- package/js/api/session.js +250 -83
- package/js/api/session.js.map +1 -0
- package/js/api/subscribe_event.js +102 -38
- package/js/api/subscribe_event.js.map +1 -0
- package/js/api/super_team.js +387 -123
- package/js/api/super_team.js.map +1 -0
- package/js/api/sysmsg.js +127 -50
- package/js/api/sysmsg.js.map +1 -0
- package/js/api/talk.js +71 -50
- package/js/api/talk.js.map +1 -0
- package/js/api/talkex.js +115 -71
- package/js/api/talkex.js.map +1 -0
- package/js/api/team.js +514 -116
- package/js/api/team.js.map +1 -0
- package/js/api/tool.js +104 -41
- package/js/api/tool.js.map +1 -0
- package/js/api/user.js +134 -50
- package/js/api/user.js.map +1 -0
- package/js/{api/rescode_def.js → def/client_def.js} +157 -93
- package/js/def/client_def.js.map +1 -0
- package/js/{api → def}/data_sync_def.js +21 -22
- package/js/def/data_sync_def.js.map +1 -0
- package/js/{api → def}/doc_trans_def.js +17 -18
- package/js/def/doc_trans_def.js.map +1 -0
- package/js/{api → def}/friend_def.js +38 -38
- package/js/def/friend_def.js.map +1 -0
- package/js/{api → def}/global_def.js +49 -49
- package/js/def/global_def.js.map +1 -0
- package/js/{api → def}/msglog_def.js +131 -125
- package/js/def/msglog_def.js.map +1 -0
- package/js/{api → def}/nos_def.js +17 -16
- package/js/def/nos_def.js.map +1 -0
- package/js/{api → def}/online_session_def.js +3 -2
- package/js/def/online_session_def.js.map +1 -0
- package/js/{api → def}/pass_through_proxy_def.js +11 -11
- package/js/def/pass_through_proxy_def.js.map +1 -0
- package/js/{api → def}/plugin_def.js +3 -2
- package/js/def/plugin_def.js.map +1 -0
- package/js/{api/session.def.js → def/session_def.js} +27 -26
- package/js/def/session_def.js.map +1 -0
- package/js/{api → def}/subscribe_event_def.js +53 -52
- package/js/def/subscribe_event_def.js.map +1 -0
- package/js/{api → def}/super_team_def.js +65 -62
- package/js/def/super_team_def.js.map +1 -0
- package/js/{api → def}/sysmsg_def.js +37 -27
- package/js/def/sysmsg_def.js.map +1 -0
- package/js/{api → def}/talk_def.js +3 -2
- package/js/def/talk_def.js.map +1 -0
- package/js/{api → def}/talkex_def.js +3 -2
- package/js/def/talkex_def.js.map +1 -0
- package/js/{api → def}/team_def.js +70 -69
- package/js/def/team_def.js.map +1 -0
- package/js/{api → def}/tool_def.js +12 -12
- package/js/def/tool_def.js.map +1 -0
- package/js/{api → def}/user_def.js +23 -22
- package/js/def/user_def.js.map +1 -0
- package/js/loader.js +30 -0
- package/js/loader.js.map +1 -0
- package/js/nim.js +40 -46
- package/js/nim.js.map +1 -0
- package/package.json +61 -48
- package/types/api/client.d.ts +124 -0
- package/types/api/data_sync.d.ts +13 -0
- package/types/api/friend.d.ts +82 -0
- package/types/api/global.d.ts +69 -0
- package/types/api/msglog.d.ts +388 -0
- package/types/api/nos.d.ts +118 -0
- package/types/api/online_session.d.ts +44 -0
- package/types/api/pass_through_proxy.d.ts +24 -0
- package/types/api/plugin.d.ts +37 -0
- package/types/api/session.d.ts +212 -0
- package/types/api/subscribe_event.d.ts +87 -0
- package/types/api/super_team.d.ts +332 -0
- package/types/api/sysmsg.d.ts +104 -0
- package/types/api/talk.d.ts +69 -0
- package/types/api/talkex.d.ts +93 -0
- package/types/api/team.d.ts +442 -0
- package/types/api/tool.d.ts +75 -0
- package/types/api/user.d.ts +111 -0
- package/types/def/client_def.d.ts +276 -0
- package/types/def/data_sync_def.d.ts +19 -0
- package/types/def/doc_trans_def.d.ts +11 -0
- package/types/def/friend_def.d.ts +65 -0
- package/types/def/global_def.d.ts +69 -0
- package/types/def/msglog_def.d.ts +328 -0
- package/types/def/nos_def.d.ts +71 -0
- package/types/def/online_session_def.d.ts +34 -0
- package/types/def/pass_through_proxy_def.d.ts +12 -0
- package/types/def/plugin_def.d.ts +7 -0
- package/types/def/session_def.d.ts +113 -0
- package/types/def/subscribe_event_def.d.ts +82 -0
- package/types/def/super_team_def.d.ts +133 -0
- package/types/def/sysmsg_def.d.ts +84 -0
- package/types/def/talk_def.d.ts +48 -0
- package/types/def/talkex_def.d.ts +111 -0
- package/types/def/team_def.d.ts +153 -0
- package/types/def/tool_def.d.ts +27 -0
- package/types/def/user_def.d.ts +58 -0
- package/types/loader.d.ts +2 -0
- package/types/nim.d.ts +18 -0
- package/js/api/client_def.js +0 -58
- package/js/api/nim.js +0 -13
- package/js/api/rts.js +0 -68
- package/js/api/rts_def.js +0 -15
- package/js/api/signaling.js +0 -62
- package/js/api/signaling_def.js +0 -20
- package/just-task.js +0 -154
- package/scripts/build_addon.js +0 -56
- package/scripts/build_wrapper.js +0 -45
- package/scripts/fetch_wrapper.js +0 -45
- package/scripts/pack_addon.js +0 -41
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** @enum NIMEventBroadcastType 事件广播类型 */
|
|
2
|
+
export declare enum NIMEventBroadcastType {
|
|
3
|
+
kNIMEventBroadcastTypeOnline = 1,
|
|
4
|
+
kNIMEventBroadcastTypeAll = 2
|
|
5
|
+
}
|
|
6
|
+
/** @enum NIMEventSyncType 事件同步类型 */
|
|
7
|
+
export declare enum NIMEventSyncType {
|
|
8
|
+
kNIMEventSyncTypeNoSelf = 0,
|
|
9
|
+
kNIMEventSyncTypeSelf = 1
|
|
10
|
+
}
|
|
11
|
+
/** @enum NIMEventSubscribeSyncEventType 订阅的事件的同步类型 */
|
|
12
|
+
export declare enum NIMEventSubscribeSyncEventType {
|
|
13
|
+
kNIMEventSubscribeSyncTypeUnSync = 0,
|
|
14
|
+
kNIMEventSubscribeSyncTypeSync = 1
|
|
15
|
+
}
|
|
16
|
+
/** @enum NIMEventType 服务器预定义的事件类型 */
|
|
17
|
+
export declare enum NIMEventType {
|
|
18
|
+
kNIMEventTypeOnlineState = 1,
|
|
19
|
+
kNIMEventTypeCustom = 100000
|
|
20
|
+
}
|
|
21
|
+
/** @enum NIMEventOnlineStateValue 在线状态事件值 */
|
|
22
|
+
export declare enum NIMEventOnlineStateValue {
|
|
23
|
+
kNIMEventOnlineStateValueLogin = 1,
|
|
24
|
+
kNIMEventOnlineStateValueLogout = 2,
|
|
25
|
+
kNIMEventOnlineStateValueDisconnect = 3,
|
|
26
|
+
kNIMEventOnlineStateValueCustom = 10000,
|
|
27
|
+
kNIMEventOnlineStateValueUpdateConfig = 10001 /** < 自己的其他端更新了自己端的multi_config信息 */
|
|
28
|
+
}
|
|
29
|
+
export declare enum NIMOnlineState {
|
|
30
|
+
kOnlineStateOnline = 0,
|
|
31
|
+
kOnlineStateBusy = 1,
|
|
32
|
+
kOnlineStateLeave = 2
|
|
33
|
+
}
|
|
34
|
+
export declare enum NIMNetState {
|
|
35
|
+
kNetStateUnknow = 0,
|
|
36
|
+
kNetStateWifi = 1,
|
|
37
|
+
kNetStateWwan = 2,
|
|
38
|
+
kNetState2G = 3,
|
|
39
|
+
kNetState3G = 4,
|
|
40
|
+
kNetState4G = 5
|
|
41
|
+
}
|
|
42
|
+
export interface EventData {
|
|
43
|
+
event_type_: number; /**< 事件类型,服务器保留1~99999的事件类型,客户端自定义事件类型需大于99999 */
|
|
44
|
+
event_value_: number; /**< 事件状态,在线状态事件服务器保留1~9999的事件值,客户端自定义事件值需大于9999 */
|
|
45
|
+
client_msg_id_: string; /**< 客户端生成的消息id */
|
|
46
|
+
config_: string; /**< 用户自定义事件扩展属性,最长4K */
|
|
47
|
+
ttl_: number; /**< 事件有效期,单位:秒,时间范围:60s到7天 */
|
|
48
|
+
broadcast_type_: NIMEventBroadcastType; /**< 事件广播类型 */
|
|
49
|
+
sync_self_: NIMEventSyncType; /**< 事件同步类型 */
|
|
50
|
+
readonly_ttl_type: number; /**< TtlType枚举值 */
|
|
51
|
+
readonly_durable_: number; /**< 是否需要持久化(可选字段),默认为需要持久化,0:不需要持久化,1:需要持久化 */
|
|
52
|
+
readonly_event_time_: number; /**< 事件发布的时间戳,服务器补充 */
|
|
53
|
+
readonly_server_msg_id_: string; /**< 服务端生成的消息id */
|
|
54
|
+
readonly_client_type_: number; /**< 发送客户端类型 */
|
|
55
|
+
readonly_nim_config_: string; /**< 预定义事件的扩展字段(在线状态事件:在线的客户端类型Json) */
|
|
56
|
+
readonly_multi_config_: string; /**< 多端配置信息字段,JSON格式{"clent_type":"clent_config","1":"xxx","2":"xxx"} */
|
|
57
|
+
readonly_publisher_accid_: string; /**< 事件发布者的accid */
|
|
58
|
+
readonly_consid_: string; /**< 发送设备id */
|
|
59
|
+
}
|
|
60
|
+
export interface EventSubscribeData {
|
|
61
|
+
event_type_: number; /**< 事件类型 */
|
|
62
|
+
ttl_: number; /**< 订阅有效期,单位:秒,范围:60s到30天 */
|
|
63
|
+
sync_event_: NIMEventSubscribeSyncEventType; /**< 订阅的事件的同步类型 */
|
|
64
|
+
publisher_accid_: string; /**< 被订阅人(事件发布人)的accid */
|
|
65
|
+
subscribe_accid_: string; /**< 订阅人的accid */
|
|
66
|
+
subscribe_time_: number; /**< 订阅时间戳 */
|
|
67
|
+
}
|
|
68
|
+
export declare type PushEventCallback = (rescode: number, result: EventData) => void;
|
|
69
|
+
export declare type BatchPushEventCallback = (rescode: number, result: Array<EventData>) => void;
|
|
70
|
+
export declare type PublishEventCallback = (rescode: number, eventType: number, result: EventData) => void;
|
|
71
|
+
export declare type SubscribeEventCallback = (rescode: number, eventType: number, failedList: Array<string>) => void;
|
|
72
|
+
export declare type UnSubscribeEventCallback = (rescode: number, eventType: number, failedList: Array<string>) => void;
|
|
73
|
+
export declare type BatchUnSubscribeEventCallback = (rescode: number, eventType: number) => void;
|
|
74
|
+
export declare type QuerySubscribeEventCallback = (rescode: number, eventType: number, result: Array<EventSubscribeData>) => void;
|
|
75
|
+
export interface NIMSubscribeEventAPI {
|
|
76
|
+
InitEventHandlers(): void;
|
|
77
|
+
Publish(data: EventData, cb: PublishEventCallback, jsonExtension: string): boolean;
|
|
78
|
+
Subscribe(eventType: NIMEventType, ttl: number, syncType: NIMEventSubscribeSyncEventType, accids: Array<string>, cb: SubscribeEventCallback, jsonExtension: string): boolean;
|
|
79
|
+
UnSubscribe(eventType: NIMEventType, accids: Array<string>, cb: UnSubscribeEventCallback, jsonExtension: string): boolean;
|
|
80
|
+
BatchUnSubscribe(eventType: NIMEventType, cb: BatchUnSubscribeEventCallback, jsonExtension: string): boolean;
|
|
81
|
+
QuerySubscribe(eventType: NIMEventType, accids: Array<string>, cb: QuerySubscribeEventCallback, jsonExtension: string): void;
|
|
82
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { NIMResCode } from './client_def';
|
|
2
|
+
import { NIMNotificationId } from './msglog_def';
|
|
3
|
+
import { UserNameCard } from './user_def';
|
|
4
|
+
/** @enum NIMSuperTeamBitsConfigMask 群组成员信息Bits属性kNIMSuperTeamUserKeyBits的配置定义 */
|
|
5
|
+
export declare enum NIMSuperTeamBitsConfigMask {
|
|
6
|
+
kNIMSuperTeamBitsConfigMaskMuteNone = 0,
|
|
7
|
+
kNIMSuperTeamBitsConfigMaskMuteNotify = 1,
|
|
8
|
+
kNIMSuperTeamBitsConfigMaskOnlyAdmin = 2
|
|
9
|
+
}
|
|
10
|
+
/** @enum NIMSuperTeamUserType 群成员类型 */
|
|
11
|
+
export declare enum NIMSuperTeamUserType {
|
|
12
|
+
kNIMSuperTeamUserTypeNomal = 0,
|
|
13
|
+
kNIMSuperTeamUserTypeCreator = 1,
|
|
14
|
+
kNIMSuperTeamUserTypeManager = 2,
|
|
15
|
+
kNIMSuperTeamUserTypeApply = 3,
|
|
16
|
+
kNIMSuperTeamUserTypeLocalWaitAccept = 100
|
|
17
|
+
}
|
|
18
|
+
/** @enum NIMSuperTeamBeInviteMode 被邀请人同意方式 */
|
|
19
|
+
export declare enum NIMSuperTeamBeInviteMode {
|
|
20
|
+
kNIMSuperTeamBeInviteModeNeedAgree = 0,
|
|
21
|
+
kNIMSuperTeamBeInviteModeNotNeedAgree = 1
|
|
22
|
+
}
|
|
23
|
+
/** @enum NIMSuperTeamInviteMode 谁可以邀请他人入群 */
|
|
24
|
+
export declare enum NIMSuperTeamInviteMode {
|
|
25
|
+
kNIMSuperTeamInviteModeManager = 0,
|
|
26
|
+
kNIMSuperTeamInviteModeEveryone = 1
|
|
27
|
+
}
|
|
28
|
+
/** @enum NIMSuperTeamUpdateInfoMode 谁可以修改群资料 */
|
|
29
|
+
export declare enum NIMSuperTeamUpdateInfoMode {
|
|
30
|
+
kNIMSuperTeamUpdateInfoModeManager = 0,
|
|
31
|
+
kNIMSuperTeamUpdateInfoModeEveryone = 1
|
|
32
|
+
}
|
|
33
|
+
/** @enum NIMSuperTeamUpdateCustomMode 谁可以更新群自定义属性 */
|
|
34
|
+
export declare enum NIMSuperTeamUpdateCustomMode {
|
|
35
|
+
kNIMSuperTeamUpdateCustomModeManager = 0,
|
|
36
|
+
kNIMSuperTeamUpdateCustomModeEveryone = 1
|
|
37
|
+
}
|
|
38
|
+
/** @enum NIMSuperTeamJoinMode 群允许加入类型 */
|
|
39
|
+
export declare enum NIMSuperTeamJoinMode {
|
|
40
|
+
kNIMSuperTeamJoinModeNoAuth = 0,
|
|
41
|
+
kNIMSuperTeamJoinModeNeedAuth = 1,
|
|
42
|
+
kNIMSuperTeamJoinModeRejectAll = 2
|
|
43
|
+
}
|
|
44
|
+
/** @enum NIMSuperTeamQueryType 根据关键字查询群组信息类型 */
|
|
45
|
+
export declare enum NIMSuperTeamQueryType {
|
|
46
|
+
kNIMQuerySuperTeamDefault = 1,
|
|
47
|
+
kNIMQuerySuperTeamByTeamId = 2,
|
|
48
|
+
kNIMQuerySuperTeamByTeamName = 3 /** 仅匹配群名称 */
|
|
49
|
+
}
|
|
50
|
+
/** @enum NIMSuperTeamMuteType 群信息kNIMSuperTeamInfoKeyMuteType的配置定义 */
|
|
51
|
+
export declare enum NIMSuperTeamMuteType {
|
|
52
|
+
kNIMSuperTeamMuteTypeNone = 0,
|
|
53
|
+
kNIMSuperTeamMuteTypeNomalMute = 1,
|
|
54
|
+
kNIMSuperTeamMuteTypeAllMute = 3
|
|
55
|
+
}
|
|
56
|
+
export interface SuperTeamEvent {
|
|
57
|
+
res_code_: NIMResCode; /**< 错误码 */
|
|
58
|
+
notification_id_: NIMNotificationId; /**< 通知类型ID */
|
|
59
|
+
team_id_: string; /**< 群组ID */
|
|
60
|
+
ids_: Array<string>; /**< 通知可能涉及到的群成员ID */
|
|
61
|
+
invalid_ids_: Array<string>; /**< 通知可能涉及到的失效的群成员ID,比如邀请入群的成员的群数量超限导致当次邀请失败 */
|
|
62
|
+
namecards_: Array<UserNameCard>; /**< 通知可能涉及到的群成员的用户名片 */
|
|
63
|
+
team_info_: SuperTeamInfo; /**< 通知可能涉及到的群信息 */
|
|
64
|
+
member_property_: SuperTeamMemberProperty; /**< 群成员属性 */
|
|
65
|
+
opt_: boolean; /**< 操作 */
|
|
66
|
+
attach_: string; /**< 扩展字段,目前仅kick和invite事件可选 */
|
|
67
|
+
src_data_: string; /**< 未解析过的原信息,目前仅支持群消息未读数相关事件 */
|
|
68
|
+
}
|
|
69
|
+
export interface SuperTeamInfoJsonValue {
|
|
70
|
+
tid: string;
|
|
71
|
+
name: string;
|
|
72
|
+
member_max_count: number;
|
|
73
|
+
prop: string;
|
|
74
|
+
intro: string;
|
|
75
|
+
announcement: string;
|
|
76
|
+
join_mode: NIMSuperTeamJoinMode;
|
|
77
|
+
custom: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
be_invite_mode: NIMSuperTeamBeInviteMode;
|
|
80
|
+
invite_mode: NIMSuperTeamInviteMode;
|
|
81
|
+
update_info_mode: NIMSuperTeamUpdateInfoMode;
|
|
82
|
+
update_custom_mode: NIMSuperTeamUpdateCustomMode;
|
|
83
|
+
mute_type: NIMSuperTeamMuteType;
|
|
84
|
+
}
|
|
85
|
+
export interface SuperTeamInfo {
|
|
86
|
+
team_info_json_value_: SuperTeamInfoJsonValue;
|
|
87
|
+
}
|
|
88
|
+
export interface SuperTeamMemberPropertyJsonValue {
|
|
89
|
+
tid: string;
|
|
90
|
+
type: NIMSuperTeamUserType;
|
|
91
|
+
nick: string;
|
|
92
|
+
bits: number;
|
|
93
|
+
mute: number;
|
|
94
|
+
custom: string;
|
|
95
|
+
}
|
|
96
|
+
export interface SuperTeamMemberProperty {
|
|
97
|
+
member_info_json_value_: SuperTeamMemberPropertyJsonValue;
|
|
98
|
+
}
|
|
99
|
+
export declare type SuperTeamEventCallback = (result: SuperTeamEvent) => void;
|
|
100
|
+
export declare type QueryAllMySuperTeamsCallback = (count: number, result: Array<string>) => void;
|
|
101
|
+
export declare type QueryAllMySuperTeamsInfoCallback = (count: number, result: Array<SuperTeamInfo>) => void;
|
|
102
|
+
export declare type QueryMyAllMemberInfosCallback = (count: number, result: Array<SuperTeamMemberProperty>) => void;
|
|
103
|
+
export declare type QuerySuperTeamMembersCallback = (tid: string, count: number, result: Array<SuperTeamMemberProperty>) => void;
|
|
104
|
+
export declare type QuerySuperTeamMemberCallback = (result: SuperTeamMemberProperty) => void;
|
|
105
|
+
export declare type QuerySuperTeamInfoCallback = (tid: string, result: SuperTeamInfo) => void;
|
|
106
|
+
export declare type QuerySuperTeamMembersOnlineCallback = (rescode: number, count: number, result: Array<SuperTeamMemberProperty>) => void;
|
|
107
|
+
export interface NIMSuperTeamAPI {
|
|
108
|
+
InitEventHandlers(): void;
|
|
109
|
+
InviteAsync(tid: string, ids: Array<string>, invitationPostscript: string, invitationAttachment: string, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
110
|
+
KickAsync(tid: string, ids: Array<string>, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
111
|
+
LeaveAsync(tid: string, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
112
|
+
UpdateSuperTeamInfoAsync(tid: string, info: SuperTeamInfo, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
113
|
+
ApplyJoinAsync(tid: string, reason: string, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
114
|
+
PassJoinApplyAsync(tid: string, applicantId: string, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
115
|
+
RejectJoinApplyAsync(tid: string, applicantId: string, reason: string, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
116
|
+
AddManagersAsync(tid: string, ids: Array<string>, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
117
|
+
RemoveManagersAsync(tid: string, ids: Array<string>, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
118
|
+
TransferTeamAsync(tid: string, newOwnerId: string, isLeave: boolean, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
119
|
+
UpdateMyPropertyAsync(prop: SuperTeamMemberProperty, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
120
|
+
UpdateOtherNickAsync(prop: SuperTeamMemberProperty, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
121
|
+
AcceptInvitationAsync(tid: string, inviterId: string, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
122
|
+
RejectInvitationAsync(tid: string, inviterId: string, reason: string, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
123
|
+
QueryAllMySuperTeamsAsync(cb: QueryAllMySuperTeamsCallback, jsonExtension: string): void;
|
|
124
|
+
QueryAllMySuperTeamsInfoAsync(cb: QueryAllMySuperTeamsInfoCallback, jsonExtension: string): void;
|
|
125
|
+
QueryMyAllMemberInfosAsync(cb: QueryMyAllMemberInfosCallback, jsonExtension: string): void;
|
|
126
|
+
QuerySuperTeamMembersAsync(tid: string, cb: QuerySuperTeamMembersCallback, jsonExtension: string): boolean;
|
|
127
|
+
QuerySuperTeamMemberAsync(tid: string, id: string, cb: QuerySuperTeamMemberCallback, jsonExtension: string): void;
|
|
128
|
+
QuerySuperTeamInfoAsync(tid: string, cb: QuerySuperTeamInfoCallback, jsonExtension: string): boolean;
|
|
129
|
+
QuerySuperTeamInfoOnlineAsync(tid: string, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
130
|
+
MuteMemberAsync(tid: string, member_id: string, set_mute: boolean, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
131
|
+
MuteAsync(tid: string, set_mute: boolean, cb: SuperTeamEventCallback, jsonExtension: string): boolean;
|
|
132
|
+
QuerySuperTeamsInfoByKeywordAsync(keyword: string, cb: QueryAllMySuperTeamsInfoCallback, jsonExtension: string): void;
|
|
133
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { NIMResCode } from './client_def';
|
|
2
|
+
import { BoolStatus } from './msglog_def';
|
|
3
|
+
/** @enum NIMSysMsgStatus 系统消息状态 */
|
|
4
|
+
export declare enum NIMSysMsgStatus {
|
|
5
|
+
kNIMSysMsgStatusNone = 0,
|
|
6
|
+
kNIMSysMsgStatusPass = 1,
|
|
7
|
+
kNIMSysMsgStatusDecline = 2,
|
|
8
|
+
kNIMSysMsgStatusRead = 3,
|
|
9
|
+
kNIMSysMsgStatusDeleted = 4,
|
|
10
|
+
kNIMSysMsgStatusInvalid = 5
|
|
11
|
+
}
|
|
12
|
+
/** @enum NIMSysMsgType 系统消息内容类型 */
|
|
13
|
+
export declare enum NIMSysMsgType {
|
|
14
|
+
kNIMSysMsgTypeTeamApply = 0,
|
|
15
|
+
kNIMSysMsgTypeTeamReject = 1,
|
|
16
|
+
kNIMSysMsgTypeTeamInvite = 2,
|
|
17
|
+
kNIMSysMsgTypeTeamInviteReject = 3,
|
|
18
|
+
kNIMSysMsgTypeFriendAdd = 5,
|
|
19
|
+
kNIMSysMsgTypeFriendDel = 6,
|
|
20
|
+
kNIMSysMsgTypeCustomP2PMsg = 100,
|
|
21
|
+
kNIMSysMsgTypeCustomTeamMsg = 101,
|
|
22
|
+
kNIMSysMsgTypeCustomSuperTeamMsg = 103,
|
|
23
|
+
kNIMSysMsgTypeUnknown = 1000
|
|
24
|
+
}
|
|
25
|
+
/** @enum NIMMessageFeature 消息种类 */
|
|
26
|
+
export declare enum NIMMessageFeature {
|
|
27
|
+
kNIMMessageFeatureDefault = 0,
|
|
28
|
+
kNIMMessageFeatureLeaveMsg = 1,
|
|
29
|
+
kNIMMessageFeatureRoamMsg = 2,
|
|
30
|
+
kNIMMessageFeatureSyncMsg = 3,
|
|
31
|
+
kNIMMessageFeatureCustomizedMsg = 4
|
|
32
|
+
}
|
|
33
|
+
export interface SysMessage {
|
|
34
|
+
timetag_: number; /**< 通知时间戳(毫秒) */
|
|
35
|
+
type_: NIMSysMsgType; /**< 通知类型 */
|
|
36
|
+
receiver_accid_: string; /**< 接收者ID */
|
|
37
|
+
sender_accid_: string; /**< 发送者ID */
|
|
38
|
+
content_: string; /**< 只读,SDK不转发该字段 */
|
|
39
|
+
attach_: string; /**< 通知附件 */
|
|
40
|
+
id_: number; /**< 通知ID */
|
|
41
|
+
status_: NIMSysMsgStatus; /**< 通知状态 */
|
|
42
|
+
msg_setting_: SysMessageSetting; /**< 消息属性设置 */
|
|
43
|
+
rescode_: NIMResCode; /**< 通知错误码 */
|
|
44
|
+
feature_: NIMMessageFeature; /**< 通知属性 */
|
|
45
|
+
total_unread_count_: number; /**< 总计的通知未读数 */
|
|
46
|
+
client_msg_id_: string; /**< 通知ID(客户端) */
|
|
47
|
+
callbac_ext_: string; /**< v8.2.0 第三方回调返回的自定义字段 */
|
|
48
|
+
}
|
|
49
|
+
export interface SysMessageSetting {
|
|
50
|
+
need_push_: BoolStatus; /**< 是否需要推送 */
|
|
51
|
+
push_need_badge_: BoolStatus; /**< 是否要做消息计数 */
|
|
52
|
+
push_need_prefix_: BoolStatus; /**< 需要推送昵称 */
|
|
53
|
+
need_offline_: BoolStatus; /**< 是否支持离线消息 */
|
|
54
|
+
push_payload_: string; /**< 第三方自定义的推送属性,长度2048 */
|
|
55
|
+
push_content_: string; /**< 自定义推送文案,长度限制200字节 */
|
|
56
|
+
anti_spam_enable_: BoolStatus; /**< (功能暂时不开放)是否需要过易盾反垃圾 */
|
|
57
|
+
anti_spam_content_: string; /**< (功能暂时不开放)(可选)开发者自定义的反垃圾字段 */
|
|
58
|
+
env_config_: string; /**< (可选) 指向自定义抄送的配置 */
|
|
59
|
+
}
|
|
60
|
+
export interface SendMessageArc {
|
|
61
|
+
talk_id_: string; /**< 会话ID */
|
|
62
|
+
msg_id_: string; /**< 消息ID */
|
|
63
|
+
rescode_: NIMResCode; /**< 错误码 */
|
|
64
|
+
msg_timetag_: number; /**< 消息时间戳 */
|
|
65
|
+
third_party_callback_ext_: string; /**< 第三方回调回来的自定义扩展字段 */
|
|
66
|
+
anti_spam_res_: string; /**< 易盾反垃圾返回的结果字段*/
|
|
67
|
+
}
|
|
68
|
+
export declare type SysmsgCallback = (result: SysMessage) => void;
|
|
69
|
+
export declare type SendCustomSysmsgCallback = (result: SendMessageArc) => void;
|
|
70
|
+
export declare type NotifySingleSysmsgCallback = (res_code: number, msg_id: number, unread_count: number) => void;
|
|
71
|
+
export declare type NotifySysmsgResCallback = (res_code: number, unread_count: number) => void;
|
|
72
|
+
export declare type QuerySysmsgCallback = (count: number, unread_count: number, result: Array<SysMessage>) => void;
|
|
73
|
+
export interface NIMSysMsgAPI {
|
|
74
|
+
InitEventHandlers(): void;
|
|
75
|
+
SendCustomNotificationMsg(msg: SysMessage): void;
|
|
76
|
+
QueryMsgAsync(limit_count: number, last_time: number, cb: QuerySysmsgCallback, jsonExtension: string): boolean;
|
|
77
|
+
QueryUnreadCount(cb: NotifySysmsgResCallback, jsonExtension: string): void;
|
|
78
|
+
SetStatusAsync(msg_id: number, status: NIMSysMsgStatus, cb: NotifySingleSysmsgCallback, jsonExtension: string): boolean;
|
|
79
|
+
ReadAllAsync(cb: NotifySysmsgResCallback, jsonExtension: string): void;
|
|
80
|
+
DeleteAsync(msg_id: number, cb: NotifySingleSysmsgCallback, jsonExtension: string): boolean;
|
|
81
|
+
DeleteAllAsync(cb: NotifySysmsgResCallback, jsonExtension: string): boolean;
|
|
82
|
+
SetStatusByTypeAsync(type: NIMSysMsgType, status: NIMSysMsgStatus, cb: NotifySysmsgResCallback, jsonExtension: string): boolean;
|
|
83
|
+
DeleteByTypeAsync(type: NIMSysMsgType, cb: NotifySysmsgResCallback, jsonExtension: string): boolean;
|
|
84
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { NIMResCode } from "./client_def";
|
|
2
|
+
import { IMMessage, NIMMessageFeature, NIMMessageType } from "./msglog_def";
|
|
3
|
+
import { NIMSessionType } from "./session_def";
|
|
4
|
+
export interface SendMessageArc {
|
|
5
|
+
talk_id_: string; /**< 会话ID */
|
|
6
|
+
msg_id_: string; /**< 消息ID */
|
|
7
|
+
rescode_: NIMResCode; /**< 错误码 */
|
|
8
|
+
msg_timetag_: number; /**< 消息时间戳 */
|
|
9
|
+
third_party_callback_ext_: string; /**< 第三方回调回来的自定义扩展字段 */
|
|
10
|
+
anti_spam_res_: string; /**< 易盾反垃圾返回的结果字段*/
|
|
11
|
+
}
|
|
12
|
+
export interface BroadcastMessage {
|
|
13
|
+
body_: string;
|
|
14
|
+
time_: number;
|
|
15
|
+
id_: number;
|
|
16
|
+
from_id_: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RecallMsgNotify {
|
|
19
|
+
from_id_: string; /**< 消息发送方ID */
|
|
20
|
+
to_id_: string; /**< 消息接收方ID */
|
|
21
|
+
msg_id_: string; /**< 客户端消息ID */
|
|
22
|
+
notify_: string; /**< 自定义通知文案 */
|
|
23
|
+
from_nick_: string; /**< 消息发送方昵称 */
|
|
24
|
+
operator_id_: string; /**< 消息的操作者,比哪谁撤消了消息 */
|
|
25
|
+
session_type_: NIMSessionType; /**< 会话类型 */
|
|
26
|
+
notify_timetag_: number; /**< 通知时间戳 */
|
|
27
|
+
notify_feature_: NIMMessageFeature; /**< 通知的种类 */
|
|
28
|
+
msglog_exist_: boolean; /**< 客户端消息本地是否存在 */
|
|
29
|
+
msglog_timetag_: number; /**< 撤回的消息的消息时间戳 */
|
|
30
|
+
attach_: string; /**< v8.2.0 透传的附件信息 */
|
|
31
|
+
callback_ext_: string; /**< v8.2.0 第三方回调返回的字定义字段 */
|
|
32
|
+
}
|
|
33
|
+
export declare type SendMsgAckCallback = (result: SendMessageArc) => void;
|
|
34
|
+
export declare type ReceiveMsgCallback = (result: IMMessage) => void;
|
|
35
|
+
export declare type ReceiveMsgsCallback = (result: Array<IMMessage>) => void;
|
|
36
|
+
export declare type RecallMsgsCallback = (rescode: number, result: Array<RecallMsgNotify>) => void;
|
|
37
|
+
export declare type ReceiveBroadcastMsgCallback = (result: BroadcastMessage) => void;
|
|
38
|
+
export declare type ReceiveBroadcastMsgsCallback = (result: Array<BroadcastMessage>) => void;
|
|
39
|
+
export declare type TeamNotificationFilterCallback = (result: IMMessage) => void;
|
|
40
|
+
export declare type MessageFilterCallback = (result: IMMessage) => boolean;
|
|
41
|
+
export interface NIMTalkAPI {
|
|
42
|
+
InitEventHandlers(): void;
|
|
43
|
+
SendMsg(msg: IMMessage, jsonExtension: string): void;
|
|
44
|
+
StopSendMsg(clientMsgId: string, type: NIMMessageType, jsonExtension: string): void;
|
|
45
|
+
RecallMsg(msg: IMMessage, notify_msg: string, cb: RecallMsgsCallback, apnstext: string, pushpayloadconst: string, jsonExtension: string): void;
|
|
46
|
+
GetAttachmentPathFromMsg(msg: IMMessage): string;
|
|
47
|
+
ReplyMessage(msg: IMMessage, json_reply_msg: string): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { IMMessage } from "./msglog_def";
|
|
2
|
+
import { NIMSessionType } from "./session_def";
|
|
3
|
+
export interface CollectInfo {
|
|
4
|
+
id: number; /**< id */
|
|
5
|
+
type: number; /**< number 类型,开发者可根据业务自定义其含意 */
|
|
6
|
+
data: string; /**<数据,string,最大20480 */
|
|
7
|
+
ext: string; /**< 扩展字段,string,最大1024 */
|
|
8
|
+
unique_id: string; /**< 去重唯一ID */
|
|
9
|
+
create_time: number; /**<创建时间 */
|
|
10
|
+
update_time: number; /**< 更新时间 */
|
|
11
|
+
}
|
|
12
|
+
export interface CollectInfoList {
|
|
13
|
+
list: Array<CollectInfo>;
|
|
14
|
+
}
|
|
15
|
+
export interface RemoveCollectsParm {
|
|
16
|
+
list: Array<MatchCollectParm>;
|
|
17
|
+
}
|
|
18
|
+
export interface MatchCollectParm {
|
|
19
|
+
create_time: number; /**<创建时间 */
|
|
20
|
+
id: number; /**< id */
|
|
21
|
+
}
|
|
22
|
+
export interface QueryCollectsParm {
|
|
23
|
+
from_time: number; /**<起始时间,默认0 */
|
|
24
|
+
to_time: number; /**<结束时间,推荐当前时间+1小时 */
|
|
25
|
+
exclude_id: number; /**<结束查询的最后一条收藏的id(不包含在查询结果中)缺省 可填0 */
|
|
26
|
+
limit: number; /**< 本次查询的上限(最多100条) */
|
|
27
|
+
reverse: boolean; /**<反向查询(按时间正序起查,正序排列),false:按时间逆序起查,逆序排列(建议默认为false) */
|
|
28
|
+
type: number; /**< 收藏类型,缺省表示所有类型 */
|
|
29
|
+
}
|
|
30
|
+
export interface QuickCommentInfo {
|
|
31
|
+
id: string; /** <服务端没有这个字段,本地为了好处理记录加上的(message serverid + from_accid + type) */
|
|
32
|
+
from_account: string;
|
|
33
|
+
reply_type: number; /**< 开发者自定义的回复类型 */
|
|
34
|
+
client_id: string; /**< 被回复消息的客户端ID */
|
|
35
|
+
server_id: number; /**< 被回复消息的服务端ID */
|
|
36
|
+
time: number; /**< 回复的时间戳 */
|
|
37
|
+
ext: string; /**< 自定义扩展字段,最大8字符 */
|
|
38
|
+
need_push: boolean; /**< 是否需要推送,0表示不需要,1表示需要,默认0 */
|
|
39
|
+
need_badge: boolean; /**< 是否需要角标,0表示不需要,1表示需要,默认0 */
|
|
40
|
+
push_title: string; /**< 推送标题 */
|
|
41
|
+
push_content: string; /**< 推送文案 */
|
|
42
|
+
push_payload: string; /**< 推送自定义字段JSON */
|
|
43
|
+
}
|
|
44
|
+
export interface RemoveQuickCommentParam {
|
|
45
|
+
id: string; /**< string 服务端没有这个字段,本地为了好处理记录加上的 */
|
|
46
|
+
reply_type: number; /**< number 开发者自定义的回复类型 */
|
|
47
|
+
ext: string; /**< string 取消操作的扩展字段 */
|
|
48
|
+
}
|
|
49
|
+
export interface QueryQuickCommentsParam {
|
|
50
|
+
message_list: Array<IMMessage>; /**< list 要查询的消息 一次最多查询20条 */
|
|
51
|
+
}
|
|
52
|
+
export interface QueryQuickCommentsResponseItem {
|
|
53
|
+
message_client_id: string;
|
|
54
|
+
quick_comment_list: Array<QuickCommentInfo>;
|
|
55
|
+
}
|
|
56
|
+
export interface QueryQuickCommentsResponse {
|
|
57
|
+
message_quick_comment_list: Array<QueryQuickCommentsResponseItem>;
|
|
58
|
+
}
|
|
59
|
+
export interface PinMessageInfo {
|
|
60
|
+
id: string; /**< Pin Message的ID 客户端生成服务端没有 */
|
|
61
|
+
session_id: string; /**< Pin Message对应的会话ID (客户端数据) */
|
|
62
|
+
server_id: number; /**< 被 Pin 消息的服务端ID */
|
|
63
|
+
client_id: string; /**< 被 pin 消息的客户商dID */
|
|
64
|
+
to_type: number; /**< 被 pin 消息的会话类型 */
|
|
65
|
+
from_account: string; /**< 被 pin 消息的发送方ID */
|
|
66
|
+
to_account: string; /**< 被 pin 消息的接收方ID */
|
|
67
|
+
message_time: number; /**< 被 pin 消息的时间戳 */
|
|
68
|
+
operator_account: string; /**< Pin Message的操作者ID */
|
|
69
|
+
ext: string; /**< Pin Message的扩展字段 */
|
|
70
|
+
create_time: number; /**< Pin Message的创建时间戳 */
|
|
71
|
+
update_time: number; /**< Pin Message的更新时间戳 */
|
|
72
|
+
}
|
|
73
|
+
export interface ModifyPinMessageParam {
|
|
74
|
+
session: string; /**< UnPin 消息所属会话 */
|
|
75
|
+
to_type: number; /**< UnPin 消息所属会话类型 */
|
|
76
|
+
id: string; /**< Pin Message 的ID 客户端生成服务端没有 */
|
|
77
|
+
ext: string; /**< 扩展字段 */
|
|
78
|
+
}
|
|
79
|
+
export interface QueryAllPinMessageResponse {
|
|
80
|
+
pin_list: Array<PinMessageInfo>;
|
|
81
|
+
}
|
|
82
|
+
export declare type AddCollectCallback = (code: number, info: CollectInfo) => void;
|
|
83
|
+
export declare type RemoveCollectsCallback = (code: number, count: number) => void;
|
|
84
|
+
export declare type UpdateCollectCallback = (code: number, info: CollectInfo) => void;
|
|
85
|
+
export declare type QueryCollectsCallback = (code: number, count: number, info: CollectInfoList) => void;
|
|
86
|
+
export declare type AddQuickCommentCallback = (code: number, info: QuickCommentInfo) => void;
|
|
87
|
+
export declare type RemoveQuickCommentCallback = (code: number, id: string) => void;
|
|
88
|
+
export declare type QueryQuickCommentCallback = (code: number, res: QueryQuickCommentsResponse) => void;
|
|
89
|
+
export declare type AddQuickCommentNotifyCallback = (session: string, to_type: NIMSessionType, msg_client_id: string, qc_info: QuickCommentInfo) => void;
|
|
90
|
+
export declare type RemoveQuickCommentNotifyCallback = (session: string, to_type: NIMSessionType, msg_client_id: string, quick_comment_id: string, ext: string) => void;
|
|
91
|
+
export declare type PinMessageCallback = (code: number, session: string, to_type: number, info: PinMessageInfo) => void;
|
|
92
|
+
export declare type UnPinMessageCallback = (code: number, session: string, to_type: number, id: string) => void;
|
|
93
|
+
export declare type UpdatePinMessageCallback = (code: number, session: string, to_type: number, info: PinMessageInfo) => void;
|
|
94
|
+
export declare type QueryPinMessageCallback = (code: number, session: string, to_type: number, res: QueryAllPinMessageResponse) => void;
|
|
95
|
+
export declare type AddPinMessageNotifyCallback = (session: string, to_type: number, info: PinMessageInfo) => void;
|
|
96
|
+
export declare type UnPinMessageNotifyCallback = (session: string, to_type: number, id: string) => void;
|
|
97
|
+
export declare type UpdatePinMessageNotifyCallback = (session: string, to_type: number, info: PinMessageInfo) => void;
|
|
98
|
+
export interface NIMTalkExAPI {
|
|
99
|
+
InitEventHandlers(): void;
|
|
100
|
+
AddCollect(collect_info: CollectInfo, cb: AddCollectCallback): void;
|
|
101
|
+
RemoveCollects(collect_list: RemoveCollectsParm, cb: RemoveCollectsCallback): void;
|
|
102
|
+
UpdateCollectExt(collect_match_param: MatchCollectParm, ext: string, cb: UpdateCollectCallback): void;
|
|
103
|
+
QueryCollectList(query_collect_list_param: QueryCollectsParm, cb: QueryCollectsCallback): void;
|
|
104
|
+
AddQuickComment(msg: IMMessage, info: QuickCommentInfo, cb: AddQuickCommentCallback): void;
|
|
105
|
+
RemoveQuickComment(msg: IMMessage, param: RemoveQuickCommentParam, cb: RemoveQuickCommentCallback): void;
|
|
106
|
+
QueryQuickCommentList(query_param: QueryQuickCommentsParam, cb: QueryQuickCommentCallback): void;
|
|
107
|
+
AddPinMessage(msg: IMMessage, info: PinMessageInfo, cb: PinMessageCallback): void;
|
|
108
|
+
UnPinMessage(modify_param: ModifyPinMessageParam, cb: UnPinMessageCallback): void;
|
|
109
|
+
UpdatePinMessage(modify_param: ModifyPinMessageParam, cb: UpdatePinMessageCallback): void;
|
|
110
|
+
QueryAllPinMessage(session: string, to_type: number, cb: QueryPinMessageCallback): void;
|
|
111
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { NIMResCode } from './client_def';
|
|
2
|
+
import { IMMessage, NIMNotificationId } from './msglog_def';
|
|
3
|
+
import { UserNameCard } from './user_def';
|
|
4
|
+
/** @enum NIMTeamBeInviteMode 被邀请人同意方式 */
|
|
5
|
+
export declare enum NIMTeamBeInviteMode {
|
|
6
|
+
kNIMTeamBeInviteModeNeedAgree = 0,
|
|
7
|
+
kNIMTeamBeInviteModeNotNeedAgree = 1
|
|
8
|
+
}
|
|
9
|
+
/** @enum NIMTeamInviteMode 谁可以邀请他人入群 */
|
|
10
|
+
export declare enum NIMTeamInviteMode {
|
|
11
|
+
kNIMTeamInviteModeManager = 0,
|
|
12
|
+
kNIMTeamInviteModeEveryone = 1
|
|
13
|
+
}
|
|
14
|
+
/** @enum NIMTeamUpdateInfoMode 谁可以修改群资料 */
|
|
15
|
+
export declare enum NIMTeamUpdateInfoMode {
|
|
16
|
+
kNIMTeamUpdateInfoModeManager = 0,
|
|
17
|
+
kNIMTeamUpdateInfoModeEveryone = 1
|
|
18
|
+
}
|
|
19
|
+
/** @enum NIMTeamUpdateCustomMode 谁可以更新群自定义属性 */
|
|
20
|
+
export declare enum NIMTeamUpdateCustomMode {
|
|
21
|
+
kNIMTeamUpdateCustomModeManager = 0,
|
|
22
|
+
kNIMTeamUpdateCustomModeEveryone = 1
|
|
23
|
+
}
|
|
24
|
+
/** @enum NIMTeamMuteType 群信息kTeamInfoKeyMuteType的配置定义 */
|
|
25
|
+
export declare enum NIMTeamMuteType {
|
|
26
|
+
kNIMTeamMuteTypeNone = 0,
|
|
27
|
+
kNIMTeamMuteTypeNomalMute = 1,
|
|
28
|
+
kNIMTeamMuteTypeAllMute = 3
|
|
29
|
+
}
|
|
30
|
+
/** @enum NIMTeamBitsConfigMask 群组成员信息Bits属性kNIMTeamUserKeyBits的配置定义 */
|
|
31
|
+
export declare enum NIMTeamBitsConfigMask {
|
|
32
|
+
kNIMTeamBitsConfigMaskMuteNone = 0,
|
|
33
|
+
kNIMTeamBitsConfigMaskMuteNotify = 1,
|
|
34
|
+
kNIMTeamBitsConfigMaskOnlyAdmin = 2
|
|
35
|
+
}
|
|
36
|
+
/** @enum NIMTeamType 群组类型 */
|
|
37
|
+
export declare enum NIMTeamType {
|
|
38
|
+
kNIMTeamTypeNormal = 0,
|
|
39
|
+
kNIMTeamTypeAdvanced = 1
|
|
40
|
+
}
|
|
41
|
+
/** @enum NIMTeamUserType 群成员类型 */
|
|
42
|
+
export declare enum NIMTeamUserType {
|
|
43
|
+
kNIMTeamUserTypeNomal = 0,
|
|
44
|
+
kNIMTeamUserTypeCreator = 1,
|
|
45
|
+
kNIMTeamUserTypeManager = 2,
|
|
46
|
+
kNIMTeamUserTypeApply = 3,
|
|
47
|
+
kNIMTeamUserTypeLocalWaitAccept = 100
|
|
48
|
+
}
|
|
49
|
+
/** @enum NIMTeamJoinMode 群允许加入类型 */
|
|
50
|
+
export declare enum NIMTeamJoinMode {
|
|
51
|
+
kNIMTeamJoinModeNoAuth = 0,
|
|
52
|
+
kNIMTeamJoinModeNeedAuth = 1,
|
|
53
|
+
kNIMTeamJoinModeRejectAll = 2
|
|
54
|
+
}
|
|
55
|
+
export declare enum NIMTeamQueryType {
|
|
56
|
+
kNIMTeamQueryDefault = 0,
|
|
57
|
+
kNIMTeamQueryByTeamId = 1,
|
|
58
|
+
kNIMTeamQueryByTeamName = 2 /** < 仅匹配群组名称 */
|
|
59
|
+
}
|
|
60
|
+
export interface TeamEvent {
|
|
61
|
+
res_code_: NIMResCode; /**< 错误码 */
|
|
62
|
+
notification_id_: NIMNotificationId; /**< 通知类型ID */
|
|
63
|
+
team_id_: string; /**< 群组ID */
|
|
64
|
+
ids_: Array<string>; /**< 通知可能涉及到的群成员ID */
|
|
65
|
+
invalid_ids_: Array<string>; /**< 通知可能涉及到的失效的群成员ID,比如邀请入群的成员的群数量超限导致当次邀请失败 */
|
|
66
|
+
namecards_: Array<UserNameCard>; /**< 通知可能涉及到的群成员的用户名片 */
|
|
67
|
+
team_info_: TeamInfo; /**< 通知可能涉及到的群信息 */
|
|
68
|
+
member_property_: TeamMemberProperty; /**< 群成员属性 */
|
|
69
|
+
opt_: boolean; /**< 操作 */
|
|
70
|
+
attach_: string; /**< 扩展字段,目前仅kick和invite事件可选 */
|
|
71
|
+
src_data_: string; /**< 未解析过的原信息,目前仅支持群消息未读数相关事件 */
|
|
72
|
+
}
|
|
73
|
+
export interface TeamInfoJsonValue {
|
|
74
|
+
tid: string;
|
|
75
|
+
name: string;
|
|
76
|
+
member_max_count: number;
|
|
77
|
+
type: NIMTeamType;
|
|
78
|
+
prop: string;
|
|
79
|
+
intro: string;
|
|
80
|
+
announcement: string;
|
|
81
|
+
join_mode: NIMTeamJoinMode;
|
|
82
|
+
custom: string;
|
|
83
|
+
icon: string;
|
|
84
|
+
be_invite_mode: NIMTeamBeInviteMode;
|
|
85
|
+
invite_mode: NIMTeamInviteMode;
|
|
86
|
+
update_info_mode: NIMTeamUpdateInfoMode;
|
|
87
|
+
update_custom_mode: NIMTeamUpdateCustomMode;
|
|
88
|
+
mute_type: NIMTeamMuteType;
|
|
89
|
+
}
|
|
90
|
+
export interface TeamInfo {
|
|
91
|
+
team_info_json_value_: TeamInfoJsonValue;
|
|
92
|
+
}
|
|
93
|
+
export interface TeamMemberPropertyJsonValue {
|
|
94
|
+
tid: string;
|
|
95
|
+
type: NIMTeamUserType;
|
|
96
|
+
nick: string;
|
|
97
|
+
bits: number;
|
|
98
|
+
mute: number;
|
|
99
|
+
custom: string;
|
|
100
|
+
}
|
|
101
|
+
export interface TeamMemberProperty {
|
|
102
|
+
member_info_json_value_: TeamMemberPropertyJsonValue;
|
|
103
|
+
}
|
|
104
|
+
export declare type TeamEventCallback = (result: TeamEvent) => void;
|
|
105
|
+
export declare type QueryAllMyTeamsCallback = (count: number, result: Array<string>) => void;
|
|
106
|
+
export declare type QueryAllMyTeamsInfoCallback = (count: number, result: Array<TeamInfo>) => void;
|
|
107
|
+
export declare type QueryMyAllMemberInfosCallback = (count: number, result: Array<TeamMemberProperty>) => void;
|
|
108
|
+
export declare type QueryTeamMembersCallback = (tid: string, count: number, result: Array<TeamMemberProperty>) => void;
|
|
109
|
+
export declare type QueryTeamMemberCallback = (result: TeamMemberProperty) => void;
|
|
110
|
+
export declare type QueryTeamInfoCallback = (tid: string, result: TeamInfo) => void;
|
|
111
|
+
export declare type QueryTeamMembersOnlineCallback = (rescode: number, count: number, result: Array<TeamMemberProperty>) => void;
|
|
112
|
+
export declare type QueryTeamMembersInvitorCallback = (rescode: number, count: number, result: Map<string, string>) => void;
|
|
113
|
+
export declare type QueryTeamsInfoCallback = (count: number, result: Array<TeamInfo>) => void;
|
|
114
|
+
export declare type TeamMsgAckReadCallback = (tid: string, success_ids: Array<string>, failure_ids: Array<string>, ignored_ids: Array<string>) => void;
|
|
115
|
+
export declare type UpdateTInfoLocalCallback = (success_ids: Array<string>, failure_ids: Array<string>) => void;
|
|
116
|
+
export declare type GetTeamInfoBatchSFTransCallback = (count: number, infos: Array<TeamInfo>) => void;
|
|
117
|
+
export declare type GetTeamInfoListCallback = (rescode: NIMResCode, infos: Array<TeamInfo>, failure_ids: Array<string>) => void;
|
|
118
|
+
export interface NIMTeamAPI {
|
|
119
|
+
InitEventHandlers(): void;
|
|
120
|
+
CreateTeamAsync(info: TeamInfo, ids: Array<string>, invitationPostscript: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
121
|
+
InviteAsync(tid: string, ids: Array<string>, invitationPostscript: string, invitationAttachment: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
122
|
+
KickAsync(tid: string, ids: Array<string>, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
123
|
+
LeaveAsync(tid: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
124
|
+
DismissAsync(tid: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
125
|
+
UpdateTeamInfoAsync(tid: string, info: TeamInfo, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
126
|
+
ApplyJoinAsync(tid: string, reason: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
127
|
+
PassJoinApplyAsync(tid: string, applicantId: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
128
|
+
RejectJoinApplyAsync(tid: string, applicantId: string, reason: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
129
|
+
AddManagersAsync(tid: string, ids: Array<string>, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
130
|
+
RemoveManagersAsync(tid: string, ids: Array<string>, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
131
|
+
TransferTeamAsync(tid: string, newOwnerId: string, isLeave: boolean, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
132
|
+
UpdateMyPropertyAsync(prop: TeamMemberProperty, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
133
|
+
UpdateOtherNickAsync(prop: TeamMemberProperty, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
134
|
+
AcceptInvitationAsync(tid: string, inviterId: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
135
|
+
RejectInvitationAsync(tid: string, inviterId: string, reason: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
136
|
+
QueryAllMyTeamsAsync(cb: QueryAllMyTeamsCallback, jsonExtension: string): void;
|
|
137
|
+
QueryAllMyTeamsInfoAsync(cb: QueryAllMyTeamsInfoCallback, jsonExtension: string): void;
|
|
138
|
+
QueryMyAllMemberInfosAsync(cb: QueryMyAllMemberInfosCallback, jsonExtension: string): void;
|
|
139
|
+
QueryTeamMembersAsync(tid: string, cb: QueryTeamMembersCallback, jsonExtension: string): boolean;
|
|
140
|
+
QueryTeamMemberAsync(tid: string, id: string, cb: QueryTeamMemberCallback, jsonExtension: string): void;
|
|
141
|
+
QueryTeamInfoAsync(tid: string, cb: QueryTeamInfoCallback, jsonExtension: string): boolean;
|
|
142
|
+
QueryTeamInfoOnlineAsync(tid: string, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
143
|
+
MuteMemberAsync(tid: string, member_id: string, set_mute: boolean, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
144
|
+
QueryMuteListOnlineAsync(tid: string, cb: QueryTeamMembersOnlineCallback, jsonExtension: string): boolean;
|
|
145
|
+
MuteAsync(tid: string, set_mute: boolean, cb: TeamEventCallback, jsonExtension: string): boolean;
|
|
146
|
+
TeamMsgAckRead(tid: string, msgs: Array<IMMessage>, cb: TeamMsgAckReadCallback, jsonExtension: string): void;
|
|
147
|
+
TeamMsgQueryUnreadList(tid: string, msg: IMMessage, accids: Array<string>, cb: TeamEventCallback, jsonExtension: string): void;
|
|
148
|
+
QueryTeamMembersInvitor(tid: string, members: Array<string>, cb: QueryTeamMembersInvitorCallback): void;
|
|
149
|
+
QueryTeamInfoByKeywordAsync(keyword: string, cb: QueryTeamsInfoCallback, jsonExtension: string): boolean;
|
|
150
|
+
UpdateTInfoLocal(infos: Array<TeamInfo>, cb: UpdateTInfoLocalCallback, jsonExtension: string): void;
|
|
151
|
+
GetTeamInfoBatchSFTrans(cb: GetTeamInfoBatchSFTransCallback, time_tag: number, jsonExtension: string): void;
|
|
152
|
+
GetTeaminfoList(tids: Array<string>, cb: GetTeamInfoListCallback): void;
|
|
153
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** @enum NIMAppDataType AppData类型 */
|
|
2
|
+
export declare enum NIMAppDataType {
|
|
3
|
+
kNIMAppDataTypeUnknownOtherRes = 0,
|
|
4
|
+
kNIMAppDataTypeImage = 1,
|
|
5
|
+
kNIMAppDataTypeAudio = 2,
|
|
6
|
+
kNIMAppDataTypeVideo = 3
|
|
7
|
+
}
|
|
8
|
+
export interface AudioInfo {
|
|
9
|
+
mime_type_: string; /** < string 语音类型 */
|
|
10
|
+
samplerate_: string; /** < string 语音采样率 */
|
|
11
|
+
url_: string; /** < string 语音url*/
|
|
12
|
+
duration_: number; /** < long 语音时长,毫秒*/
|
|
13
|
+
}
|
|
14
|
+
export declare type GetAudioTextCallback = (rescode: number, text: string) => void;
|
|
15
|
+
export declare type FilterClientAntispamCallback = (succeed: boolean, rescode: number, text: string) => void;
|
|
16
|
+
export interface NIMToolAPI {
|
|
17
|
+
InitEventHandlers(): void;
|
|
18
|
+
GetUserAppdataDir(appAccount: string): string;
|
|
19
|
+
GetSpecificAppdataDir(appAccount: string, appdataType: NIMAppDataType): string;
|
|
20
|
+
GetLocalAppdataDir(): string;
|
|
21
|
+
GetCurModuleDir(): string;
|
|
22
|
+
GetMd5(input: string): string;
|
|
23
|
+
GetFileMd5(filePath: string): string;
|
|
24
|
+
GetUuid(): string;
|
|
25
|
+
GetAudioTextAsync(audioInfo: AudioInfo, cb: GetAudioTextCallback, jsonExtension: string): boolean;
|
|
26
|
+
FilterClientAntispam(text: string, replaceString: string, libName: string, cb: FilterClientAntispamCallback): void;
|
|
27
|
+
}
|