node-nim 9.14.2 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +7 -1
  2. package/dist/loader.js +35 -35
  3. package/dist/nim/client.js +184 -184
  4. package/dist/nim/client.js.map +1 -1
  5. package/dist/nim/data_sync.js +19 -19
  6. package/dist/nim/friend.js +150 -150
  7. package/dist/nim/global.js +131 -131
  8. package/dist/nim/msglog.js +687 -687
  9. package/dist/nim/nos.js +216 -180
  10. package/dist/nim/nos.js.map +1 -1
  11. package/dist/nim/online_session.js +85 -85
  12. package/dist/nim/pass_through_proxy.js +39 -39
  13. package/dist/nim/plugin.js +65 -65
  14. package/dist/nim/session.js +392 -392
  15. package/dist/nim/subscribe_event.js +142 -142
  16. package/dist/nim/super_team.js +592 -592
  17. package/dist/nim/sysmsg.js +194 -194
  18. package/dist/nim/talk.js +209 -209
  19. package/dist/nim/talk.js.map +1 -1
  20. package/dist/nim/talkex.js +191 -191
  21. package/dist/nim/team.js +818 -818
  22. package/dist/nim/tool.js +119 -119
  23. package/dist/nim/user.js +201 -201
  24. package/dist/nim_def/client_def.js +245 -245
  25. package/dist/nim_def/client_def.js.map +1 -1
  26. package/dist/nim_def/data_sync_def.js +20 -20
  27. package/dist/nim_def/doc_trans_def.js +16 -16
  28. package/dist/nim_def/friend_def.js +37 -37
  29. package/dist/nim_def/global_def.js +39 -39
  30. package/dist/nim_def/msglog_def.js +148 -148
  31. package/dist/nim_def/nos_def.js +16 -16
  32. package/dist/nim_def/online_session_def.js +2 -2
  33. package/dist/nim_def/pass_through_proxy_def.js +10 -10
  34. package/dist/nim_def/plugin_def.js +2 -2
  35. package/dist/nim_def/session_def.js +26 -26
  36. package/dist/nim_def/subscribe_event_def.js +52 -52
  37. package/dist/nim_def/super_team_def.js +64 -64
  38. package/dist/nim_def/sysmsg_def.js +28 -28
  39. package/dist/nim_def/talk_def.js +2 -2
  40. package/dist/nim_def/talkex_def.js +2 -2
  41. package/dist/nim_def/team_def.js +69 -69
  42. package/dist/nim_def/tool_def.js +11 -11
  43. package/dist/nim_def/user_def.js +22 -22
  44. package/dist/node-nim.js +171 -171
  45. package/dist/node-nim.js.map +1 -1
  46. package/dist/qchat/attachment.js +63 -63
  47. package/dist/qchat/channel.js +314 -314
  48. package/dist/qchat/channel_category.js +187 -187
  49. package/dist/qchat/instance.js +77 -77
  50. package/dist/qchat/message.js +285 -285
  51. package/dist/qchat/role.js +423 -423
  52. package/dist/qchat/server.js +453 -453
  53. package/dist/qchat/system_notification.js +74 -74
  54. package/dist/qchat_def/attachment_def.js +2 -2
  55. package/dist/qchat_def/channel_def.js +2 -2
  56. package/dist/qchat_def/instance_def.js +2 -2
  57. package/dist/qchat_def/message_def.js +2 -2
  58. package/dist/qchat_def/public_def.js +649 -649
  59. package/dist/qchat_def/public_def.js.map +1 -1
  60. package/dist/qchat_def/role_def.js +2 -2
  61. package/dist/qchat_def/server_def.js +2 -2
  62. package/dist/qchat_def/system_notification_def.js +2 -2
  63. package/dist/v2/v2_nim_chatroom_client.js +135 -0
  64. package/dist/v2/v2_nim_chatroom_client.js.map +1 -0
  65. package/dist/v2/v2_nim_chatroom_service.js +244 -0
  66. package/dist/v2/v2_nim_chatroom_service.js.map +1 -0
  67. package/dist/v2/v2_nim_client.js +138 -0
  68. package/dist/v2/v2_nim_client.js.map +1 -0
  69. package/dist/v2/v2_nim_conversation_group_service.js +116 -0
  70. package/dist/v2/v2_nim_conversation_group_service.js.map +1 -0
  71. package/dist/v2/v2_nim_conversation_service.js +236 -0
  72. package/dist/v2/v2_nim_conversation_service.js.map +1 -0
  73. package/dist/v2/v2_nim_friend_service.js +128 -0
  74. package/dist/v2/v2_nim_friend_service.js.map +1 -0
  75. package/dist/v2/v2_nim_login_service.js +119 -123
  76. package/dist/v2/v2_nim_login_service.js.map +1 -1
  77. package/dist/v2/v2_nim_message_service.js +382 -0
  78. package/dist/v2/v2_nim_message_service.js.map +1 -0
  79. package/dist/v2/v2_nim_notification_service.js +30 -0
  80. package/dist/v2/v2_nim_notification_service.js.map +1 -0
  81. package/dist/v2/v2_nim_setting_service.js +86 -0
  82. package/dist/v2/v2_nim_setting_service.js.map +1 -0
  83. package/dist/v2/v2_nim_storage_service.js +58 -0
  84. package/dist/v2/v2_nim_storage_service.js.map +1 -0
  85. package/dist/v2/v2_nim_team_service.js +360 -0
  86. package/dist/v2/v2_nim_team_service.js.map +1 -0
  87. package/dist/v2/v2_nim_user_service.js +76 -0
  88. package/dist/v2/v2_nim_user_service.js.map +1 -0
  89. package/dist/v2/v2_nim_utilities.js +276 -0
  90. package/dist/v2/v2_nim_utilities.js.map +1 -0
  91. package/dist/v2_def/v2_nim_callback_def.js +2 -2
  92. package/dist/v2_def/v2_nim_enum_def.js +1087 -325
  93. package/dist/v2_def/v2_nim_enum_def.js.map +1 -1
  94. package/dist/v2_def/v2_nim_struct_def.js +2 -2
  95. package/package.json +74 -74
  96. package/script/download-sdk.js +78 -78
  97. package/script/exec-node-nim-tester.js +17 -17
  98. package/script/publish-to-netease-npm.js +3 -2
  99. package/types/loader.d.ts +2 -2
  100. package/types/nim/client.d.ts +123 -123
  101. package/types/nim/data_sync.d.ts +12 -12
  102. package/types/nim/friend.d.ts +82 -82
  103. package/types/nim/global.d.ts +69 -69
  104. package/types/nim/msglog.d.ts +392 -392
  105. package/types/nim/nos.d.ts +118 -118
  106. package/types/nim/online_session.d.ts +44 -44
  107. package/types/nim/pass_through_proxy.d.ts +24 -24
  108. package/types/nim/plugin.d.ts +39 -39
  109. package/types/nim/session.d.ts +212 -212
  110. package/types/nim/subscribe_event.d.ts +87 -87
  111. package/types/nim/super_team.d.ts +331 -331
  112. package/types/nim/sysmsg.d.ts +105 -105
  113. package/types/nim/talk.d.ts +94 -94
  114. package/types/nim/talkex.d.ts +95 -95
  115. package/types/nim/team.d.ts +461 -461
  116. package/types/nim/tool.d.ts +77 -77
  117. package/types/nim/user.d.ts +111 -111
  118. package/types/nim_def/client_def.d.ts +284 -284
  119. package/types/nim_def/data_sync_def.d.ts +19 -19
  120. package/types/nim_def/doc_trans_def.d.ts +11 -11
  121. package/types/nim_def/friend_def.d.ts +65 -65
  122. package/types/nim_def/global_def.d.ts +62 -62
  123. package/types/nim_def/msglog_def.d.ts +373 -373
  124. package/types/nim_def/nos_def.d.ts +72 -72
  125. package/types/nim_def/online_session_def.d.ts +34 -34
  126. package/types/nim_def/pass_through_proxy_def.d.ts +13 -13
  127. package/types/nim_def/plugin_def.d.ts +8 -8
  128. package/types/nim_def/session_def.d.ts +114 -114
  129. package/types/nim_def/subscribe_event_def.d.ts +83 -83
  130. package/types/nim_def/super_team_def.d.ts +144 -137
  131. package/types/nim_def/sysmsg_def.d.ts +70 -70
  132. package/types/nim_def/talk_def.d.ts +96 -96
  133. package/types/nim_def/talkex_def.d.ts +112 -112
  134. package/types/nim_def/team_def.d.ts +167 -167
  135. package/types/nim_def/tool_def.d.ts +28 -28
  136. package/types/nim_def/user_def.d.ts +59 -59
  137. package/types/node-nim.d.ts +90 -93
  138. package/types/qchat/attachment.d.ts +40 -40
  139. package/types/qchat/channel.d.ts +139 -139
  140. package/types/qchat/channel_category.d.ts +82 -82
  141. package/types/qchat/instance.d.ts +46 -46
  142. package/types/qchat/message.d.ts +128 -128
  143. package/types/qchat/role.d.ts +166 -166
  144. package/types/qchat/server.d.ts +198 -198
  145. package/types/qchat/system_notification.d.ts +39 -39
  146. package/types/qchat_def/attachment_def.d.ts +71 -71
  147. package/types/qchat_def/channel_def.d.ts +643 -643
  148. package/types/qchat_def/instance_def.d.ts +214 -214
  149. package/types/qchat_def/message_def.d.ts +565 -565
  150. package/types/qchat_def/public_def.d.ts +754 -754
  151. package/types/qchat_def/role_def.d.ts +413 -413
  152. package/types/qchat_def/server_def.d.ts +529 -529
  153. package/types/qchat_def/system_notification_def.d.ts +172 -172
  154. package/types/v2/v2_nim_chatroom_client.d.ts +73 -0
  155. package/types/v2/v2_nim_chatroom_service.d.ts +114 -0
  156. package/types/v2/v2_nim_client.d.ts +75 -0
  157. package/types/v2/v2_nim_conversation_group_service.d.ts +54 -0
  158. package/types/v2/v2_nim_conversation_service.d.ts +110 -0
  159. package/types/v2/v2_nim_friend_service.d.ts +58 -0
  160. package/types/v2/v2_nim_login_service.d.ts +80 -96
  161. package/types/v2/v2_nim_message_service.d.ts +143 -0
  162. package/types/v2/v2_nim_notification_service.d.ts +18 -0
  163. package/types/v2/v2_nim_setting_service.d.ts +43 -0
  164. package/types/v2/v2_nim_storage_service.d.ts +28 -0
  165. package/types/v2/v2_nim_team_service.d.ts +184 -0
  166. package/types/v2/v2_nim_user_service.d.ts +34 -0
  167. package/types/v2/v2_nim_utilities.d.ts +168 -0
  168. package/types/v2_def/v2_nim_callback_def.d.ts +7 -20
  169. package/types/v2_def/v2_nim_enum_def.d.ts +1009 -300
  170. package/types/v2_def/v2_nim_struct_def.d.ts +1539 -338
  171. package/dist/chatroom/chatroom.js +0 -263
  172. package/dist/chatroom/chatroom.js.map +0 -1
  173. package/dist/chatroom_def/chatroom_def.js +0 -120
  174. package/dist/chatroom_def/chatroom_def.js.map +0 -1
  175. package/dist/v2/v2_nim_instance.js +0 -44
  176. package/dist/v2/v2_nim_instance.js.map +0 -1
  177. package/types/chatroom/chatroom.d.ts +0 -55
  178. package/types/chatroom_def/chatroom_def.d.ts +0 -448
  179. package/types/v2/v2_nim_instance.d.ts +0 -25
@@ -1,105 +1,105 @@
1
- import { EventEmitter } from 'eventemitter3';
2
- import { NIMSysMsgAPI, SysMessage, NIMSysMsgStatus, NIMSysMsgType, NotifySingleSysmsgCallback, NotifySysmsgResCallback, QuerySysmsgCallback } from '../nim_def/sysmsg_def';
3
- import { SendMessageArc } from '../nim_def/talk_def';
4
- import { NIMResCode } from '../nim_def/client_def';
5
- export declare interface NIMSysMsgEvents {
6
- /** 系统通知 */
7
- receiveSystemMsg: [SysMessage];
8
- /** 发送透传消息回调 */
9
- sendCustomSystemMsg: [SendMessageArc];
10
- }
11
- export declare class NIMSysMsg extends EventEmitter<NIMSysMsgEvents> {
12
- sysmsg: NIMSysMsgAPI;
13
- constructor();
14
- /** 注册全局回调 */
15
- initEventHandlers(): void;
16
- /** 发送自定义通知消息
17
- * @param json_msg 消息体Json, 可以通过CreateCustomNotificationMsg方法自动创建
18
- * @return void 无返回值
19
- */
20
- sendCustomNotificationMsg(msg: SysMessage): void;
21
- /** 查询本地系统消息
22
- * @param limit_count 一次查询数量,建议20
23
- * @param last_time 上次查询最后一条消息的时间戳
24
- * @param jsonExtension json扩展参数(备用,目前不需要)
25
- * @param cb 查询本地系统消息的回调函数
26
- * @return boolean 检查参数如果不符合要求则返回失败
27
- */
28
- queryMsgAsync(limit_count: number, last_time: number, cb: QuerySysmsgCallback | null, jsonExtension: string): Promise<[number, number, Array<SysMessage>] | null>;
29
- /** 查询未读消息数
30
- * @param jsonExtension json扩展参数(备用,目前不需要)
31
- * @param cb 查询未读消息数的回调函数
32
- * @return void 无返回值
33
- * @note
34
- * <pre>
35
- * 200:成功
36
- * </pre>
37
- */
38
- queryUnreadCount(cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number]>;
39
- /** 设置消息状态
40
- * @param msg_id 消息id
41
- * @param status 消息状态
42
- * @param jsonExtension json扩展参数(备用,目前不需要)
43
- * @param cb 设置消息状态的回调函数
44
- * @return void 无返回值
45
- * @note
46
- * <pre>
47
- * 200:成功
48
- * </pre>
49
- */
50
- setStatusAsync(msg_id: string, status: NIMSysMsgStatus, cb: NotifySingleSysmsgCallback | null, jsonExtension: string): Promise<[NIMResCode, number, number] | null>;
51
- /** 设置全部消息为已读
52
- * @param jsonExtension json扩展参数(备用,目前不需要)
53
- * @param cb 设置全部消息为已读的回调函数
54
- * @return void 无返回值
55
- * @note
56
- * <pre>
57
- * 200:成功
58
- * </pre>
59
- */
60
- readAllAsync(cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number]>;
61
- /** 删除消息
62
- * @param msg_id 消息id
63
- * @param jsonExtension json扩展参数(备用,目前不需要)
64
- * @param cb 删除消息的回调函数
65
- * @return boolean 检查参数如果不符合要求则返回失败
66
- * @note
67
- * <pre>
68
- * 200:成功
69
- * </pre>
70
- */
71
- deleteAsync(msg_id: string, cb: NotifySingleSysmsgCallback | null, jsonExtension: string): Promise<[NIMResCode, number, number] | null>;
72
- /** 全部删除
73
- * @param jsonExtension json扩展参数(备用,目前不需要)
74
- * @param cb 删除消息的回调函数
75
- * @return void 无返回值
76
- * @note
77
- * <pre>
78
- * 200:成功
79
- * </pre>
80
- */
81
- deleteAllAsync(cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number] | null>;
82
- /** 按类型设置系统通知状态
83
- * @param type 类型
84
- * @param status 状态
85
- * @param jsonExtension json扩展参数(备用,目前不需要)
86
- * @param cb 回调函数
87
- * @return void 无返回值
88
- * @note
89
- * <pre>
90
- * 200:成功
91
- * </pre>
92
- */
93
- setStatusByTypeAsync(type: NIMSysMsgType, status: NIMSysMsgStatus, cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number] | null>;
94
- /** 按类型删除系统通知
95
- * @param type 类型
96
- * @param jsonExtension json扩展参数(备用,目前不需要)
97
- * @param cb 回调函数
98
- * @return void 无返回值
99
- * @note
100
- * <pre>
101
- * 200:成功
102
- * </pre>
103
- */
104
- deleteByTypeAsync(type: NIMSysMsgType, cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number] | null>;
105
- }
1
+ import { EventEmitter } from 'eventemitter3';
2
+ import { NIMSysMsgAPI, SysMessage, NIMSysMsgStatus, NIMSysMsgType, NotifySingleSysmsgCallback, NotifySysmsgResCallback, QuerySysmsgCallback } from '../nim_def/sysmsg_def';
3
+ import { SendMessageArc } from '../nim_def/talk_def';
4
+ import { NIMResCode } from '../nim_def/client_def';
5
+ export declare interface NIMSysMsgEvents {
6
+ /** 系统通知 */
7
+ receiveSystemMsg: [SysMessage];
8
+ /** 发送透传消息回调 */
9
+ sendCustomSystemMsg: [SendMessageArc];
10
+ }
11
+ export declare class NIMSysMsg extends EventEmitter<NIMSysMsgEvents> {
12
+ sysmsg: NIMSysMsgAPI;
13
+ constructor();
14
+ /** 注册全局回调 */
15
+ initEventHandlers(): void;
16
+ /** 发送自定义通知消息
17
+ * @param json_msg 消息体Json, 可以通过CreateCustomNotificationMsg方法自动创建
18
+ * @return void 无返回值
19
+ */
20
+ sendCustomNotificationMsg(msg: SysMessage): void;
21
+ /** 查询本地系统消息
22
+ * @param limit_count 一次查询数量,建议20
23
+ * @param last_time 上次查询最后一条消息的时间戳
24
+ * @param jsonExtension json扩展参数(备用,目前不需要)
25
+ * @param cb 查询本地系统消息的回调函数
26
+ * @return boolean 检查参数如果不符合要求则返回失败
27
+ */
28
+ queryMsgAsync(limit_count: number, last_time: number, cb: QuerySysmsgCallback | null, jsonExtension: string): Promise<[number, number, Array<SysMessage>] | null>;
29
+ /** 查询未读消息数
30
+ * @param jsonExtension json扩展参数(备用,目前不需要)
31
+ * @param cb 查询未读消息数的回调函数
32
+ * @return void 无返回值
33
+ * @note
34
+ * <pre>
35
+ * 200:成功
36
+ * </pre>
37
+ */
38
+ queryUnreadCount(cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number]>;
39
+ /** 设置消息状态
40
+ * @param msg_id 消息id
41
+ * @param status 消息状态
42
+ * @param jsonExtension json扩展参数(备用,目前不需要)
43
+ * @param cb 设置消息状态的回调函数
44
+ * @return void 无返回值
45
+ * @note
46
+ * <pre>
47
+ * 200:成功
48
+ * </pre>
49
+ */
50
+ setStatusAsync(msg_id: string, status: NIMSysMsgStatus, cb: NotifySingleSysmsgCallback | null, jsonExtension: string): Promise<[NIMResCode, number, number] | null>;
51
+ /** 设置全部消息为已读
52
+ * @param jsonExtension json扩展参数(备用,目前不需要)
53
+ * @param cb 设置全部消息为已读的回调函数
54
+ * @return void 无返回值
55
+ * @note
56
+ * <pre>
57
+ * 200:成功
58
+ * </pre>
59
+ */
60
+ readAllAsync(cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number]>;
61
+ /** 删除消息
62
+ * @param msg_id 消息id
63
+ * @param jsonExtension json扩展参数(备用,目前不需要)
64
+ * @param cb 删除消息的回调函数
65
+ * @return boolean 检查参数如果不符合要求则返回失败
66
+ * @note
67
+ * <pre>
68
+ * 200:成功
69
+ * </pre>
70
+ */
71
+ deleteAsync(msg_id: string, cb: NotifySingleSysmsgCallback | null, jsonExtension: string): Promise<[NIMResCode, number, number] | null>;
72
+ /** 全部删除
73
+ * @param jsonExtension json扩展参数(备用,目前不需要)
74
+ * @param cb 删除消息的回调函数
75
+ * @return void 无返回值
76
+ * @note
77
+ * <pre>
78
+ * 200:成功
79
+ * </pre>
80
+ */
81
+ deleteAllAsync(cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number] | null>;
82
+ /** 按类型设置系统通知状态
83
+ * @param type 类型
84
+ * @param status 状态
85
+ * @param jsonExtension json扩展参数(备用,目前不需要)
86
+ * @param cb 回调函数
87
+ * @return void 无返回值
88
+ * @note
89
+ * <pre>
90
+ * 200:成功
91
+ * </pre>
92
+ */
93
+ setStatusByTypeAsync(type: NIMSysMsgType, status: NIMSysMsgStatus, cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number] | null>;
94
+ /** 按类型删除系统通知
95
+ * @param type 类型
96
+ * @param jsonExtension json扩展参数(备用,目前不需要)
97
+ * @param cb 回调函数
98
+ * @return void 无返回值
99
+ * @note
100
+ * <pre>
101
+ * 200:成功
102
+ * </pre>
103
+ */
104
+ deleteByTypeAsync(type: NIMSysMsgType, cb: NotifySysmsgResCallback | null, jsonExtension: string): Promise<[NIMResCode, number] | null>;
105
+ }
@@ -1,94 +1,94 @@
1
- import { EventEmitter } from 'eventemitter3';
2
- import { IMMessage, MessageSetting, NIMMessageType } from '../nim_def/msglog_def';
3
- import { BroadcastMessage, FileUpPrgCallback, IMAudio, IMFile, IMImage, IMLocation, IMVideo, MessageFilterCallback, NIMTalkAPI, RecallMsgNotify, RecallMsgsCallback, SendMessageArc, TeamNotificationFilterCallback } from '../nim_def/talk_def';
4
- import { NIMResCode } from '../nim_def/client_def';
5
- import { NIMSessionType } from 'ts/node-nim';
6
- export declare interface NIMTalkEvents {
7
- /** 发送消息回调 */
8
- sendMsg: [SendMessageArc];
9
- /** 接收消息 */
10
- receiveMsg: [IMMessage];
11
- /** 批量接收消息,如离线/漫游消息 */
12
- receiveMsgs: [Array<IMMessage>];
13
- /** 消息撤回通知 */
14
- recallMsgs: [number, Array<RecallMsgNotify>];
15
- /** 接收广播消息 */
16
- receiveBroadcastMsg: [BroadcastMessage];
17
- /** 批量接收广播消息 */
18
- receiveBroadcastMsgs: [Array<BroadcastMessage>];
19
- }
20
- export declare class NIMTalk extends EventEmitter<NIMTalkEvents> {
21
- talk: NIMTalkAPI;
22
- constructor();
23
- /** 注册全局回调 */
24
- initEventHandlers(): void;
25
- /** 发送消息
26
- * @param json_msg 消息体Json字符串,可以通过CreateXXXMessage方法自动创建
27
- * @param jsonExtension json扩展参数(备用,目前不需要)
28
- * @param pcb 上传进度的回调函数, 如果发送的消息里包含了文件资源,则通过此回调函数通知上传进度
29
- * @return void 无返回值
30
- */
31
- sendMsg(msg: IMMessage, jsonExtension: string, progressCb: FileUpPrgCallback): void;
32
- /** 停止正在发送中的消息(目前只支持发送文件消息时的终止)
33
- * @param client_msg_id 停止发送的消息客户端id
34
- * @param type 停止发送的消息类型
35
- * @param jsonExtension json扩展参数(备用,目前不需要)
36
- * @return void 无返回值
37
- */
38
- stopSendMsg(clientMsgId: string, type: NIMMessageType, jsonExtension: string): void;
39
- /** 撤回消息
40
- * @param msg 消息
41
- * @param notify_msg 自定义通知消息
42
- * @param cb 回调
43
- * @param param 额外的参数,包含apnstext、pushpayload、jsonExtension、env_config、user_data
44
- * @note
45
- * <pre>
46
- * 200:成功
47
- * 414:参数错误
48
- * 508:撤回时间超过配制有效期,默认是2分钟
49
- * 10414:本地错误码,参数错误
50
- * 10508:本地错误码,超过配置有效期或者所需参数不存在
51
- * </pre>
52
- */
53
- recallMsg(msg: IMMessage, notify_msg: string, cb: RecallMsgsCallback | null, apnstext: string, pushpayloadconst: string, jsonExtension: string): Promise<[NIMResCode, Array<RecallMsgNotify>]>;
54
- /** 创建文本消息 */
55
- createTextMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, content: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
56
- /** 创建文件消息 */
57
- createFileMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, file: IMFile, file_path: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
58
- /** 创建图片消息 */
59
- createImageMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, image: IMImage, file_path: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
60
- /** 创建语音消息 */
61
- createAudioMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, audio: IMAudio, file_path: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
62
- /** 创建视频消息 */
63
- createVideoMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, video: IMVideo, file_path: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
64
- /** 创建位置消息 */
65
- createLocationMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, location: IMLocation, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
66
- /** 创建提醒消息 */
67
- createTipMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, tip: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
68
- /** 创建转发消息 */
69
- createRetweetMessage(sourceMessage: IMMessage, client_msg_id: string, session_type: NIMSessionType, receiver_id: string, msg_setting: MessageSetting, timetag: number): IMMessage;
70
- /** 从消息体中获取附件(图片、语音、视频等)的本地路径
71
- * @param msg 消息
72
- * @return string 消息如果有附件,不管是否已下载,返回附件的本地路径;消息如果没有附件,返回空字符串。
73
- */
74
- getAttachmentPathFromMsg(msg: IMMessage): string;
75
- /** 回复消息thread 聊天场景
76
- * @param msg 被回复消息的消息体
77
- * @param json_reply_msg 回复消息的消息体,可通过各种createxxxmessage接口创建
78
- * @param prg_cb 传进度的回调函数, 如果发送的消息里包含了文件资源,则通过此回调函数通知上传进度
79
- * @return void 无返回值
80
- */
81
- replyMessage(msg: IMMessage, json_reply_msg: string): void;
82
- /** (全局回调)注册消息过滤接口 (堵塞线程,谨慎使用,避免耗时行为)
83
- * @param[in] filter 过滤接口
84
- * @param[in] json_extension json扩展参数(备用,目前不需要)
85
- * @return void 无返回值
86
- */
87
- regMessageFilter(cb: MessageFilterCallback | null, jsonExtension: string): void;
88
- /** (全局回调)注册群通知过滤接口 (堵塞线程,谨慎使用,避免耗时行为)
89
- * @param[in] json_extension json扩展参数(备用,目前不需要)
90
- * @param[in] filter 过滤接口
91
- * @return void 无返回值
92
- */
93
- regTeamNotificationFilter(cb: TeamNotificationFilterCallback | null, jsonExtension: string): void;
94
- }
1
+ import { EventEmitter } from 'eventemitter3';
2
+ import { IMMessage, MessageSetting, NIMMessageType } from '../nim_def/msglog_def';
3
+ import { BroadcastMessage, FileUpPrgCallback, IMAudio, IMFile, IMImage, IMLocation, IMVideo, MessageFilterCallback, NIMTalkAPI, RecallMsgNotify, RecallMsgsCallback, SendMessageArc, TeamNotificationFilterCallback } from '../nim_def/talk_def';
4
+ import { NIMResCode } from '../nim_def/client_def';
5
+ import { NIMSessionType } from 'ts/node-nim';
6
+ export declare interface NIMTalkEvents {
7
+ /** 发送消息回调 */
8
+ sendMsg: [SendMessageArc];
9
+ /** 接收消息 */
10
+ receiveMsg: [IMMessage];
11
+ /** 批量接收消息,如离线/漫游消息 */
12
+ receiveMsgs: [Array<IMMessage>];
13
+ /** 消息撤回通知 */
14
+ recallMsgs: [number, Array<RecallMsgNotify>];
15
+ /** 接收广播消息 */
16
+ receiveBroadcastMsg: [BroadcastMessage];
17
+ /** 批量接收广播消息 */
18
+ receiveBroadcastMsgs: [Array<BroadcastMessage>];
19
+ }
20
+ export declare class NIMTalk extends EventEmitter<NIMTalkEvents> {
21
+ talk: NIMTalkAPI;
22
+ constructor();
23
+ /** 注册全局回调 */
24
+ initEventHandlers(): void;
25
+ /** 发送消息
26
+ * @param json_msg 消息体Json字符串,可以通过CreateXXXMessage方法自动创建
27
+ * @param jsonExtension json扩展参数(备用,目前不需要)
28
+ * @param pcb 上传进度的回调函数, 如果发送的消息里包含了文件资源,则通过此回调函数通知上传进度
29
+ * @return void 无返回值
30
+ */
31
+ sendMsg(msg: IMMessage, jsonExtension: string, progressCb: FileUpPrgCallback | null): void;
32
+ /** 停止正在发送中的消息(目前只支持发送文件消息时的终止)
33
+ * @param client_msg_id 停止发送的消息客户端id
34
+ * @param type 停止发送的消息类型
35
+ * @param jsonExtension json扩展参数(备用,目前不需要)
36
+ * @return void 无返回值
37
+ */
38
+ stopSendMsg(clientMsgId: string, type: NIMMessageType, jsonExtension: string): void;
39
+ /** 撤回消息
40
+ * @param msg 消息
41
+ * @param notify_msg 自定义通知消息
42
+ * @param cb 回调
43
+ * @param param 额外的参数,包含apnstext、pushpayload、jsonExtension、env_config、user_data
44
+ * @note
45
+ * <pre>
46
+ * 200:成功
47
+ * 414:参数错误
48
+ * 508:撤回时间超过配制有效期,默认是2分钟
49
+ * 10414:本地错误码,参数错误
50
+ * 10508:本地错误码,超过配置有效期或者所需参数不存在
51
+ * </pre>
52
+ */
53
+ recallMsg(msg: IMMessage, notify_msg: string, cb: RecallMsgsCallback | null, apnstext: string, pushpayloadconst: string, jsonExtension: string): Promise<[NIMResCode, Array<RecallMsgNotify>]>;
54
+ /** 创建文本消息 */
55
+ createTextMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, content: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
56
+ /** 创建文件消息 */
57
+ createFileMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, file: IMFile, file_path: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
58
+ /** 创建图片消息 */
59
+ createImageMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, image: IMImage, file_path: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
60
+ /** 创建语音消息 */
61
+ createAudioMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, audio: IMAudio, file_path: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
62
+ /** 创建视频消息 */
63
+ createVideoMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, video: IMVideo, file_path: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
64
+ /** 创建位置消息 */
65
+ createLocationMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, location: IMLocation, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
66
+ /** 创建提醒消息 */
67
+ createTipMessage(receiver_id: string, session_type: NIMSessionType, client_msg_id: string, tip: string, msg_setting: MessageSetting, timetag: number, sub_type: number): IMMessage;
68
+ /** 创建转发消息 */
69
+ createRetweetMessage(sourceMessage: IMMessage, client_msg_id: string, session_type: NIMSessionType, receiver_id: string, msg_setting: MessageSetting, timetag: number): IMMessage;
70
+ /** 从消息体中获取附件(图片、语音、视频等)的本地路径
71
+ * @param msg 消息
72
+ * @return string 消息如果有附件,不管是否已下载,返回附件的本地路径;消息如果没有附件,返回空字符串。
73
+ */
74
+ getAttachmentPathFromMsg(msg: IMMessage): string;
75
+ /** 回复消息thread 聊天场景
76
+ * @param msg 被回复消息的消息体
77
+ * @param json_reply_msg 回复消息的消息体,可通过各种createxxxmessage接口创建
78
+ * @param prg_cb 传进度的回调函数, 如果发送的消息里包含了文件资源,则通过此回调函数通知上传进度
79
+ * @return void 无返回值
80
+ */
81
+ replyMessage(msg: IMMessage, json_reply_msg: string): void;
82
+ /** (全局回调)注册消息过滤接口 (堵塞线程,谨慎使用,避免耗时行为)
83
+ * @param[in] filter 过滤接口
84
+ * @param[in] json_extension json扩展参数(备用,目前不需要)
85
+ * @return void 无返回值
86
+ */
87
+ regMessageFilter(cb: MessageFilterCallback | null, jsonExtension: string): void;
88
+ /** (全局回调)注册群通知过滤接口 (堵塞线程,谨慎使用,避免耗时行为)
89
+ * @param[in] json_extension json扩展参数(备用,目前不需要)
90
+ * @param[in] filter 过滤接口
91
+ * @return void 无返回值
92
+ */
93
+ regTeamNotificationFilter(cb: TeamNotificationFilterCallback | null, jsonExtension: string): void;
94
+ }
@@ -1,95 +1,95 @@
1
- import { EventEmitter } from 'eventemitter3';
2
- import { NIMTalkExAPI, CollectInfo, AddCollectCallback, RemoveCollectsParm, RemoveCollectsCallback, MatchCollectParm, UpdateCollectCallback, QueryCollectsParm, QueryCollectsCallback, QuickCommentInfo, AddQuickCommentCallback, RemoveQuickCommentParam, RemoveQuickCommentCallback, QueryQuickCommentsParam, QueryQuickCommentCallback, PinMessageInfo, PinMessageCallback, ModifyPinMessageParam, UnPinMessageCallback, UpdatePinMessageCallback, QueryPinMessageCallback, CollectInfoList, QueryQuickCommentsResponse, QueryAllPinMessageResponse } from '../nim_def/talkex_def';
3
- import { IMMessage } from '../nim_def/msglog_def';
4
- import { NIMResCode } from '../nim_def/client_def';
5
- export declare interface NIMTalkExEvents {
6
- /** 添加快捷回复 */
7
- addQuickComment: [number, QuickCommentInfo];
8
- /** 删除快捷回复 */
9
- removeQuickComment: [number, string];
10
- /** Pin消息 */
11
- pin: [number, string, number, PinMessageInfo];
12
- /** Unpin消息 */
13
- unpin: [number, string, number, string];
14
- /** 更新Pin消息 */
15
- updatePin: [number, string, number, PinMessageInfo];
16
- }
17
- export declare class NIMTalkEx extends EventEmitter<NIMTalkExEvents> {
18
- talkex: NIMTalkExAPI;
19
- constructor();
20
- /** 注册全局回调 */
21
- initEventHandlers(): void;
22
- /** Collect */
23
- /** 添加收藏
24
- * @param collect_info 收藏内容
25
- * @param cb 执行结果回调函数
26
- * @return void 无返回值
27
- */
28
- addCollect(collect_info: CollectInfo, cb: AddCollectCallback | null): Promise<[NIMResCode, CollectInfo]>;
29
- /** 批量删除收藏
30
- * @param collect_list 要删除的收藏列表
31
- * @param cb 执行结果回调函数
32
- * @return void 无返回值
33
- */
34
- removeCollects(collect_list: RemoveCollectsParm, cb: RemoveCollectsCallback | null): Promise<[NIMResCode, number]>;
35
- /** 更新收藏扩展字段
36
- * @param collect_match_param 根据收藏的id 与 create time去匹配收藏内容
37
- * @param ext 收藏的扩展字段内容
38
- * @param cb 执行结果回调函数
39
- * @return void 无返回值
40
- */
41
- updateCollectExt(collect_match_param: MatchCollectParm, ext: string, cb: UpdateCollectCallback | null): Promise<[NIMResCode, CollectInfo]>;
42
- /** 分页查询收藏列表
43
- * @param query_collect_list_param 查询参数
44
- * @param cb 执行结果回调函数
45
- * @return void 无返回值
46
- */
47
- queryCollectList(query_collect_list_param: QueryCollectsParm, cb: QueryCollectsCallback | null): Promise<[NIMResCode, number, CollectInfoList]>;
48
- /** 添加快捷回复
49
- * @param msg 被回复的消息
50
- * @param info 回复的内容及设置
51
- * @param cb 执行结果回调函数
52
- * @return void 无返回值
53
- */
54
- addQuickComment(msg: IMMessage, info: QuickCommentInfo, cb: AddQuickCommentCallback | null): Promise<[NIMResCode, QuickCommentInfo]>;
55
- /** 删除快捷回复
56
- * @param msg 被删除的消息
57
- * @param param 删除设置
58
- * @param cb 执行结果回调函数
59
- * @return void 无返回值
60
- */
61
- removeQuickComment(msg: IMMessage, param: RemoveQuickCommentParam, cb: RemoveQuickCommentCallback | null): Promise<[NIMResCode, string]>;
62
- /** 查询快捷回复
63
- * @param query_param 查询参数,一次最多只能查询20条消息的快捷回复
64
- * @param cb 执行结果回调函数
65
- * @return void 无返回值
66
- */
67
- queryQuickCommentList(query_param: QueryQuickCommentsParam, cb: QueryQuickCommentCallback | null): Promise<[NIMResCode, QueryQuickCommentsResponse]>;
68
- /** PinMsg */
69
- /** Pin某条消息
70
- * @param msg 要Pin的消息
71
- * @param pin_info Pin的内容 只需赋值 ext参数,其它参数SDK来补充
72
- * @param cb 执行结果回调函数
73
- * @return void 无返回值
74
- */
75
- addPinMessage(msg: IMMessage, info: PinMessageInfo, cb: PinMessageCallback | null): Promise<[NIMResCode, string, number, PinMessageInfo]>;
76
- /** 取消Pin某条消息
77
- * @param modify_param UnPin Message 参数
78
- * @param cb 执行结果回调函数
79
- * @return void 无返回值
80
- */
81
- unPinMessage(modify_param: ModifyPinMessageParam, cb: UnPinMessageCallback | null): Promise<[NIMResCode, string, number, string]>;
82
- /** 更新 Pin Message ext字段
83
- * @param modify_param 更新 Pin Message 参数
84
- * @param cb 执行结果回调函数
85
- * @return void 无返回值
86
- */
87
- updatePinMessage(modify_param: ModifyPinMessageParam, cb: UpdatePinMessageCallback | null): Promise<[NIMResCode, string, number, PinMessageInfo]>;
88
- /** 查询会话的所有 Pin Message
89
- * @param session 会话ID
90
- * @param to_type 会话类型
91
- * @param cb 执行结果回调函数
92
- * @return void 无返回值
93
- */
94
- queryAllPinMessage(session: string, to_type: number, cb: QueryPinMessageCallback | null): Promise<[NIMResCode, string, number, QueryAllPinMessageResponse]>;
95
- }
1
+ import { EventEmitter } from 'eventemitter3';
2
+ import { NIMTalkExAPI, CollectInfo, AddCollectCallback, RemoveCollectsParm, RemoveCollectsCallback, MatchCollectParm, UpdateCollectCallback, QueryCollectsParm, QueryCollectsCallback, QuickCommentInfo, AddQuickCommentCallback, RemoveQuickCommentParam, RemoveQuickCommentCallback, QueryQuickCommentsParam, QueryQuickCommentCallback, PinMessageInfo, PinMessageCallback, ModifyPinMessageParam, UnPinMessageCallback, UpdatePinMessageCallback, QueryPinMessageCallback, CollectInfoList, QueryQuickCommentsResponse, QueryAllPinMessageResponse } from '../nim_def/talkex_def';
3
+ import { IMMessage } from '../nim_def/msglog_def';
4
+ import { NIMResCode } from '../nim_def/client_def';
5
+ export declare interface NIMTalkExEvents {
6
+ /** 添加快捷回复 */
7
+ addQuickComment: [number, QuickCommentInfo];
8
+ /** 删除快捷回复 */
9
+ removeQuickComment: [number, string];
10
+ /** Pin消息 */
11
+ pin: [number, string, number, PinMessageInfo];
12
+ /** Unpin消息 */
13
+ unpin: [number, string, number, string];
14
+ /** 更新Pin消息 */
15
+ updatePin: [number, string, number, PinMessageInfo];
16
+ }
17
+ export declare class NIMTalkEx extends EventEmitter<NIMTalkExEvents> {
18
+ talkex: NIMTalkExAPI;
19
+ constructor();
20
+ /** 注册全局回调 */
21
+ initEventHandlers(): void;
22
+ /** Collect */
23
+ /** 添加收藏
24
+ * @param collect_info 收藏内容
25
+ * @param cb 执行结果回调函数
26
+ * @return void 无返回值
27
+ */
28
+ addCollect(collect_info: CollectInfo, cb: AddCollectCallback | null): Promise<[NIMResCode, CollectInfo]>;
29
+ /** 批量删除收藏
30
+ * @param collect_list 要删除的收藏列表
31
+ * @param cb 执行结果回调函数
32
+ * @return void 无返回值
33
+ */
34
+ removeCollects(collect_list: RemoveCollectsParm, cb: RemoveCollectsCallback | null): Promise<[NIMResCode, number]>;
35
+ /** 更新收藏扩展字段
36
+ * @param collect_match_param 根据收藏的id 与 create time去匹配收藏内容
37
+ * @param ext 收藏的扩展字段内容
38
+ * @param cb 执行结果回调函数
39
+ * @return void 无返回值
40
+ */
41
+ updateCollectExt(collect_match_param: MatchCollectParm, ext: string, cb: UpdateCollectCallback | null): Promise<[NIMResCode, CollectInfo]>;
42
+ /** 分页查询收藏列表
43
+ * @param query_collect_list_param 查询参数
44
+ * @param cb 执行结果回调函数
45
+ * @return void 无返回值
46
+ */
47
+ queryCollectList(query_collect_list_param: QueryCollectsParm, cb: QueryCollectsCallback | null): Promise<[NIMResCode, number, CollectInfoList]>;
48
+ /** 添加快捷回复
49
+ * @param msg 被回复的消息
50
+ * @param info 回复的内容及设置
51
+ * @param cb 执行结果回调函数
52
+ * @return void 无返回值
53
+ */
54
+ addQuickComment(msg: IMMessage, info: QuickCommentInfo, cb: AddQuickCommentCallback | null): Promise<[NIMResCode, QuickCommentInfo]>;
55
+ /** 删除快捷回复
56
+ * @param msg 被删除的消息
57
+ * @param param 删除设置
58
+ * @param cb 执行结果回调函数
59
+ * @return void 无返回值
60
+ */
61
+ removeQuickComment(msg: IMMessage, param: RemoveQuickCommentParam, cb: RemoveQuickCommentCallback | null): Promise<[NIMResCode, string]>;
62
+ /** 查询快捷回复
63
+ * @param query_param 查询参数,一次最多只能查询20条消息的快捷回复
64
+ * @param cb 执行结果回调函数
65
+ * @return void 无返回值
66
+ */
67
+ queryQuickCommentList(query_param: QueryQuickCommentsParam, cb: QueryQuickCommentCallback | null): Promise<[NIMResCode, QueryQuickCommentsResponse]>;
68
+ /** PinMsg */
69
+ /** Pin某条消息
70
+ * @param msg 要Pin的消息
71
+ * @param pin_info Pin的内容 只需赋值 ext参数,其它参数SDK来补充
72
+ * @param cb 执行结果回调函数
73
+ * @return void 无返回值
74
+ */
75
+ addPinMessage(msg: IMMessage, info: PinMessageInfo, cb: PinMessageCallback | null): Promise<[NIMResCode, string, number, PinMessageInfo]>;
76
+ /** 取消Pin某条消息
77
+ * @param modify_param UnPin Message 参数
78
+ * @param cb 执行结果回调函数
79
+ * @return void 无返回值
80
+ */
81
+ unPinMessage(modify_param: ModifyPinMessageParam, cb: UnPinMessageCallback | null): Promise<[NIMResCode, string, number, string]>;
82
+ /** 更新 Pin Message ext字段
83
+ * @param modify_param 更新 Pin Message 参数
84
+ * @param cb 执行结果回调函数
85
+ * @return void 无返回值
86
+ */
87
+ updatePinMessage(modify_param: ModifyPinMessageParam, cb: UpdatePinMessageCallback | null): Promise<[NIMResCode, string, number, PinMessageInfo]>;
88
+ /** 查询会话的所有 Pin Message
89
+ * @param session 会话ID
90
+ * @param to_type 会话类型
91
+ * @param cb 执行结果回调函数
92
+ * @return void 无返回值
93
+ */
94
+ queryAllPinMessage(session: string, to_type: number, cb: QueryPinMessageCallback | null): Promise<[NIMResCode, string, number, QueryAllPinMessageResponse]>;
95
+ }