node-nim 9.5.0-rc.1 → 9.7.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.
Files changed (77) hide show
  1. package/README.md +130 -149
  2. package/dist/chatroom/chatroom.js +14 -4
  3. package/dist/chatroom/chatroom.js.map +1 -1
  4. package/dist/loader.js +15 -7
  5. package/dist/loader.js.map +1 -1
  6. package/dist/nim/client.js +5 -5
  7. package/dist/nim/client.js.map +1 -1
  8. package/dist/nim/friend.js.map +1 -1
  9. package/dist/nim/global.js.map +1 -1
  10. package/dist/nim/msglog.js +24 -0
  11. package/dist/nim/msglog.js.map +1 -1
  12. package/dist/nim/nos.js.map +1 -1
  13. package/dist/nim/online_session.js.map +1 -1
  14. package/dist/nim/pass_through_proxy.js.map +1 -1
  15. package/dist/nim/plugin.js.map +1 -1
  16. package/dist/nim/session.js.map +1 -1
  17. package/dist/nim/subscribe_event.js.map +1 -1
  18. package/dist/nim/super_team.js.map +1 -1
  19. package/dist/nim/sysmsg.js.map +1 -1
  20. package/dist/nim/talk.js.map +1 -1
  21. package/dist/nim/talkex.js.map +1 -1
  22. package/dist/nim/team.js.map +1 -1
  23. package/dist/nim/tool.js.map +1 -1
  24. package/dist/nim/user.js.map +1 -1
  25. package/dist/nim_def/client_def.js +164 -79
  26. package/dist/nim_def/client_def.js.map +1 -1
  27. package/dist/nim_def/msglog_def.js +1 -0
  28. package/dist/nim_def/msglog_def.js.map +1 -1
  29. package/dist/qchat_def/public_def.js +102 -69
  30. package/dist/qchat_def/public_def.js.map +1 -1
  31. package/package.json +64 -64
  32. package/script/download-sdk.mjs +67 -64
  33. package/types/chatroom/chatroom.d.ts +24 -23
  34. package/types/chatroom_def/chatroom_def.d.ts +44 -18
  35. package/types/nim/client.d.ts +8 -8
  36. package/types/nim/friend.d.ts +6 -6
  37. package/types/nim/global.d.ts +6 -6
  38. package/types/nim/msglog.d.ts +43 -28
  39. package/types/nim/nos.d.ts +5 -5
  40. package/types/nim/online_session.d.ts +4 -4
  41. package/types/nim/pass_through_proxy.d.ts +1 -1
  42. package/types/nim/plugin.d.ts +2 -2
  43. package/types/nim/session.d.ts +19 -19
  44. package/types/nim/subscribe_event.d.ts +5 -5
  45. package/types/nim/super_team.d.ts +24 -24
  46. package/types/nim/sysmsg.d.ts +8 -8
  47. package/types/nim/talk.d.ts +3 -3
  48. package/types/nim/talkex.d.ts +11 -11
  49. package/types/nim/team.d.ts +33 -33
  50. package/types/nim/tool.d.ts +2 -2
  51. package/types/nim/user.d.ts +8 -8
  52. package/types/nim_def/client_def.d.ts +95 -92
  53. package/types/nim_def/data_sync_def.d.ts +1 -1
  54. package/types/nim_def/friend_def.d.ts +10 -10
  55. package/types/nim_def/global_def.d.ts +13 -13
  56. package/types/nim_def/msglog_def.d.ts +54 -45
  57. package/types/nim_def/nos_def.d.ts +14 -14
  58. package/types/nim_def/online_session_def.d.ts +9 -9
  59. package/types/nim_def/pass_through_proxy_def.d.ts +3 -3
  60. package/types/nim_def/plugin_def.d.ts +4 -4
  61. package/types/nim_def/session_def.d.ts +36 -36
  62. package/types/nim_def/subscribe_event_def.d.ts +12 -12
  63. package/types/nim_def/super_team_def.d.ts +32 -32
  64. package/types/nim_def/sysmsg_def.d.ts +13 -13
  65. package/types/nim_def/talk_def.d.ts +11 -11
  66. package/types/nim_def/talkex_def.d.ts +27 -27
  67. package/types/nim_def/team_def.d.ts +47 -47
  68. package/types/nim_def/tool_def.d.ts +4 -4
  69. package/types/nim_def/user_def.d.ts +14 -14
  70. package/types/qchat_def/attachment_def.d.ts +4 -4
  71. package/types/qchat_def/channel_def.d.ts +47 -47
  72. package/types/qchat_def/instance_def.d.ts +9 -11
  73. package/types/qchat_def/message_def.d.ts +27 -23
  74. package/types/qchat_def/public_def.d.ts +20 -70
  75. package/types/qchat_def/role_def.d.ts +45 -45
  76. package/types/qchat_def/server_def.d.ts +44 -44
  77. package/types/qchat_def/system_notification_def.d.ts +9 -9
@@ -30,85 +30,88 @@ export declare enum NIMClientType {
30
30
  }
31
31
  /** @enum NIMResCode 返回的错误号(只定义需要客户端处理的) */
32
32
  export declare enum NIMResCode {
33
- kNIMResError = 0 /**< 错误 */,
34
- kNIMResSuccess = 200 /**< 没有错误,一切正常 */,
35
- kNIMResVersionError = 201 /**< 客户端版本不正确 */,
36
- kNIMResUidPassError = 302 /**< 用户名或密码错误 */,
37
- kNIMResForbidden = 403 /**< 禁止操作 */,
38
- kNIMResNotExist = 404 /**< 请求的目标(用户或对象)不存在 */,
39
- kNIMResNoModify = 406 /**< 数据自上次查询以来未发生变化(用于增量更新) */,
40
- kNIMResTimeoutError = 408 /**< 请求过程超时 */,
41
- kNIMResParameterError = 414 /**< 参数错误 */,
42
- kNIMResConnectionError = 415 /**< 网络连接出现错误 */,
43
- kNIMResFrequently = 416 /**< 操作太过频繁 */,
44
- kNIMResExist = 417 /**< 对象已经存在/重复操作 */,
45
- kNIMResOverrun = 419 /**< 超限 */,
46
- kNIMResAccountBlock = 422 /**< 帐号被禁用 */,
47
- kNIMResUnknownError = 500 /**< 未知错误,或者不方便告诉你 */,
48
- kNIMResServerDataError = 501 /**< 服务器数据错误 */,
49
- kNIMResTooBuzy = 503 /**< 服务器太忙 */,
50
- kNIMResExceedLimit = 508 /**< 超过配置有效期 */,
51
- kNIMResInvalid = 509 /**< 协议无效, 不允许访问的协议 */,
52
- kNIMResTeamECountLimit = 801 /**< 已达到人数限制 */,
53
- kNIMResTeamENAccess = 802 /**< 没有权限 */,
54
- kNIMResTeamENotExist = 803 /**< 群不存在 */,
55
- kNIMResTeamEMemberNotExist = 804 /**< 用户不在兴趣组里面 */,
56
- kNIMResTeamErrType = 805 /**< 群类型不对 */,
57
- kNIMResTeamLimit = 806 /**< 创建群数量限制 */,
58
- kNIMResTeamUserStatusErr = 807 /**< 群成员状态不对 */,
59
- kNIMResTeamApplySuccess = 808 /**< 申请成功 */,
60
- kNIMResTeamAlreadyIn = 809 /**< 已经在群里 */,
61
- kNIMResTeamInviteSuccess = 810 /**< 邀请成功 */,
62
- kNIMResForcePushCountLimit = 811 /**< 强推列表账号数量超限 */,
63
- kNIMResTeamMemberLimit = 813 /**< 操作成功,但部分成员的群数量超限 */,
64
- kNIMResTeamGetInfoListPartSuccess = 816 /**< 批量查询群信息部分成功 */,
65
- kNIMResInvalidProtocol = 997 /**< 协议已失效 */,
66
- kNIMResEUnpacket = 998 /**< 解包错误 */,
67
- kNIMResEPacket = 999 /**< 打包错误 */,
68
- kNIMResInBlack = 7101 /**< 被接收方加入黑名单 SDK版本大于2.5.0支持 */,
69
- kNIMResRoomNotExists = 10404 /**< 房间不存在 */,
70
- kNIMResRoomHasExists = 10405 /**< 房间已存在 */,
71
- kNIMResRoomMemberNotExists = 10406 /**< 不在房间内 */,
72
- kNIMResRoomMemberHasExists = 10407 /**< 已经在房间内 */,
73
- kNIMResRoomInviteNotExists = 10408 /**< 邀请不存在或已过期 */,
74
- kNIMResRoomInviteHasReject = 10409 /**< 邀请已经拒绝 */,
75
- kNIMResRoomInviteHasAccept = 10410 /**< 邀请已经接受了 */,
76
- kNIMResPeerNimOffline = 10201 /**< 对方云信不在线 */,
77
- kNIMResPeerPushOffline = 10202 /**< 对方推送亦不可达 */,
78
- kNIMResRoomUidConflict = 10417 /**< uid冲突 */,
79
- kNIMResRoomMemberExceed = 10419 /**< 房间人数超限 */,
80
- kNIMResRoomMemberHasExistsOtherClient = 10420 /**< 已经在房间内(自己的其他端) */,
81
- kNIMLocalRes = 10000 /**< 值大于该错误号的都是客户端自定义的错误号。不能随意更改其值! */,
82
- kNIMResRoomLocalNeedRequestAgain = 10001 /**< 客户端本地错误号,需要重新向IM服务器获取进入聊天室权限 */,
83
- kNIMLocalResNetworkError = 10010 /**< 客户端本地错误号,本地网络错误,需要检查本地网络 */,
84
- kNIMLocalResMsgNosUploadCancel = 10200 /**< (发送文件消息或者stop_upload_ex)HTTP upload to NOS上传暂停 */,
85
- kNIMLocalResMsgNosDownloadCancel = 10206 /**< (收到文件消息或者stop_download_ex)HTTP download from NOS下载暂停 */,
86
- kNIMLocalResMsgNosDownloadCheckError = 10207 /**< 收到文件消息,NOS下载完成后本地文件检查错误,一般为下载的文件大小与文件信息不符 */,
87
- kNIMLocalResMsgFileNotAccess = 10403 /**< 本地文件无访问权限 */,
88
- kNIMLocalResMsgFileNotExist = 10404 /**< 本地资源不存在 */,
89
- kNIMLocalResParameterError = 10414 /**< 本地错误码,参数错误,(收到消息,资源下载地址无效,无法下载) */,
90
- kNIMLocalResExist = 10417 /**< 本地错误码,对象已经存在/重复操作,(收到消息,本地资源已存在,不需要重复下载) */,
91
- kNIMLocalResParaError = 10450 /**< 调用api,传入的参数有误 */,
92
- kNIMLocalResMsgSendNosError = 10502 /**< 发送消息,上传NOS失败 */,
93
- kNIMLocalResExceedLimit = 10508 /**< 本地错误码,超过配置有效期或者所需参数不存在 */,
94
- kNIMLocalResCheckMsgDBFailed = 10600 /**< 导入消息历史时验证身份和加密密钥不通过 */,
95
- kNIMLocalResImportMsgDBFailed = 10601 /**< 导入消息历史时写记录失败 */,
96
- kNIMLocalResTMembersSyncUndone = 10602 /**< 群成员尚同步完成 */,
97
- kNIMLocalResRtsError = 11100 /**< rts会话 未知错误 */,
98
- kNIMLocalResRtsIdNotExist = 11101 /**< rts会话 id不存在 */,
99
- kNIMLocalResRtsVChatExist = 11417 /**< rts会话 音视频已存在 */,
100
- kNIMLocalResRtsStatusError = 11501 /**< rts会话 通道状态不正确 */,
101
- kNIMLocalResRtsChannelNotExist = 11510 /**< rts会话 通道不存在 */,
102
- kNIMResRoomLinkError = 13001 /**< 主链接错误 */,
103
- kNIMResRoomError = 13002 /**< 聊天室状态异常 */,
104
- kNIMResRoomBlackBeOut = 13003 /**< 黑名单用户禁止进入 */,
105
- kNIMResRoomBeMuted = 13004 /**< 被禁言 */,
106
- kNIMResRoomAllMuted = 13006 /**< 聊天室处于整体禁言状态,只有管理员能发言 */,
107
- kNIMLocalResAPIErrorInitUndone = 20000 /**< 还未初始化或初始化未正常完成 */,
108
- kNIMLocalResAPIErrorLoginUndone = 20001 /**< 还未登陆或登录未完成 */,
109
- kNIMLocalResAPIErrorLogined = 20002 /**< 已经登录 */,
110
- kNIMLocalResAPIErrorVersionError = 20003 /**< SDK版本不对,可能会引发其他问题 */,
111
- kNIMLocalResAPIErrorChatroomMixError = 20004 /**< 聊天室模式混用错误,不支持同时以登陆状态和匿名状态登陆聊天室 */
33
+ kNIMResError = 0,
34
+ kNIMResSuccess = 200,
35
+ kNIMResVersionError = 201,
36
+ kNIMResUidPassError = 302,
37
+ kNIMResForbidden = 403,
38
+ kNIMResNotExist = 404,
39
+ kNIMResNoModify = 406,
40
+ kNIMResTimeoutError = 408,
41
+ kNIMResParameterError = 414,
42
+ kNIMResConnectionError = 415,
43
+ kNIMResFrequently = 416,
44
+ kNIMResExist = 417,
45
+ kNIMResOverrun = 419,
46
+ kNIMResAccountBlock = 422,
47
+ kNIMResUnknownError = 500,
48
+ kNIMResServerDataError = 501,
49
+ kNIMResTooBuzy = 503,
50
+ kNIMResExceedLimit = 508,
51
+ kNIMResInvalid = 509,
52
+ kNIMResTeamECountLimit = 801,
53
+ kNIMResTeamENAccess = 802,
54
+ kNIMResTeamENotExist = 803,
55
+ kNIMResTeamEMemberNotExist = 804,
56
+ kNIMResTeamErrType = 805,
57
+ kNIMResTeamLimit = 806,
58
+ kNIMResTeamUserStatusErr = 807,
59
+ kNIMResTeamApplySuccess = 808,
60
+ kNIMResTeamAlreadyIn = 809,
61
+ kNIMResTeamInviteSuccess = 810,
62
+ kNIMResForcePushCountLimit = 811,
63
+ kNIMResTeamMemberLimit = 813,
64
+ kNIMResTeamGetInfoListPartSuccess = 816,
65
+ kNIMResInvalidProtocol = 997,
66
+ kNIMResEUnpacket = 998,
67
+ kNIMResEPacket = 999,
68
+ kNIMResInBlack = 7101,
69
+ kNIMResRoomNotExists = 10404,
70
+ kNIMResRoomHasExists = 10405,
71
+ kNIMResRoomMemberNotExists = 10406,
72
+ kNIMResRoomMemberHasExists = 10407,
73
+ kNIMResRoomInviteNotExists = 10408,
74
+ kNIMResRoomInviteHasReject = 10409,
75
+ kNIMResRoomInviteHasAccept = 10410,
76
+ kNIMResPeerNimOffline = 10201,
77
+ kNIMResPeerPushOffline = 10202,
78
+ kNIMResRoomUidConflict = 10417,
79
+ kNIMResRoomMemberExceed = 10419,
80
+ kNIMResRoomMemberHasExistsOtherClient = 10420,
81
+ kNIMLocalRes = 10000,
82
+ kNIMResRoomLocalNeedRequestAgain = 10001,
83
+ kNIMLocalResNetworkError = 10010,
84
+ kNIMLocalResMsgNosUploadCancel = 10200,
85
+ kNIMLocalResMsgNosDownloadCancel = 10206,
86
+ kNIMLocalResMsgNosDownloadCheckError = 10207,
87
+ kNIMLocalResMsgAccessDenied = 10403,
88
+ kNIMLocalResMsgFileNotExist = 10404,
89
+ kNIMLocalResParameterError = 10414,
90
+ kNIMLocalResFrequently = 10416,
91
+ kNIMLocalResExist = 10417,
92
+ kNIMLocalResParaError = 10450,
93
+ kNIMLocalResMsgSendNosError = 10502,
94
+ kNIMLocalResExceedLimit = 10508,
95
+ kNIMLocalResCheckMsgDBFailed = 10600,
96
+ kNIMLocalResImportMsgDBFailed = 10601,
97
+ kNIMLocalResTMembersSyncUndone = 10602,
98
+ kNIMLocalResRtsError = 11100,
99
+ kNIMLocalResRtsIdNotExist = 11101,
100
+ kNIMLocalResRtsVChatExist = 11417,
101
+ kNIMLocalResRtsStatusError = 11501,
102
+ kNIMLocalResRtsChannelNotExist = 11510,
103
+ kNIMResRoomLinkError = 13001,
104
+ kNIMResRoomError = 13002,
105
+ kNIMResRoomBlackBeOut = 13003,
106
+ kNIMResRoomBeMuted = 13004,
107
+ kNIMResRoomAllMuted = 13006,
108
+ kNIMLocalResAPIErrorInitUndone = 20000,
109
+ kNIMLocalResAPIErrorLoginUndone = 20001,
110
+ kNIMLocalResAPIErrorLogined = 20002,
111
+ kNIMLocalResAPIErrorVersionError = 20003,
112
+ kNIMLocalResAPIErrorChatroomMixError = 20005,
113
+ kNIMLocalResAPIErrorLoginExceedRetryCount = 20006,
114
+ kNIMLocalResAPIErrorRunOutOfLinkAddress = 20007
112
115
  }
113
116
  /** @enum NIMLoginStep 登录步骤 */
114
117
  export declare enum NIMLoginStep {
@@ -253,28 +256,28 @@ export interface KickOtherRes {
253
256
  res_code_?: NIMResCode; /**< 返回的错误码NIMResCode */
254
257
  device_ids_?: Array<string>; /**< 设备id,uuid */
255
258
  }
256
- export declare type LoginCallback = (result: LoginRes) => void;
257
- export declare type LogoutCallback = (rescode: NIMResCode) => void;
258
- export declare type KickoutCallback = (result: KickoutRes) => void;
259
- export declare type DisconnectCallback = () => void;
260
- export declare type MultiSpotLoginCallback = (result: MultiSpotLoginRes) => void;
261
- export declare type KickOtherCallback = (result: KickOtherRes) => void;
262
- export declare type MultiportPushConfigCallback = (rescode: NIMResCode, open: boolean) => void;
263
- export declare type GetCurrentServerTimeCallback = (rescode: NIMResCode, calcLocal: boolean, time: number) => void;
259
+ export type LoginCallback = (result: LoginRes) => void;
260
+ export type LogoutCallback = (rescode: NIMResCode) => void;
261
+ export type KickoutCallback = (result: KickoutRes) => void;
262
+ export type DisconnectCallback = () => void;
263
+ export type MultiSpotLoginCallback = (result: MultiSpotLoginRes) => void;
264
+ export type KickOtherCallback = (result: KickOtherRes) => void;
265
+ export type MultiportPushConfigCallback = (rescode: NIMResCode, open: boolean) => void;
266
+ export type GetCurrentServerTimeCallback = (rescode: NIMResCode, calcLocal: boolean, time: number) => void;
264
267
  export interface NIMClientAPI {
265
268
  Init(appKey: string, appDataDir: string, appInstallDir: string, config: SDKConfig): boolean;
266
269
  InitEventHandlers(): void;
267
- Login(appKey: string, account: string, password: string, cb: LoginCallback, jsonExtension: string): boolean;
268
- Logout(logoutType: NIMLogoutType, cb: LogoutCallback, jsonExtension: string): void;
270
+ Login(appKey: string, account: string, password: string, cb: LoginCallback | null, jsonExtension: string): boolean;
271
+ Logout(logoutType: NIMLogoutType, cb: LogoutCallback | null, jsonExtension: string): void;
269
272
  Cleanup(jsonExtension: string): void;
270
273
  GetSDKConfig(): SDKConfig;
271
274
  LoginCustomDataToJson(customData: string): string;
272
275
  GetLoginState(jsonExtension: string): NIMLoginState;
273
276
  Relogin(jsonExtension: string): void;
274
277
  KickOtherClient(clients: Array<string>): void;
275
- SetMultiportPushConfigAsync(switch_on: boolean, cb: MultiportPushConfigCallback, jsonExtension: string): void;
276
- GetMultiportPushConfigAsync(cb: MultiportPushConfigCallback, jsonExtension: string): void;
278
+ SetMultiportPushConfigAsync(switch_on: boolean, cb: MultiportPushConfigCallback | null, jsonExtension: string): void;
279
+ GetMultiportPushConfigAsync(cb: MultiportPushConfigCallback | null, jsonExtension: string): void;
277
280
  GetSDKVersion(): string;
278
- GetServerCurrentTime(cb: GetCurrentServerTimeCallback, calcLocal: boolean): void;
281
+ GetServerCurrentTime(cb: GetCurrentServerTimeCallback | null, calcLocal: boolean): void;
279
282
  GetCurrentUserAccount(): string;
280
283
  }
@@ -13,7 +13,7 @@ export declare enum NIMDataSyncType {
13
13
  export declare enum NIMDataSyncStatus {
14
14
  kNIMDataSyncStatusComplete = 1 /** < 同步完成*/
15
15
  }
16
- export declare type DataSyncCallback = (syncType: NIMDataSyncType, status: NIMDataSyncStatus, dataSyncInfo: string) => void;
16
+ export type DataSyncCallback = (syncType: NIMDataSyncType, status: NIMDataSyncStatus, dataSyncInfo: string) => void;
17
17
  export interface NIMDataSyncAPI {
18
18
  InitEventHandlers(): void;
19
19
  }
@@ -51,16 +51,16 @@ export interface FriendChangeEvent {
51
51
  type_?: NIMFriendChangeType; /** < 事件类型 */
52
52
  content_?: string; /** < 事件内容,根据事件类型通过提供的ParsexxxEvent接口(nim_cpp_friend.h)解析该内容 */
53
53
  }
54
- export declare type FriendChangeCallback = (result: FriendChangeEvent) => void;
55
- export declare type FriendOptCallback = (rescode: NIMResCode) => void;
56
- export declare type GetFriendsListCallback = (rescode: NIMResCode, result: Array<FriendProfile>) => void;
57
- export declare type GetFriendProfileCallback = (accid: string, result: FriendProfile) => void;
54
+ export type FriendChangeCallback = (result: FriendChangeEvent) => void;
55
+ export type FriendOptCallback = (rescode: NIMResCode) => void;
56
+ export type GetFriendsListCallback = (rescode: NIMResCode, result: Array<FriendProfile>) => void;
57
+ export type GetFriendProfileCallback = (accid: string, result: FriendProfile) => void;
58
58
  export interface NIMFriendAPI {
59
59
  InitEventHandlers(): void;
60
- Request(accid: string, verify_type: NIMVerifyType, msg: string, cb: FriendOptCallback, jsonExtension: string): boolean;
61
- Delete(accid: string, option: DeleteFriendOption, cb: FriendOptCallback): boolean;
62
- Update(profile: FriendProfile, cb: FriendOptCallback, jsonExtension: string): boolean;
63
- GetList(cb: GetFriendsListCallback, jsonExtension: string): void;
64
- GetFriendProfile(accid: string, cb: GetFriendProfileCallback, jsonExtension: string): void;
65
- QueryFriendListByKeyword(keyword: string, cb: GetFriendsListCallback, jsonExtension: string): boolean;
60
+ Request(accid: string, verify_type: NIMVerifyType, msg: string, cb: FriendOptCallback | null, jsonExtension: string): boolean;
61
+ Delete(accid: string, option: DeleteFriendOption, cb: FriendOptCallback | null): boolean;
62
+ Update(profile: FriendProfile, cb: FriendOptCallback | null, jsonExtension: string): boolean;
63
+ GetList(cb: GetFriendsListCallback | null, jsonExtension: string): void;
64
+ GetFriendProfile(accid: string, cb: GetFriendProfileCallback | null, jsonExtension: string): void;
65
+ QueryFriendListByKeyword(keyword: string, cb: GetFriendsListCallback | null, jsonExtension: string): boolean;
66
66
  }
@@ -43,20 +43,20 @@ export interface SDKDBErrorInfo {
43
43
  description_?: string;
44
44
  attach_?: string;
45
45
  }
46
- export declare type ExceptionCallback = (exception: NIMSDKException, log: string) => void;
47
- export declare type SDKFeedbackCallback = (rescode: NIMResCode) => void;
48
- export declare type DetectProxyCallback = (connect: boolean, step: NIMProxyDetectStep, jsonExtension: string) => void;
49
- export declare type GetCachedFileInfoCallback = (rescode: NIMResCode, result: CachedFileInfo) => void;
50
- export declare type DeleteCachedFileCallback = (rescode: NIMResCode) => void;
51
- export declare type SDKDBErrorCallback = (result: SDKDBErrorInfo) => void;
52
- export declare type UploadSDKLogCallback = (rescode: NIMResCode) => void;
46
+ export type ExceptionCallback = (exception: NIMSDKException, log: string) => void;
47
+ export type SDKFeedbackCallback = (rescode: NIMResCode) => void;
48
+ export type DetectProxyCallback = (connect: boolean, step: NIMProxyDetectStep, jsonExtension: string) => void;
49
+ export type GetCachedFileInfoCallback = (rescode: NIMResCode, result: CachedFileInfo) => void;
50
+ export type DeleteCachedFileCallback = (rescode: NIMResCode) => void;
51
+ export type SDKDBErrorCallback = (result: SDKDBErrorInfo) => void;
52
+ export type UploadSDKLogCallback = (rescode: NIMResCode) => void;
53
53
  export interface NIMGlobalAPI {
54
54
  InitEventHandlers(): void;
55
- SetExceptionReportCallback(jsonExtension: string, cb: ExceptionCallback): void;
55
+ SetExceptionReportCallback(jsonExtension: string, cb: ExceptionCallback | null): void;
56
56
  SetProxy(type: NIMProxyType, host: string, port: number, user: string, password: string): void;
57
- DetectProxy(type: NIMProxyType, host: string, port: number, user: string, password: string, cb: DetectProxyCallback): void;
58
- GetSDKCachedFileInfoAsync(loginId: string, fileType: NIMCachedFileType, endTimestamp: number, jsonExtension: string, cb: GetCachedFileInfoCallback): void;
59
- DeleteSDKCachedFileAsync(loginId: string, fileType: NIMCachedFileType, endTimestamp: number, jsonExtension: string, cb: DeleteCachedFileCallback): void;
60
- SDKFeedbackAsync(url: string, jsonExtension: string, cb: SDKFeedbackCallback): void;
61
- UploadSDKLog(feedbackStr: string, cb: UploadSDKLogCallback): void;
57
+ DetectProxy(type: NIMProxyType, host: string, port: number, user: string, password: string, cb: DetectProxyCallback | null): void;
58
+ GetSDKCachedFileInfoAsync(loginId: string, fileType: NIMCachedFileType, endTimestamp: number, jsonExtension: string, cb: GetCachedFileInfoCallback | null): void;
59
+ DeleteSDKCachedFileAsync(loginId: string, fileType: NIMCachedFileType, endTimestamp: number, jsonExtension: string, cb: DeleteCachedFileCallback | null): void;
60
+ SDKFeedbackAsync(url: string, jsonExtension: string, cb: SDKFeedbackCallback | null): void;
61
+ UploadSDKLog(feedbackStr: string, cb: UploadSDKLogCallback | null): void;
62
62
  }
@@ -68,6 +68,7 @@ export declare enum NIMMessageType {
68
68
  kNIMMessageTypeFile = 6 /** < 文件类型消息*/,
69
69
  kNIMMessageTypeTips = 10 /** < 提醒类型消息,Tip内容根据格式要求填入消息结构中的kNIMMsgKeyServerExt字段*/,
70
70
  kNIMMessageTypeRobot = 11 /** < 波特机器人消息*/,
71
+ kNIMMessageTypeG2NetCall = 12 /** < G2话单消息*/,
71
72
  kNIMMessageTypeCustom = 100 /** < 自定义消息*/,
72
73
  kNIMMessageTypeUnknown = 1000 /** < 未知类型消息,本地使用,发送时勿使用,作为默认值*/
73
74
  }
@@ -167,8 +168,7 @@ export interface MessageSetting {
167
168
  anti_spam_enable_?: BoolStatus; /**< 是否需要过易盾反垃圾 */
168
169
  anti_spam_content_?: string; /**< (可选)开发者自定义的反垃圾字段,长度限制5000 */
169
170
  anti_apam_biz_id_?: string; /**< (可选)用户配置的对某些单条消息另外的反垃圾的业务ID */
170
- anti_apam_using_yidun_?: number; /**< number, (可选) 单条消息是否使用易盾反垃圾 0:(在开通易盾的情况下)不过易盾反垃圾而是通用反垃圾
171
- 其他都是按照原来的规则 */
171
+ anti_apam_using_yidun_?: number; /**< number, (可选) 单条消息是否使用易盾反垃圾 0:(在开通易盾的情况下)不过易盾反垃圾 */
172
172
  client_anti_spam_hitting_?: BoolStatus; /**< (可选) 是否命中客户端反垃圾 */
173
173
  team_msg_need_ack_?: BoolStatus; /**< 群消息是否需要已读业务,0:不需要,1:需要 */
174
174
  team_msg_ack_sent_?: BoolStatus; /**< 是否已经发送群消息已读回执 */
@@ -297,55 +297,64 @@ export interface QueryMsgByOptionsAsyncParam {
297
297
  msg_sub_type_?: number; /**< 消息的子类型 */
298
298
  search_content_?: string; /**< 检索文本(目前只支持kNIMMessageTypeText和kNIMMessageTypeFile这两种类型消息的文本关键字检索,即支持文字消息和文件名的检索 */
299
299
  }
300
- export declare type QueryMsgCallback = (rescode: NIMResCode, id: string, to_type: NIMSessionType, result: QueryMsglogResult) => void;
301
- export declare type QuerySingleMsgCallback = (rescode: NIMResCode, id: string, msg: IMMessage) => void;
302
- export declare type ModifyMultipleMsglogCallback = (rescode: NIMResCode, uid: string, to_type: NIMSessionType) => void;
303
- export declare type ModifySingleMsglogCallback = (rescode: NIMResCode, msg_id: string) => void;
304
- export declare type DBFunctionCallback = (rescode: NIMResCode) => void;
305
- export declare type DeleteMsglogSelfNotifyCallback = (result: Array<DeleteMsglogSelfNotifyItemInfo>) => void;
306
- export declare type DeleteHistoryMessagesNotifyCallback = (result: Array<DeleteMsglogSelfNotifyParam>) => void;
307
- export declare type DeleteMessageSelfAsyncCallback = (rescode: NIMResCode) => void;
308
- export declare type MessageStatusChangedCallback = (result: MessageStatusChangedResult) => void;
309
- export declare type ImportDbPrgCallback = (importedCount: number, totalCount: number) => void;
310
- export declare type DeleteHistoryOnLineAsyncCallback = (rescode: NIMResCode, accid: string) => void;
311
- export declare type DeleteHistoryOnLineAsyncExCallback = (rescode: NIMResCode, accid: string, to_type: number, timestamp: number, jsonExtension: string) => void;
312
- export declare type QueryMessageIsThreadRootCallback = (rescode: NIMResCode, client_id: string, is_root: boolean) => void;
313
- export declare type QueryMessageOnlineCallback = (rescode: NIMResCode, client_id: string, msg: IMMessage) => void;
314
- export declare type QueryThreadHistoryMsgCallback = (rescode: NIMResCode, root_msg: IMMessage, total: number, last_msg_time: number, msg_array: Array<IMMessage>) => void;
315
- export declare type FullTextSearchOnlineAsyncCallback = (rescode: NIMResCode, result: QueryMsglogResult) => void;
300
+ export interface GetMessagesResult {
301
+ rescode_?: NIMResCode; /**< 操作结果 */
302
+ session_id_?: string; /**< 会话ID */
303
+ session_type_?: NIMSessionType; /**< 会话类型 */
304
+ reliable_?: boolean; /**< 结果是否可信:例如当查询范围不在可信时间段内, 但远端请求失败时, 返回的本地结果可能不完整 */
305
+ messages_?: Array<IMMessage>; /**< 历史消息列表 */
306
+ }
307
+ export type QueryMsgCallback = (rescode: NIMResCode, id: string, to_type: NIMSessionType, result: QueryMsglogResult) => void;
308
+ export type GetMessagesDynamicallyCallback = (result: GetMessagesResult) => void;
309
+ export type QuerySingleMsgCallback = (rescode: NIMResCode, id: string, msg: IMMessage) => void;
310
+ export type ModifyMultipleMsglogCallback = (rescode: NIMResCode, uid: string, to_type: NIMSessionType) => void;
311
+ export type ModifySingleMsglogCallback = (rescode: NIMResCode, msg_id: string) => void;
312
+ export type DBFunctionCallback = (rescode: NIMResCode) => void;
313
+ export type DeleteMsglogSelfNotifyCallback = (result: Array<DeleteMsglogSelfNotifyItemInfo>) => void;
314
+ export type DeleteHistoryMessagesNotifyCallback = (result: Array<DeleteMsglogSelfNotifyParam>) => void;
315
+ export type DeleteMessageSelfAsyncCallback = (rescode: NIMResCode) => void;
316
+ export type MessageStatusChangedCallback = (result: MessageStatusChangedResult) => void;
317
+ export type ImportDbPrgCallback = (importedCount: number, totalCount: number) => void;
318
+ export type DeleteHistoryOnLineAsyncCallback = (rescode: NIMResCode, accid: string) => void;
319
+ export type DeleteHistoryOnLineAsyncExCallback = (rescode: NIMResCode, accid: string, to_type: number, timestamp: number, jsonExtension: string) => void;
320
+ export type QueryMessageIsThreadRootCallback = (rescode: NIMResCode, client_id: string, is_root: boolean) => void;
321
+ export type QueryMessageOnlineCallback = (rescode: NIMResCode, client_id: string, msg: IMMessage) => void;
322
+ export type QueryThreadHistoryMsgCallback = (rescode: NIMResCode, root_msg: IMMessage, total: number, last_msg_time: number, msg_array: Array<IMMessage>) => void;
323
+ export type FullTextSearchOnlineAsyncCallback = (rescode: NIMResCode, result: QueryMsglogResult) => void;
316
324
  export interface NIMMsgLogAPI {
317
325
  InitEventHandlers(): void;
318
- QueryMsgByIDAysnc(clientMsgId: string, cb: QuerySingleMsgCallback, jsonExtension: string): boolean;
319
- QueryMsgAsync(accid: string, to_type: NIMSessionType, limit_count: number, anchor_msg_time: number, cb: QueryMsgCallback, jsonExtension: string): boolean;
320
- QueryMsgOnlineAsync(param: QueryMsgOnlineAsyncParam, cb: QueryMsgCallback): boolean;
321
- QueryMsgByKeywordOnlineAsync(param: QueryMsgByKeywordOnlineParam, cb: QueryMsgCallback): boolean;
322
- QueryMsgOfSpecifiedTypeInASessionAsync(to_type: NIMSessionType, id: string, limit_count: number, fromTime: number, endTime: number, endClientMsgId: string, reverse: boolean, msgType: Array<NIMMessageType>, cb: QueryMsgCallback, jsonExtension: string): boolean;
323
- QueryMsgByOptionsAsync(param: QueryMsgByOptionsAsyncParam, cb: QueryMsgCallback): boolean;
324
- BatchStatusReadAsync(accid: string, to_type: NIMSessionType, cb: ModifyMultipleMsglogCallback, jsonExtension: string): boolean;
325
- BatchStatusDeleteAsync(accid: string, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback, jsonExtension: string): boolean;
326
- SetStatusAsync(msg_id: string, status: NIMMsgLogStatus, cb: ModifySingleMsglogCallback, jsonExtension: string): boolean;
327
- SetSubStatusAsync(msg_id: string, status: NIMMsgLogSubStatus, cb: ModifySingleMsglogCallback, jsonExtension: string): boolean;
328
- WriteMsglogToLocalAsync(talkId: string, msg: IMMessage, needUpdateSession: boolean, composeLastMsg: boolean, excludeMsgType: Array<number>, cb: ModifySingleMsglogCallback): boolean;
329
- DeleteBySessionTypeAsync(delSessions: boolean, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback, jsonExtension: string): boolean;
330
- DeleteAsync(session_id: string, to_type: NIMSessionType, msg_id: string, cb: ModifySingleMsglogCallback, jsonExtension: string): boolean;
331
- DeleteAllAsync(del_session: boolean, revert_by_query_online: boolean, cb: DBFunctionCallback, jsonExtension: string): boolean;
332
- DeleteMsgByTimeAsync(session_id: string, to_type: NIMSessionType, revert_by_query_online: boolean, timestamp1: number, timestamp2: number, cb: DBFunctionCallback, jsonExtension: string): boolean;
333
- ExportDbAsync(dst_path: string, cb: DBFunctionCallback, jsonExtension: string): boolean;
334
- ImportDbAsync(src_path: string, db_cb: DBFunctionCallback, prg_cb: ImportDbPrgCallback, jsonExtension: string): boolean;
335
- SendReceiptAsync(msg: IMMessage, cb: MessageStatusChangedCallback): void;
326
+ QueryMsgByIDAysnc(clientMsgId: string, cb: QuerySingleMsgCallback | null, jsonExtension: string): boolean;
327
+ QueryMsgAsync(accid: string, to_type: NIMSessionType, limit_count: number, anchor_msg_time: number, cb: QueryMsgCallback | null, jsonExtension: string): boolean;
328
+ GetMessagesDynamically(session_id: string, to_type: NIMSessionType, from_time: number, to_time: number, limit_count: number, anchor_client_msg_id: string, anchor_server_msg_id: number, direction: NIMMsglogSearchDirection, cb: GetMessagesDynamicallyCallback | null, jsonExtension: string): void;
329
+ QueryMsgOnlineAsync(param: QueryMsgOnlineAsyncParam, cb: QueryMsgCallback | null): boolean;
330
+ QueryMsgByKeywordOnlineAsync(param: QueryMsgByKeywordOnlineParam, cb: QueryMsgCallback | null): boolean;
331
+ QueryMsgOfSpecifiedTypeInASessionAsync(to_type: NIMSessionType, id: string, limit_count: number, fromTime: number, endTime: number, endClientMsgId: string, reverse: boolean, msgType: Array<NIMMessageType>, cb: QueryMsgCallback | null, jsonExtension: string): boolean;
332
+ QueryMsgByOptionsAsync(param: QueryMsgByOptionsAsyncParam, cb: QueryMsgCallback | null): boolean;
333
+ BatchStatusReadAsync(accid: string, to_type: NIMSessionType, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): boolean;
334
+ BatchStatusDeleteAsync(accid: string, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): boolean;
335
+ SetStatusAsync(msg_id: string, status: NIMMsgLogStatus, cb: ModifySingleMsglogCallback | null, jsonExtension: string): boolean;
336
+ SetSubStatusAsync(msg_id: string, status: NIMMsgLogSubStatus, cb: ModifySingleMsglogCallback | null, jsonExtension: string): boolean;
337
+ WriteMsglogToLocalAsync(talkId: string, msg: IMMessage, needUpdateSession: boolean, composeLastMsg: boolean, excludeMsgType: Array<number>, cb: ModifySingleMsglogCallback | null): boolean;
338
+ DeleteBySessionTypeAsync(delSessions: boolean, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): boolean;
339
+ DeleteAsync(session_id: string, to_type: NIMSessionType, msg_id: string, cb: ModifySingleMsglogCallback | null, jsonExtension: string): boolean;
340
+ DeleteAllAsync(del_session: boolean, revert_by_query_online: boolean, cb: DBFunctionCallback | null, jsonExtension: string): boolean;
341
+ DeleteMsgByTimeAsync(session_id: string, to_type: NIMSessionType, revert_by_query_online: boolean, timestamp1: number, timestamp2: number, cb: DBFunctionCallback | null, jsonExtension: string): boolean;
342
+ ExportDbAsync(dst_path: string, cb: DBFunctionCallback | null, jsonExtension: string): boolean;
343
+ ImportDbAsync(src_path: string, db_cb: DBFunctionCallback, prg_cb: ImportDbPrgCallback | null, jsonExtension: string): boolean;
344
+ SendReceiptAsync(msg: IMMessage, cb: MessageStatusChangedCallback | null): void;
336
345
  QuerySentMessageBeReaded(msg: IMMessage): boolean;
337
346
  QueryReceivedMsgReceiptSent(msg: IMMessage): boolean;
338
- UpdateLocalExtAsync(msg_id: string, local_ext: string, cb: ModifySingleMsglogCallback, jsonExtension: string): boolean;
339
- ReadAllAsync(cb: DBFunctionCallback, jsonExtension: string): boolean;
347
+ UpdateLocalExtAsync(msg_id: string, local_ext: string, cb: ModifySingleMsglogCallback | null, jsonExtension: string): boolean;
348
+ ReadAllAsync(cb: DBFunctionCallback | null, jsonExtension: string): boolean;
340
349
  ExportBackupToRemote(export_info: LogsBackupExportInfo): boolean;
341
350
  ImportBackupToRemote(export_info: LogsBackupImportInfo): boolean;
342
351
  CancelImportBackupFromRemote(): void;
343
352
  CancelExportBackupToRemote(): void;
344
- DeleteHistoryOnlineAsync(accid: string, delete_roaming: boolean, jsonExtension: string, cb: DeleteHistoryOnLineAsyncExCallback): void;
345
- DeleteHistoryOnlineAsyncEx(accid: string, to_type: number, needs_notify_self: boolean, jsonExtension: string, cb: DeleteHistoryOnLineAsyncExCallback): void;
346
- DeleteMessageSelfAsync(msg: IMMessage, ext: string, cb: DeleteMessageSelfAsyncCallback): void;
347
- QueryMessageIsThreadRoot(client_id: string, cb: QueryMessageIsThreadRootCallback): void;
348
- QueryMessageOnline(param: QueryMsgAsyncParam, cb: QueryMessageOnlineCallback): void;
349
- QueryThreadHistoryMsg(msg: IMMessage, param: QueryThreadHistoryMsgAsyncParam, cb: QueryThreadHistoryMsgCallback): void;
350
- FullTextSearchOnlineAsync(param: FullTextSearchOnlineAsyncParam, cb: FullTextSearchOnlineAsyncCallback): void;
353
+ DeleteHistoryOnlineAsync(accid: string, delete_roaming: boolean, jsonExtension: string, cb: DeleteHistoryOnLineAsyncExCallback | null): void;
354
+ DeleteHistoryOnlineAsyncEx(accid: string, to_type: number, needs_notify_self: boolean, jsonExtension: string, cb: DeleteHistoryOnLineAsyncExCallback | null): void;
355
+ DeleteMessageSelfAsync(msg: IMMessage, ext: string, cb: DeleteMessageSelfAsyncCallback | null): void;
356
+ QueryMessageIsThreadRoot(client_id: string, cb: QueryMessageIsThreadRootCallback | null): void;
357
+ QueryMessageOnline(param: QueryMsgAsyncParam, cb: QueryMessageOnlineCallback | null): void;
358
+ QueryThreadHistoryMsg(msg: IMMessage, param: QueryThreadHistoryMsgAsyncParam, cb: QueryThreadHistoryMsgCallback | null): void;
359
+ FullTextSearchOnlineAsync(param: FullTextSearchOnlineAsyncParam, cb: FullTextSearchOnlineAsyncCallback | null): void;
351
360
  }
@@ -49,24 +49,24 @@ export interface UploadMediaResult {
49
49
  export interface ProgressData {
50
50
  res_id_?: string; /**< 资源id */
51
51
  }
52
- export declare type InitNosResultCallback = (res: InitNosResult) => void;
53
- export declare type DownloadMediaCallback = (rescode: NIMResCode, filePath: string, callId: string, resId: string) => void;
54
- export declare type UploadMediaExCallback = (rescode: NIMResCode, result: UploadMediaResult) => void;
55
- export declare type ProgressCallback = (completedSize: number, fileSize: number) => void;
56
- export declare type TransferInfoCallback = (actualSize: number, speed: number) => void;
57
- export declare type ProgressExCallback = (completeSsize: number, fileSize: number, result: ProgressData) => void;
58
- export declare type DownloadMediaExCallback = (rescode: NIMResCode, result: DownloadMediaResult) => void;
59
- export declare type SafeURLToOriginURLCallback = (rescode: NIMResCode, originalUrl: string) => void;
60
- export declare type SpeedCallback = (speed: number) => void;
52
+ export type InitNosResultCallback = (res: InitNosResult) => void;
53
+ export type DownloadMediaCallback = (rescode: NIMResCode, filePath: string, callId: string, resId: string) => void;
54
+ export type UploadMediaExCallback = (rescode: NIMResCode, result: UploadMediaResult) => void;
55
+ export type ProgressCallback = (completedSize: number, fileSize: number) => void;
56
+ export type TransferInfoCallback = (actualSize: number, speed: number) => void;
57
+ export type ProgressExCallback = (completeSsize: number, fileSize: number, result: ProgressData) => void;
58
+ export type DownloadMediaExCallback = (rescode: NIMResCode, result: DownloadMediaResult) => void;
59
+ export type SafeURLToOriginURLCallback = (rescode: NIMResCode, originalUrl: string) => void;
60
+ export type SpeedCallback = (speed: number) => void;
61
61
  export interface NIMNOSAPI {
62
62
  InitEventHandlers(): void;
63
- InitConfig(param: InitNosConfigParam, cb: InitNosResultCallback): void;
64
- FetchMedia(msg: IMMessage, jsonExtension: string, res_cb: DownloadMediaCallback, prg_cb: ProgressCallback, speed_cb: SpeedCallback, transfer_cb: TransferInfoCallback): boolean;
63
+ InitConfig(param: InitNosConfigParam, cb: InitNosResultCallback | null): void;
64
+ FetchMedia(msg: IMMessage, jsonExtension: string, res_cb: DownloadMediaCallback | null, prg_cb: ProgressCallback | null, speed_cb: SpeedCallback | null, transfer_cb: TransferInfoCallback | null): boolean;
65
65
  StopFetchMedia(msg: IMMessage): boolean;
66
- UploadResource(local_file: string, tag: string, param: NOSParams, res_cb: UploadMediaExCallback, prg_cb: ProgressExCallback, speed_cb: SpeedCallback, transfer_cb: TransferInfoCallback): boolean;
66
+ UploadResource(local_file: string, tag: string, param: NOSParams, res_cb: UploadMediaExCallback | null, prg_cb: ProgressExCallback | null, speed_cb: SpeedCallback | null, transfer_cb: TransferInfoCallback | null): boolean;
67
67
  StopUploadResource(task_id: string, jsonExtension: string): boolean;
68
- DownloadResource(nosUrl: string, param: NOSParams, res_cb: DownloadMediaExCallback, prg_cb: ProgressExCallback, speed_cb: SpeedCallback, transfer_cb: TransferInfoCallback): boolean;
68
+ DownloadResource(nosUrl: string, param: NOSParams, res_cb: DownloadMediaExCallback | null, prg_cb: ProgressExCallback | null, speed_cb: SpeedCallback | null, transfer_cb: TransferInfoCallback | null): boolean;
69
69
  StopDownloadResource(task_id: string, jsonExtension: string): boolean;
70
- SafeURLToOriginURL(safe_url: string, cb: SafeURLToOriginURLCallback, jsonExtension: string): void;
70
+ SafeURLToOriginURL(safe_url: string, cb: SafeURLToOriginURLCallback | null, jsonExtension: string): void;
71
71
  SetSupportQuickTrans(quick: boolean): void;
72
72
  }
@@ -20,15 +20,15 @@ export interface DeleteSessionItem {
20
20
  export interface DeleteSessionParam {
21
21
  delete_list_?: Array<DeleteSessionItem>;
22
22
  }
23
- export declare type QueryOnlineSessionInfoCallback = (rescode: NIMResCode, result: SessionInfo) => void;
24
- export declare type QueryOnlineSessionListCallback = (result: QuerySessionListResult) => void;
25
- export declare type UpdateOnlineSessionInfoCallback = (rescode: NIMResCode) => void;
26
- export declare type DeleteOnlineSessionInfoCallback = (rescode: NIMResCode) => void;
27
- export declare type OnlineSessionChangedCallback = (result: SessionInfo) => void;
23
+ export type QueryOnlineSessionInfoCallback = (rescode: NIMResCode, result: SessionInfo) => void;
24
+ export type QueryOnlineSessionListCallback = (result: QuerySessionListResult) => void;
25
+ export type UpdateOnlineSessionInfoCallback = (rescode: NIMResCode) => void;
26
+ export type DeleteOnlineSessionInfoCallback = (rescode: NIMResCode) => void;
27
+ export type OnlineSessionChangedCallback = (result: SessionInfo) => void;
28
28
  export interface NIMOnlineSessionAPI {
29
29
  InitEventHandlers(): void;
30
- QuerySessionList(minTime: number, maxTime: number, needLastMsg: boolean, limit: number, cb: QueryOnlineSessionListCallback): void;
31
- QuerySession(to_type: NIMSessionType, session_id: string, cb: QueryOnlineSessionInfoCallback): void;
32
- UpdateSession(to_type: NIMSessionType, session_id: string, ext: string, cb: UpdateOnlineSessionInfoCallback): void;
33
- DeleteSession(param: DeleteSessionParam, cb: DeleteOnlineSessionInfoCallback): void;
30
+ QuerySessionList(minTime: number, maxTime: number, needLastMsg: boolean, limit: number, cb: QueryOnlineSessionListCallback | null): void;
31
+ QuerySession(to_type: NIMSessionType, session_id: string, cb: QueryOnlineSessionInfoCallback | null): void;
32
+ UpdateSession(to_type: NIMSessionType, session_id: string, ext: string, cb: UpdateOnlineSessionInfoCallback | null): void;
33
+ DeleteSession(param: DeleteSessionParam, cb: DeleteOnlineSessionInfoCallback | null): void;
34
34
  }
@@ -5,9 +5,9 @@ export declare enum NIMSendHttpRequestMethods {
5
5
  kNIMHttpPut = 3,
6
6
  kNIMHttpDelete = 4
7
7
  }
8
- export declare type ReceivedHttpMsgCallback = (from_accid: string, body: string, timestamp: number) => void;
9
- export declare type SendHttpRequestCallback = (rescode: NIMResCode, header: string, body: string, jsonExtension: string) => void;
8
+ export type ReceivedHttpMsgCallback = (from_accid: string, body: string, timestamp: number) => void;
9
+ export type SendHttpRequestCallback = (rescode: NIMResCode, header: string, body: string, jsonExtension: string) => void;
10
10
  export interface NIMPassThroughProxyAPI {
11
11
  InitEventHandlers(): void;
12
- SendHttpRequest(host: string, path: string, method: NIMSendHttpRequestMethods, headers: string, body: string, jsonExtension: string, cb: SendHttpRequestCallback): void;
12
+ SendHttpRequest(host: string, path: string, method: NIMSendHttpRequestMethods, headers: string, body: string, jsonExtension: string, cb: SendHttpRequestCallback | null): void;
13
13
  }
@@ -1,8 +1,8 @@
1
1
  import { NIMResCode } from './client_def';
2
- export declare type ChatRoomRequestEnterCallback = (rescode: NIMResCode, result: string) => void;
3
- export declare type QChatRequestLinkAddressCallback = (rescode: NIMResCode, result: Array<string>) => void;
2
+ export type ChatRoomRequestEnterCallback = (rescode: NIMResCode, result: string) => void;
3
+ export type QChatRequestLinkAddressCallback = (rescode: NIMResCode, result: Array<string>) => void;
4
4
  export interface NIMPluginAPI {
5
5
  InitEventHandlers(): void;
6
- ChatRoomRequestEnterAsync(room_id: number, cb: ChatRoomRequestEnterCallback, ext: string): void;
7
- QChatRequestLinkAddress(ip_version: number, cb: QChatRequestLinkAddressCallback, ext: string): void;
6
+ ChatRoomRequestEnterAsync(room_id: number, cb: ChatRoomRequestEnterCallback | null, ext: string): void;
7
+ QChatRequestLinkAddress(ip_version: number, cb: QChatRequestLinkAddressCallback | null, ext: string): void;
8
8
  }
@@ -73,42 +73,42 @@ export interface SessionRoamMsgHasMoreTagInfo {
73
73
  message_time_tag?: number;
74
74
  message_server_id?: number;
75
75
  }
76
- export declare type SessionChangeCallback = (rescode: NIMResCode, result: SessionData, count: number) => void;
77
- export declare type DeleteSessionRoamingMessageCallback = (rescode: NIMResCode, to_type: number, session_id: string) => void;
78
- export declare type BadgeCountCallback = (result: string) => void;
79
- export declare type QuerySessionListCallback = (count: number, result: SessionDataList) => void;
80
- export declare type QuerySessionDataCallback = (rescode: NIMResCode, result: SessionData) => void;
81
- export declare type SetToStickTopSessionNotifyCallback = (result: string) => void;
82
- export declare type CancelStickTopSessionNotifyCallback = (session_id: string, session_type: NIMSessionType) => void;
83
- export declare type UpdateStickTopSessionNotifyCallback = (result: string) => void;
84
- export declare type QueryStickTopSessionListCallback = (res_code: NIMResCode, result: string) => void;
85
- export declare type SetToStickTopSessionCallback = (res_code: NIMResCode, result: string) => void;
86
- export declare type UpdateStickTopSessionCallback = (res_code: NIMResCode, result: string) => void;
87
- export declare type CancelToStickTopSessionCallback = (res_code: NIMResCode, session_id: string, session_type: NIMSessionType) => void;
88
- export declare type QueryHasmoreRoammsgCallback = (res_code: NIMResCode, info: SessionRoamMsgHasMoreTagInfo) => void;
89
- export declare type QueryAllHasmoreRoammsgCallback = (res_code: NIMResCode, info_list: Array<SessionRoamMsgHasMoreTagInfo>) => void;
90
- export declare type UpdateHasmoreRoammsgCallback = (res_code: NIMResCode) => void;
91
- export declare type DeleteHasmoreRoammsgCallback = (res_code: NIMResCode) => void;
92
- export declare type SetMultiUnreadCountZeroAsyncCallback = (res_code: NIMResCode, data_list: Array<SessionData>, unread_count: number) => void;
76
+ export type SessionChangeCallback = (rescode: NIMResCode, result: SessionData, count: number) => void;
77
+ export type DeleteSessionRoamingMessageCallback = (rescode: NIMResCode, to_type: number, session_id: string) => void;
78
+ export type BadgeCountCallback = (result: string) => void;
79
+ export type QuerySessionListCallback = (count: number, result: SessionDataList) => void;
80
+ export type QuerySessionDataCallback = (rescode: NIMResCode, result: SessionData) => void;
81
+ export type SetToStickTopSessionNotifyCallback = (result: string) => void;
82
+ export type CancelStickTopSessionNotifyCallback = (session_id: string, session_type: NIMSessionType) => void;
83
+ export type UpdateStickTopSessionNotifyCallback = (result: string) => void;
84
+ export type QueryStickTopSessionListCallback = (res_code: NIMResCode, result: string) => void;
85
+ export type SetToStickTopSessionCallback = (res_code: NIMResCode, result: string) => void;
86
+ export type UpdateStickTopSessionCallback = (res_code: NIMResCode, result: string) => void;
87
+ export type CancelToStickTopSessionCallback = (res_code: NIMResCode, session_id: string, session_type: NIMSessionType) => void;
88
+ export type QueryHasmoreRoammsgCallback = (res_code: NIMResCode, info: SessionRoamMsgHasMoreTagInfo) => void;
89
+ export type QueryAllHasmoreRoammsgCallback = (res_code: NIMResCode, info_list: Array<SessionRoamMsgHasMoreTagInfo>) => void;
90
+ export type UpdateHasmoreRoammsgCallback = (res_code: NIMResCode) => void;
91
+ export type DeleteHasmoreRoammsgCallback = (res_code: NIMResCode) => void;
92
+ export type SetMultiUnreadCountZeroAsyncCallback = (res_code: NIMResCode, data_list: Array<SessionData>, unread_count: number) => void;
93
93
  export interface NIMSessionAPI {
94
94
  InitEventHandlers(): void;
95
- QueryStickTopSessionList(cb: QueryStickTopSessionListCallback): void;
96
- SetToStickTopSession(session_id: string, to_type: number, ext: string, cb: SetToStickTopSessionCallback): void;
97
- UpdateToStickTopSession(session_id: string, to_type: number, ext: string, cb: UpdateStickTopSessionCallback): void;
98
- CancelToStickTopSession(session_id: string, to_type: number, cb: CancelToStickTopSessionCallback): void;
99
- QueryLastFewSessionAsync(limit: number, cb: QuerySessionListCallback, jsonExtension: string): void;
100
- QueryAllRecentSessionAsync(msg_excluded_type_list: Array<NIMMessageType>, cb: QuerySessionListCallback, jsonExtension: string): void;
101
- DeleteRecentSession(type: NIMSessionType, id: string, cb: SessionChangeCallback, delete_roaming: boolean): void;
102
- DeleteAllRecentSession(cb: SessionChangeCallback, jsonExtension: string): void;
103
- DeleteSessionRoamingMessage(to_type: number, session_id: string, cb: DeleteSessionRoamingMessageCallback, ext: string): boolean;
104
- SetUnreadCountZeroAsync(type: NIMSessionType, id: string, cb: SessionChangeCallback, jsonExtension: string): boolean;
105
- SetMultiUnreadCountZeroAsync(is_super_team: boolean, zero_list: Array<MultiUnreadCountZeroInfo>, cb: SetMultiUnreadCountZeroAsyncCallback): boolean;
106
- SetSessionTop(type: NIMSessionType, id: string, top: boolean, cb: SessionChangeCallback, jsonExtension: string): boolean;
107
- SetSessionExtendData(type: NIMSessionType, id: string, data: string, cb: SessionChangeCallback, jsonExtension: string): boolean;
108
- SetAllUnreadCountZeroAsync(cb: SessionChangeCallback, jsonExtension: string): boolean;
109
- QuerySessionDataById(type: NIMSessionType, id: string, cb: QuerySessionDataCallback, jsonExtension: string): void;
110
- QueryHasmoreRoammsg(session_id: string, to_type: number, cb: QueryHasmoreRoammsgCallback): void;
111
- QueryAllHasmoreRoammsg(cb: QueryAllHasmoreRoammsgCallback): void;
112
- UpdateHasmoreRoammsg(msg: IMMessage, cb: UpdateHasmoreRoammsgCallback): void;
113
- DeleteHasmoreRoammsg(session_id: string, to_type: NIMSessionType, cb: DeleteHasmoreRoammsgCallback): void;
95
+ QueryStickTopSessionList(cb: QueryStickTopSessionListCallback | null): void;
96
+ SetToStickTopSession(session_id: string, to_type: number, ext: string, cb: SetToStickTopSessionCallback | null): void;
97
+ UpdateToStickTopSession(session_id: string, to_type: number, ext: string, cb: UpdateStickTopSessionCallback | null): void;
98
+ CancelToStickTopSession(session_id: string, to_type: number, cb: CancelToStickTopSessionCallback | null): void;
99
+ QueryLastFewSessionAsync(limit: number, cb: QuerySessionListCallback | null, jsonExtension: string): void;
100
+ QueryAllRecentSessionAsync(msg_excluded_type_list: Array<NIMMessageType>, cb: QuerySessionListCallback | null, jsonExtension: string): void;
101
+ DeleteRecentSession(type: NIMSessionType, id: string, cb: SessionChangeCallback | null, delete_roaming: boolean): void;
102
+ DeleteAllRecentSession(cb: SessionChangeCallback | null, jsonExtension: string): void;
103
+ DeleteSessionRoamingMessage(to_type: number, session_id: string, cb: DeleteSessionRoamingMessageCallback | null, ext: string): boolean;
104
+ SetUnreadCountZeroAsync(type: NIMSessionType, id: string, cb: SessionChangeCallback | null, jsonExtension: string): boolean;
105
+ SetMultiUnreadCountZeroAsync(is_super_team: boolean, zero_list: Array<MultiUnreadCountZeroInfo>, cb: SetMultiUnreadCountZeroAsyncCallback | null): boolean;
106
+ SetSessionTop(type: NIMSessionType, id: string, top: boolean, cb: SessionChangeCallback | null, jsonExtension: string): boolean;
107
+ SetSessionExtendData(type: NIMSessionType, id: string, data: string, cb: SessionChangeCallback | null, jsonExtension: string): boolean;
108
+ SetAllUnreadCountZeroAsync(cb: SessionChangeCallback | null, jsonExtension: string): boolean;
109
+ QuerySessionDataById(type: NIMSessionType, id: string, cb: QuerySessionDataCallback | null, jsonExtension: string): void;
110
+ QueryHasmoreRoammsg(session_id: string, to_type: number, cb: QueryHasmoreRoammsgCallback | null): void;
111
+ QueryAllHasmoreRoammsg(cb: QueryAllHasmoreRoammsgCallback | null): void;
112
+ UpdateHasmoreRoammsg(msg: IMMessage, cb: UpdateHasmoreRoammsgCallback | null): void;
113
+ DeleteHasmoreRoammsg(session_id: string, to_type: NIMSessionType, cb: DeleteHasmoreRoammsgCallback | null): void;
114
114
  }