@onyx-p/imlib-web 1.2.5 → 1.2.7
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/dist/README.md +14 -0
- package/dist/index.esm.js +33421 -0
- package/dist/index.umd.js +33503 -0
- package/{types → dist/types}/index.d.ts +68 -9
- package/{types → dist/types}/model/baseMessage.d.ts +4 -7
- package/dist/types/model/iQuotedReplyMessage.d.ts +7 -0
- package/{types → dist/types}/model/iReceivedConversation.d.ts +22 -6
- package/{types → dist/types}/model/iReceivedMessage.d.ts +19 -10
- package/dist/types/model/mentionedInfo.d.ts +9 -0
- package/dist/types/model/messages/fileMessage.d.ts +24 -0
- package/dist/types/model/messages/gifMessage.d.ts +27 -0
- package/dist/types/model/messages/imageMessage.d.ts +32 -0
- package/dist/types/model/messages/index.d.ts +12 -0
- package/dist/types/model/messages/notificationMessages.d.ts +20 -0
- package/dist/types/model/messages/otherMediaMessages.d.ts +105 -0
- package/dist/types/model/messages/recallCommandMessage.d.ts +9 -0
- package/dist/types/model/messages/textMessage.d.ts +12 -0
- package/dist/types/model/messages/videoMessage.d.ts +30 -0
- package/dist/types/model/messages/voiceMessage.d.ts +18 -0
- package/{types → dist/types}/model/statusTypes.d.ts +9 -17
- package/{types → dist/types}/types.d.ts +74 -40
- package/package.json +65 -13
- package/index.esm.js +0 -21664
- package/index.umd.js +0 -21721
- package/types/model/mentionedInfo.d.ts +0 -9
- package/types/model/messages/commandMessage.d.ts +0 -20
- package/types/model/messages/custMessage.d.ts +0 -34
- package/types/model/messages/fileMessage.d.ts +0 -25
- package/types/model/messages/gifMessage.d.ts +0 -28
- package/types/model/messages/imageMessage.d.ts +0 -32
- package/types/model/messages/index.d.ts +0 -10
- package/types/model/messages/recallCommandMessage.d.ts +0 -18
- package/types/model/messages/textMessage.d.ts +0 -16
- package/types/model/messages/voiceMessage.d.ts +0 -21
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ConnectionStatus, ConversationType, NotificationLevel, NotificationStatus } from './model/statusTypes';
|
|
2
|
-
import { EventListeners, Events, GetHistoryMessageOption, GetHistoryMessageResult, IBaseConversationInfo, IConversationOption, IConversationState, IDeleteMessageOptions, IGetConversationListOptions, IImageMessageOption, IInitOption, IPromiseResult, IRecallMessageOptions, ISendBody, ISendMessageOptions, IUploadHooks, IUploadMessageOption, ProfileInfo } from './types';
|
|
2
|
+
import { EventListeners, Events, GetHistoryMessageOption, GetHistoryMessageResult, IAsyncRes, IBaseConversationInfo, IConversationOption, IConversationState, IDeleteMessageOptions, IGetConversationListOptions, IImageMessageOption, IInitOption, IPromiseResult, IRecallMessageOptions, ISendBody, ISenderEnrichedMessage, ISendMessageOptions, IUploadHooks, IUploadMessageOption, ProfileInfo, IInsertOptions } from './types';
|
|
3
3
|
import { BaseMessage, IBaseMessageBody } from './model/baseMessage';
|
|
4
4
|
import { ITextMessageBody } from './model/messages/textMessage';
|
|
5
5
|
import IReceivedMessage from './model/iReceivedMessage';
|
|
6
6
|
import IReceivedConversation from './model/iReceivedConversation';
|
|
7
7
|
import { CommonReqResult, PBCodec } from './net/connection/webSocketServer';
|
|
8
8
|
import { BaseResp } from './net/pbs/rpc.base';
|
|
9
|
-
|
|
10
|
-
export
|
|
9
|
+
import { IChatRecordMsgDetail } from './model/messages/otherMediaMessages';
|
|
10
|
+
export { TextMessage, ImageMessage, HQVoiceMessage, GIFMessage, FileMessage, VideoMessage, RecallCommandMessage, LocationMessage, ChatRecordMessage, ContactMessage, InvitationMessage, RedEnvelopeMessage, TransferMessage, LinkMessage, PrivateOpenBurnAfterReadingMessage, PrivateCloseBurnAfterReadingMessage, GroupOpenBurnAfterReadingMessage, GroupCloseBurnAfterReadingMessage } from './model/messages';
|
|
11
|
+
export type { ITextMessageBody, IImageMessageBody, IGIFMessageBody, IFileMessageBody, IHQVoiceMessageBody, IRecallCommandMessageBody, IVideoMessageBody, ILocationMessageBody, IChatRecordMessageBody, IContactMessageBody, IInvitationMessageBody, IRedEnvelopeMessageBody, ITransferMessageBody, IBurnAfterReadingMessageBody, ILinkMessageBody } from './model/messages';
|
|
12
|
+
export { MessageTypes, NotiMessageTypes } from './constants/messageTypes';
|
|
11
13
|
export type { IBaseMessageBody, IReceivedMessage, IReceivedConversation };
|
|
12
14
|
export * from './types';
|
|
13
15
|
export * from './model/statusTypes';
|
|
@@ -96,6 +98,10 @@ export declare const getUnreadMentionedCount: (options: IConversationOption) =>
|
|
|
96
98
|
* 获取所有群会话 @ 消息未读数
|
|
97
99
|
*/
|
|
98
100
|
export declare const getAllUnreadMentionedCount: () => IPromiseResult<number>;
|
|
101
|
+
/**
|
|
102
|
+
* 获取本地单个会话的状态
|
|
103
|
+
*/
|
|
104
|
+
export declare const getConversationState: (options: IConversationOption) => IConversationState | null;
|
|
99
105
|
/**
|
|
100
106
|
* 获取本地全部会话的状态
|
|
101
107
|
* @description
|
|
@@ -168,7 +174,8 @@ export declare const getTopConversationList: () => IPromiseResult<IBaseConversat
|
|
|
168
174
|
* @param prototypes 消息属性名称
|
|
169
175
|
* @param isStatusMessage 是否是状态消息
|
|
170
176
|
*/
|
|
171
|
-
export declare const registerMessageType: <T extends IBaseMessageBody>(messageType:
|
|
177
|
+
export declare const registerMessageType: <T extends IBaseMessageBody>(messageType: number, isPersited: boolean, isCounted: boolean, isStatusMessage?: boolean) => new (content: T) => BaseMessage<T>;
|
|
178
|
+
export declare const insertMessage: (conversation: IConversationOption, content: IReceivedMessage, options?: IInsertOptions) => Promise<IAsyncRes<IReceivedMessage>>;
|
|
172
179
|
/**
|
|
173
180
|
* 发送消息
|
|
174
181
|
* @param options
|
|
@@ -194,15 +201,15 @@ export declare const sendHQVoiceMessage: (conversation: IConversationOption, msg
|
|
|
194
201
|
* 发送文件消息
|
|
195
202
|
*/
|
|
196
203
|
export declare const sendFileMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks, sendOptions?: IUploadMessageOption) => IPromiseResult<IReceivedMessage>;
|
|
204
|
+
/**
|
|
205
|
+
* 发送短视频消息
|
|
206
|
+
*/
|
|
207
|
+
export declare const sendSightMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks, sendOptions?: IUploadMessageOption) => IPromiseResult<IReceivedMessage>;
|
|
197
208
|
/**
|
|
198
209
|
* 撤回消息
|
|
199
210
|
* @param options
|
|
200
211
|
*/
|
|
201
212
|
export declare const recallMessage: (conversation: IConversationOption, options: IRecallMessageOptions) => IPromiseResult<IReceivedMessage>;
|
|
202
|
-
/**
|
|
203
|
-
* 获取历史消息
|
|
204
|
-
*/
|
|
205
|
-
export declare const getHistoryMessages: (conversation: IConversationOption, options: GetHistoryMessageOption) => IPromiseResult<GetHistoryMessageResult>;
|
|
206
213
|
/**
|
|
207
214
|
* 获取远程历史消息
|
|
208
215
|
*/
|
|
@@ -216,9 +223,61 @@ export declare const deleteMessages: (conversation: IConversationOption, message
|
|
|
216
223
|
* @param conversation 会话
|
|
217
224
|
* @param timestamp 清除时间点, 该时间之前的消息将被清除
|
|
218
225
|
*/
|
|
219
|
-
export declare const clearHistoryMessages: (conversation: IConversationOption
|
|
226
|
+
export declare const clearHistoryMessages: (conversation: IConversationOption) => IPromiseResult<void>;
|
|
227
|
+
/**
|
|
228
|
+
* 解析聊天记录消息详情
|
|
229
|
+
* @param conversation 会话
|
|
230
|
+
* @param detailItems 消息详情
|
|
231
|
+
* @returns 消息列表
|
|
232
|
+
*/
|
|
233
|
+
export declare const parseChatRecordMsgDetails: (conversation: IConversationOption, detailItems: IChatRecordMsgDetail[]) => IReceivedMessage[];
|
|
234
|
+
/**
|
|
235
|
+
* 将消息编码为聊天记录消息详情
|
|
236
|
+
* @param message 消息
|
|
237
|
+
* @returns 消息详情
|
|
238
|
+
*/
|
|
239
|
+
export declare const encodeReceivedMessage2ChatRecordMsgDetail: (message: ISenderEnrichedMessage) => IChatRecordMsgDetail | null;
|
|
240
|
+
/**
|
|
241
|
+
* 发送已读回执
|
|
242
|
+
* @param messages 消息列表
|
|
243
|
+
* @returns
|
|
244
|
+
*/
|
|
245
|
+
export declare const sendReadReceipts: (messages: IReceivedMessage[]) => IPromiseResult<void>;
|
|
220
246
|
export declare const mockLogin: (config: {
|
|
221
247
|
langCode: string;
|
|
222
248
|
phone: string;
|
|
223
249
|
password: string;
|
|
224
250
|
}) => CommonReqResult<import("./net/pbs/rpc.login").AuthSignIn2Resp>;
|
|
251
|
+
export declare const mockGetLoginCode: (config: {
|
|
252
|
+
langCode: string;
|
|
253
|
+
phone: string;
|
|
254
|
+
}) => CommonReqResult<import("./net/pbs/rpc.login").WebGetLoginCodeResp>;
|
|
255
|
+
export declare const mockVerifyLoginCode: (config: {
|
|
256
|
+
country: string;
|
|
257
|
+
phone: string;
|
|
258
|
+
code: string;
|
|
259
|
+
}) => CommonReqResult<import("./net/pbs/rpc.login").ClickOKToWebResp>;
|
|
260
|
+
/**
|
|
261
|
+
* 清除指定会话中阅后即焚过期的消息
|
|
262
|
+
* @param conversation 会话信息
|
|
263
|
+
* @returns 被清除的消息ID列表
|
|
264
|
+
*/
|
|
265
|
+
export declare const clearBurnAfterReadingExpiredMessages: (conversation: IConversationOption) => IPromiseResult<string[]>;
|
|
266
|
+
/**
|
|
267
|
+
* 发送引用回复消息
|
|
268
|
+
* @param message 消息
|
|
269
|
+
* @param quoteReply 引用回复消息
|
|
270
|
+
* @param options 发送选项
|
|
271
|
+
* @returns 发送结果
|
|
272
|
+
*/
|
|
273
|
+
export declare const sendQuoteReplyMessage: (message: BaseMessage, quoteReply: IReceivedMessage, options?: ISendMessageOptions) => IPromiseResult<IReceivedMessage>;
|
|
274
|
+
/**
|
|
275
|
+
* 获取消息
|
|
276
|
+
* @param messageId 消息ID
|
|
277
|
+
* @returns 消息
|
|
278
|
+
*/
|
|
279
|
+
export declare const getMessageById: (messageId: number) => IPromiseResult<IReceivedMessage | null | undefined>;
|
|
280
|
+
/**
|
|
281
|
+
* 获取消息
|
|
282
|
+
*/
|
|
283
|
+
export declare const getMessageByUId: (messageUId: string) => IPromiseResult<IReceivedMessage | null | undefined>;
|
|
@@ -34,17 +34,14 @@ export interface IUserInfo {
|
|
|
34
34
|
/**
|
|
35
35
|
* 消息基本结构
|
|
36
36
|
*/
|
|
37
|
-
export type IBaseMessageBody =
|
|
37
|
+
export type IBaseMessageBody = Record<string, any>;
|
|
38
38
|
export type MessageCodingData = Record<string, any>;
|
|
39
39
|
export declare class BaseMessage<T extends IBaseMessageBody = any> {
|
|
40
|
-
|
|
40
|
+
messageType: number;
|
|
41
41
|
content: T;
|
|
42
42
|
readonly isPersited: boolean;
|
|
43
43
|
readonly isCounted: boolean;
|
|
44
44
|
readonly isStatusMessage: boolean;
|
|
45
|
-
constructor(messageType:
|
|
46
|
-
get objectId(): number;
|
|
47
|
-
static getObjectId(): number;
|
|
48
|
-
static decode(aDecoder: MessageCodingData): BaseMessage<any>;
|
|
49
|
-
encode(): MessageCodingData;
|
|
45
|
+
constructor(messageType: number, content: T, isPersited?: boolean, isCounted?: boolean, isStatusMessage?: boolean);
|
|
50
46
|
}
|
|
47
|
+
export declare const registerMessageType: <T extends IBaseMessageBody>(messageType: number, isPersited: boolean, isCounted: boolean, isStatusMessage?: boolean) => new (content: T) => BaseMessage<T>;
|
|
@@ -4,10 +4,6 @@ import IReceivedMessage from './iReceivedMessage';
|
|
|
4
4
|
* 从服务器拉取到的会话数据结构
|
|
5
5
|
*/
|
|
6
6
|
export default interface IReceivedConversation {
|
|
7
|
-
/**
|
|
8
|
-
* 会话的业务标识
|
|
9
|
-
*/
|
|
10
|
-
channelId?: string;
|
|
11
7
|
/**
|
|
12
8
|
* 会话类型
|
|
13
9
|
*/
|
|
@@ -26,7 +22,7 @@ export default interface IReceivedConversation {
|
|
|
26
22
|
/**
|
|
27
23
|
* 会话中的最后一条消息
|
|
28
24
|
*/
|
|
29
|
-
latestMessage?: IReceivedMessage;
|
|
25
|
+
latestMessage?: IReceivedMessage | null;
|
|
30
26
|
/**
|
|
31
27
|
* 是否包含 @ 自己的消息,此数据仅在 `conversationType` 为 `ConversationType.GROUP` 时有效
|
|
32
28
|
*/
|
|
@@ -46,9 +42,29 @@ export default interface IReceivedConversation {
|
|
|
46
42
|
/**
|
|
47
43
|
* 会话中消息的最后未读时间
|
|
48
44
|
*/
|
|
49
|
-
lastUnreadTime:
|
|
45
|
+
lastUnreadTime: string;
|
|
50
46
|
/**
|
|
51
47
|
* @ 消息未读数
|
|
52
48
|
*/
|
|
53
49
|
unreadMentionedCount?: number;
|
|
50
|
+
/**
|
|
51
|
+
* 会话名称
|
|
52
|
+
*/
|
|
53
|
+
dialogTitle?: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* 会话头像
|
|
56
|
+
*/
|
|
57
|
+
smallAvatarUrl?: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* 是否开启了阅后即焚
|
|
60
|
+
*/
|
|
61
|
+
burnAfterReadingFlag: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* 阅后即焚的时长
|
|
64
|
+
*/
|
|
65
|
+
burnAfterReadingTime?: number | null;
|
|
66
|
+
/**
|
|
67
|
+
* 会话更新时间,根据这个排序
|
|
68
|
+
*/
|
|
69
|
+
updateTime?: number | null;
|
|
54
70
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { ConversationType, MessageDirection, SentStatus } from './statusTypes';
|
|
1
|
+
import { ConversationType, MessageDirection, ReceivedStatus, SentStatus } from './statusTypes';
|
|
2
|
+
import IQuotedReplyMessage from './iQuotedReplyMessage';
|
|
2
3
|
/**
|
|
3
4
|
* 消息数据
|
|
4
5
|
*/
|
|
5
6
|
export default interface IReceivedMessage {
|
|
6
|
-
/**
|
|
7
|
-
* 会话的业务标识
|
|
8
|
-
*/
|
|
9
|
-
channelId?: string;
|
|
10
7
|
/**
|
|
11
8
|
* 会话类型
|
|
12
9
|
*/
|
|
@@ -27,7 +24,7 @@ export default interface IReceivedMessage {
|
|
|
27
24
|
* 消息结构名称,即消息类型
|
|
28
25
|
* @example RC:TxtMsg
|
|
29
26
|
*/
|
|
30
|
-
messageType:
|
|
27
|
+
messageType: number;
|
|
31
28
|
/**
|
|
32
29
|
* 服务端存储的消息 Id
|
|
33
30
|
*/
|
|
@@ -43,12 +40,12 @@ export default interface IReceivedMessage {
|
|
|
43
40
|
/**
|
|
44
41
|
* 消息在服务器端的发送时间
|
|
45
42
|
*/
|
|
46
|
-
sentTime:
|
|
43
|
+
sentTime: string;
|
|
47
44
|
/**
|
|
48
45
|
* 消息接收时间,该时间通过消息的 `sentTime` 值在本地进行计算得出,不推荐使用
|
|
49
46
|
* @description 当 isOffLineMessage 为 true 时,该值无效
|
|
50
47
|
*/
|
|
51
|
-
receivedTime:
|
|
48
|
+
receivedTime: string;
|
|
52
49
|
/**
|
|
53
50
|
* 是否存储
|
|
54
51
|
* @default true
|
|
@@ -75,13 +72,25 @@ export default interface IReceivedMessage {
|
|
|
75
72
|
/**
|
|
76
73
|
* 消息接收状态
|
|
77
74
|
*/
|
|
78
|
-
receivedStatus:
|
|
75
|
+
receivedStatus: ReceivedStatus;
|
|
79
76
|
/**
|
|
80
77
|
* CPP 独有字段 消息本地 ID
|
|
81
78
|
*/
|
|
82
|
-
messageId
|
|
79
|
+
messageId: number;
|
|
83
80
|
/**
|
|
84
81
|
* 消息发送状态
|
|
85
82
|
*/
|
|
86
83
|
sentStatus: SentStatus;
|
|
84
|
+
/**
|
|
85
|
+
* 是否为阅后即焚消息
|
|
86
|
+
*/
|
|
87
|
+
burnAfterReadingFlag: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* 阅后即焚消息的时长
|
|
90
|
+
*/
|
|
91
|
+
burnAfterReadingTime?: number;
|
|
92
|
+
/**
|
|
93
|
+
* 引用消息
|
|
94
|
+
*/
|
|
95
|
+
quotedReply?: IQuotedReplyMessage;
|
|
87
96
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface IFileMessageBody {
|
|
2
|
+
/**
|
|
3
|
+
* 文件名称
|
|
4
|
+
*/
|
|
5
|
+
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* 文件类型
|
|
8
|
+
*/
|
|
9
|
+
extension: string;
|
|
10
|
+
/**
|
|
11
|
+
* 文件尺寸,单位: Byte
|
|
12
|
+
*/
|
|
13
|
+
size: number;
|
|
14
|
+
/**
|
|
15
|
+
* 远程文件资源地址
|
|
16
|
+
*/
|
|
17
|
+
fileKey: string;
|
|
18
|
+
/**
|
|
19
|
+
* 文件的加密密钥
|
|
20
|
+
*/
|
|
21
|
+
encryptKey?: string;
|
|
22
|
+
}
|
|
23
|
+
declare const FileMessage: new (content: IFileMessageBody) => import("../baseMessage").BaseMessage<IFileMessageBody>;
|
|
24
|
+
export default FileMessage;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GIF 消息
|
|
3
|
+
*/
|
|
4
|
+
export interface IGIFMessageBody {
|
|
5
|
+
/**
|
|
6
|
+
* GIF 图片资源 url 地址
|
|
7
|
+
*/
|
|
8
|
+
originalObjectKey: string;
|
|
9
|
+
/**
|
|
10
|
+
* 图片扩展名
|
|
11
|
+
*/
|
|
12
|
+
extension: string;
|
|
13
|
+
/**
|
|
14
|
+
* 图片宽度
|
|
15
|
+
*/
|
|
16
|
+
width: number;
|
|
17
|
+
/**
|
|
18
|
+
* 图片高度
|
|
19
|
+
*/
|
|
20
|
+
height: number;
|
|
21
|
+
/**
|
|
22
|
+
* 图片的加密密钥
|
|
23
|
+
*/
|
|
24
|
+
encryptKey?: string;
|
|
25
|
+
}
|
|
26
|
+
declare const GIFMessage: new (content: IGIFMessageBody) => import("../baseMessage").BaseMessage<IGIFMessageBody>;
|
|
27
|
+
export default GIFMessage;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IUserInfo, IExtraData, IMentionedInfo } from '../baseMessage';
|
|
2
|
+
/**
|
|
3
|
+
* 图片消息
|
|
4
|
+
*/
|
|
5
|
+
export interface IImageMessageBody extends IExtraData, IMentionedInfo, IUserInfo {
|
|
6
|
+
/**
|
|
7
|
+
* 图片的扩展名
|
|
8
|
+
*/
|
|
9
|
+
extension?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 缩略图远程地址
|
|
12
|
+
*/
|
|
13
|
+
thumbnailObjectKey: string;
|
|
14
|
+
/**
|
|
15
|
+
* 原图远程地址
|
|
16
|
+
*/
|
|
17
|
+
originalObjectKey: string;
|
|
18
|
+
/**
|
|
19
|
+
* 图片的加密密钥
|
|
20
|
+
*/
|
|
21
|
+
encryptKey?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 图片的宽
|
|
24
|
+
*/
|
|
25
|
+
width: number;
|
|
26
|
+
/**
|
|
27
|
+
* 图片的高
|
|
28
|
+
*/
|
|
29
|
+
height: number;
|
|
30
|
+
}
|
|
31
|
+
declare const ImageMessage: new (content: IImageMessageBody) => import("../baseMessage").BaseMessage<IImageMessageBody>;
|
|
32
|
+
export default ImageMessage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import TextMessage, { ITextMessageBody } from './textMessage';
|
|
2
|
+
import ImageMessage, { IImageMessageBody } from './imageMessage';
|
|
3
|
+
import GIFMessage, { IGIFMessageBody } from './gifMessage';
|
|
4
|
+
import HQVoiceMessage, { IHQVoiceMessageBody } from './voiceMessage';
|
|
5
|
+
import FileMessage, { IFileMessageBody } from './fileMessage';
|
|
6
|
+
import VideoMessage, { IVideoMessageBody } from './videoMessage';
|
|
7
|
+
import { ILocationMessageBody, LocationMessage, IChatRecordMessageBody, ChatRecordMessage, IContactMessageBody, ContactMessage, IInvitationMessageBody, InvitationMessage, IRedEnvelopeMessageBody, RedEnvelopeMessage, ITransferMessageBody, TransferMessage, ILinkMessageBody, LinkMessage } from './otherMediaMessages';
|
|
8
|
+
import { IBurnAfterReadingMessageBody } from './notificationMessages';
|
|
9
|
+
import { PrivateOpenBurnAfterReadingMessage, PrivateCloseBurnAfterReadingMessage, GroupOpenBurnAfterReadingMessage, GroupCloseBurnAfterReadingMessage } from './notificationMessages';
|
|
10
|
+
import RecallCommandMessage, { IRecallCommandMessageBody } from './recallCommandMessage';
|
|
11
|
+
export { TextMessage, ImageMessage, GIFMessage, HQVoiceMessage, FileMessage, RecallCommandMessage, VideoMessage, LocationMessage, ChatRecordMessage, ContactMessage, InvitationMessage, RedEnvelopeMessage, TransferMessage, PrivateOpenBurnAfterReadingMessage, PrivateCloseBurnAfterReadingMessage, GroupOpenBurnAfterReadingMessage, GroupCloseBurnAfterReadingMessage, LinkMessage };
|
|
12
|
+
export type { ITextMessageBody, IImageMessageBody, IGIFMessageBody, IHQVoiceMessageBody, IFileMessageBody, IRecallCommandMessageBody, IVideoMessageBody, ILocationMessageBody, IChatRecordMessageBody, IContactMessageBody, IInvitationMessageBody, IRedEnvelopeMessageBody, ITransferMessageBody, IBurnAfterReadingMessageBody, ILinkMessageBody };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IBaseMessageBody } from "../baseMessage";
|
|
2
|
+
export interface IReceiptMessageBody extends IBaseMessageBody {
|
|
3
|
+
groupId?: string;
|
|
4
|
+
destId?: string;
|
|
5
|
+
msgIdList: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface IBurnAfterReadingMessageBody extends IBaseMessageBody {
|
|
8
|
+
burnAfterReadingTime: number;
|
|
9
|
+
params?: string[];
|
|
10
|
+
templateId: number;
|
|
11
|
+
}
|
|
12
|
+
declare const GroupArrivalReceiptMessage: new (content: IReceiptMessageBody) => import("../baseMessage").BaseMessage<IReceiptMessageBody>;
|
|
13
|
+
declare const GroupReadReceiptMessage: new (content: IReceiptMessageBody) => import("../baseMessage").BaseMessage<IReceiptMessageBody>;
|
|
14
|
+
declare const PrivateArrivalReceiptMessage: new (content: IReceiptMessageBody) => import("../baseMessage").BaseMessage<IReceiptMessageBody>;
|
|
15
|
+
declare const PrivateReadReceiptMessage: new (content: IReceiptMessageBody) => import("../baseMessage").BaseMessage<IReceiptMessageBody>;
|
|
16
|
+
declare const PrivateOpenBurnAfterReadingMessage: new (content: IBurnAfterReadingMessageBody) => import("../baseMessage").BaseMessage<IBurnAfterReadingMessageBody>;
|
|
17
|
+
declare const PrivateCloseBurnAfterReadingMessage: new (content: IBurnAfterReadingMessageBody) => import("../baseMessage").BaseMessage<IBurnAfterReadingMessageBody>;
|
|
18
|
+
declare const GroupOpenBurnAfterReadingMessage: new (content: IBurnAfterReadingMessageBody) => import("../baseMessage").BaseMessage<IBurnAfterReadingMessageBody>;
|
|
19
|
+
declare const GroupCloseBurnAfterReadingMessage: new (content: IBurnAfterReadingMessageBody) => import("../baseMessage").BaseMessage<IBurnAfterReadingMessageBody>;
|
|
20
|
+
export { GroupArrivalReceiptMessage, GroupReadReceiptMessage, PrivateArrivalReceiptMessage, PrivateReadReceiptMessage, PrivateOpenBurnAfterReadingMessage, PrivateCloseBurnAfterReadingMessage, GroupOpenBurnAfterReadingMessage, GroupCloseBurnAfterReadingMessage };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export interface ILocationMessageBody {
|
|
2
|
+
thumbnailObjectKey: string;
|
|
3
|
+
title: string;
|
|
4
|
+
desc: string;
|
|
5
|
+
locationType: number;
|
|
6
|
+
encryptKey?: string;
|
|
7
|
+
lat: number;
|
|
8
|
+
lon: number;
|
|
9
|
+
}
|
|
10
|
+
export interface IChatRecordMessageBody {
|
|
11
|
+
chatTitle: string;
|
|
12
|
+
msgDataFileKey: string;
|
|
13
|
+
msgList: Array<{
|
|
14
|
+
srcId: string;
|
|
15
|
+
senderNickname: string;
|
|
16
|
+
mediaConstructor: number;
|
|
17
|
+
msgPostContent: string;
|
|
18
|
+
}>;
|
|
19
|
+
encryptKey?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IChatRecordMsgDetail {
|
|
22
|
+
senderNickname: string;
|
|
23
|
+
senderAvatar?: string;
|
|
24
|
+
msgId: string;
|
|
25
|
+
srcId: string;
|
|
26
|
+
destId: string;
|
|
27
|
+
msgPreContent?: string;
|
|
28
|
+
msgPostContent?: string;
|
|
29
|
+
mediaConstructor: number;
|
|
30
|
+
mediaAttribute?: string;
|
|
31
|
+
msgSendTime: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IContactMessageBody {
|
|
34
|
+
uid: string;
|
|
35
|
+
nickname: string;
|
|
36
|
+
phoneNumber: string;
|
|
37
|
+
langcode: string;
|
|
38
|
+
smallAvatarUrl?: string;
|
|
39
|
+
gender: number;
|
|
40
|
+
}
|
|
41
|
+
export interface IInvitationMessageBody {
|
|
42
|
+
groupUin: string;
|
|
43
|
+
groupTitle: string;
|
|
44
|
+
inviteFromUin: string;
|
|
45
|
+
inviteFromNickName: string;
|
|
46
|
+
totalMemberCount: number;
|
|
47
|
+
createTime: number;
|
|
48
|
+
smallAvatarUrl?: string;
|
|
49
|
+
groupMemberSmallAvatarUrlArr?: string[];
|
|
50
|
+
}
|
|
51
|
+
export interface IRedEnvelopeMessageBody {
|
|
52
|
+
id: number;
|
|
53
|
+
createTime: string;
|
|
54
|
+
updateTime: string;
|
|
55
|
+
amount: string;
|
|
56
|
+
count: number;
|
|
57
|
+
uid: string;
|
|
58
|
+
nativeNumber: string;
|
|
59
|
+
nativeType: number;
|
|
60
|
+
sendSign: string;
|
|
61
|
+
title: string;
|
|
62
|
+
symbol: string;
|
|
63
|
+
receivedStatus: number;
|
|
64
|
+
status: number;
|
|
65
|
+
expireTime: number;
|
|
66
|
+
currency: string;
|
|
67
|
+
currencyLogo: string;
|
|
68
|
+
refundAmount: string;
|
|
69
|
+
receivedAmount?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ITransferMessageBody {
|
|
72
|
+
id: number;
|
|
73
|
+
createTime: string;
|
|
74
|
+
updateTime: string;
|
|
75
|
+
uid: string;
|
|
76
|
+
orderId: string;
|
|
77
|
+
src: string;
|
|
78
|
+
symbol: string;
|
|
79
|
+
type: number;
|
|
80
|
+
toUid: string;
|
|
81
|
+
nativeType: number;
|
|
82
|
+
money: number;
|
|
83
|
+
refName: string;
|
|
84
|
+
transNo: string;
|
|
85
|
+
status: number;
|
|
86
|
+
pushStatus: number;
|
|
87
|
+
currency: string;
|
|
88
|
+
currencyLogo: string;
|
|
89
|
+
network: string;
|
|
90
|
+
networkLogo: string;
|
|
91
|
+
refId: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ILinkMessageBody {
|
|
94
|
+
url: string;
|
|
95
|
+
title?: string;
|
|
96
|
+
content?: string;
|
|
97
|
+
}
|
|
98
|
+
declare let LocationMessage: new (content: ILocationMessageBody) => import("../baseMessage").BaseMessage<ILocationMessageBody>;
|
|
99
|
+
declare let ChatRecordMessage: new (content: IChatRecordMessageBody) => import("../baseMessage").BaseMessage<IChatRecordMessageBody>;
|
|
100
|
+
declare let ContactMessage: new (content: IContactMessageBody) => import("../baseMessage").BaseMessage<IContactMessageBody>;
|
|
101
|
+
declare let InvitationMessage: new (content: IInvitationMessageBody) => import("../baseMessage").BaseMessage<IInvitationMessageBody>;
|
|
102
|
+
declare let RedEnvelopeMessage: new (content: IRedEnvelopeMessageBody) => import("../baseMessage").BaseMessage<IRedEnvelopeMessageBody>;
|
|
103
|
+
declare let TransferMessage: new (content: ITransferMessageBody) => import("../baseMessage").BaseMessage<ITransferMessageBody>;
|
|
104
|
+
declare let LinkMessage: new (content: ILinkMessageBody) => import("../baseMessage").BaseMessage<ILinkMessageBody>;
|
|
105
|
+
export { LocationMessage, ChatRecordMessage, ContactMessage, InvitationMessage, RedEnvelopeMessage, TransferMessage, LinkMessage };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IBaseMessageBody } from "../baseMessage";
|
|
2
|
+
/**
|
|
3
|
+
* 撤回通知消息(被撤回消息摘要)
|
|
4
|
+
*/
|
|
5
|
+
export interface IRecallCommandMessageBody extends IBaseMessageBody {
|
|
6
|
+
messageUId: string;
|
|
7
|
+
}
|
|
8
|
+
declare const RecallCommandMessage: new (content: IRecallCommandMessageBody) => import("../baseMessage").BaseMessage<IRecallCommandMessageBody>;
|
|
9
|
+
export default RecallCommandMessage;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IMentionedInfo } from '../baseMessage';
|
|
2
|
+
/**
|
|
3
|
+
* 文本消息
|
|
4
|
+
*/
|
|
5
|
+
export interface ITextMessageBody extends IMentionedInfo {
|
|
6
|
+
/**
|
|
7
|
+
* 文本消息内容
|
|
8
|
+
*/
|
|
9
|
+
content: string;
|
|
10
|
+
}
|
|
11
|
+
declare const TextMessage: new (content: ITextMessageBody) => import("../baseMessage").BaseMessage<ITextMessageBody>;
|
|
12
|
+
export default TextMessage;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IMentionedInfo } from '../baseMessage';
|
|
2
|
+
export interface IVideoMessageBody extends IMentionedInfo {
|
|
3
|
+
/**
|
|
4
|
+
* 远程媒体资源地址
|
|
5
|
+
*/
|
|
6
|
+
videoObjectKey: string;
|
|
7
|
+
/**
|
|
8
|
+
* 缩略图的远程媒体资源地址
|
|
9
|
+
*/
|
|
10
|
+
thumbnailObjectKey: string;
|
|
11
|
+
/**
|
|
12
|
+
* 编解码类型,默认为 mp4
|
|
13
|
+
*/
|
|
14
|
+
extension?: string;
|
|
15
|
+
encryptKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 视频宽度
|
|
18
|
+
*/
|
|
19
|
+
width: number;
|
|
20
|
+
/**
|
|
21
|
+
* 视频高度
|
|
22
|
+
*/
|
|
23
|
+
height: number;
|
|
24
|
+
/**
|
|
25
|
+
* 视频时长描述
|
|
26
|
+
*/
|
|
27
|
+
during: string;
|
|
28
|
+
}
|
|
29
|
+
declare const VideoMessage: new (content: IVideoMessageBody) => import("../baseMessage").BaseMessage<IVideoMessageBody>;
|
|
30
|
+
export default VideoMessage;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IMentionedInfo } from '../baseMessage';
|
|
2
|
+
export interface IHQVoiceMessageBody extends IMentionedInfo {
|
|
3
|
+
/**
|
|
4
|
+
* 远程媒体资源地址
|
|
5
|
+
*/
|
|
6
|
+
audioObjectKey: string;
|
|
7
|
+
/**
|
|
8
|
+
* 语音消息的时长,最大值为 60 (单位:秒)
|
|
9
|
+
*/
|
|
10
|
+
length: number;
|
|
11
|
+
/**
|
|
12
|
+
* 编解码类型,默认为 m4a 音频
|
|
13
|
+
*/
|
|
14
|
+
extension?: string;
|
|
15
|
+
encryptKey?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const VoiceMessage: new (content: IHQVoiceMessageBody) => import("../baseMessage").BaseMessage<IHQVoiceMessageBody>;
|
|
18
|
+
export default VoiceMessage;
|
|
@@ -281,11 +281,7 @@ export declare enum ConversationType {
|
|
|
281
281
|
/**
|
|
282
282
|
* 群组聊天
|
|
283
283
|
*/
|
|
284
|
-
GROUP = 3
|
|
285
|
-
/**
|
|
286
|
-
* 超级群
|
|
287
|
-
*/
|
|
288
|
-
ULTRA_GROUP = 10
|
|
284
|
+
GROUP = 3
|
|
289
285
|
}
|
|
290
286
|
/**
|
|
291
287
|
* 群组 @ 类型
|
|
@@ -363,25 +359,21 @@ export declare enum SentStatus {
|
|
|
363
359
|
}
|
|
364
360
|
export declare enum ReceivedStatus {
|
|
365
361
|
/**
|
|
366
|
-
*
|
|
367
|
-
*/
|
|
368
|
-
READ = 1,
|
|
369
|
-
/**
|
|
370
|
-
* 已听
|
|
362
|
+
* 初始状态
|
|
371
363
|
*/
|
|
372
|
-
|
|
364
|
+
IDLE = 0,
|
|
373
365
|
/**
|
|
374
|
-
*
|
|
366
|
+
* 已接收
|
|
375
367
|
*/
|
|
376
|
-
|
|
368
|
+
RECEIVED = 1,
|
|
377
369
|
/**
|
|
378
|
-
*
|
|
370
|
+
* 已读
|
|
379
371
|
*/
|
|
380
|
-
|
|
372
|
+
READ = 2,
|
|
381
373
|
/**
|
|
382
|
-
*
|
|
374
|
+
* 已听
|
|
383
375
|
*/
|
|
384
|
-
|
|
376
|
+
LISTENED = 3
|
|
385
377
|
}
|
|
386
378
|
/**
|
|
387
379
|
* 免打扰等级
|