easemob-websdk 4.2.0 → 4.2.1-beta
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.
- package/CHANGELOG.md +9 -0
- package/Easemob-chat.d.ts +15 -3
- package/Easemob-chat.js +1 -1
- package/chatroom/chatroom.d.ts +2 -0
- package/contact/contact.d.ts +7 -1
- package/contact/contact.js +1 -1
- package/group/group.d.ts +2 -0
- package/group/group.js +1 -1
- package/localCache/localCache.d.ts +59 -0
- package/localCache/localCache.js +1 -0
- package/miniCore/miniCore.d.ts +20 -1
- package/miniCore/miniCore.js +1 -1
- package/miniProgram/Easemob-chat.js +1 -1
- package/package.json +1 -1
- package/presence/presence.d.ts +2 -0
- package/silent/silent.d.ts +2 -0
- package/status.d.ts +160 -0
- package/thread/thread.d.ts +2 -0
- package/translation/translation.d.ts +2 -0
- package/types/common.d.ts +24 -1
- package/types/engineCore.d.ts +5 -2
- package/types/error.d.ts +2 -1
- package/types/eventHandler.d.ts +16 -0
- package/types/groupApi.d.ts +8 -7
- package/types/index.d.ts +32 -0
- package/types/indexApi.d.ts +2 -2
- package/types/localCache.d.ts +53 -0
- package/types/message.d.ts +0 -1
- package/types/presenceApi.d.ts +0 -5
- package/types/threadApi.d.ts +7 -1
- package/types/utils.d.ts +90 -0
- package/uniApp/Easemob-chat.js +1 -1
- package/types/status.d.ts +0 -337
package/miniCore/miniCore.d.ts
CHANGED
|
@@ -4,10 +4,14 @@ import { Presence } from '../presence/presence';
|
|
|
4
4
|
import { Silent } from '../silent/silent';
|
|
5
5
|
import { Thread } from '../thread/thread';
|
|
6
6
|
import { Translation } from '../translation/translation';
|
|
7
|
+
import { LocalCache } from '../localCache/localCache';
|
|
7
8
|
import { Message } from '../message/index';
|
|
8
9
|
import { Contact } from '../contact/contact';
|
|
9
10
|
import { AsyncResult } from '../types/common';
|
|
10
11
|
import { MessagesType } from '../types/message';
|
|
12
|
+
import { EventHandlerType } from '../types/eventHandler';
|
|
13
|
+
import { MessageBody } from '../types/message';
|
|
14
|
+
import { SendMsgResult } from '../types/indexApi';
|
|
11
15
|
interface MiniCoreOptions {
|
|
12
16
|
appKey: string;
|
|
13
17
|
isHttpDNS?: boolean;
|
|
@@ -17,7 +21,7 @@ interface MiniCoreOptions {
|
|
|
17
21
|
deviceId?: string;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
|
-
interface OpenParams {
|
|
24
|
+
export interface OpenParams {
|
|
21
25
|
/** The user ID. */
|
|
22
26
|
username: string;
|
|
23
27
|
/** The user ID. */
|
|
@@ -125,6 +129,7 @@ declare class MiniCore {
|
|
|
125
129
|
usePlugin(this: MiniCore, plugin: any, name?: string): any;
|
|
126
130
|
isOpened(): boolean;
|
|
127
131
|
open(params: OpenParams): Promise<void>;
|
|
132
|
+
send(params: MessageBody): Promise<SendMsgResult>;
|
|
128
133
|
/** Closes the connection. */
|
|
129
134
|
close(): void;
|
|
130
135
|
registerUser(params: {
|
|
@@ -139,6 +144,18 @@ declare class MiniCore {
|
|
|
139
144
|
downloadAndParseCombineMessage(
|
|
140
145
|
options: DownloadCombineMessagesParams
|
|
141
146
|
): Promise<MessagesType[]>;
|
|
147
|
+
/**
|
|
148
|
+
* Adds listening events.
|
|
149
|
+
*
|
|
150
|
+
* ```typescript
|
|
151
|
+
* connection.addEventHandler('customId', {
|
|
152
|
+
* onTextMessage: (message) => {
|
|
153
|
+
* console.log(message)
|
|
154
|
+
* }
|
|
155
|
+
* })
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
addEventHandler(id: string, handler: EventHandlerType): void;
|
|
142
159
|
|
|
143
160
|
private clearTokenTimeout;
|
|
144
161
|
private tokenExpireTimeCountDown;
|
|
@@ -158,6 +175,8 @@ declare class MiniCore {
|
|
|
158
175
|
silent: Silent;
|
|
159
176
|
thread: Thread;
|
|
160
177
|
translation: Translation;
|
|
178
|
+
localCache: LocalCache;
|
|
161
179
|
}
|
|
162
180
|
declare const miniCore: typeof MiniCore;
|
|
181
|
+
export type { MiniCore };
|
|
163
182
|
export default miniCore;
|