easemob-websdk 4.19.1 → 4.21.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.
- package/Easemob-chat.d.ts +83 -2
- package/Easemob-chat.js +1 -1
- package/chatroom/chatroom.js +1 -1
- package/contact/contact.d.ts +37 -1
- package/contact/contact.js +1 -1
- package/group/group.d.ts +5 -1
- package/group/group.js +1 -1
- package/localCache/localCache.js +1 -1
- package/miniCore/miniCore.js +1 -1
- package/miniProgram/Easemob-chat.js +1 -1
- package/package.json +1 -1
- package/presence/presence.js +1 -1
- package/silent/silent.js +1 -1
- package/status.d.ts +10 -0
- package/thread/thread.js +1 -1
- package/translation/translation.js +1 -1
- package/types/indexApi.d.ts +25 -0
- package/uniApp/Easemob-chat.js +1 -1
- package/circleSdk/Easemob-chat.d.ts +0 -8066
- package/circleSdk/Easemob-chat.js +0 -1
package/Easemob-chat.d.ts
CHANGED
|
@@ -44,6 +44,28 @@ export declare namespace EasemobChat {
|
|
|
44
44
|
jid: Jid;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
interface AudioParams {
|
|
48
|
+
/** The audio format. */
|
|
49
|
+
format?: string;
|
|
50
|
+
/** The sample rate. */
|
|
51
|
+
sampleRate?: number;
|
|
52
|
+
/** The bits per sample. */
|
|
53
|
+
bitsPerSample?: number;
|
|
54
|
+
/** The number of channels. */
|
|
55
|
+
channels?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface MiniProgramVoiceFile {
|
|
59
|
+
/** The local file path in mini program. */
|
|
60
|
+
filePath: string;
|
|
61
|
+
/** The optional file name. */
|
|
62
|
+
name?: string;
|
|
63
|
+
/** The optional file size in bytes. */
|
|
64
|
+
size?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
type VoiceSourceFile = File | MiniProgramVoiceFile;
|
|
68
|
+
|
|
47
69
|
type ExcludeAckMessageBody = Exclude<
|
|
48
70
|
MessageBody,
|
|
49
71
|
ReadMsgBody | DeliveryMsgBody | ChannelMsgBody
|
|
@@ -1449,6 +1471,16 @@ export declare namespace EasemobChat {
|
|
|
1449
1471
|
WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION = 222,
|
|
1450
1472
|
/** The file has expired. */
|
|
1451
1473
|
WEBIM_DOWNLOADFILE_ERROR_EXPIRED = 223,
|
|
1474
|
+
/** Invalid voice file. */
|
|
1475
|
+
FILE_INVALID = 407,
|
|
1476
|
+
/** Voice duration exceeds the limit. */
|
|
1477
|
+
FILE_DURATION_TOO_LONG = 408,
|
|
1478
|
+
/** Voice-to-text failed. */
|
|
1479
|
+
FILE_VOICE_TO_TEXT_FAILED = 409,
|
|
1480
|
+
/** Voice file not found. */
|
|
1481
|
+
FILE_NOT_FOUND = 410,
|
|
1482
|
+
/** Voice file too large. */
|
|
1483
|
+
FILE_TOO_LARGE = 411,
|
|
1452
1484
|
|
|
1453
1485
|
/** get DNS failed */
|
|
1454
1486
|
SERVER_GET_DNSLIST_FAILED = 304,
|
|
@@ -3833,7 +3865,7 @@ export declare namespace EasemobChat {
|
|
|
3833
3865
|
success?: (res: AsyncResult<GroupRequestResult[]>) => void;
|
|
3834
3866
|
error?: (error: ErrorEvent) => void;
|
|
3835
3867
|
}
|
|
3836
|
-
): Promise<AsyncResult<GroupRequestResult[]>>;
|
|
3868
|
+
): Promise<AsyncResult<GroupRequestResult[] | GroupRequestResult>>;
|
|
3837
3869
|
|
|
3838
3870
|
/**
|
|
3839
3871
|
* Adds members to the group allowlist. Members on the allowlist can still post messages even if they are muted in the group. Only the group admin or above can call this method. Members added to the allowlist will receive "operation: 'addUserToAllowlist'" in the callback of onGroupEvent.
|
|
@@ -3852,7 +3884,7 @@ export declare namespace EasemobChat {
|
|
|
3852
3884
|
success?: (res: AsyncResult<GroupRequestResult[]>) => void;
|
|
3853
3885
|
error?: (error: ErrorEvent) => void;
|
|
3854
3886
|
}
|
|
3855
|
-
): Promise<AsyncResult<GroupRequestResult[]>>;
|
|
3887
|
+
): Promise<AsyncResult<GroupRequestResult[] | GroupRequestResult[]>>;
|
|
3856
3888
|
|
|
3857
3889
|
/** @deprecated Use {@link removeGroupWhitelistMember} instead. */
|
|
3858
3890
|
rmUsersFromGroupWhitelist(
|
|
@@ -5477,6 +5509,55 @@ export declare namespace EasemobChat {
|
|
|
5477
5509
|
}
|
|
5478
5510
|
): Promise<AsyncResult<CursorPinnedMessagesResult>>;
|
|
5479
5511
|
|
|
5512
|
+
/**
|
|
5513
|
+
* Transcribes a voice message to text.
|
|
5514
|
+
*
|
|
5515
|
+
* This method only supports successfully sent voice messages.
|
|
5516
|
+
*
|
|
5517
|
+
* Once transcribed, the text is returned via callback and can also be retrieved through {res.data.text} .
|
|
5518
|
+
*
|
|
5519
|
+
* This method supports AMR and MP3 voice messages, but does not support direct transcription of PCM format.
|
|
5520
|
+
*
|
|
5521
|
+
* ```typescript
|
|
5522
|
+
* connection.voiceMessageToText(messageBody, audioParams)
|
|
5523
|
+
* ```
|
|
5524
|
+
*/
|
|
5525
|
+
voiceMessageToText(
|
|
5526
|
+
this: Connection,
|
|
5527
|
+
/** The voice message body. */
|
|
5528
|
+
messageBody: AudioMsgBody,
|
|
5529
|
+
/**
|
|
5530
|
+
* Voice parameters for local voice file recognition.
|
|
5531
|
+
*
|
|
5532
|
+
* For {@link AudioParams.AudioFormat }, since it lacks header information, you must provide parameters such as the sample rate and the number of channels via audioParams.
|
|
5533
|
+
*
|
|
5534
|
+
*/
|
|
5535
|
+
audioParams?: AudioParams
|
|
5536
|
+
): Promise<
|
|
5537
|
+
AsyncResult<{
|
|
5538
|
+
text: string;
|
|
5539
|
+
}>
|
|
5540
|
+
>;
|
|
5541
|
+
|
|
5542
|
+
/**
|
|
5543
|
+
* Transcribes a local voice file to text.
|
|
5544
|
+
*
|
|
5545
|
+
* ```typescript
|
|
5546
|
+
* connection.voiceFileToText(file, audioParams)
|
|
5547
|
+
* ```
|
|
5548
|
+
*/
|
|
5549
|
+
voiceFileToText(
|
|
5550
|
+
this: Connection,
|
|
5551
|
+
/** The voice file object or the local file path object (for mini programs). */
|
|
5552
|
+
file: VoiceSourceFile,
|
|
5553
|
+
/** Optional voice parameters for local voice file recognition.*/
|
|
5554
|
+
audioParams?: AudioParams
|
|
5555
|
+
): Promise<
|
|
5556
|
+
AsyncResult<{
|
|
5557
|
+
text: string;
|
|
5558
|
+
}>
|
|
5559
|
+
>;
|
|
5560
|
+
|
|
5480
5561
|
getUserIdByRTCUIds(
|
|
5481
5562
|
this: Connection,
|
|
5482
5563
|
RTCUIds: number[]
|