@uimkit/uikit-react
Version:
<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>
282 lines (279 loc) • 6.28 kB
TypeScript
import { ChatConfigWithInfo } from './index.js';
declare enum MessageType {
Text = "text",
Image = "image",
Audio = "audio",
Video = "video",
File = "file",
Location = "location",
Face = "face",
Link = "link",
Merger = "merger",
Calling = "calling",
Custom = "custom",
GroupTip = "group_tip",
GroupSystemNotice = "group_system_notice"
}
type Provider = {
identifier: string;
name: string;
};
/**
* 用户档案,IMAccount 应该继承这个
*/
interface Profile {
id: string;
name: string;
nickname?: string;
avatar?: string;
gender?: number;
}
interface IMAccount extends Profile {
provider: string;
created_at: number;
presence: string;
unread?: number;
}
/**
* 联系人
*/
interface Contact extends Profile {
id: string;
account: string;
marked: boolean;
created_at: number;
}
/**
* 群成员
*/
interface GroupMember extends Profile {
id: string;
group_id: string;
nickname: string;
avatar: string;
}
declare enum MomentType {
Video = "video"
}
/**
* 动态 / 朋友圈
*/
interface Moment {
id: string;
type: MomentType;
}
type Image = {
url: string;
height?: number;
width?: number;
};
interface ImageMessageBody {
infos: Image[];
}
interface AudioMessageBody {
url: string;
duration: number;
}
interface VideoMessageBody {
}
interface CallingMessagePayload {
data: any;
}
interface GroupSystemNoticeMessagePayload {
groupProfile: any;
operatorID: string;
operationType: number;
userDefinedField: any;
}
declare enum GroupTipOperationType {
MemberJoin = 1,
MemberQuit = 2,
MemberKickedOut = 3,
MemberSetAdmin = 4,
MemberCanceledAdmin = 5,
GroupProfileUpdated = 6,
MemberProfileUpdated = 7
}
interface GroupTipMessagePayload {
operationType: GroupTipOperationType;
operatorID: string;
userIDList: string[];
memberList: string[];
newGroupProfile?: any;
}
interface Message {
id: string;
/**
* 消息类型
*/
type: MessageType;
text?: string;
image?: ImageMessageBody;
audio?: AudioMessageBody;
video?: VideoMessageBody;
calling?: CallingMessagePayload;
tip?: GroupTipMessagePayload;
group_system_notice?: GroupSystemNoticeMessagePayload;
/**
* 消息发送者的头像地址
*/
avatar?: string;
/**
* 消息发送者的昵称, 是否应该叫 nick
*/
name: string;
account: string;
sent_at: number;
nick?: string;
data?: any;
/**
* 消息所属的会话 ID
*/
conversation_id: string;
conversation_type: ConversationType;
/**
* TODO 发送方的 id
*/
from?: string;
/**
* TODO 接收方的 id
*/
to: string;
/**
* 消息的流向
in 为收到的消息
out 为发出的消息
*/
flow: string;
/**
* 是否被撤回
*/
revoked: boolean;
fromAccount: string;
nameCard: string;
sending: boolean;
succeeded: boolean;
failed: boolean;
failed_reason?: string;
mentioned_users?: Profile[];
/**
* 消息状态
* unSend(未发送)
* success(发送成功)
* fail(发送失败)
*/
status: string;
}
declare enum ConversationType {
Private = "private",
Group = "group",
System = "system"
}
interface Conversation {
id: string;
/**
* 会话类型
*/
type: ConversationType;
/**
* TODO 群组会话类型, 聊天室 / 直播群
*/
name: string;
contact?: Contact;
group?: Group;
/**
* 未读计数。GRP_MEETING / GRP_AVCHATROOM 类型的群组会话不记录未读计数
*/
unread: number;
/**
* 会话最新的消息
*/
last_message?: Message;
/**
* 会话是否置顶
*/
pinned: boolean;
/**
* 会话所属的账户id
*/
accountId: string;
account: string;
/**
* 时间戳(ms)
*/
active_at: number;
/**
* 创建时间 时间戳(ms)
*/
created_at: number;
/**
* 参与者,当会话是群时,代表 群id, 当会话是个人时,代表 用户id
*/
participant: string;
config?: ChatConfigWithInfo;
}
interface Group {
id: string;
name: string;
avatar: string;
}
interface GroupInvitation {
}
interface GroupApplication {
}
type EmptyObject = Record<string, unknown>;
type PageListQueryParameters<T> = T & {
offset?: number;
limit?: number;
};
type PageListExtra = {
offset: number;
limit: number;
total: number;
};
type PageListResponse<T> = {
extra: PageListExtra;
data: Array<T>;
};
type Cursor = string | number;
type CursorDirection = "after" | "before";
type CursorListQueryParameters<T> = T & {
cursor?: Cursor;
direction?: CursorDirection;
limit?: number;
};
type CursorListExtra = {
has_next: boolean;
has_previous: boolean;
start_cursor?: Cursor;
end_cursor?: Cursor;
limit: number;
};
type CursorListResponse<T> = {
extra: CursorListExtra;
data: Array<T>;
};
type FriendApplication = {};
declare enum SortDirection {
DESC = "desc",
ASC = "asc"
}
type Filter = any;
type SortField = {
field: string;
direction: SortDirection;
};
type SearchQuery = {
filter?: Filter;
sort?: SortField[];
limit?: number;
};
type UserFilter = {};
interface UserSearchQuery extends SearchQuery {
filter: UserFilter;
sort?: SortField[];
limit?: number;
}
type CreateGroupConversationParams = {};
export { AudioMessageBody, CallingMessagePayload, Contact, Conversation, ConversationType, CreateGroupConversationParams, Cursor, CursorDirection, CursorListExtra, CursorListQueryParameters, CursorListResponse, EmptyObject, Filter, FriendApplication, Group, GroupApplication, GroupInvitation, GroupMember, GroupSystemNoticeMessagePayload, GroupTipMessagePayload, GroupTipOperationType, IMAccount, Image, ImageMessageBody, Message, MessageType, Moment, MomentType, PageListExtra, PageListQueryParameters, PageListResponse, Profile, Provider, SearchQuery, SortDirection, SortField, UserFilter, UserSearchQuery, VideoMessageBody };
//# sourceMappingURL=models.d.ts.map