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
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
- import { ChatRoomIndependentEnterInfo, ChatRoomAnoymityEnterInfo, ChatRoomEnterInfo, NIMChatRoomLoginState, ChatRoomMessage, ChatRoomGetMembersParameters, GetMembersCallback, GetMembersCountByTagCallback, ChatRoomGetMsgHistoryParameters, GetMsgHistoryCallback, ChatRoomSetMemberAttributeParameters, SetMemberAttributeCallback, GetChatRoomInfoCallback, KickMemberCallback, NIMChatRoomProxyType, TempMuteMemberCallback, ChatRoomInfo, UpdateRoomInfoCallback, ChatRoomMemberInfo, UpdateMyRoomRoleCallback, ChatRoomQueueElement, ChatRoomQueueOfferOption, QueueOfferCallback, QueuePollCallback, QueueListCallback, QueueHeaderCallback, QueueDropCallback, QueueBatchUpdateCallback, NIMChatRoomLocation, UpdateLocationCallback, ChatRoomUpdateTagsInfo, UpdateTagsCallback, ChatRoomNotification, NIMChatRoomEnterStep, NIMChatRoomExitReason, NIMChatRoomLinkCondition } from '../chatroom_def/chatroom_def';
2
+ import { ChatRoomIndependentEnterInfo, ChatRoomAnoymityEnterInfo, ChatRoomEnterInfo, NIMChatRoomLoginState, ChatRoomMessage, ChatRoomGetMembersParameters, GetMembersCallback, GetMembersCountByTagCallback, ChatRoomGetMsgHistoryParameters, GetMsgHistoryCallback, ChatRoomSetMemberAttributeParameters, SetMemberAttributeCallback, GetChatRoomInfoCallback, KickMemberCallback, NIMChatRoomProxyType, TempMuteMemberCallback, ChatRoomInfo, UpdateRoomInfoCallback, ChatRoomMemberInfo, UpdateMyRoomRoleCallback, ChatRoomQueueElement, ChatRoomQueueOfferOption, QueueOfferCallback, QueuePollCallback, QueueListCallback, QueueHeaderCallback, QueueDropCallback, QueueBatchUpdateCallback, NIMChatRoomLocation, UpdateLocationCallback, ChatRoomUpdateTagsInfo, UpdateTagsCallback, ChatRoomNotification, NIMChatRoomEnterStep, NIMChatRoomExitReason, NIMChatRoomLinkCondition, ChatRoomGetMsgHistoryByTagsParameters, ChatRoomConfig } from '../chatroom_def/chatroom_def';
3
3
  import { NIMResCode } from 'ts/nim_def/client_def';
4
4
  export declare interface ChatRoomEvents {
5
5
  /** 登录 */
@@ -23,32 +23,33 @@ export declare class ChatRoomModule extends EventEmitter<ChatRoomEvents> {
23
23
  initEventHandlers(): void;
24
24
  init(app_install_dir: string, json_extension: string): boolean;
25
25
  cleanup(json_extension: string): void;
26
- independentEnter(room_id: number, info: ChatRoomIndependentEnterInfo): boolean;
27
- anonymousEnter(room_id: number, anonymity_info: ChatRoomAnoymityEnterInfo, info: ChatRoomEnterInfo, json_extension: string): boolean;
26
+ independentEnter(room_id: number, info: ChatRoomIndependentEnterInfo, config: ChatRoomConfig): boolean;
27
+ anonymousEnter(room_id: number, anonymity_info: ChatRoomAnoymityEnterInfo, info: ChatRoomEnterInfo, config: ChatRoomConfig): boolean;
28
28
  enter(room_id: number, request_login_data: string, info: ChatRoomEnterInfo, json_extension: string): boolean;
29
29
  exit(room_id: number, json_extension: string): void;
30
30
  getLoginState(room_id: number, json_extension: string): NIMChatRoomLoginState;
31
31
  setMsgsBatchReport(set_batch: boolean, json_extension: string): void;
32
32
  sendMsg(room_id: number, msg: ChatRoomMessage, json_extension: string): boolean;
33
- getMembersOnlineAsync(room_id: number, parameters: ChatRoomGetMembersParameters, cb: GetMembersCallback, json_extension: string): Promise<[number, number, Array<ChatRoomMemberInfo>]>;
34
- getMembersByTagOnlineAsync(room_id: number, parameters: ChatRoomGetMembersParameters, cb: GetMembersCallback, json_extension: string): Promise<[number, number, Array<ChatRoomMemberInfo>]>;
35
- getMembersCountByTagOnlineAsync(room_id: number, parameters: ChatRoomGetMembersParameters, cb: GetMembersCountByTagCallback, json_extension: string): Promise<[number, NIMResCode, number]>;
36
- getMessageHistoryOnlineAsync(room_id: number, parameters: ChatRoomGetMsgHistoryParameters, cb: GetMsgHistoryCallback, json_extension: string): Promise<[number, number, Array<ChatRoomMessage>]>;
37
- setMemberAttributeOnlineAsync(room_id: number, parameters: ChatRoomSetMemberAttributeParameters, cb: SetMemberAttributeCallback, json_extension: string): Promise<[number, NIMResCode, ChatRoomMemberInfo]>;
38
- getInfoAsync(room_id: number, cb: GetChatRoomInfoCallback, json_extension: string): Promise<[number, NIMResCode, ChatRoomInfo]>;
39
- getMemberInfoByIDsAsync(room_id: number, ids: Array<string>, cb: GetMembersCallback, json_extension: string): Promise<[number, NIMResCode, Array<ChatRoomMemberInfo>]>;
40
- kickMemberAsync(room_id: number, id: string, notify_ext: string, cb: KickMemberCallback, json_extension: string): Promise<[number, NIMResCode]>;
33
+ getMembersOnlineAsync(room_id: number, parameters: ChatRoomGetMembersParameters, cb: GetMembersCallback | null, json_extension: string): Promise<[number, number, Array<ChatRoomMemberInfo>]>;
34
+ getMembersByTagOnlineAsync(room_id: number, parameters: ChatRoomGetMembersParameters, cb: GetMembersCallback | null, json_extension: string): Promise<[number, number, Array<ChatRoomMemberInfo>]>;
35
+ getMembersCountByTagOnlineAsync(room_id: number, parameters: ChatRoomGetMembersParameters, cb: GetMembersCountByTagCallback | null, json_extension: string): Promise<[number, NIMResCode, number]>;
36
+ getMessageHistoryOnlineAsync(room_id: number, parameters: ChatRoomGetMsgHistoryParameters, cb: GetMsgHistoryCallback | null, json_extension: string): Promise<[number, number, Array<ChatRoomMessage>]>;
37
+ getMessageHistoryByTagsOnlineAsync(room_id: number, parameters: ChatRoomGetMsgHistoryByTagsParameters, cb: GetMsgHistoryCallback | null, json_extension: string): Promise<[number, number, Array<ChatRoomMessage>]>;
38
+ setMemberAttributeOnlineAsync(room_id: number, parameters: ChatRoomSetMemberAttributeParameters, cb: SetMemberAttributeCallback | null, json_extension: string): Promise<[number, NIMResCode, ChatRoomMemberInfo]>;
39
+ getInfoAsync(room_id: number, cb: GetChatRoomInfoCallback | null, json_extension: string): Promise<[number, NIMResCode, ChatRoomInfo]>;
40
+ getMemberInfoByIDsAsync(room_id: number, ids: Array<string>, cb: GetMembersCallback | null, json_extension: string): Promise<[number, NIMResCode, Array<ChatRoomMemberInfo>]>;
41
+ kickMemberAsync(room_id: number, id: string, notify_ext: string, cb: KickMemberCallback | null, json_extension: string): Promise<[number, NIMResCode]>;
41
42
  setProxy(type: NIMChatRoomProxyType, host: string, port: number, user: string, password: string): void;
42
- tempMuteMemberAsync(room_id: number, accid: string, duration: number, need_notify: boolean, notify_ext: string, cb: TempMuteMemberCallback, json_extension: string): Promise<[number, NIMResCode, ChatRoomMemberInfo]>;
43
- tempMuteMemberByTagAsync(room_id: number, target_tag: string, duration: number, need_notify: boolean, notify_ext: string, cb: TempMuteMemberCallback, notify_tags: string, json_extension: string): Promise<[number, NIMResCode, ChatRoomMemberInfo]>;
44
- updateRoomInfoAsync(room_id: number, room_info: ChatRoomInfo, need_notify: boolean, notify_ext: string, cb: UpdateRoomInfoCallback, json_extension: string): Promise<[number, NIMResCode]>;
45
- updateMyRoomRoleAsync(room_id: number, info: ChatRoomMemberInfo, need_notify: boolean, notify_ext: string, cb: UpdateMyRoomRoleCallback, json_extension: string): Promise<[number, NIMResCode]>;
46
- queueOfferAsync(room_id: number, element: ChatRoomQueueElement, option: ChatRoomQueueOfferOption, cb: QueueOfferCallback, json_extension: string): Promise<[number, NIMResCode, ChatRoomQueueElement]>;
47
- queuePollAsync(room_id: number, element_key: string, cb: QueuePollCallback, json_extension: string): Promise<[number, NIMResCode, ChatRoomQueueElement]>;
48
- queueListAsync(room_id: number, cb: QueueListCallback, json_extension: string): Promise<[number, NIMResCode, Array<ChatRoomQueueElement>]>;
49
- queueHeaderAsync(room_id: number, cb: QueueHeaderCallback, json_extension: string): Promise<[number, NIMResCode, ChatRoomQueueElement]>;
50
- queueDropAsync(room_id: number, cb: QueueDropCallback, json_extension: string): Promise<[number, NIMResCode]>;
51
- queueBatchUpdateAsync(room_id: number, batch_elements: Array<ChatRoomQueueElement>, need_notify: boolean, notify_ext: string, cb: QueueBatchUpdateCallback, json_extension: string): Promise<[number, NIMResCode, Array<string>]>;
52
- updateLocation(room_id: number, location: NIMChatRoomLocation, cb: UpdateLocationCallback, json_extension: string): Promise<[number, NIMResCode] | null>;
53
- updateTags(room_id: number, tags_info: ChatRoomUpdateTagsInfo, cb: UpdateTagsCallback, json_extension: string): Promise<[number, NIMResCode] | null>;
43
+ tempMuteMemberAsync(room_id: number, accid: string, duration: number, need_notify: boolean, notify_ext: string, cb: TempMuteMemberCallback | null, json_extension: string): Promise<[number, NIMResCode, ChatRoomMemberInfo]>;
44
+ tempMuteMemberByTagAsync(room_id: number, target_tag: string, duration: number, need_notify: boolean, notify_ext: string, cb: TempMuteMemberCallback | null, notify_tags: string, json_extension: string): Promise<[number, NIMResCode, ChatRoomMemberInfo]>;
45
+ updateRoomInfoAsync(room_id: number, room_info: ChatRoomInfo, need_notify: boolean, notify_ext: string, cb: UpdateRoomInfoCallback | null, json_extension: string): Promise<[number, NIMResCode]>;
46
+ updateMyRoomRoleAsync(room_id: number, info: ChatRoomMemberInfo, need_notify: boolean, notify_ext: string, cb: UpdateMyRoomRoleCallback | null, json_extension: string): Promise<[number, NIMResCode]>;
47
+ queueOfferAsync(room_id: number, element: ChatRoomQueueElement, option: ChatRoomQueueOfferOption, cb: QueueOfferCallback | null, json_extension: string): Promise<[number, NIMResCode, ChatRoomQueueElement]>;
48
+ queuePollAsync(room_id: number, element_key: string, cb: QueuePollCallback | null, json_extension: string): Promise<[number, NIMResCode, ChatRoomQueueElement]>;
49
+ queueListAsync(room_id: number, cb: QueueListCallback | null, json_extension: string): Promise<[number, NIMResCode, Array<ChatRoomQueueElement>]>;
50
+ queueHeaderAsync(room_id: number, cb: QueueHeaderCallback | null, json_extension: string): Promise<[number, NIMResCode, ChatRoomQueueElement]>;
51
+ queueDropAsync(room_id: number, cb: QueueDropCallback | null, json_extension: string): Promise<[number, NIMResCode]>;
52
+ queueBatchUpdateAsync(room_id: number, batch_elements: Array<ChatRoomQueueElement>, need_notify: boolean, notify_ext: string, cb: QueueBatchUpdateCallback | null, json_extension: string): Promise<[number, NIMResCode, Array<string>]>;
53
+ updateLocation(room_id: number, location: NIMChatRoomLocation, cb: UpdateLocationCallback | null, json_extension: string): Promise<[number, NIMResCode] | null>;
54
+ updateTags(room_id: number, tags_info: ChatRoomUpdateTagsInfo, cb: UpdateTagsCallback | null, json_extension: string): Promise<[number, NIMResCode] | null>;
54
55
  }
@@ -157,6 +157,18 @@ export interface ChatRoomAnoymityEnterInfo {
157
157
  /** 登录聊天室的密码 */
158
158
  token_?: string;
159
159
  }
160
+ export interface ChatRoomConfig {
161
+ public_config: {
162
+ nego_key_neca: number;
163
+ comm_enca: number;
164
+ hand_shake_type: number;
165
+ };
166
+ private_config: {
167
+ nego_key_enca_key_parta: string;
168
+ nego_key_enca_key_partb: string;
169
+ nego_key_enca_key_version: number;
170
+ };
171
+ }
160
172
  export interface ChatRoomEnterInfoValue {
161
173
  /** 设置进入聊天室后展示的昵称 */
162
174
  nick?: string;
@@ -200,7 +212,7 @@ export interface ChatRoomMessageSetting {
200
212
  history_save_?: boolean;
201
213
  /** (可选)用户配置的对某些单条消息另外的反垃圾的业务ID */
202
214
  anti_spam_bizid_?: string;
203
- /** (可选) 单条消息是否使用易盾反垃圾 0:(在开通易盾的情况下)不过易盾反垃圾而是通用反垃圾,其他都是按照原来的规则 */
215
+ /** (可选) 单条消息是否使用易盾反垃圾 0:(在开通易盾的情况下)不过易盾反垃圾 */
204
216
  anti_spam_using_yidun_?: number;
205
217
  /** 高优先级消息标记,1:是; 非高优先级消息不带该字段,服务器填写,发送方不需要填写 */
206
218
  high_priority_?: number;
@@ -308,6 +320,20 @@ export interface ChatRoomGetMsgHistoryParameters {
308
320
  /** 类型 */
309
321
  msg_types_?: Array<NIMChatRoomMsgType>;
310
322
  }
323
+ export interface ChatRoomGetMsgHistoryByTagsParameters {
324
+ /** 开始时间,单位毫秒 */
325
+ start_timetag_?: number;
326
+ /** 结束时间,单位毫秒 */
327
+ end_timetag_?: number;
328
+ /** 本次返回的消息数量 */
329
+ limit_?: number;
330
+ /** 是否反向查询 */
331
+ reverse_?: boolean;
332
+ /** 标签 */
333
+ tags_?: Array<string>;
334
+ /** 类型 */
335
+ msg_types_?: Array<NIMChatRoomMsgType>;
336
+ }
311
337
  export interface ChatRoomSetMemberAttributeParameters {
312
338
  /** 成员ID */
313
339
  account_id_?: string;
@@ -400,20 +426,20 @@ export interface ChatRoomInfo {
400
426
  /** number, 队列管理权限:0:所有人都有权限变更队列,1:只有主播管理员才能操作变更 */
401
427
  queuelevel?: number;
402
428
  }
403
- export declare type GetMembersCallback = (room_id: number, rescode: NIMResCode, infos: Array<ChatRoomMemberInfo>) => void;
404
- export declare type GetMembersCountByTagCallback = (room_id: number, rescode: NIMResCode, count: number) => void;
405
- export declare type GetMsgHistoryCallback = (room_id: number, rescode: NIMResCode, msgs: Array<ChatRoomMessage>) => void;
406
- export declare type SetMemberAttributeCallback = (room_id: number, rescode: NIMResCode, info: ChatRoomMemberInfo) => void;
407
- export declare type GetChatRoomInfoCallback = (room_id: number, rescode: NIMResCode, info: ChatRoomInfo) => void;
408
- export declare type KickMemberCallback = (room_id: number, rescode: NIMResCode) => void;
409
- export declare type TempMuteMemberCallback = (room_id: number, rescode: NIMResCode, info: ChatRoomMemberInfo) => void;
410
- export declare type UpdateRoomInfoCallback = (room_id: number, rescode: NIMResCode) => void;
411
- export declare type UpdateMyRoomRoleCallback = (room_id: number, rescode: NIMResCode) => void;
412
- export declare type UpdateLocationCallback = (room_id: number, rescode: NIMResCode) => void;
413
- export declare type UpdateTagsCallback = (room_id: number, rescode: NIMResCode) => void;
414
- export declare type QueueOfferCallback = (room_id: number, rescode: NIMResCode, element: ChatRoomQueueElement) => void;
415
- export declare type QueuePollCallback = (room_id: number, rescode: NIMResCode, element: ChatRoomQueueElement) => void;
416
- export declare type QueueListCallback = (room_id: number, rescode: NIMResCode, queue: Array<ChatRoomQueueElement>) => void;
417
- export declare type QueueDropCallback = (room_id: number, rescode: NIMResCode) => void;
418
- export declare type QueueHeaderCallback = (room_id: number, rescode: NIMResCode, element: ChatRoomQueueElement) => void;
419
- export declare type QueueBatchUpdateCallback = (room_id: number, rescode: NIMResCode, not_in_queue: Array<string>) => void;
429
+ export type GetMembersCallback = (room_id: number, rescode: NIMResCode, infos: Array<ChatRoomMemberInfo>) => void;
430
+ export type GetMembersCountByTagCallback = (room_id: number, rescode: NIMResCode, count: number) => void;
431
+ export type GetMsgHistoryCallback = (room_id: number, rescode: NIMResCode, msgs: Array<ChatRoomMessage>) => void;
432
+ export type SetMemberAttributeCallback = (room_id: number, rescode: NIMResCode, info: ChatRoomMemberInfo) => void;
433
+ export type GetChatRoomInfoCallback = (room_id: number, rescode: NIMResCode, info: ChatRoomInfo) => void;
434
+ export type KickMemberCallback = (room_id: number, rescode: NIMResCode) => void;
435
+ export type TempMuteMemberCallback = (room_id: number, rescode: NIMResCode, info: ChatRoomMemberInfo) => void;
436
+ export type UpdateRoomInfoCallback = (room_id: number, rescode: NIMResCode) => void;
437
+ export type UpdateMyRoomRoleCallback = (room_id: number, rescode: NIMResCode) => void;
438
+ export type UpdateLocationCallback = (room_id: number, rescode: NIMResCode) => void;
439
+ export type UpdateTagsCallback = (room_id: number, rescode: NIMResCode) => void;
440
+ export type QueueOfferCallback = (room_id: number, rescode: NIMResCode, element: ChatRoomQueueElement) => void;
441
+ export type QueuePollCallback = (room_id: number, rescode: NIMResCode, element: ChatRoomQueueElement) => void;
442
+ export type QueueListCallback = (room_id: number, rescode: NIMResCode, queue: Array<ChatRoomQueueElement>) => void;
443
+ export type QueueDropCallback = (room_id: number, rescode: NIMResCode) => void;
444
+ export type QueueHeaderCallback = (room_id: number, rescode: NIMResCode, element: ChatRoomQueueElement) => void;
445
+ export type QueueBatchUpdateCallback = (room_id: number, rescode: NIMResCode, not_in_queue: Array<string>) => void;
@@ -17,16 +17,16 @@ export declare interface NIMClientEvents {
17
17
  export declare class NIMClient extends EventEmitter<NIMClientEvents> {
18
18
  client: NIMClientAPI;
19
19
  constructor();
20
+ /** 注册全局回调 */
21
+ initEventHandlers(): void;
20
22
  /** NIM SDK初始化
21
23
  * @param appKey 应用注册的APP KEY
22
24
  * @param appDataDir 推荐用户目录放置在系统目录AppData\Local,默认只需要传入目录名,SDK会默认在系统目录下创建该级用户目录。如果要使用其他自定义路径,需传入绝对路径路径,并确保该目录有正确的读写权限。
23
- * @param appInstallDir SDK动态库所在的目录全路径(如果传入为空,则按照默认规则搜索该动态库)
25
+ * @param appInstallDir Deprecated
24
26
  * @param config 初始化参数
25
27
  * @return bool 返回值true: 成功, false: 失败
26
28
  */
27
29
  init(appKey: string, appDataDir: string, appInstallDir: string, config: SDKConfig): boolean;
28
- /** 注册全局回调 */
29
- initEventHandlers(): void;
30
30
  /** NIM客户端登录
31
31
  * @param appKey
32
32
  * @param account 帐号
@@ -46,7 +46,7 @@ export declare class NIMClient extends EventEmitter<NIMClientEvents> {
46
46
  * 422:账号被禁用
47
47
  * </pre>
48
48
  */
49
- login(appKey: string, account: string, password: string, cb: LoginCallback, jsonExtension: string): Promise<[LoginRes]>;
49
+ login(appKey: string, account: string, password: string, cb: LoginCallback | null, jsonExtension: string): Promise<[LoginRes]>;
50
50
  /** NIM客户端注销/退出
51
51
  * @param logoutType Logout操作类型,其定义见nim_client_def.h
52
52
  * @param cb 注销/退出的回调函数
@@ -58,7 +58,7 @@ export declare class NIMClient extends EventEmitter<NIMClientEvents> {
58
58
  * 500:未知错误
59
59
  * </pre>
60
60
  */
61
- logout(logoutType: NIMLogoutType, cb: LogoutCallback, jsonExtension: string): Promise<[NIMResCode]>;
61
+ logout(logoutType: NIMLogoutType, cb: LogoutCallback | null, jsonExtension: string): Promise<[NIMResCode]>;
62
62
  /** NIM SDK清理
63
63
  * @param jsonExtension json扩展参数(备用,目前不需要)
64
64
  * @return void 无返回值
@@ -93,13 +93,13 @@ export declare class NIMClient extends EventEmitter<NIMClientEvents> {
93
93
  * 200:成功
94
94
  * </pre>
95
95
  */
96
- setMultiportPushConfigAsync(switch_on: boolean, cb: MultiportPushConfigCallback, jsonExtension: string): Promise<[NIMResCode, boolean]>;
96
+ setMultiportPushConfigAsync(switch_on: boolean, cb: MultiportPushConfigCallback | null, jsonExtension: string): Promise<[NIMResCode, boolean]>;
97
97
  /** 获得多端推送设置
98
98
  * @param cb 回调函数
99
99
  * @param jsonExtension json扩展参数(备用,目前不需要)
100
100
  * @return void
101
101
  */
102
- getMultiportPushConfigAsync(cb: MultiportPushConfigCallback, jsonExtension: string): Promise<[NIMResCode, boolean]>;
102
+ getMultiportPushConfigAsync(cb: MultiportPushConfigCallback | null, jsonExtension: string): Promise<[NIMResCode, boolean]>;
103
103
  /** 获取SDK版本号
104
104
  * @return string 版本号
105
105
  */
@@ -115,7 +115,7 @@ export declare class NIMClient extends EventEmitter<NIMClientEvents> {
115
115
  * 时的方案以减少服务端的压力,并会在回调中指明返回的时间是由本地计算的。 如果返回 code != 200,同样会返回一个本地计算结果
116
116
  * </pre>
117
117
  */
118
- getServerCurrentTime(cb: GetCurrentServerTimeCallback, calcLocal: boolean): Promise<[number, boolean, number]>;
118
+ getServerCurrentTime(cb: GetCurrentServerTimeCallback | null, calcLocal: boolean): Promise<[number, boolean, number]>;
119
119
  /** 获取当前登录的用户账号(accid)
120
120
  * @return string 当前登录的用户账号(accid)
121
121
  * @note 没有登录时将返回空字符串 */
@@ -24,7 +24,7 @@ export declare class NIMFriend extends EventEmitter<NIMFriendEvents> {
24
24
  * 500:未知错误
25
25
  * </pre>
26
26
  */
27
- request(accid: string, verify_type: NIMVerifyType, msg: string, cb: FriendOptCallback, jsonExtension: string): Promise<[NIMResCode] | null>;
27
+ request(accid: string, verify_type: NIMVerifyType, msg: string, cb: FriendOptCallback | null, jsonExtension: string): Promise<[NIMResCode] | null>;
28
28
  /** 删除好友
29
29
  * @param accid 对方帐号
30
30
  * @param option 删除好友选项,目前仅有是否删除备注信息选项
@@ -37,7 +37,7 @@ export declare class NIMFriend extends EventEmitter<NIMFriendEvents> {
37
37
  * 500:未知错误
38
38
  * </pre>
39
39
  */
40
- delete(accid: string, option: DeleteFriendOption, cb: FriendOptCallback): Promise<[NIMResCode] | null>;
40
+ delete(accid: string, option: DeleteFriendOption, cb: FriendOptCallback | null): Promise<[NIMResCode] | null>;
41
41
  /** 更新好友资料
42
42
  * @param profile 好友资料
43
43
  * @param cb 更新好友资料回调函数
@@ -50,7 +50,7 @@ export declare class NIMFriend extends EventEmitter<NIMFriendEvents> {
50
50
  * 500:未知错误
51
51
  * </pre>
52
52
  */
53
- update(profile: FriendProfile, cb: FriendOptCallback, jsonExtension: string): Promise<[NIMResCode] | null>;
53
+ update(profile: FriendProfile, cb: FriendOptCallback | null, jsonExtension: string): Promise<[NIMResCode] | null>;
54
54
  /** 增量获取好友列表
55
55
  * @param cb 获取好友列表回调函数
56
56
  * @param jsonExtension json扩展参数(备用,目前不需要)
@@ -60,14 +60,14 @@ export declare class NIMFriend extends EventEmitter<NIMFriendEvents> {
60
60
  * 200:成功
61
61
  * </pre>
62
62
  */
63
- getList(cb: GetFriendsListCallback, jsonExtension: string): Promise<[NIMResCode, Array<FriendProfile>]>;
63
+ getList(cb: GetFriendsListCallback | null, jsonExtension: string): Promise<[NIMResCode, Array<FriendProfile>]>;
64
64
  /** 获取好友信息
65
65
  * @param accid 对方帐号
66
66
  * @param cb 获取好友信息回调函数
67
67
  * @param jsonExtension json扩展参数(备用,目前不需要)
68
68
  * @return void 无返回值
69
69
  */
70
- getFriendProfile(accid: string, cb: GetFriendProfileCallback, jsonExtension: string): Promise<[string, FriendProfile]>;
70
+ getFriendProfile(accid: string, cb: GetFriendProfileCallback | null, jsonExtension: string): Promise<[string, FriendProfile]>;
71
71
  /** 增量获取好友列表
72
72
  * @param keyword 要查询的关键字
73
73
  * @param cb 获取好友列表回调函数
@@ -78,5 +78,5 @@ export declare class NIMFriend extends EventEmitter<NIMFriendEvents> {
78
78
  * 200:成功
79
79
  * </pre>
80
80
  */
81
- queryFriendListByKeyword(keyword: string, cb: GetFriendsListCallback, jsonExtension: string): Promise<[NIMResCode, Array<FriendProfile>] | null>;
81
+ queryFriendListByKeyword(keyword: string, cb: GetFriendsListCallback | null, jsonExtension: string): Promise<[NIMResCode, Array<FriendProfile>] | null>;
82
82
  }
@@ -15,7 +15,7 @@ export declare class NIMGlobal extends EventEmitter<NIMGlobalEvents> {
15
15
  * @param cb
16
16
  * @return void 无返回值
17
17
  */
18
- setExceptionReportCallback(jsonExtension: string, cb: ExceptionCallback): Promise<[NIMSDKException, string]>;
18
+ setExceptionReportCallback(jsonExtension: string, cb: ExceptionCallback | null): Promise<[NIMSDKException, string]>;
19
19
  /** 设置SDK统一的网络代理。不需要代理时,type设置为kNIMProxyNone,其余参数都传空字符串(端口设为0)。有些代理不需要用户名和密码,相应参数也传空字符串。
20
20
  * @param type 代理类型,见NIMProxyType定义
21
21
  * @param host 代理地址
@@ -34,7 +34,7 @@ export declare class NIMGlobal extends EventEmitter<NIMGlobalEvents> {
34
34
  * @param cb 回调函数
35
35
  * @return void 无返回值
36
36
  */
37
- detectProxy(type: NIMProxyType, host: string, port: number, user: string, password: string, cb: DetectProxyCallback): Promise<[boolean, NIMProxyDetectStep, string]>;
37
+ detectProxy(type: NIMProxyType, host: string, port: number, user: string, password: string, cb: DetectProxyCallback | null): Promise<[boolean, NIMProxyDetectStep, string]>;
38
38
  /** 获取sdk缓存文件信息
39
39
  * @param loginId 查询的账号ID
40
40
  * @param fileType 文件类型,常量定义见NIMCachedFileType
@@ -43,7 +43,7 @@ export declare class NIMGlobal extends EventEmitter<NIMGlobalEvents> {
43
43
  * @param cb
44
44
  * @return void 无返回值
45
45
  */
46
- getSDKCachedFileInfoAsync(loginId: string, fileType: NIMCachedFileType, endTimestamp: number, jsonExtension: string, cb: GetCachedFileInfoCallback): Promise<[NIMResCode, CachedFileInfo]>;
46
+ getSDKCachedFileInfoAsync(loginId: string, fileType: NIMCachedFileType, endTimestamp: number, jsonExtension: string, cb: GetCachedFileInfoCallback | null): Promise<[NIMResCode, CachedFileInfo]>;
47
47
  /** 删除sdk缓存文件
48
48
  * @param loginId 查询的账号ID
49
49
  * @param fileType 文件类型,常量定义见NIMCachedFileType
@@ -52,18 +52,18 @@ export declare class NIMGlobal extends EventEmitter<NIMGlobalEvents> {
52
52
  * @param cb
53
53
  * @return void 无返回值
54
54
  */
55
- deleteSDKCachedFileAsync(loginId: string, fileType: NIMCachedFileType, endTimestamp: number, jsonExtension: string, cb: DeleteCachedFileCallback): Promise<[NIMResCode]>;
55
+ deleteSDKCachedFileAsync(loginId: string, fileType: NIMCachedFileType, endTimestamp: number, jsonExtension: string, cb: DeleteCachedFileCallback | null): Promise<[NIMResCode]>;
56
56
  /** SDK 反馈
57
57
  * @param url 开发者需将所需要反馈的文件(dump,应用日志等)上传至nos。
58
58
  * @param jsonExtension json扩展参数(备用,目前不需要)
59
59
  * @param cb
60
60
  * @return void 无返回值
61
61
  */
62
- sdkFeedbackAsync(url: string, jsonExtension: string, cb: SDKFeedbackCallback): Promise<[NIMResCode]>;
62
+ sdkFeedbackAsync(url: string, jsonExtension: string, cb: SDKFeedbackCallback | null): Promise<[NIMResCode]>;
63
63
  /** 上传SDK日志到服务器
64
64
  * @param feedbackStr 反馈信息
65
65
  * @param cb 操作结果的回调函数
66
66
  * @return void
67
67
  */
68
- uploadSDKLog(feedbackStr: string, cb: UploadSDKLogCallback): Promise<[NIMResCode]>;
68
+ uploadSDKLog(feedbackStr: string, cb: UploadSDKLogCallback | null): Promise<[NIMResCode]>;
69
69
  }
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
2
  import { NIMSessionType } from '../nim_def/session_def';
3
- import { NIMMsgLogAPI, QuerySingleMsgCallback, QueryMsgCallback, NIMMessageType, ModifyMultipleMsglogCallback, NIMMsgLogStatus, ModifySingleMsglogCallback, NIMMsgLogSubStatus, DBFunctionCallback, ImportDbPrgCallback, MessageStatusChangedCallback, LogsBackupExportInfo, LogsBackupImportInfo, DeleteHistoryOnLineAsyncCallback, DeleteHistoryOnLineAsyncExCallback, DeleteMessageSelfAsyncCallback, QueryMessageIsThreadRootCallback, QueryMsgAsyncParam, QueryMessageOnlineCallback, QueryThreadHistoryMsgAsyncParam, QueryThreadHistoryMsgCallback, FullTextSearchOnlineAsyncParam, FullTextSearchOnlineAsyncCallback, IMMessage, QueryMsgByKeywordOnlineParam, QueryMsgOnlineAsyncParam, DeleteMsglogSelfNotifyItemInfo, DeleteMsglogSelfNotifyParam, MessageStatusChangedResult, QueryMsgByOptionsAsyncParam, QueryMsglogResult } from '../nim_def/msglog_def';
3
+ import { NIMMsgLogAPI, QuerySingleMsgCallback, QueryMsgCallback, NIMMessageType, ModifyMultipleMsglogCallback, NIMMsgLogStatus, ModifySingleMsglogCallback, NIMMsgLogSubStatus, DBFunctionCallback, ImportDbPrgCallback, MessageStatusChangedCallback, LogsBackupExportInfo, LogsBackupImportInfo, DeleteHistoryOnLineAsyncCallback, DeleteHistoryOnLineAsyncExCallback, DeleteMessageSelfAsyncCallback, QueryMessageIsThreadRootCallback, QueryMsgAsyncParam, QueryMessageOnlineCallback, QueryThreadHistoryMsgAsyncParam, QueryThreadHistoryMsgCallback, FullTextSearchOnlineAsyncParam, FullTextSearchOnlineAsyncCallback, IMMessage, QueryMsgByKeywordOnlineParam, QueryMsgOnlineAsyncParam, DeleteMsglogSelfNotifyItemInfo, DeleteMsglogSelfNotifyParam, MessageStatusChangedResult, QueryMsgByOptionsAsyncParam, QueryMsglogResult, NIMMsglogSearchDirection, GetMessagesDynamicallyCallback, GetMessagesResult } from '../nim_def/msglog_def';
4
4
  import { NIMResCode } from 'ts/nim_def/client_def';
5
5
  export declare interface NIMMsgLogEvents {
6
6
  /** 单向删除消息记录通知 */
@@ -25,7 +25,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
25
25
  * 200:成功
26
26
  * </pre>
27
27
  */
28
- queryMsgByIDAysnc(clientMsgId: string, cb: QuerySingleMsgCallback, jsonExtension: string): Promise<[NIMResCode, string, IMMessage] | null>;
28
+ queryMsgByIDAysnc(clientMsgId: string, cb: QuerySingleMsgCallback | null, jsonExtension: string): Promise<[NIMResCode, string, IMMessage] | null>;
29
29
  /** 查询本地消息
30
30
  * @param accid 查询id,account_id/uid或者tid
31
31
  * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
@@ -40,7 +40,22 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
40
40
  * 200:成功
41
41
  * </pre>
42
42
  */
43
- queryMsgAsync(accid: string, to_type: NIMSessionType, limit_count: number, anchor_msg_time: number, cb: QueryMsgCallback, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
43
+ queryMsgAsync(accid: string, to_type: NIMSessionType, limit_count: number, anchor_msg_time: number, cb: QueryMsgCallback | null, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
44
+ /** 查询历史消息,基于本地可信时间段信息来动态判断获取消息的途径
45
+ * @param[in] session_id 会话id
46
+ * @param[in] to_type 会话类型, 双人0,群组1, 超大群5
47
+ * @param[in] from_time 开始时间, 包含
48
+ * @param[in] to_time 结束时间, 大于from_time, 0表示当前时间; 只有在direction为kForward且anchor_client_msg_id不为空时才包含
49
+ * @param[in] limit_count 查询数量
50
+ * @param[in] anchor_client_msg_id 查询起始的客户端消息id, 查询结果不包括这条消息
51
+ * @param[in] anchor_server_msg_id 查询起始的服务器消息id, 查询结果不包括这条消息
52
+ * @param[in] direction 查询方向
53
+ * @param[in] cb 查询消息的回调函数
54
+ * @param[in] json_extension json扩展参数(备用,目前不需要)
55
+ * @return void
56
+ * @note 错误码 200:成功
57
+ */
58
+ 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): Promise<[GetMessagesResult] | null>;
44
59
  /** 在线查询消息(不包括系统消息)
45
60
  * @param param 查询参数
46
61
  * @param cb 在线查询消息的回调函数
@@ -52,7 +67,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
52
67
  * 414:参数错误
53
68
  * </pre>
54
69
  */
55
- queryMsgOnlineAsync(param: QueryMsgOnlineAsyncParam, cb: QueryMsgCallback): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
70
+ queryMsgOnlineAsync(param: QueryMsgOnlineAsyncParam, cb: QueryMsgCallback | null): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
56
71
  /** 在线查询消息(不包括系统消息)
57
72
  * @param param 查询参数
58
73
  * @param cb 在线查询消息的回调函数
@@ -64,7 +79,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
64
79
  * 414:参数错误
65
80
  * </pre>
66
81
  */
67
- queryMsgByKeywordOnlineAsync(param: QueryMsgByKeywordOnlineParam, cb: QueryMsgCallback): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
82
+ queryMsgByKeywordOnlineAsync(param: QueryMsgByKeywordOnlineParam, cb: QueryMsgCallback | null): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
68
83
  /** 根据指定条件在一个会话中查询指定单个或多个类型的本地消息
69
84
  * @param to_type 会话类型,双人0,群组1 (nim_msglog_def.h)
70
85
  * @param id 查询id,对方的account id或者群组tid。
@@ -82,7 +97,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
82
97
  * 200:成功
83
98
  * </pre>
84
99
  */
85
- queryMsgOfSpecifiedTypeInASessionAsync(to_type: NIMSessionType, id: string, limit_count: number, fromTime: number, endTime: number, endClientMsgId: string, reverse: boolean, msgType: Array<NIMMessageType>, cb: QueryMsgCallback, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
100
+ 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): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
86
101
  /** 根据指定条件查询本地消息,使用此接口可以完成全局搜索等功能,具体请参阅开发手册
87
102
  * @param param 查询参数
88
103
  * @param cb 在线查询消息的回调函数
@@ -92,7 +107,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
92
107
  * 200:成功
93
108
  * </pre>
94
109
  */
95
- queryMsgByOptionsAsync(param: QueryMsgByOptionsAsyncParam, cb: QueryMsgCallback): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
110
+ queryMsgByOptionsAsync(param: QueryMsgByOptionsAsyncParam, cb: QueryMsgCallback | null): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
96
111
  /** 批量设置已读状态
97
112
  * @param accid 查询id,account_id/uid或者tid
98
113
  * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
@@ -104,7 +119,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
104
119
  * 200:成功
105
120
  * </pre>
106
121
  */
107
- batchStatusReadAsync(accid: string, to_type: NIMSessionType, cb: ModifyMultipleMsglogCallback, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
122
+ batchStatusReadAsync(accid: string, to_type: NIMSessionType, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
108
123
  /** 删除某个会话的全部聊天记录
109
124
  * @param accid 要删除会话的id,account_id/uid或者tid
110
125
  * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
@@ -117,7 +132,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
117
132
  * 200:成功
118
133
  * </pre>
119
134
  */
120
- batchStatusDeleteAsync(accid: string, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
135
+ batchStatusDeleteAsync(accid: string, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
121
136
  /** 设置消息状态
122
137
  * @param msg_id 消息id
123
138
  * @param status 消息状态枚举值
@@ -129,7 +144,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
129
144
  * 200:成功
130
145
  * </pre>
131
146
  */
132
- setStatusAsync(msg_id: string, status: NIMMsgLogStatus, cb: ModifySingleMsglogCallback, jsonExtension: string): Promise<[NIMResCode, string] | null>;
147
+ setStatusAsync(msg_id: string, status: NIMMsgLogStatus, cb: ModifySingleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string] | null>;
133
148
  /** 设置消息子状态
134
149
  * @param msg_id 消息id
135
150
  * @param status 消息子状态枚举值
@@ -141,7 +156,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
141
156
  * 200:成功
142
157
  * </pre>
143
158
  */
144
- setSubStatusAsync(msg_id: string, status: NIMMsgLogSubStatus, cb: ModifySingleMsglogCallback, jsonExtension: string): Promise<[NIMResCode, string] | null>;
159
+ setSubStatusAsync(msg_id: string, status: NIMMsgLogSubStatus, cb: ModifySingleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string] | null>;
145
160
  /** 只往本地消息历史数据库里写入一条消息(如果已存在这条消息,则更新。通常是APP的本地自定义消息,并不会发给服务器)
146
161
  * @param talkId 会话id,对方的account id或者群组tid
147
162
  * @param msg 消息内容
@@ -155,7 +170,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
155
170
  * 200:成功
156
171
  * </pre>
157
172
  */
158
- writeMsglogToLocalAsync(talkId: string, msg: IMMessage, needUpdateSession: boolean, composeLastMsg: boolean, excludeMsgType: Array<number>, cb: ModifySingleMsglogCallback): Promise<[NIMResCode, string] | null>;
173
+ writeMsglogToLocalAsync(talkId: string, msg: IMMessage, needUpdateSession: boolean, composeLastMsg: boolean, excludeMsgType: Array<number>, cb: ModifySingleMsglogCallback | null): Promise<[NIMResCode, string] | null>;
159
174
  /** 删除指定会话类型的所有消息
160
175
  * @param delSessions 是否删除会话
161
176
  * @param to_type 会话类型
@@ -168,7 +183,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
168
183
  * 200:成功
169
184
  * </pre>
170
185
  */
171
- deleteBySessionTypeAsync(delSessions: boolean, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
186
+ deleteBySessionTypeAsync(delSessions: boolean, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
172
187
  /** 删除指定一条消息
173
188
  * @param session_id 会话id,对方的account id或者群组tid
174
189
  * @param to_type 会话类型
@@ -181,7 +196,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
181
196
  * 200:成功
182
197
  * </pre>
183
198
  */
184
- deleteAsync(session_id: string, to_type: NIMSessionType, msg_id: string, cb: ModifySingleMsglogCallback, jsonExtension: string): Promise<[NIMResCode, string] | null>;
199
+ deleteAsync(session_id: string, to_type: NIMSessionType, msg_id: string, cb: ModifySingleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string] | null>;
185
200
  /** 删除全部消息历史
186
201
  * @param del_session 是否删除所有会话列表项(即全部最近联系人)。
187
202
  ture则删除,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandRemoveAll事件(不会触发每个会话项的kNIMSessionCommandRemove事件);
@@ -196,7 +211,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
196
211
  * 200:成功
197
212
  * </pre>
198
213
  */
199
- deleteAllAsync(del_session: boolean, revert_by_query_online: boolean, cb: DBFunctionCallback, jsonExtension: string): Promise<[NIMResCode] | null>;
214
+ deleteAllAsync(del_session: boolean, revert_by_query_online: boolean, cb: DBFunctionCallback | null, jsonExtension: string): Promise<[NIMResCode] | null>;
200
215
  /** 根据时间段删除部分会话的历史消息
201
216
  * @param session_id 要删除消息的会话ID
202
217
  * @param to_type 要删除消息的会话类型
@@ -211,7 +226,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
211
226
  * 200:成功
212
227
  * </pre>
213
228
  */
214
- deleteMsgByTimeAsync(session_id: string, to_type: NIMSessionType, revert_by_query_online: boolean, timestamp1: number, timestamp2: number, cb: DBFunctionCallback, jsonExtension: string): Promise<[NIMResCode] | null>;
229
+ deleteMsgByTimeAsync(session_id: string, to_type: NIMSessionType, revert_by_query_online: boolean, timestamp1: number, timestamp2: number, cb: DBFunctionCallback | null, jsonExtension: string): Promise<[NIMResCode] | null>;
215
230
  /** 导出整个消息历史DB文件(不包括系统消息历史)
216
231
  * @param dst_path 导出时保存的目标全路径(UTF-8编码)。
217
232
  * @param jsonExtension json扩展参数(备用,目前不需要)
@@ -222,7 +237,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
222
237
  * 200:成功
223
238
  * </pre>
224
239
  */
225
- exportDbAsync(dst_path: string, cb: DBFunctionCallback, jsonExtension: string): Promise<[NIMResCode]>;
240
+ exportDbAsync(dst_path: string, cb: DBFunctionCallback | null, jsonExtension: string): Promise<[NIMResCode]>;
226
241
  /** 导入消息历史DB文件(不包括系统消息历史)。先验证是否自己的消息历史文件和DB加密密钥(见nim_client_def.h里的kNIMDataBaseEncryptKey),如果验证不通过,则不导入。
227
242
  * @param src_path 导入源文件的全路径(UTF-8编码)。
228
243
  * @param jsonExtension json扩展参数(备用,目前不需要)
@@ -236,7 +251,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
236
251
  * 10601:导入消息历史时写记录失败
237
252
  * </pre>
238
253
  */
239
- importDbAsync(src_path: string, cb: DBFunctionCallback, prg_cb: ImportDbPrgCallback, jsonExtension: string): Promise<[NIMResCode]>;
254
+ importDbAsync(src_path: string, cb: DBFunctionCallback, prg_cb: ImportDbPrgCallback | null, jsonExtension: string): Promise<[NIMResCode]>;
240
255
  /** 发送消息已读回执
241
256
  * @param msg 已读消息
242
257
  * @param cb 操作结果的回调函数
@@ -249,7 +264,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
249
264
  * 10414:本地错误码,参数错误
250
265
  * </pre>
251
266
  */
252
- sendReceiptAsync(msg: IMMessage, cb: MessageStatusChangedCallback): Promise<[MessageStatusChangedResult]>;
267
+ sendReceiptAsync(msg: IMMessage, cb: MessageStatusChangedCallback | null): Promise<[MessageStatusChangedResult]>;
253
268
  /** 查询自己发送的消息是否被对方已读
254
269
  * @param msg 消息。
255
270
  * @return boolean 是否被已读
@@ -271,7 +286,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
271
286
  * 200:成功
272
287
  * </pre>
273
288
  */
274
- updateLocalExtAsync(msg_id: string, local_ext: string, cb: ModifySingleMsglogCallback, jsonExtension: string): Promise<[NIMResCode, string]>;
289
+ updateLocalExtAsync(msg_id: string, local_ext: string, cb: ModifySingleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string]>;
275
290
  /** 全部未读消息历史标记为已读
276
291
  * @param jsonExtension json扩展参数(备用,目前不需要)
277
292
  * @param cb 操作结果的回调函数
@@ -281,7 +296,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
281
296
  * 200:成功
282
297
  * </pre>
283
298
  */
284
- readAllAsync(cb: DBFunctionCallback, jsonExtension: string): Promise<[NIMResCode]>;
299
+ readAllAsync(cb: DBFunctionCallback | null, jsonExtension: string): Promise<[NIMResCode]>;
285
300
  /** 导出本地消息记录到云端
286
301
  * @param export_info 导出需要的参数参考LogsBackupExportInfo定义
287
302
  * @return boolean false : 当前有导入/导出操作正在进行中
@@ -311,7 +326,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
311
326
  * 200:成功
312
327
  * </pre>
313
328
  */
314
- deleteHistoryOnlineAsync(accid: string, del_remote: boolean, jsonExtension: string, cb: DeleteHistoryOnLineAsyncCallback): Promise<[NIMResCode, string]>;
329
+ deleteHistoryOnlineAsync(accid: string, del_remote: boolean, jsonExtension: string, cb: DeleteHistoryOnLineAsyncCallback | null): Promise<[NIMResCode, string]>;
315
330
  /** 删除某一会话的云端的历史记录[v8.0.0]
316
331
  * @param accid 对方的accid(p2p:accid team:tid)
317
332
  * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
@@ -321,7 +336,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
321
336
  * @return void
322
337
  * @note 错误码 200:成功
323
338
  */
324
- deleteHistoryOnlineAsyncEx(accid: string, to_type: number, needs_notify_self: boolean, jsonExtension: string, cb: DeleteHistoryOnLineAsyncExCallback): Promise<[NIMResCode, string, number, number, string]>;
339
+ deleteHistoryOnlineAsyncEx(accid: string, to_type: number, needs_notify_self: boolean, jsonExtension: string, cb: DeleteHistoryOnLineAsyncExCallback | null): Promise<[NIMResCode, string, number, number, string]>;
325
340
  /** 单向删除某条消息记录(同时删除本地与云端)
326
341
  * @param msg 要删除的消息
327
342
  * @param exts 用户自定义扩展字段
@@ -332,7 +347,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
332
347
  * 200:成功
333
348
  * </pre>
334
349
  */
335
- deleteMessageSelfAsync(msg: IMMessage, ext: string, cb: DeleteMessageSelfAsyncCallback): Promise<[NIMResCode]>;
350
+ deleteMessageSelfAsync(msg: IMMessage, ext: string, cb: DeleteMessageSelfAsyncCallback | null): Promise<[NIMResCode]>;
336
351
  /** 查询某条消息是否为thread聊天的根消息
337
352
  * @param client_id 要查询的消息的客户端ID
338
353
  * @param cb 操作结果的回调函数
@@ -342,7 +357,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
342
357
  * 200:成功
343
358
  * </pre>
344
359
  */
345
- queryMessageIsThreadRoot(client_id: string, cb: QueryMessageIsThreadRootCallback): Promise<[NIMResCode, string, boolean]>;
360
+ queryMessageIsThreadRoot(client_id: string, cb: QueryMessageIsThreadRootCallback | null): Promise<[NIMResCode, string, boolean]>;
346
361
  /** 查询某条消息的具体内容一般用在thread talk 场景中
347
362
  * @param param 要查询的消息的相关参数,可以在msglog.threadinfo中得到
348
363
  * @param cb 查询结果的回调函数
@@ -352,7 +367,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
352
367
  * 200:成功
353
368
  * </pre>
354
369
  */
355
- queryMessageOnline(param: QueryMsgAsyncParam, cb: QueryMessageOnlineCallback): Promise<[NIMResCode, string, IMMessage]>;
370
+ queryMessageOnline(param: QueryMsgAsyncParam, cb: QueryMessageOnlineCallback | null): Promise<[NIMResCode, string, IMMessage]>;
356
371
  /** 分页查询thread talk消息历史
357
372
  * @param msg 要查询的消息
358
373
  * @param param 要查询的消息的相关参数,可以在msglog.threadinfo中得到
@@ -363,7 +378,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
363
378
  * 200:成功
364
379
  * </pre>
365
380
  */
366
- queryThreadHistoryMsg(msg: IMMessage, param: QueryThreadHistoryMsgAsyncParam, cb: QueryThreadHistoryMsgCallback): Promise<[NIMResCode, IMMessage, number, number, Array<IMMessage>]>;
381
+ queryThreadHistoryMsg(msg: IMMessage, param: QueryThreadHistoryMsgAsyncParam, cb: QueryThreadHistoryMsgCallback | null): Promise<[NIMResCode, IMMessage, number, number, Array<IMMessage>]>;
367
382
  /** 在线全文检索
368
383
  * @param param 全文检索参数
369
384
  * @param cb 全文检索结果回调函数
@@ -373,5 +388,5 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
373
388
  * 200:成功
374
389
  * </pre>
375
390
  */
376
- fullTextSearchOnlineAsync(param: FullTextSearchOnlineAsyncParam, cb: FullTextSearchOnlineAsyncCallback): Promise<[NIMResCode, QueryMsglogResult]>;
391
+ fullTextSearchOnlineAsync(param: FullTextSearchOnlineAsyncParam, cb: FullTextSearchOnlineAsyncCallback | null): Promise<[NIMResCode, QueryMsglogResult]>;
377
392
  }