node-nim 10.2.0 → 10.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +0 -6
  2. package/dist/chatroom_def/chatroom_def.js +121 -0
  3. package/dist/chatroom_def/chatroom_def.js.map +1 -0
  4. package/dist/loader.js +19 -4
  5. package/dist/loader.js.map +1 -1
  6. package/dist/nim/msglog.js +163 -81
  7. package/dist/nim/msglog.js.map +1 -1
  8. package/dist/nim/session.js +3 -3
  9. package/dist/nim/session.js.map +1 -1
  10. package/dist/nim/super_team.js +59 -0
  11. package/dist/nim/super_team.js.map +1 -1
  12. package/dist/nim/talk.js +5 -5
  13. package/dist/nim/talk.js.map +1 -1
  14. package/dist/nim/team.js +48 -0
  15. package/dist/nim/team.js.map +1 -1
  16. package/dist/nim/tool.js +3 -0
  17. package/dist/nim/tool.js.map +1 -1
  18. package/dist/nim_def/client_def.js +1 -0
  19. package/dist/nim_def/client_def.js.map +1 -1
  20. package/dist/nim_def/msglog_def.js +31 -1
  21. package/dist/nim_def/msglog_def.js.map +1 -1
  22. package/dist/nim_def/super_team_def.js +8 -1
  23. package/dist/nim_def/super_team_def.js.map +1 -1
  24. package/dist/nim_def/team_def.js +8 -1
  25. package/dist/nim_def/team_def.js.map +1 -1
  26. package/dist/node-nim.js +3 -1
  27. package/dist/node-nim.js.map +1 -1
  28. package/dist/qchat/message.js +39 -0
  29. package/dist/qchat/message.js.map +1 -1
  30. package/dist/qchat_def/public_def.js +2 -0
  31. package/dist/qchat_def/public_def.js.map +1 -1
  32. package/dist/v2/v2_nim_ai_service.js +40 -0
  33. package/dist/v2/v2_nim_ai_service.js.map +1 -0
  34. package/dist/v2/v2_nim_chatroom_service.js.map +1 -1
  35. package/dist/v2/v2_nim_client.js +14 -0
  36. package/dist/v2/v2_nim_client.js.map +1 -1
  37. package/dist/v2/v2_nim_conversation_service.js +24 -0
  38. package/dist/v2/v2_nim_conversation_service.js.map +1 -1
  39. package/dist/v2/v2_nim_friend_service.js +41 -0
  40. package/dist/v2/v2_nim_friend_service.js.map +1 -1
  41. package/dist/v2/v2_nim_message_service.js +22 -0
  42. package/dist/v2/v2_nim_message_service.js.map +1 -1
  43. package/dist/v2/v2_nim_storage_service.js +82 -1
  44. package/dist/v2/v2_nim_storage_service.js.map +1 -1
  45. package/dist/v2/v2_nim_team_service.js +24 -0
  46. package/dist/v2/v2_nim_team_service.js.map +1 -1
  47. package/dist/v2/v2_nim_user_service.js +32 -0
  48. package/dist/v2/v2_nim_user_service.js.map +1 -1
  49. package/dist/v2/v2_nim_utilities.js +52 -1
  50. package/dist/v2/v2_nim_utilities.js.map +1 -1
  51. package/dist/v2_def/v2_nim_enum_def.js +60 -0
  52. package/dist/v2_def/v2_nim_enum_def.js.map +1 -1
  53. package/package.json +12 -3
  54. package/script/publish-to-netease-npm.js +9 -3
  55. package/types/chatroom_def/chatroom_def.d.ts +449 -0
  56. package/types/loader.d.ts +2 -2
  57. package/types/nim/client.d.ts +5 -5
  58. package/types/nim/msglog.d.ts +124 -80
  59. package/types/nim/session.d.ts +1 -1
  60. package/types/nim/super_team.d.ts +26 -1
  61. package/types/nim/talk.d.ts +4 -4
  62. package/types/nim/team.d.ts +21 -1
  63. package/types/nim/tool.d.ts +1 -0
  64. package/types/nim_def/client_def.d.ts +4 -1
  65. package/types/nim_def/msglog_def.d.ts +36 -1
  66. package/types/nim_def/super_team_def.d.ts +28 -0
  67. package/types/nim_def/talk_def.d.ts +1 -1
  68. package/types/nim_def/team_def.d.ts +19 -0
  69. package/types/node-nim.d.ts +2 -2
  70. package/types/qchat/message.d.ts +16 -1
  71. package/types/qchat_def/message_def.d.ts +36 -0
  72. package/types/qchat_def/public_def.d.ts +3 -1
  73. package/types/v2/v2_nim_ai_service.d.ts +18 -0
  74. package/types/v2/v2_nim_chatroom_service.d.ts +2 -0
  75. package/types/v2/v2_nim_client.d.ts +9 -1
  76. package/types/v2/v2_nim_conversation_service.d.ts +10 -0
  77. package/types/v2/v2_nim_friend_service.d.ts +14 -2
  78. package/types/v2/v2_nim_message_service.d.ts +9 -1
  79. package/types/v2/v2_nim_storage_service.d.ts +32 -2
  80. package/types/v2/v2_nim_team_service.d.ts +9 -1
  81. package/types/v2/v2_nim_user_service.d.ts +11 -1
  82. package/types/v2/v2_nim_utilities.d.ts +38 -1
  83. package/types/v2_def/v2_nim_enum_def.d.ts +46 -3
  84. package/types/v2_def/v2_nim_struct_def.d.ts +171 -8
@@ -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, NIMMsglogSearchDirection, GetMessagesDynamicallyCallback, GetMessagesResult } 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, NIMBuildingMsglogIndexesCompleteReason, QueryMsgByKeywordParam, IsMessageIndexEstablishedCallback, BuildMsglogIndexesProgress, BuildMsglogIndexesComplete } from '../nim_def/msglog_def';
4
4
  import { NIMResCode } from '../nim_def/client_def';
5
5
  export declare interface NIMMsgLogEvents {
6
6
  /** 单向删除消息记录通知 */
@@ -16,9 +16,9 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
16
16
  /** 注册全局回调 */
17
17
  initEventHandlers(): void;
18
18
  /** 根据消息ID查询本地(单条)消息
19
- * @param clientMsgId 客户端消息ID
20
- * @param jsonExtension json扩展参数(备用,目前不需要)
21
- * @param cb 查询本地消息的回调函数
19
+ * @param clientMsgId 客户端消息ID
20
+ * @param jsonExtension json扩展参数(备用,目前不需要)
21
+ * @param cb 查询本地消息的回调函数
22
22
  * @return boolean 检查参数如果不符合要求则返回失败
23
23
  * @note
24
24
  * <pre>
@@ -27,13 +27,13 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
27
27
  */
28
28
  queryMsgByIDAysnc(clientMsgId: string, cb: QuerySingleMsgCallback | null, jsonExtension: string): Promise<[NIMResCode, string, IMMessage] | null>;
29
29
  /** 查询本地消息
30
- * @param accid 查询id,account_id/uid或者tid
31
- * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
32
- * @param limit_count 一次查询数量,建议20
30
+ * @param accid 查询id,account_id/uid或者tid
31
+ * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
32
+ * @param limit_count 一次查询数量,建议20
33
33
  * @param anchor_msg_time
34
34
  * 作为此次查询的定位点的消息历史的消息时间戳(上次查询最后一条消息的时间戳,按指定的时间的顺序起查,默认为逆序,2.4.0之前命名为last_name)
35
35
  * @param jsonExtension json扩展参数(备用,目前不需要)
36
- * @param cb 查询本地消息的回调函数
36
+ * @param cb 查询本地消息的回调函数
37
37
  * @return boolean 检查参数如果不符合要求则返回失败
38
38
  * @note
39
39
  * <pre>
@@ -57,8 +57,8 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
57
57
  */
58
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: string, direction: NIMMsglogSearchDirection, cb: GetMessagesDynamicallyCallback | null, jsonExtension: string): Promise<[GetMessagesResult] | null>;
59
59
  /** 在线查询消息(不包括系统消息)
60
- * @param param 查询参数
61
- * @param cb 在线查询消息的回调函数
60
+ * @param param 查询参数
61
+ * @param cb 在线查询消息的回调函数
62
62
  * @return boolean 检查参数如果不符合要求则返回失败
63
63
  * @note
64
64
  * <pre>
@@ -69,8 +69,8 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
69
69
  */
70
70
  queryMsgOnlineAsync(param: QueryMsgOnlineAsyncParam, cb: QueryMsgCallback | null): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
71
71
  /** 在线查询消息(不包括系统消息)
72
- * @param param 查询参数
73
- * @param cb 在线查询消息的回调函数
72
+ * @param param 查询参数
73
+ * @param cb 在线查询消息的回调函数
74
74
  * @return boolean 检查参数如果不符合要求则返回失败
75
75
  * @note
76
76
  * <pre>
@@ -81,17 +81,17 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
81
81
  */
82
82
  queryMsgByKeywordOnlineAsync(param: QueryMsgByKeywordOnlineParam, cb: QueryMsgCallback | null): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
83
83
  /** 根据指定条件在一个会话中查询指定单个或多个类型的本地消息
84
- * @param to_type 会话类型,双人0,群组1 (nim_msglog_def.h)
85
- * @param id 查询id,对方的account id或者群组tid。
86
- * @param limit_count 本次查询的消息条数上限(最多100条)
87
- * @param fromTime 起始时间点,单位:毫秒
88
- * @param endTime 结束时间点,单位:毫秒
89
- * @param endClientMsgId 结束查询的最后一条消息的end_client_msg_id(不包含在查询结果中)
90
- * @param reverse true:反向查询(按时间正序起查,正序排列),false:按时间逆序起查,逆序排列(建议默认为false)
91
- * @param msgType 检索的消息类型
92
- * @param jsonExtension json扩展参数(备用,目前不需要)
93
- * @param cb 在线查询消息的回调函数
94
- * @return boolean 检查参数如果不符合要求则返回失败
84
+ * @param to_type 会话类型,双人0,群组1 (nim_msglog_def.h)
85
+ * @param id 查询id,对方的account id或者群组tid。
86
+ * @param limit_count 本次查询的消息条数上限(最多100条)
87
+ * @param from_time 起始时间点,单位:毫秒,当为 0 时将不作为过滤条件
88
+ * @param end_time 结束时间点,单位:毫秒,当为 0 时将不作为过滤条件
89
+ * @param end_client_msg_id 作为查询结果的过滤条件,无论正向、反向查询,当遇到此消息 ID 时均跳过后续的消息,且不将该 ID 对应的消息包含在查询结果中
90
+ * @param reverse 查询方向,为 true 时对时间段内的消息从新到旧查询,查询结果按消息时间降序排列,为 false 时对时间段内的消息从旧到新查询,查询结果按消息时间升序排列
91
+ * @param msg_type 检索的消息类型
92
+ * @param json_extension json 扩展参数(备用,目前不需要)
93
+ * @param cb 在线查询消息的回调函数
94
+ * @return bool 检查参数如果不符合要求则返回失败
95
95
  * @note
96
96
  * <pre>
97
97
  * 200:成功
@@ -100,7 +100,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
100
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>;
101
101
  /** 根据指定条件查询本地消息,使用此接口可以完成全局搜索等功能,具体请参阅开发手册
102
102
  * @param param 查询参数
103
- * @param cb 在线查询消息的回调函数
103
+ * @param cb 在线查询消息的回调函数
104
104
  * @return boolean 检查参数如果不符合要求则返回失败
105
105
  * @note
106
106
  * <pre>
@@ -109,10 +109,10 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
109
109
  */
110
110
  queryMsgByOptionsAsync(param: QueryMsgByOptionsAsyncParam, cb: QueryMsgCallback | null): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult] | null>;
111
111
  /** 批量设置已读状态
112
- * @param accid 查询id,account_id/uid或者tid
113
- * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
112
+ * @param accid 查询id,account_id/uid或者tid
113
+ * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
114
114
  * @param jsonExtension json扩展参数(备用,目前不需要)
115
- * @param cb 操作结果的回调函数
115
+ * @param cb 操作结果的回调函数
116
116
  * @return boolean 检查参数如果不符合要求则返回失败
117
117
  * @note
118
118
  * <pre>
@@ -121,10 +121,10 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
121
121
  */
122
122
  batchStatusReadAsync(accid: string, to_type: NIMSessionType, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
123
123
  /** 删除某个会话的全部聊天记录
124
- * @param accid 要删除会话的id,account_id/uid或者tid
125
- * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
126
- * @param revert_by_query_online 是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
127
- * @param cb 操作结果的回调函数
124
+ * @param accid 要删除会话的id,account_id/uid或者tid
125
+ * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
126
+ * @param revert_by_query_online 是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
127
+ * @param cb 操作结果的回调函数
128
128
  * @param jsonExtension json扩展参数(备用,目前不需要)
129
129
  * @return boolean 检查参数如果不符合要求则返回失败
130
130
  * @note
@@ -134,10 +134,10 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
134
134
  */
135
135
  batchStatusDeleteAsync(accid: string, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
136
136
  /** 设置消息状态
137
- * @param msg_id 消息id
137
+ * @param msg_id 消息id
138
138
  * @param status 消息状态枚举值
139
139
  * @param jsonExtension json扩展参数(备用,目前不需要)
140
- * @param cb 操作结果的回调函数
140
+ * @param cb 操作结果的回调函数
141
141
  * @return boolean 检查参数如果不符合要求则返回失败
142
142
  * @note
143
143
  * <pre>
@@ -146,10 +146,10 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
146
146
  */
147
147
  setStatusAsync(msg_id: string, status: NIMMsgLogStatus, cb: ModifySingleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string] | null>;
148
148
  /** 设置消息子状态
149
- * @param msg_id 消息id
149
+ * @param msg_id 消息id
150
150
  * @param status 消息子状态枚举值
151
151
  * @param jsonExtension json扩展参数(备用,目前不需要)
152
- * @param cb 操作结果的回调函数
152
+ * @param cb 操作结果的回调函数
153
153
  * @return boolean 检查参数如果不符合要求则返回失败
154
154
  * @note
155
155
  * <pre>
@@ -172,11 +172,11 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
172
172
  */
173
173
  writeMsglogToLocalAsync(talkId: string, msg: IMMessage, needUpdateSession: boolean, composeLastMsg: boolean, excludeMsgType: Array<number>, cb: ModifySingleMsglogCallback | null): Promise<[NIMResCode, string] | null>;
174
174
  /** 删除指定会话类型的所有消息
175
- * @param delSessions 是否删除会话
176
- * @param to_type 会话类型
177
- * @param revert_by_query_online 是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
175
+ * @param delSessions 是否删除会话
176
+ * @param to_type 会话类型
177
+ * @param revert_by_query_online 是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
178
178
  * @param jsonExtension json扩展参数(备用,目前不需要)
179
- * @param cb 操作结果的回调函数
179
+ * @param cb 操作结果的回调函数
180
180
  * @return boolean 检查参数如果不符合要求则返回失败
181
181
  * @note
182
182
  * <pre>
@@ -185,11 +185,11 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
185
185
  */
186
186
  deleteBySessionTypeAsync(delSessions: boolean, to_type: NIMSessionType, revert_by_query_online: boolean, cb: ModifyMultipleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string, NIMSessionType] | null>;
187
187
  /** 删除指定一条消息
188
- * @param session_id 会话id,对方的account id或者群组tid
189
- * @param to_type 会话类型
190
- * @param msg_id 消息id
188
+ * @param session_id 会话id,对方的account id或者群组tid
189
+ * @param to_type 会话类型
190
+ * @param msg_id 消息id
191
191
  * @param jsonExtension json扩展参数(备用,目前不需要)
192
- * @param cb 操作结果的回调函数
192
+ * @param cb 操作结果的回调函数
193
193
  * @return boolean 检查参数如果不符合要求则返回失败
194
194
  * @note
195
195
  * <pre>
@@ -198,28 +198,28 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
198
198
  */
199
199
  deleteAsync(session_id: string, to_type: NIMSessionType, msg_id: string, cb: ModifySingleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string] | null>;
200
200
  /** 删除全部消息历史
201
- * @param del_session 是否删除所有会话列表项(即全部最近联系人)。
202
- ture则删除,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandRemoveAll事件(不会触发每个会话项的kNIMSessionCommandRemove事件);
203
- false则不删除,并将所有会话项的最后一条消息的状态kNIMSessionMsgStatus设置为已删除状态,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSession
204
- CommandAllMsgDeleted事件(不会触发每个会话项的kNIMSessionCommandUpdate事件,避免频繁通知上层)。
205
- * @param revert_by_query_online 是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
206
- * @param jsonExtension json扩展参数(备用,目前不需要)
207
- * @param cb 操作结果的回调函数
208
- * @return boolean 检查参数如果不符合要求则返回失败
209
- * @note
210
- * <pre>
211
- * 200:成功
212
- * </pre>
213
- */
201
+ * @param del_session 是否删除所有会话列表项(即全部最近联系人)。
202
+ ture则删除,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandRemoveAll事件(不会触发每个会话项的kNIMSessionCommandRemove事件);
203
+ false则不删除,并将所有会话项的最后一条消息的状态kNIMSessionMsgStatus设置为已删除状态,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSession
204
+ CommandAllMsgDeleted事件(不会触发每个会话项的kNIMSessionCommandUpdate事件,避免频繁通知上层)。
205
+ * @param revert_by_query_online 是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
206
+ * @param jsonExtension json扩展参数(备用,目前不需要)
207
+ * @param cb 操作结果的回调函数
208
+ * @return boolean 检查参数如果不符合要求则返回失败
209
+ * @note
210
+ * <pre>
211
+ * 200:成功
212
+ * </pre>
213
+ */
214
214
  deleteAllAsync(del_session: boolean, revert_by_query_online: boolean, cb: DBFunctionCallback | null, jsonExtension: string): Promise<[NIMResCode] | null>;
215
215
  /** 根据时间段删除部分会话的历史消息
216
- * @param session_id 要删除消息的会话ID
217
- * @param to_type 要删除消息的会话类型
218
- * @param revert_by_query_online 是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
216
+ * @param session_id 要删除消息的会话ID
217
+ * @param to_type 要删除消息的会话类型
218
+ * @param revert_by_query_online 是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
219
219
  * @param timestamp1 单位ms timestamp1 与 timestamp2 组成一个时间段,SDK 内部会判断大小调整入参顺序
220
220
  * @param timestamp2 单位ms timestamp2 与 timestamp1 组成一个时间段,SDK 内部会判断大小调整入参顺序
221
221
  * @param jsonExtension json扩展参数(备用,目前不需要)
222
- * @param cb 操作结果的回调函数
222
+ * @param cb 操作结果的回调函数
223
223
  * @return boolean 检查参数如果不符合要求则返回失败
224
224
  * @note
225
225
  * <pre>
@@ -228,9 +228,9 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
228
228
  */
229
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>;
230
230
  /** 导出整个消息历史DB文件(不包括系统消息历史)
231
- * @param dst_path 导出时保存的目标全路径(UTF-8编码)。
231
+ * @param dst_path 导出时保存的目标全路径(UTF-8编码)。
232
232
  * @param jsonExtension json扩展参数(备用,目前不需要)
233
- * @param cb 操作结果的回调函数
233
+ * @param cb 操作结果的回调函数
234
234
  * @return boolean 检查参数如果不符合要求则返回失败
235
235
  * @note
236
236
  * <pre>
@@ -239,10 +239,10 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
239
239
  */
240
240
  exportDbAsync(dst_path: string, cb: DBFunctionCallback | null, jsonExtension: string): Promise<[NIMResCode]>;
241
241
  /** 导入消息历史DB文件(不包括系统消息历史)。先验证是否自己的消息历史文件和DB加密密钥(见nim_client_def.h里的kNIMDataBaseEncryptKey),如果验证不通过,则不导入。
242
- * @param src_path 导入源文件的全路径(UTF-8编码)。
243
- * @param jsonExtension json扩展参数(备用,目前不需要)
244
- * @param cb 操作结果的回调函数
245
- * @param prg_cb 导入进度的回调函数
242
+ * @param src_path 导入源文件的全路径(UTF-8编码)。
243
+ * @param jsonExtension json扩展参数(备用,目前不需要)
244
+ * @param cb 操作结果的回调函数
245
+ * @param prg_cb 导入进度的回调函数
246
246
  * @return boolean 检查参数如果不符合要求则返回失败
247
247
  * @note
248
248
  * <pre>
@@ -253,8 +253,8 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
253
253
  */
254
254
  importDbAsync(src_path: string, cb: DBFunctionCallback, prg_cb: ImportDbPrgCallback | null, jsonExtension: string): Promise<[NIMResCode]>;
255
255
  /** 发送消息已读回执
256
- * @param msg 已读消息
257
- * @param cb 操作结果的回调函数
256
+ * @param msg 已读消息
257
+ * @param cb 操作结果的回调函数
258
258
  * @return void 无返回值
259
259
  * @note
260
260
  * <pre>
@@ -266,20 +266,20 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
266
266
  */
267
267
  sendReceiptAsync(msg: IMMessage, cb: MessageStatusChangedCallback | null): Promise<[MessageStatusChangedResult]>;
268
268
  /** 查询自己发送的消息是否被对方已读
269
- * @param msg 消息。
269
+ * @param msg 消息。
270
270
  * @return boolean 是否被已读
271
271
  */
272
272
  querySentMessageBeReaded(msg: IMMessage): boolean;
273
273
  /** 查询收到的消息是否已经发送过已读回执
274
- * @param msg 消息。
274
+ * @param msg 消息。
275
275
  * @return boolean 是否已发送过
276
276
  */
277
277
  queryReceivedMsgReceiptSent(msg: IMMessage): boolean;
278
278
  /** 更新本地消息扩展字段内容
279
- * @param msg_id 消息id
279
+ * @param msg_id 消息id
280
280
  * @param local_ext 本地扩展字段内容
281
281
  * @param jsonExtension json扩展参数(备用,目前不需要)
282
- * @param cb 操作结果的回调函数
282
+ * @param cb 操作结果的回调函数
283
283
  * @return boolean 检查参数如果不符合要求则返回失败
284
284
  * @note
285
285
  * <pre>
@@ -289,7 +289,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
289
289
  updateLocalExtAsync(msg_id: string, local_ext: string, cb: ModifySingleMsglogCallback | null, jsonExtension: string): Promise<[NIMResCode, string]>;
290
290
  /** 全部未读消息历史标记为已读
291
291
  * @param jsonExtension json扩展参数(备用,目前不需要)
292
- * @param cb 操作结果的回调函数
292
+ * @param cb 操作结果的回调函数
293
293
  * @return boolean 检查参数如果不符合要求则返回失败
294
294
  * @note
295
295
  * <pre>
@@ -319,7 +319,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
319
319
  * @param accid 对方的accid
320
320
  * @param del_remote 是否同时删除所有的漫游消息 true : 是 false : 否
321
321
  * @param jsonExtension json扩展参数(备用,目前不需要)
322
- * @param cb 操作结果的回调函数
322
+ * @param cb 操作结果的回调函数
323
323
  * @return void
324
324
  * @note
325
325
  * <pre>
@@ -332,7 +332,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
332
332
  * @param to_type 会话类型,双人0,群组1 (见nim_msglog_def.h)
333
333
  * @param needs_notify_self 是否通知其它终端
334
334
  * @param jsonExtension 扩展字段
335
- * @param cb 操作结果的回调函数
335
+ * @param cb 操作结果的回调函数
336
336
  * @return void
337
337
  * @note 错误码 200:成功
338
338
  */
@@ -340,7 +340,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
340
340
  /** 单向删除某条消息记录(同时删除本地与云端)
341
341
  * @param msg 要删除的消息
342
342
  * @param exts 用户自定义扩展字段
343
- * @param cb 操作结果的回调函数
343
+ * @param cb 操作结果的回调函数
344
344
  * @return void 无返回值
345
345
  * @note
346
346
  * <pre>
@@ -350,17 +350,17 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
350
350
  deleteMessageSelfAsync(msg: IMMessage, ext: string, cb: DeleteMessageSelfAsyncCallback | null): Promise<[NIMResCode]>;
351
351
  /** 查询某条消息是否为thread聊天的根消息
352
352
  * @param client_id 要查询的消息的客户端ID
353
- * @param cb 操作结果的回调函数
353
+ * @param cb 操作结果的回调函数
354
354
  * @return void 无返回值
355
355
  * @note
356
356
  * <pre>
357
357
  * 200:成功
358
358
  * </pre>
359
359
  */
360
- queryMessageIsThreadRoot(client_id: string, cb: QueryMessageIsThreadRootCallback | null): Promise<[NIMResCode, string, boolean]>;
360
+ queryMessageIsThreadRoot(client_id: string, cb: QueryMessageIsThreadRootCallback | null): Promise<[NIMResCode, string, boolean, number]>;
361
361
  /** 查询某条消息的具体内容一般用在thread talk 场景中
362
362
  * @param param 要查询的消息的相关参数,可以在msglog.threadinfo中得到
363
- * @param cb 查询结果的回调函数
363
+ * @param cb 查询结果的回调函数
364
364
  * @return void 无返回值
365
365
  * @note
366
366
  * <pre>
@@ -371,7 +371,7 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
371
371
  /** 分页查询thread talk消息历史
372
372
  * @param msg 要查询的消息
373
373
  * @param param 要查询的消息的相关参数,可以在msglog.threadinfo中得到
374
- * @param cb 查询结果的回调函数
374
+ * @param cb 查询结果的回调函数
375
375
  * @return void 无返回值
376
376
  * @note
377
377
  * <pre>
@@ -379,6 +379,17 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
379
379
  * </pre>
380
380
  */
381
381
  queryThreadHistoryMsg(msg: IMMessage, param: QueryThreadHistoryMsgAsyncParam, cb: QueryThreadHistoryMsgCallback | null): Promise<[NIMResCode, IMMessage, number, number, Array<IMMessage>]>;
382
+ /** 查询本地 thread talk 消息历史
383
+ * @param msg 根消息消息体
384
+ * @param cb 查询结果的回调函数
385
+ * @return void 无返回值
386
+ * @note
387
+ * <pre>
388
+ * 200:成功
389
+ * 414:参数错误
390
+ * </pre>
391
+ */
392
+ queryLocalThreadHistoryMsg(msg: IMMessage, cb: QueryMsgCallback | null): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult]>;
382
393
  /** 在线全文检索
383
394
  * @param param 全文检索参数
384
395
  * @param cb 全文检索结果回调函数
@@ -389,4 +400,37 @@ export declare class NIMMsgLog extends EventEmitter<NIMMsgLogEvents> {
389
400
  * </pre>
390
401
  */
391
402
  fullTextSearchOnlineAsync(param: FullTextSearchOnlineAsyncParam, cb: FullTextSearchOnlineAsyncCallback | null): Promise<[NIMResCode, QueryMsglogResult]>;
403
+ /**
404
+ * @brief 根据关键字在本地查询关联消息的内容,与其他关键字查询接口不同,本接口使用全文检索引擎进行查询
405
+ * 如果您有历史数据,请先调用 IsMessageIndexEstablished 判断是否已经同步完成所有旧消息索引
406
+ * 如果尚未同步完成,可使用 BuildingMsglogIndexes 来构建历史消息索引,以提供全文检索接口快速查询内容
407
+ * @param param 查询参数 @see QueryMsgByKeywordParam
408
+ * @param cb 查询消息的回调函数
409
+ * @return bool 检查参数如果不符合要求则返回失败
410
+ * @note
411
+ * <pre>
412
+ * 200:成功
413
+ * 414:参数错误
414
+ * </pre>
415
+ */
416
+ queryMessagesByKeywordAsync(param: QueryMsgByKeywordParam, cb: QueryMsgCallback | null): Promise<[NIMResCode, string, NIMSessionType, QueryMsglogResult]>;
417
+ /**
418
+ * @brief 判断消息索引是否已经建立完成,如果已经建立完成,则可以使用 QueryMessagesByKeywordAsync 接口通过关键字全文检索
419
+ * @param cb 是否已经建立完成的回调函数
420
+ * @return void
421
+ */
422
+ isMessageIndexEstablished(cb: IsMessageIndexEstablishedCallback): Promise<boolean>;
423
+ /**
424
+ * @brief 对旧的历史消息构建消息索引表
425
+ * @param page_size 每页同步多少条消息,建议最小不低于 1000,最大不超过 5000
426
+ * @param progress 构建消息索引表进度回调 @see BuildMsglogIndexesProgress
427
+ * @param completion 构建消息索引表完成回调 @see BuildMsglogIndexesComplete
428
+ * @return void
429
+ */
430
+ buildMsglogIndexes(page_size: number, progress: BuildMsglogIndexesProgress | null, complete: BuildMsglogIndexesComplete | null): Promise<[NIMBuildingMsglogIndexesCompleteReason, string]>;
431
+ /**
432
+ * @brief 取消构建消息索引表
433
+ * @return void
434
+ */
435
+ cancelMsglogIndexesBuilding(): void;
392
436
  }
@@ -74,7 +74,7 @@ export declare class NIMSession extends EventEmitter<NIMSessionEvents> {
74
74
  * @param jsonExtension json扩展参数(备用,目前不需要)
75
75
  * @return void 无返回值
76
76
  */
77
- queryAllRecentSessionAsync(msg_excluded_type_list: Array<NIMMessageType>, cb: QuerySessionListCallback | null, jsonExtension: string): Promise<[NIMResCode, SessionDataList]>;
77
+ queryAllRecentSessionAsync(msg_excluded_type_list: Array<NIMMessageType>, cb: QuerySessionListCallback | null, jsonExtension: string): Promise<[number, SessionDataList]>;
78
78
  /** 删除最近联系人
79
79
  * @param to_type 会话类型,双人0,群组1 (nim_msglog_def.h)
80
80
  * @param id 对方的account id或者群组tid。
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
- import { QuerySuperTeamMyAllMemberInfosCallback, NIMSuperTeamAPI, SuperTeamEventCallback, SuperTeamInfo, SuperTeamMemberProperty, QueryAllMySuperTeamsCallback, QueryAllMySuperTeamsInfoCallback, QuerySuperTeamMembersCallback, QuerySuperTeamMemberCallback, QuerySuperTeamInfoCallback, SuperTeamEvent } from '../nim_def/super_team_def';
2
+ import { QuerySuperTeamMyAllMemberInfosCallback, NIMSuperTeamAPI, SuperTeamEventCallback, SuperTeamInfo, SuperTeamMemberProperty, QueryAllMySuperTeamsCallback, QueryAllMySuperTeamsInfoCallback, QuerySuperTeamMembersCallback, QuerySuperTeamMemberCallback, QuerySuperTeamInfoCallback, SuperTeamEvent, SuperTeamMemberKeywordSearchOption, SuperTeamMemberSerachResult, SuperTeamMemberRoleTypeSearchOption } from '../nim_def/super_team_def';
3
3
  export declare interface NIMSuperTeamEvents {
4
4
  /** 超大群事件 */
5
5
  superTeamEvent: [SuperTeamEvent];
@@ -187,6 +187,20 @@ export declare class NIMSuperTeam extends EventEmitter<NIMSuperTeamEvents> {
187
187
  * </pre>
188
188
  */
189
189
  updateMyPropertyAsync(prop: SuperTeamMemberProperty, cb: SuperTeamEventCallback | null, jsonExtension: string): Promise<[SuperTeamEvent] | null>;
190
+ /** @fn boolean addTeamMembersFollow(tid: string, account_ids: Array<string>, cb: SuperTeamEventCallback)
191
+ * 添加群成员特别通知
192
+ * @param[in] tid 群组id
193
+ * @param[in] account_ids 群成员id
194
+ * @param[in] cb 添加群成员特别通知的回调函数
195
+ */
196
+ addTeamMembersFollow(tid: string, account_ids: Array<string>, cb: SuperTeamEventCallback): Promise<[SuperTeamEvent] | null>;
197
+ /** @fn boolean removeTeamMembersFollow(tid: string, account_ids: Array<string>, SuperTeamEventCallback
198
+ * cb) 移除群成员特别通知
199
+ * @param[in] tid 群组id
200
+ * @param[in] account_ids 群成员id
201
+ * @param[in] cb 移除群成员特别通知的回调函数
202
+ */
203
+ removeTeamMembersFollow(tid: string, account_ids: Array<string>, cb: SuperTeamEventCallback): Promise<[SuperTeamEvent] | null>;
190
204
  /** 修改别人的群昵称
191
205
  * @param prop 群成员属性
192
206
  * @param jsonExtension json扩展参数(备用,目前不需要)
@@ -328,4 +342,15 @@ export declare class NIMSuperTeam extends EventEmitter<NIMSuperTeamEvents> {
328
342
  * @return boolean 检查参数如果不符合要求则返回失败
329
343
  */
330
344
  querySuperTeamsInfoByKeywordAsync(keyword: string, cb: QueryAllMySuperTeamsInfoCallback | null, jsonExtension: string): Promise<[number, Array<SuperTeamInfo>]>;
345
+ /** 搜索群成员
346
+ * @param option 搜索群成员选项
347
+ * @return boolean 检查参数如果不符合要求则返回失败
348
+ */
349
+ searchTeamMembers(option: SuperTeamMemberKeywordSearchOption): Promise<[SuperTeamMemberSerachResult]>;
350
+ /** 根据成员类型获取群成员
351
+ * @param tid 群组id
352
+ * @param option 获取群成员选项
353
+ * @return boolean 检查参数如果不符合要求则返回失败
354
+ */
355
+ getTeamMemberList(tid: string, option: SuperTeamMemberRoleTypeSearchOption): Promise<[SuperTeamMemberSerachResult]>;
331
356
  }
@@ -73,12 +73,12 @@ export declare class NIMTalk extends EventEmitter<NIMTalkEvents> {
73
73
  */
74
74
  getAttachmentPathFromMsg(msg: IMMessage): string;
75
75
  /** 回复消息thread 聊天场景
76
- * @param msg 被回复消息的消息体
77
- * @param json_reply_msg 回复消息的消息体,可通过各种createxxxmessage接口创建
78
- * @param prg_cb 传进度的回调函数, 如果发送的消息里包含了文件资源,则通过此回调函数通知上传进度
76
+ * @param formerMsg 被回复消息的消息体
77
+ * @param replyMsg 回复消息的消息体,可通过各种createxxxmessage接口创建
78
+ * @param progressCb 传进度的回调函数, 如果发送的消息里包含了文件资源,则通过此回调函数通知上传进度
79
79
  * @return void 无返回值
80
80
  */
81
- replyMessage(msg: IMMessage, json_reply_msg: string): void;
81
+ replyMessage(formerMsg: IMMessage, replyMsg: IMMessage, progressCb: FileUpPrgCallback): void;
82
82
  /** (全局回调)注册消息过滤接口 (堵塞线程,谨慎使用,避免耗时行为)
83
83
  * @param[in] filter 过滤接口
84
84
  * @param[in] json_extension json扩展参数(备用,目前不需要)
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
2
  import { IMMessage } from '../nim_def/msglog_def';
3
- import { NIMTeamAPI, TeamInfo, TeamEventCallback, QueryAllMyTeamsCallback, QueryAllMyTeamsInfoCallback, QueryTeamMyAllMemberInfosCallback, QueryTeamMembersCallback, QueryTeamMemberCallback, QueryTeamInfoCallback, QueryTeamMembersOnlineCallback, TeamMsgAckReadCallback, QueryTeamMembersInvitorCallback, QueryTeamsInfoCallback, UpdateTInfoLocalCallback, GetTeamInfoBatchSFTransCallback, GetTeamInfoListCallback, TeamMemberProperty, TeamEvent } from '../nim_def/team_def';
3
+ import { NIMTeamAPI, TeamInfo, TeamEventCallback, QueryAllMyTeamsCallback, QueryAllMyTeamsInfoCallback, QueryTeamMyAllMemberInfosCallback, QueryTeamMembersCallback, QueryTeamMemberCallback, QueryTeamInfoCallback, QueryTeamMembersOnlineCallback, TeamMsgAckReadCallback, QueryTeamMembersInvitorCallback, QueryTeamsInfoCallback, UpdateTInfoLocalCallback, GetTeamInfoBatchSFTransCallback, GetTeamInfoListCallback, TeamMemberProperty, TeamEvent, TeamMemberRoleTypeSearchOption, TeamMemberSerachResult } from '../nim_def/team_def';
4
4
  import { NIMResCode } from '../nim_def/client_def';
5
5
  export declare interface NIMTeamEvents {
6
6
  /** 群事件 */
@@ -238,6 +238,20 @@ export declare class NIMTeam extends EventEmitter<NIMTeamEvents> {
238
238
  * </pre>
239
239
  */
240
240
  updateMyPropertyAsync(prop: TeamMemberProperty, cb: TeamEventCallback | null, jsonExtension: string): Promise<[TeamEvent] | null>;
241
+ /** @fn boolean addTeamMembersFollow(tid: string, account_ids: Array<string>, cb: TeamEventCallback)
242
+ * 添加群成员特别通知
243
+ * @param[in] tid 群组id
244
+ * @param[in] account_ids 群成员id
245
+ * @param[in] cb 添加群成员特别通知的回调函数
246
+ */
247
+ addTeamMembersFollow(tid: string, account_ids: Array<string>, cb: TeamEventCallback): Promise<[TeamEvent] | null>;
248
+ /** @fn boolean removeTeamMembersFollow(tid: string, account_ids: Array<string>, TeamEventCallback
249
+ * cb) 移除群成员特别通知
250
+ * @param[in] tid 群组id
251
+ * @param[in] account_ids 群成员id
252
+ * @param[in] cb 移除群成员特别通知的回调函数
253
+ */
254
+ removeTeamMembersFollow(tid: string, account_ids: Array<string>, cb: TeamEventCallback): Promise<[TeamEvent] | null>;
241
255
  /** 修改别人的群昵称
242
256
  * @param prop 群成员属性
243
257
  * @param jsonExtension json扩展参数(备用,目前不需要)
@@ -458,4 +472,10 @@ export declare class NIMTeam extends EventEmitter<NIMTeamEvents> {
458
472
  * </pre>
459
473
  */
460
474
  getTeaminfoList(tids: Array<string>, cb: GetTeamInfoListCallback | null): Promise<[NIMResCode, Array<TeamInfo>, Array<string>]>;
475
+ /** 根据成员类型获取群成员
476
+ * @param tid 群组id
477
+ * @param option 获取群成员选项
478
+ * @return boolean 检查参数如果不符合要求则返回失败
479
+ */
480
+ getTeamMemberList(tid: string, option: TeamMemberRoleTypeSearchOption): Promise<[TeamMemberSerachResult]>;
461
481
  }
@@ -74,4 +74,5 @@ export declare class NIMTool extends EventEmitter<NIMToolEvents> {
74
74
  * </pre>
75
75
  */
76
76
  filterClientAntispam(text: string, replaceString: string, libName: string, cb: FilterClientAntispamCallback | null): Promise<[boolean, NIMResCode, string]>;
77
+ parseStringToJsonObject(jsonString: string): object;
77
78
  }
@@ -26,7 +26,8 @@ export declare enum NIMClientType {
26
26
  kNIMClientTypePCWindows = 4 /** < PC Windows*/,
27
27
  kNIMClientTypeWeb = 16 /** < Web*/,
28
28
  kNIMClientTypeRestAPI = 32 /** < RestAPI*/,
29
- kNIMClientTypeMacOS = 64 /** < Mac*/
29
+ kNIMClientTypeMacOS = 64 /** < Mac*/,
30
+ kNIMClientTypeHarmonyOS = 65 /** < HarmonyOS */
30
31
  }
31
32
  /** @enum NIMResCode 返回的错误号(只定义需要客户端处理的) */
32
33
  export declare enum NIMResCode {
@@ -165,6 +166,8 @@ export interface SDKConfig {
165
166
  ,默认为false,开启后获取的缩略图为原格式,关闭后获取的缩略图为第一帧静态图 */
166
167
  client_antispam_?: boolean; /**< boolean 客户端反垃圾,默认为false,如需开启请提前咨询技术支持或销售 */
167
168
  team_msg_ack_?: boolean; /**< boolean 群消息已读功能开关, 默认为false,如需开启请提前咨询技术支持或销售 */
169
+ team_query_tinfo_override_by_local_?: boolean; /**< boolean 在线查询群组信息时是否使用本地数据对 member_valid 字段进行覆盖 */
170
+ team_sync_tlist_limit_?: number; /**< int 同步群列表数量限制,范围 100-2000,默认 2000 */
168
171
  need_update_lbs_befor_relogin_?: boolean; /**< boolean 在进行重新登录前是否先刷新一下lbs,对于切换网络的场景适用 */
169
172
  custom_client_type_?: number; /**< int, 自定义客户端类型字段,大于0 */
170
173
  /***********消息“已接收回执”发送配置 begin************/
@@ -116,6 +116,22 @@ export declare enum NIMMsglogSearchDirection {
116
116
  kForward = 0 /** < 以时间点为准向前搜索 */,
117
117
  kBackward = 1 /** < 以时间点为准向后搜索 */
118
118
  }
119
+ export declare enum NIMMsglogSearchSegmentEngine {
120
+ kSegmentEngineDefault = 0,
121
+ kSegmentEngineSimple = 1,
122
+ kSegmentEngineJiebaCutWithHMM = 2,
123
+ kSegmentEngineJiebaCutWithoutHMM = 3,
124
+ kSegmentEngineJiebaCutAll = 4,
125
+ kSegmentEngineJiebaCutForSearch = 5,
126
+ kSegmentEngineJiebaCutHMM = 6
127
+ }
128
+ export declare enum NIMBuildingMsglogIndexesCompleteReason {
129
+ kBuildingMsglogIndexesCompleted = 0,
130
+ kBuildingMsglogIndexesCanceled = 1,
131
+ kBuildingMsglogIndexesError = 2,
132
+ kBuildingMsglogIndexesFullDisk = 3,
133
+ kBuildingMsglogIndexesInProgress = 4
134
+ }
119
135
  /** @enum NIMMsglogQuerySource 消息历史查询来源 */
120
136
  export declare enum NIMMsglogQuerySource {
121
137
  kNIMMsglogQuerySourceLocal = 0 /** < 本地查询*/,
@@ -317,6 +333,17 @@ export interface GetMessagesResult {
317
333
  reliable_?: boolean; /**< 结果是否可信:例如当查询范围不在可信时间段内, 但远端请求失败时, 返回的本地结果可能不完整 */
318
334
  messages_?: Array<IMMessage>; /**< 历史消息列表 */
319
335
  }
336
+ export interface QueryMsgByKeywordParam {
337
+ keyword_: string; /**< 要查询的关键字 */
338
+ account_id_?: string; /**< 查询id,对方的account id或者群组tid */
339
+ to_type_?: NIMSessionType; /**< enum 会话类型,双人0,群组1 (nim_msglog_def.h) */
340
+ type_: Array<NIMMessageType>; /**< array 要获取的消息类型,默认只有文本类消息,可自行扩充其他类型消息,除通知类消息不受支持外,其他类型消息(包括自定义消息)均可检索 */
341
+ limit_count_?: number; /**< number 本次查询的消息条数上限 */
342
+ from_time_?: number; /**< number 起始时间点,单位:毫秒 */
343
+ end_time_?: number; /**< number 结束时间点,单位:毫秒 */
344
+ direction_?: NIMMsglogSearchDirection; /**< enum 查询方向 */
345
+ segment_engine_?: NIMMsglogSearchSegmentEngine; /**< enum 分段引擎 */
346
+ }
320
347
  export type QueryMsgCallback = (rescode: NIMResCode, id: string, to_type: NIMSessionType, result: QueryMsglogResult) => void;
321
348
  export type GetMessagesDynamicallyCallback = (result: GetMessagesResult) => void;
322
349
  export type QuerySingleMsgCallback = (rescode: NIMResCode, id: string, msg: IMMessage) => void;
@@ -330,10 +357,13 @@ export type MessageStatusChangedCallback = (result: MessageStatusChangedResult)
330
357
  export type ImportDbPrgCallback = (importedCount: number, totalCount: number) => void;
331
358
  export type DeleteHistoryOnLineAsyncCallback = (rescode: NIMResCode, accid: string) => void;
332
359
  export type DeleteHistoryOnLineAsyncExCallback = (rescode: NIMResCode, accid: string, to_type: number, timestamp: number, jsonExtension: string) => void;
333
- export type QueryMessageIsThreadRootCallback = (rescode: NIMResCode, client_id: string, is_root: boolean) => void;
360
+ export type QueryMessageIsThreadRootCallback = (rescode: NIMResCode, client_id: string, is_root: boolean, reply_count: number) => void;
334
361
  export type QueryMessageOnlineCallback = (rescode: NIMResCode, client_id: string, msg: IMMessage) => void;
335
362
  export type QueryThreadHistoryMsgCallback = (rescode: NIMResCode, root_msg: IMMessage, total: number, last_msg_time: number, msg_array: Array<IMMessage>) => void;
336
363
  export type FullTextSearchOnlineAsyncCallback = (rescode: NIMResCode, result: QueryMsglogResult) => void;
364
+ export type IsMessageIndexEstablishedCallback = (is_established: boolean) => void;
365
+ export type BuildMsglogIndexesProgress = (total: number, built_count: number) => void;
366
+ export type BuildMsglogIndexesComplete = (reason: NIMBuildingMsglogIndexesCompleteReason, message: string) => void;
337
367
  export interface NIMMsgLogAPI {
338
368
  InitEventHandlers(): void;
339
369
  QueryMsgByIDAysnc(clientMsgId: string, cb: QuerySingleMsgCallback | null, jsonExtension: string): boolean;
@@ -369,5 +399,10 @@ export interface NIMMsgLogAPI {
369
399
  QueryMessageIsThreadRoot(client_id: string, cb: QueryMessageIsThreadRootCallback | null): void;
370
400
  QueryMessageOnline(param: QueryMsgAsyncParam, cb: QueryMessageOnlineCallback | null): void;
371
401
  QueryThreadHistoryMsg(msg: IMMessage, param: QueryThreadHistoryMsgAsyncParam, cb: QueryThreadHistoryMsgCallback | null): void;
402
+ QueryLocalThreadHistoryMsg(msg: IMMessage, cb: QueryMsgCallback | null): void;
372
403
  FullTextSearchOnlineAsync(param: FullTextSearchOnlineAsyncParam, cb: FullTextSearchOnlineAsyncCallback | null): void;
404
+ QueryMessagesByKeywordAsync(param: QueryMsgByKeywordParam, cb: QueryMsgCallback | null): void;
405
+ IsMessageIndexEstablished(cb: IsMessageIndexEstablishedCallback | null): void;
406
+ BuildMsglogIndexes(page_size: number, progress: BuildMsglogIndexesProgress | null, complete: BuildMsglogIndexesComplete | null): void;
407
+ CancelMsglogIndexesBuilding(): void;
373
408
  }