node-nim 9.14.3 → 9.14.4

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 (127) hide show
  1. package/dist/chatroom/chatroom.js +262 -262
  2. package/dist/chatroom_def/chatroom_def.js +119 -119
  3. package/dist/loader.js +35 -35
  4. package/dist/nim/client.js +184 -184
  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 +180 -180
  10. package/dist/nim/online_session.js +85 -85
  11. package/dist/nim/pass_through_proxy.js +39 -39
  12. package/dist/nim/plugin.js +65 -65
  13. package/dist/nim/session.js +392 -392
  14. package/dist/nim/subscribe_event.js +142 -142
  15. package/dist/nim/super_team.js +651 -615
  16. package/dist/nim/super_team.js.map +1 -1
  17. package/dist/nim/sysmsg.js +194 -194
  18. package/dist/nim/talk.js +209 -209
  19. package/dist/nim/talkex.js +191 -191
  20. package/dist/nim/team.js +866 -830
  21. package/dist/nim/team.js.map +1 -1
  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/data_sync_def.js +20 -20
  26. package/dist/nim_def/doc_trans_def.js +16 -16
  27. package/dist/nim_def/friend_def.js +37 -37
  28. package/dist/nim_def/global_def.js +39 -39
  29. package/dist/nim_def/msglog_def.js +148 -148
  30. package/dist/nim_def/nos_def.js +16 -16
  31. package/dist/nim_def/online_session_def.js +2 -2
  32. package/dist/nim_def/pass_through_proxy_def.js +10 -10
  33. package/dist/nim_def/plugin_def.js +2 -2
  34. package/dist/nim_def/session_def.js +26 -26
  35. package/dist/nim_def/subscribe_event_def.js +52 -52
  36. package/dist/nim_def/super_team_def.js +71 -71
  37. package/dist/nim_def/sysmsg_def.js +28 -28
  38. package/dist/nim_def/talk_def.js +2 -2
  39. package/dist/nim_def/talkex_def.js +2 -2
  40. package/dist/nim_def/team_def.js +76 -76
  41. package/dist/nim_def/tool_def.js +11 -11
  42. package/dist/nim_def/user_def.js +22 -22
  43. package/dist/node-nim.js +171 -171
  44. package/dist/qchat/attachment.js +63 -63
  45. package/dist/qchat/channel.js +314 -314
  46. package/dist/qchat/channel_category.js +187 -187
  47. package/dist/qchat/instance.js +77 -77
  48. package/dist/qchat/message.js +285 -285
  49. package/dist/qchat/role.js +423 -423
  50. package/dist/qchat/server.js +453 -453
  51. package/dist/qchat/system_notification.js +74 -74
  52. package/dist/qchat_def/attachment_def.js +2 -2
  53. package/dist/qchat_def/channel_def.js +2 -2
  54. package/dist/qchat_def/instance_def.js +2 -2
  55. package/dist/qchat_def/message_def.js +2 -2
  56. package/dist/qchat_def/public_def.js +649 -649
  57. package/dist/qchat_def/role_def.js +2 -2
  58. package/dist/qchat_def/server_def.js +2 -2
  59. package/dist/qchat_def/system_notification_def.js +2 -2
  60. package/dist/v2/v2_nim_instance.js +43 -43
  61. package/dist/v2/v2_nim_login_service.js +123 -123
  62. package/dist/v2_def/v2_nim_callback_def.js +2 -2
  63. package/dist/v2_def/v2_nim_enum_def.js +325 -325
  64. package/dist/v2_def/v2_nim_struct_def.js +2 -2
  65. package/package.json +1 -1
  66. package/types/chatroom/chatroom.d.ts +55 -55
  67. package/types/chatroom_def/chatroom_def.d.ts +448 -448
  68. package/types/loader.d.ts +2 -2
  69. package/types/nim/client.d.ts +123 -123
  70. package/types/nim/data_sync.d.ts +12 -12
  71. package/types/nim/friend.d.ts +82 -82
  72. package/types/nim/global.d.ts +69 -69
  73. package/types/nim/msglog.d.ts +392 -392
  74. package/types/nim/nos.d.ts +118 -118
  75. package/types/nim/online_session.d.ts +44 -44
  76. package/types/nim/pass_through_proxy.d.ts +24 -24
  77. package/types/nim/plugin.d.ts +39 -39
  78. package/types/nim/session.d.ts +212 -212
  79. package/types/nim/subscribe_event.d.ts +87 -87
  80. package/types/nim/super_team.d.ts +356 -342
  81. package/types/nim/sysmsg.d.ts +105 -105
  82. package/types/nim/talk.d.ts +94 -94
  83. package/types/nim/talkex.d.ts +95 -95
  84. package/types/nim/team.d.ts +481 -467
  85. package/types/nim/tool.d.ts +77 -77
  86. package/types/nim/user.d.ts +111 -111
  87. package/types/nim_def/client_def.d.ts +284 -284
  88. package/types/nim_def/data_sync_def.d.ts +19 -19
  89. package/types/nim_def/doc_trans_def.d.ts +11 -11
  90. package/types/nim_def/friend_def.d.ts +65 -65
  91. package/types/nim_def/global_def.d.ts +62 -62
  92. package/types/nim_def/msglog_def.d.ts +373 -373
  93. package/types/nim_def/nos_def.d.ts +72 -72
  94. package/types/nim_def/online_session_def.d.ts +34 -34
  95. package/types/nim_def/pass_through_proxy_def.d.ts +13 -13
  96. package/types/nim_def/plugin_def.d.ts +8 -8
  97. package/types/nim_def/session_def.d.ts +114 -114
  98. package/types/nim_def/subscribe_event_def.d.ts +83 -83
  99. package/types/nim_def/super_team_def.d.ts +165 -163
  100. package/types/nim_def/sysmsg_def.d.ts +70 -70
  101. package/types/nim_def/talk_def.d.ts +96 -96
  102. package/types/nim_def/talkex_def.d.ts +112 -112
  103. package/types/nim_def/team_def.d.ts +186 -184
  104. package/types/nim_def/tool_def.d.ts +28 -28
  105. package/types/nim_def/user_def.d.ts +59 -59
  106. package/types/node-nim.d.ts +93 -93
  107. package/types/qchat/attachment.d.ts +40 -40
  108. package/types/qchat/channel.d.ts +139 -139
  109. package/types/qchat/channel_category.d.ts +82 -82
  110. package/types/qchat/instance.d.ts +46 -46
  111. package/types/qchat/message.d.ts +128 -128
  112. package/types/qchat/role.d.ts +166 -166
  113. package/types/qchat/server.d.ts +198 -198
  114. package/types/qchat/system_notification.d.ts +39 -39
  115. package/types/qchat_def/attachment_def.d.ts +71 -71
  116. package/types/qchat_def/channel_def.d.ts +643 -643
  117. package/types/qchat_def/instance_def.d.ts +214 -214
  118. package/types/qchat_def/message_def.d.ts +565 -565
  119. package/types/qchat_def/public_def.d.ts +754 -754
  120. package/types/qchat_def/role_def.d.ts +413 -413
  121. package/types/qchat_def/server_def.d.ts +529 -529
  122. package/types/qchat_def/system_notification_def.d.ts +172 -172
  123. package/types/v2/v2_nim_instance.d.ts +25 -25
  124. package/types/v2/v2_nim_login_service.d.ts +96 -96
  125. package/types/v2_def/v2_nim_callback_def.d.ts +20 -20
  126. package/types/v2_def/v2_nim_enum_def.d.ts +300 -300
  127. package/types/v2_def/v2_nim_struct_def.d.ts +338 -338
@@ -1,172 +1,172 @@
1
- import { QChatMessageUpdateInfo } from './message_def';
2
- import { NIMQChatSystemNotificationType, NIMQChatSystemNotificationStatus, QChatBaseResp, NIMQChatSystemNotificationToType } from './public_def';
3
- /** @interface QChatSystemNotification */
4
- export interface QChatSystemNotification {
5
- /** 消息通知目标 */
6
- to_type: NIMQChatSystemNotificationToType;
7
- /** 消息所属的server id */
8
- server_id?: string;
9
- /** 消息所属的channel id */
10
- channel_id?: string;
11
- /** 消息id */
12
- msg_id?: string;
13
- /** 系统消息类型 */
14
- msg_type?: NIMQChatSystemNotificationType;
15
- /** 消息内容 */
16
- msg_body?: string;
17
- /** 消息附件 */
18
- msg_attach?: string;
19
- /** 消息扩展字段 */
20
- msg_ext?: string;
21
- /** 重发标记,false:不是重发,true:是重发 */
22
- resend_flag?: boolean;
23
- /** 通知接受者账号列表 */
24
- to_accids?: Array<string>;
25
- /** false 或者 true, 是否存离线,只有 to_accids 不为空,才能设置为存离线,默认 false */
26
- history_enable?: boolean;
27
- /** 自定义的推送属性,限制json */
28
- push_payload?: string;
29
- /** 自定义的推送内容 */
30
- push_content?: string;
31
- /** 是否需要推送, false: 不需要, true: 需要, 默认 false */
32
- push_enable?: boolean;
33
- /** 是否需要消息计数, false: 不需要, true: 需要, 默认 true */
34
- need_badge?: boolean;
35
- /** 是否需要推送昵称, false: 不需要, true: 需要, 默认 true */
36
- need_push_nick?: boolean;
37
- /** 是否需要抄送, false: 不需要, true: 需要, 默认 true */
38
- route_enable?: boolean;
39
- /** 环境变量,用于指向不同的抄送、第三方回调等配置 */
40
- env?: string;
41
- /** 消息状态 */
42
- status?: NIMQChatSystemNotificationStatus;
43
- /** 消息服务器端id */
44
- msg_server_id?: string;
45
- /** 消息发送者的accid */
46
- from_accid?: string;
47
- /** 消息发送者的客户端类型 */
48
- from_client_type?: number;
49
- /** 消息发送者的设备id */
50
- from_device_id?: string;
51
- /** 消息发送者的昵称 */
52
- from_nick?: string;
53
- /** 消息发送时间戳 */
54
- timestamp?: number;
55
- /** 消息更新时间戳 */
56
- update_timestamp?: number;
57
- /** 回调扩展字段 */
58
- callback_ext?: string;
59
- }
60
- /** @interface QChatTypingEvent */
61
- export interface QChatTypingEvent {
62
- /** 事件所属的server id */
63
- server_id?: string;
64
- /** 事件所属的channel id */
65
- channel_id?: string;
66
- /** 事件扩展字段 */
67
- extension?: string;
68
- /** 事件发送者的accid */
69
- from_accid?: string;
70
- /** 事件发送者的昵称 */
71
- from_nick?: string;
72
- /** 事件发送时间戳 */
73
- timestamp?: number;
74
- }
75
- /** @interface QChatRecvSystemNotificationResp */
76
- export interface QChatRecvSystemNotificationResp {
77
- /** 系统消息 */
78
- notification?: QChatSystemNotification;
79
- }
80
- /** @interface QChatSystemNotificationUpdatedResp */
81
- export interface QChatSystemNotificationUpdatedResp {
82
- /** 操作结果, 参考NIMResCode */
83
- res_code?: number;
84
- /** 消息更新信息 */
85
- update_info?: QChatMessageUpdateInfo;
86
- /** 消息体 */
87
- notification?: QChatSystemNotification;
88
- }
89
- /** @interface QChatSendSystemNotificationResp */
90
- export interface QChatSendSystemNotificationResp {
91
- /** 操作结果, 参考NIMResCode */
92
- res_code?: number;
93
- /** 系统消息 */
94
- notification?: QChatSystemNotification;
95
- }
96
- /** @interface QChatUpdateSystemNotificationResp */
97
- export interface QChatUpdateSystemNotificationResp {
98
- /** 操作结果, 参考NIMResCode */
99
- res_code?: number;
100
- /** 系统消息 */
101
- notification?: QChatSystemNotification;
102
- }
103
- /** @interface QChatMarkReadSystemNotificationResp */
104
- export type QChatMarkReadSystemNotificationResp = QChatBaseResp;
105
- /** @interface QChatMarkSystemNotificationsReadResp */
106
- export type QChatMarkSystemNotificationsReadResp = QChatBaseResp;
107
- /** @interface QChatRecvTypingEventResp */
108
- export interface QChatRecvTypingEventResp {
109
- /** 圈组正在输入事件 */
110
- typing_event?: QChatTypingEvent;
111
- }
112
- /** @interface QChatSendTypingEventResp */
113
- export interface QChatSendTypingEventResp {
114
- /** 操作结果, 参考NIMResCode */
115
- res_code?: number;
116
- /** 圈组正在输入事件 */
117
- typing_event?: QChatTypingEvent;
118
- }
119
- /** 接收系统消息回调 */
120
- export type RecvSystemNotificationCallback = (resp: QChatRecvSystemNotificationResp) => void;
121
- /** 发送系统消息回调 */
122
- export type SendSystemNotificationCallback = (resp: QChatSendSystemNotificationResp) => void;
123
- /** 消息更新回调 */
124
- export type SystemNotificationUpdatedCallback = (resp: QChatSystemNotificationUpdatedResp) => void;
125
- /** 更新系统通知回调 */
126
- export type UpdateSystemNotificationCallback = (resp: QChatUpdateSystemNotificationResp) => void;
127
- /** 标记系统通知消息已读回调函数 */
128
- export type MarkReadSystemNotificationCallback = (resp: QChatMarkSystemNotificationsReadResp) => void;
129
- /** 接收圈组正在输入事件回调 */
130
- export type RecvTypingEventCallback = (resp: QChatRecvTypingEventResp) => void;
131
- /** 发送圈组正在输入事件回调 */
132
- export type SendTypingEventCallback = (resp: QChatSendTypingEventResp) => void;
133
- /** @interface QChatSendSystemNotificationParam */
134
- export interface QChatSendSystemNotificationParam {
135
- /** 系统消息体 */
136
- notification?: QChatSystemNotification;
137
- }
138
- /** @interface QChatUpdateSystemNotificationParam */
139
- export interface QChatUpdateSystemNotificationParam {
140
- /** 系统通知服务器ID */
141
- msg_server_id?: string;
142
- /** 系统通知类型 */
143
- msg_type?: NIMQChatSystemNotificationType;
144
- /** 消息状态 */
145
- status?: NIMQChatSystemNotificationStatus;
146
- /** 消息内容 */
147
- msg_body?: string;
148
- /** 消息扩展字段 */
149
- msg_ext?: string;
150
- /** 更新信息 */
151
- update_info?: QChatMessageUpdateInfo;
152
- }
153
- /** @interface NIMQChatSystemNotificationMarkReadInfo */
154
- export interface NIMQChatSystemNotificationMarkReadInfo {
155
- /** 消息服务器 id */
156
- msg_server_id?: string;
157
- /** 系统通知类型 */
158
- msg_type?: NIMQChatSystemNotificationType;
159
- }
160
- /** @interface QChatMarkSystemNotificationsReadParam */
161
- export interface QChatMarkSystemNotificationsReadParam {
162
- cb?: MarkReadSystemNotificationCallback;
163
- mark_read_infos?: Array<NIMQChatSystemNotificationMarkReadInfo>;
164
- }
165
- /** @interface QChatRegRecvTypingEventCbParam */
166
- export interface QChatRegRecvTypingEventCbParam {
167
- }
168
- /** @interface QChatSendTypingEventParam */
169
- export interface QChatSendTypingEventParam {
170
- /** 圈组正在输入事件 */
171
- typing_event?: QChatTypingEvent;
172
- }
1
+ import { QChatMessageUpdateInfo } from './message_def';
2
+ import { NIMQChatSystemNotificationType, NIMQChatSystemNotificationStatus, QChatBaseResp, NIMQChatSystemNotificationToType } from './public_def';
3
+ /** @interface QChatSystemNotification */
4
+ export interface QChatSystemNotification {
5
+ /** 消息通知目标 */
6
+ to_type: NIMQChatSystemNotificationToType;
7
+ /** 消息所属的server id */
8
+ server_id?: string;
9
+ /** 消息所属的channel id */
10
+ channel_id?: string;
11
+ /** 消息id */
12
+ msg_id?: string;
13
+ /** 系统消息类型 */
14
+ msg_type?: NIMQChatSystemNotificationType;
15
+ /** 消息内容 */
16
+ msg_body?: string;
17
+ /** 消息附件 */
18
+ msg_attach?: string;
19
+ /** 消息扩展字段 */
20
+ msg_ext?: string;
21
+ /** 重发标记,false:不是重发,true:是重发 */
22
+ resend_flag?: boolean;
23
+ /** 通知接受者账号列表 */
24
+ to_accids?: Array<string>;
25
+ /** false 或者 true, 是否存离线,只有 to_accids 不为空,才能设置为存离线,默认 false */
26
+ history_enable?: boolean;
27
+ /** 自定义的推送属性,限制json */
28
+ push_payload?: string;
29
+ /** 自定义的推送内容 */
30
+ push_content?: string;
31
+ /** 是否需要推送, false: 不需要, true: 需要, 默认 false */
32
+ push_enable?: boolean;
33
+ /** 是否需要消息计数, false: 不需要, true: 需要, 默认 true */
34
+ need_badge?: boolean;
35
+ /** 是否需要推送昵称, false: 不需要, true: 需要, 默认 true */
36
+ need_push_nick?: boolean;
37
+ /** 是否需要抄送, false: 不需要, true: 需要, 默认 true */
38
+ route_enable?: boolean;
39
+ /** 环境变量,用于指向不同的抄送、第三方回调等配置 */
40
+ env?: string;
41
+ /** 消息状态 */
42
+ status?: NIMQChatSystemNotificationStatus;
43
+ /** 消息服务器端id */
44
+ msg_server_id?: string;
45
+ /** 消息发送者的accid */
46
+ from_accid?: string;
47
+ /** 消息发送者的客户端类型 */
48
+ from_client_type?: number;
49
+ /** 消息发送者的设备id */
50
+ from_device_id?: string;
51
+ /** 消息发送者的昵称 */
52
+ from_nick?: string;
53
+ /** 消息发送时间戳 */
54
+ timestamp?: number;
55
+ /** 消息更新时间戳 */
56
+ update_timestamp?: number;
57
+ /** 回调扩展字段 */
58
+ callback_ext?: string;
59
+ }
60
+ /** @interface QChatTypingEvent */
61
+ export interface QChatTypingEvent {
62
+ /** 事件所属的server id */
63
+ server_id?: string;
64
+ /** 事件所属的channel id */
65
+ channel_id?: string;
66
+ /** 事件扩展字段 */
67
+ extension?: string;
68
+ /** 事件发送者的accid */
69
+ from_accid?: string;
70
+ /** 事件发送者的昵称 */
71
+ from_nick?: string;
72
+ /** 事件发送时间戳 */
73
+ timestamp?: number;
74
+ }
75
+ /** @interface QChatRecvSystemNotificationResp */
76
+ export interface QChatRecvSystemNotificationResp {
77
+ /** 系统消息 */
78
+ notification?: QChatSystemNotification;
79
+ }
80
+ /** @interface QChatSystemNotificationUpdatedResp */
81
+ export interface QChatSystemNotificationUpdatedResp {
82
+ /** 操作结果, 参考NIMResCode */
83
+ res_code?: number;
84
+ /** 消息更新信息 */
85
+ update_info?: QChatMessageUpdateInfo;
86
+ /** 消息体 */
87
+ notification?: QChatSystemNotification;
88
+ }
89
+ /** @interface QChatSendSystemNotificationResp */
90
+ export interface QChatSendSystemNotificationResp {
91
+ /** 操作结果, 参考NIMResCode */
92
+ res_code?: number;
93
+ /** 系统消息 */
94
+ notification?: QChatSystemNotification;
95
+ }
96
+ /** @interface QChatUpdateSystemNotificationResp */
97
+ export interface QChatUpdateSystemNotificationResp {
98
+ /** 操作结果, 参考NIMResCode */
99
+ res_code?: number;
100
+ /** 系统消息 */
101
+ notification?: QChatSystemNotification;
102
+ }
103
+ /** @interface QChatMarkReadSystemNotificationResp */
104
+ export type QChatMarkReadSystemNotificationResp = QChatBaseResp;
105
+ /** @interface QChatMarkSystemNotificationsReadResp */
106
+ export type QChatMarkSystemNotificationsReadResp = QChatBaseResp;
107
+ /** @interface QChatRecvTypingEventResp */
108
+ export interface QChatRecvTypingEventResp {
109
+ /** 圈组正在输入事件 */
110
+ typing_event?: QChatTypingEvent;
111
+ }
112
+ /** @interface QChatSendTypingEventResp */
113
+ export interface QChatSendTypingEventResp {
114
+ /** 操作结果, 参考NIMResCode */
115
+ res_code?: number;
116
+ /** 圈组正在输入事件 */
117
+ typing_event?: QChatTypingEvent;
118
+ }
119
+ /** 接收系统消息回调 */
120
+ export type RecvSystemNotificationCallback = (resp: QChatRecvSystemNotificationResp) => void;
121
+ /** 发送系统消息回调 */
122
+ export type SendSystemNotificationCallback = (resp: QChatSendSystemNotificationResp) => void;
123
+ /** 消息更新回调 */
124
+ export type SystemNotificationUpdatedCallback = (resp: QChatSystemNotificationUpdatedResp) => void;
125
+ /** 更新系统通知回调 */
126
+ export type UpdateSystemNotificationCallback = (resp: QChatUpdateSystemNotificationResp) => void;
127
+ /** 标记系统通知消息已读回调函数 */
128
+ export type MarkReadSystemNotificationCallback = (resp: QChatMarkSystemNotificationsReadResp) => void;
129
+ /** 接收圈组正在输入事件回调 */
130
+ export type RecvTypingEventCallback = (resp: QChatRecvTypingEventResp) => void;
131
+ /** 发送圈组正在输入事件回调 */
132
+ export type SendTypingEventCallback = (resp: QChatSendTypingEventResp) => void;
133
+ /** @interface QChatSendSystemNotificationParam */
134
+ export interface QChatSendSystemNotificationParam {
135
+ /** 系统消息体 */
136
+ notification?: QChatSystemNotification;
137
+ }
138
+ /** @interface QChatUpdateSystemNotificationParam */
139
+ export interface QChatUpdateSystemNotificationParam {
140
+ /** 系统通知服务器ID */
141
+ msg_server_id?: string;
142
+ /** 系统通知类型 */
143
+ msg_type?: NIMQChatSystemNotificationType;
144
+ /** 消息状态 */
145
+ status?: NIMQChatSystemNotificationStatus;
146
+ /** 消息内容 */
147
+ msg_body?: string;
148
+ /** 消息扩展字段 */
149
+ msg_ext?: string;
150
+ /** 更新信息 */
151
+ update_info?: QChatMessageUpdateInfo;
152
+ }
153
+ /** @interface NIMQChatSystemNotificationMarkReadInfo */
154
+ export interface NIMQChatSystemNotificationMarkReadInfo {
155
+ /** 消息服务器 id */
156
+ msg_server_id?: string;
157
+ /** 系统通知类型 */
158
+ msg_type?: NIMQChatSystemNotificationType;
159
+ }
160
+ /** @interface QChatMarkSystemNotificationsReadParam */
161
+ export interface QChatMarkSystemNotificationsReadParam {
162
+ cb?: MarkReadSystemNotificationCallback;
163
+ mark_read_infos?: Array<NIMQChatSystemNotificationMarkReadInfo>;
164
+ }
165
+ /** @interface QChatRegRecvTypingEventCbParam */
166
+ export interface QChatRegRecvTypingEventCbParam {
167
+ }
168
+ /** @interface QChatSendTypingEventParam */
169
+ export interface QChatSendTypingEventParam {
170
+ /** 圈组正在输入事件 */
171
+ typing_event?: QChatTypingEvent;
172
+ }
@@ -1,25 +1,25 @@
1
- import { V2NIMInitOption, V2NIMError } from 'ts/v2_def/v2_nim_struct_def';
2
- import { EventEmitter } from 'eventemitter3';
3
- import { V2NIMLoginService } from './v2_nim_login_service';
4
- export declare interface V2NIMInstanceEvents {
5
- }
6
- export declare class V2NIMInstance extends EventEmitter<V2NIMInstanceEvents> {
7
- instance: any;
8
- loginService: V2NIMLoginService | null;
9
- constructor();
10
- /**
11
- * 初始化
12
- * @param option - 初始化选项
13
- * @returns V2NIMError | null
14
- * @example
15
- */
16
- init(option: V2NIMInitOption): V2NIMError | null;
17
- /** @brief 反初始化
18
- * @return V2NIMError | null
19
- */
20
- uninit(): V2NIMError | null;
21
- /** @brief 获取登录服务
22
- * @return V2NIMLoginService
23
- */
24
- getLoginService(): V2NIMLoginService | null;
25
- }
1
+ import { V2NIMInitOption, V2NIMError } from 'ts/v2_def/v2_nim_struct_def';
2
+ import { EventEmitter } from 'eventemitter3';
3
+ import { V2NIMLoginService } from './v2_nim_login_service';
4
+ export declare interface V2NIMInstanceEvents {
5
+ }
6
+ export declare class V2NIMInstance extends EventEmitter<V2NIMInstanceEvents> {
7
+ instance: any;
8
+ loginService: V2NIMLoginService | null;
9
+ constructor();
10
+ /**
11
+ * 初始化
12
+ * @param option - 初始化选项
13
+ * @returns V2NIMError | null
14
+ * @example
15
+ */
16
+ init(option: V2NIMInitOption): V2NIMError | null;
17
+ /** @brief 反初始化
18
+ * @return V2NIMError | null
19
+ */
20
+ uninit(): V2NIMError | null;
21
+ /** @brief 获取登录服务
22
+ * @return V2NIMLoginService
23
+ */
24
+ getLoginService(): V2NIMLoginService | null;
25
+ }
@@ -1,96 +1,96 @@
1
- import { V2NIMDataSyncDetail, V2NIMError, V2NIMKickedOfflineDetail, V2NIMLoginClient, V2NIMLoginOption } from 'ts/v2_def/v2_nim_struct_def';
2
- import { EventEmitter } from 'eventemitter3';
3
- import { V2NIMReconnectDelayProvider } from 'ts/v2_def/v2_nim_callback_def';
4
- export declare interface V2NIMLoginServiceEvents {
5
- /** 登录状态变更回调 */
6
- onLoginStatus: [V2NIMLoginStatus];
7
- /** 登录失败回调 */
8
- onLoginFailed: [V2NIMError];
9
- /** 被踢下线回调 */
10
- onKickedOffline: [V2NIMKickedOfflineDetail];
11
- /** 登录客户端变更回调 */
12
- onLoginClientChanged: [V2NIMLoginClientChange, V2NIMLoginClient[]];
13
- }
14
- export declare class V2NIMLoginService extends EventEmitter<V2NIMLoginServiceEvents> {
15
- instance: any;
16
- loginDetail: V2NIMLoginDetail;
17
- constructor();
18
- /**
19
- * 登录接口
20
- * @param account 账号
21
- * @param token 密码
22
- * @param option 登录选项
23
- * @returns Promise<void>
24
- */
25
- login(account: string, token: string, option: V2NIMLoginOption): Promise<void>;
26
- /**
27
- * 登出接口
28
- * @returns Promise<void>
29
- */
30
- logout(): Promise<void>;
31
- /**
32
- * 获取当前登录用户
33
- * @returns string 当前登录用户
34
- */
35
- getLoginUser(): string;
36
- /**
37
- * 获取登录状态
38
- * @returns V2NIMLoginStatus 登录状态
39
- */
40
- getLoginStatus(): V2NIMLoginStatus;
41
- /**
42
- * 获取登录客户端列表
43
- * @returns V2NIMLoginClient[] 登录客户端列表
44
- */
45
- getLoginClients(): V2NIMLoginClient[];
46
- /**
47
- * 踢掉登录客户端下线
48
- * @param client 登录客户端
49
- * @returns Promise<void>
50
- */
51
- kickOffline(client: V2NIMLoginClient): Promise<void>;
52
- /**
53
- * 获取被踢下线原因
54
- * @returns V2NIMKickedOfflineDetail 被踢下线原因
55
- */
56
- getKickedOfflineDetail(): V2NIMKickedOfflineDetail;
57
- /**
58
- * 获取登录详情信息
59
- * @returns V2NIMLoginDetail 登录详情信息
60
- */
61
- getLoginDetail(): V2NIMLoginDetail;
62
- }
63
- export declare interface V2NIMLoginDetailEvents {
64
- /** 连接状态变更回调 */
65
- onConnectStatus: [V2NIMConnectStatus];
66
- /** 连接断开回调 */
67
- onDisconnected: [V2NIMError | null];
68
- /** 连接成功回调 */
69
- onConnectSuccess: [];
70
- /** 连接失败回调 */
71
- onConnectFailed: [V2NIMError];
72
- /** 连接中回调 */
73
- onConnecting: [];
74
- /** 数据同步回调 */
75
- onDataSync: [V2NIMDataSyncType, V2NIMDataSyncState, V2NIMError | null];
76
- }
77
- export declare class V2NIMLoginDetail extends EventEmitter<V2NIMLoginDetailEvents> {
78
- instance: any;
79
- constructor();
80
- /**
81
- * 获取连接状态
82
- * @returns V2NIMConnectStatus 连接状态
83
- */
84
- getConnectStatus(): V2NIMConnectStatus;
85
- /**
86
- * 获取数据同步状态
87
- * @returns V2NIMDataSyncDetail[] 数据同步状态列表
88
- */
89
- getDataSync(): V2NIMDataSyncDetail[];
90
- /**
91
- * 设置获取重连延时回调
92
- * @param provider 获取重连延时回调
93
- * @returns void
94
- */
95
- setReconnectDelayProvider(provider: V2NIMReconnectDelayProvider): void;
96
- }
1
+ import { V2NIMDataSyncDetail, V2NIMError, V2NIMKickedOfflineDetail, V2NIMLoginClient, V2NIMLoginOption } from 'ts/v2_def/v2_nim_struct_def';
2
+ import { EventEmitter } from 'eventemitter3';
3
+ import { V2NIMReconnectDelayProvider } from 'ts/v2_def/v2_nim_callback_def';
4
+ export declare interface V2NIMLoginServiceEvents {
5
+ /** 登录状态变更回调 */
6
+ onLoginStatus: [V2NIMLoginStatus];
7
+ /** 登录失败回调 */
8
+ onLoginFailed: [V2NIMError];
9
+ /** 被踢下线回调 */
10
+ onKickedOffline: [V2NIMKickedOfflineDetail];
11
+ /** 登录客户端变更回调 */
12
+ onLoginClientChanged: [V2NIMLoginClientChange, V2NIMLoginClient[]];
13
+ }
14
+ export declare class V2NIMLoginService extends EventEmitter<V2NIMLoginServiceEvents> {
15
+ instance: any;
16
+ loginDetail: V2NIMLoginDetail;
17
+ constructor();
18
+ /**
19
+ * 登录接口
20
+ * @param account 账号
21
+ * @param token 密码
22
+ * @param option 登录选项
23
+ * @returns Promise<void>
24
+ */
25
+ login(account: string, token: string, option: V2NIMLoginOption): Promise<void>;
26
+ /**
27
+ * 登出接口
28
+ * @returns Promise<void>
29
+ */
30
+ logout(): Promise<void>;
31
+ /**
32
+ * 获取当前登录用户
33
+ * @returns string 当前登录用户
34
+ */
35
+ getLoginUser(): string;
36
+ /**
37
+ * 获取登录状态
38
+ * @returns V2NIMLoginStatus 登录状态
39
+ */
40
+ getLoginStatus(): V2NIMLoginStatus;
41
+ /**
42
+ * 获取登录客户端列表
43
+ * @returns V2NIMLoginClient[] 登录客户端列表
44
+ */
45
+ getLoginClients(): V2NIMLoginClient[];
46
+ /**
47
+ * 踢掉登录客户端下线
48
+ * @param client 登录客户端
49
+ * @returns Promise<void>
50
+ */
51
+ kickOffline(client: V2NIMLoginClient): Promise<void>;
52
+ /**
53
+ * 获取被踢下线原因
54
+ * @returns V2NIMKickedOfflineDetail 被踢下线原因
55
+ */
56
+ getKickedOfflineDetail(): V2NIMKickedOfflineDetail;
57
+ /**
58
+ * 获取登录详情信息
59
+ * @returns V2NIMLoginDetail 登录详情信息
60
+ */
61
+ getLoginDetail(): V2NIMLoginDetail;
62
+ }
63
+ export declare interface V2NIMLoginDetailEvents {
64
+ /** 连接状态变更回调 */
65
+ onConnectStatus: [V2NIMConnectStatus];
66
+ /** 连接断开回调 */
67
+ onDisconnected: [V2NIMError | null];
68
+ /** 连接成功回调 */
69
+ onConnectSuccess: [];
70
+ /** 连接失败回调 */
71
+ onConnectFailed: [V2NIMError];
72
+ /** 连接中回调 */
73
+ onConnecting: [];
74
+ /** 数据同步回调 */
75
+ onDataSync: [V2NIMDataSyncType, V2NIMDataSyncState, V2NIMError | null];
76
+ }
77
+ export declare class V2NIMLoginDetail extends EventEmitter<V2NIMLoginDetailEvents> {
78
+ instance: any;
79
+ constructor();
80
+ /**
81
+ * 获取连接状态
82
+ * @returns V2NIMConnectStatus 连接状态
83
+ */
84
+ getConnectStatus(): V2NIMConnectStatus;
85
+ /**
86
+ * 获取数据同步状态
87
+ * @returns V2NIMDataSyncDetail[] 数据同步状态列表
88
+ */
89
+ getDataSync(): V2NIMDataSyncDetail[];
90
+ /**
91
+ * 设置获取重连延时回调
92
+ * @param provider 获取重连延时回调
93
+ * @returns void
94
+ */
95
+ setReconnectDelayProvider(provider: V2NIMReconnectDelayProvider): void;
96
+ }
@@ -1,20 +1,20 @@
1
- import { V2NIMError, V2NIMMessage, V2NIMSendMessageResult } from './v2_nim_struct_def';
2
- /** @brief 通用成功回调 */
3
- export type V2NIMSuccessCallback = () => void;
4
- /** @brief 通用失败回调 */
5
- /** @param error 错误信息 */
6
- export type V2NIMFailureCallback = (error: V2NIMError) => void;
7
- /** @brief 通用进度回调 */
8
- /** @param progress 进度, 0-100 */
9
- export type V2NIMProgressCallback = (progress: number) => void;
10
- /** @brief 消息发送成功回调 */
11
- /** @param message 消息 */
12
- /** @param result 消息发送结果 */
13
- export type V2NIMSendMessageSuccessCallback = (message: V2NIMMessage, result: V2NIMSendMessageResult) => void;
14
- /** @brief 消息数组成功回调 */
15
- /** @param messages 消息数组 */
16
- export type V2NIMMessageListSuccessCallback = (messages: Array<V2NIMMessage>) => void;
17
- /** @brief 获取重连延时回调 */
18
- /** @param defaultDelay 默认延时, 单位毫秒 */
19
- /** @return number 延时, 单位毫秒 */
20
- export type V2NIMReconnectDelayProvider = (defaultDelay: number) => number;
1
+ import { V2NIMError, V2NIMMessage, V2NIMSendMessageResult } from './v2_nim_struct_def';
2
+ /** @brief 通用成功回调 */
3
+ export type V2NIMSuccessCallback = () => void;
4
+ /** @brief 通用失败回调 */
5
+ /** @param error 错误信息 */
6
+ export type V2NIMFailureCallback = (error: V2NIMError) => void;
7
+ /** @brief 通用进度回调 */
8
+ /** @param progress 进度, 0-100 */
9
+ export type V2NIMProgressCallback = (progress: number) => void;
10
+ /** @brief 消息发送成功回调 */
11
+ /** @param message 消息 */
12
+ /** @param result 消息发送结果 */
13
+ export type V2NIMSendMessageSuccessCallback = (message: V2NIMMessage, result: V2NIMSendMessageResult) => void;
14
+ /** @brief 消息数组成功回调 */
15
+ /** @param messages 消息数组 */
16
+ export type V2NIMMessageListSuccessCallback = (messages: Array<V2NIMMessage>) => void;
17
+ /** @brief 获取重连延时回调 */
18
+ /** @param defaultDelay 默认延时, 单位毫秒 */
19
+ /** @return number 延时, 单位毫秒 */
20
+ export type V2NIMReconnectDelayProvider = (defaultDelay: number) => number;