@uimkit/uikit-react
Version:
<img style="width:64px" src="https://mgmt.uimkit.chat/media/img/avatar.png"/>
236 lines (233 loc) • 8.03 kB
TypeScript
import { EventHandler } from './events.js';
import { IMAccount, PageListQueryParameters, EmptyObject, PageListResponse, CursorListQueryParameters, CursorListResponse, Contact, Group, Conversation, Moment, Message, ConversationType, MessageType, ImageMessageBody, AudioMessageBody, VideoMessageBody, GroupMember } from './models.js';
type GetIMAccountParameters = {
account_id: string;
subscribe?: boolean;
};
type GetIMAccountResponse = IMAccount;
type GetAccountListParameters = PageListQueryParameters<EmptyObject> & {
provider?: string;
subscribe?: boolean;
};
type GetAccountListResponse = PageListResponse<IMAccount>;
type GetContactListParameters = CursorListQueryParameters<EmptyObject> & {
account_id: string;
};
type GetContactListResponse = CursorListResponse<Contact>;
type GetGroupListParameters = PageListQueryParameters<EmptyObject> & {
account_id: string;
};
type GetGroupsResponse = PageListResponse<Group>;
type GetConversationsParameters = CursorListQueryParameters<EmptyObject> & {
account_id: string;
};
type GetConversationsResponse = CursorListResponse<Conversation>;
type GetConversationParameters = {
conversation_id: string;
};
type GetConversationResponse = Conversation;
type GetContactConversationParameters = {
account_id: string;
user_id: string;
};
type GetContactConversationResponse = Conversation;
type GetGroupConversationParameters = {
account_id: string;
group_id: string;
};
type GetGroupConversationResponse = Conversation;
type ResetConversationUnreadParameters = {
conversation_id: string;
};
type ResetConversationUnreadResponse = Conversation;
type GetContactParameters = {
account_id: string;
user_id: string;
};
type GetContactResponse = Contact;
type AddContactParameters = {
account_id: string;
contact: string;
hello_message?: string;
};
type AddContactResponse = {
success: boolean;
reason?: string;
};
type GetGroupParameters = {
account_id: string;
group_id: string;
};
type GetGroupResponse = Group;
type GetGroupMemberListParameters = CursorListQueryParameters<EmptyObject> & {
group_id: string;
};
type GetAccountMomentListParameters = CursorListQueryParameters<{
account_id: string;
}>;
type GetContactMomentListParameters = CursorListQueryParameters<{
contact_id: string;
}>;
type GetMomentListResponse = CursorListResponse<Moment>;
type GetMessageListParameters = CursorListQueryParameters<EmptyObject> & {
conversation_id: string;
};
type GetMessageListResponse = CursorListResponse<Message>;
type SendMessageDirectParameters = {
from: string;
to: string;
conversation_type: ConversationType;
type: MessageType;
text?: string;
image?: ImageMessageBody;
audio?: AudioMessageBody;
video?: VideoMessageBody;
};
type SendMessageToConversationParameters = {
conversation_id: string;
type: MessageType;
text?: string;
image?: ImageMessageBody;
voice?: AudioMessageBody;
video?: VideoMessageBody;
};
type SendMessageParameters = SendMessageDirectParameters | SendMessageToConversationParameters;
type SendMessageResponse = Message;
type ResendMessageParameters = {
message_id: string;
};
type ResendMessageResponse = Message;
type DeleteMessageParameters = {
message_id: string;
};
type DeleteMessageResponse = any;
type GetGroupMemberListResponse = CursorListResponse<GroupMember>;
interface APIClient {
/******************** IMAccount ********************/
getAccountList(params: GetAccountListParameters): Promise<GetAccountListResponse>;
/******************** Contact ********************/
/**
*
* @param params
*/
getContactList(params: GetContactListParameters): Promise<GetContactListResponse>;
getContact(params: any): Promise<Contact>;
/******************** Message ********************/
/**
*
* @param params
*/
createTextMessage(params: any): Message;
/**
*
* @param params
*/
createFaceMessage(params: any): Message;
/**
*
* @param params
*/
createVideoMessage(params: any): Message;
/**
*
* @param params
*/
createImageMessage(params: any): Message;
/**
*
* @param params
*/
createFileMessage(params: any): Message;
/**
*
* @param params
*/
createLocationMessage(params: any): Message;
/**
*
* @param params
*/
createMergerMessage(params: any): Message;
/**
*
* @param params
*/
createTextAtMessage(params: any): Message;
/**
*
* @param params
*/
createCustomMessage(params: any): Message;
/**
*
* @param params
*/
createAudioMessage(params: any): Message;
/**
*
* @param params
*/
getAccount(params: any): Promise<IMAccount>;
/**
*
* @param params
*/
getMessageList(params: GetMessageListParameters): Promise<GetMessageListResponse>;
/**
* 发送消息
* @param params
*/
sendMessage(message: any | Message): Promise<any>;
deleteMessage(id: string): Promise<any>;
/**
* 删除消息的接口
* @param messageList
*/
getMessage(messageList: any): Promise<any>;
/**
* 重发消息的接口,当消息发送失败时,可调用该接口进行重发。
* @param @Message message 消息实例
*/
resendMessage(message: any | Message): Promise<any>;
/**
*
* @param message
*/
revokeMessage(message: any): Promise<any>;
/******************** Conversation ********************/
createConversation(params: any): Promise<Conversation>;
/**
*
* @param params 获取会话列表
*/
getConversationList(params: any): Promise<any>;
getConversation(params: any): Promise<Conversation>;
/**
* 删除会话
* @param id
*/
deleteConversation(id: string): Promise<void>;
getContactConversation(params: any): Promise<Conversation>;
resetConversationUnread(params: any): Promise<any>;
/**
* 标记会话消息为已读
* @param id
*/
setConversationRead(conversationID: string): Promise<void>;
/**
* 置顶会话
* @param conversationID 会话ID
* @param pinned true 置顶; false 取消置顶
*/
pinConversation(conversationID: string, pinned: boolean): Promise<void>;
/******************** Group ********************/
getGroup(params: any): Promise<Group>;
getGroupList(params: GetGroupListParameters): Promise<GetGroupMemberListResponse>;
getGroupMembers(query: GetGroupMemberListParameters): Promise<GetGroupMemberListResponse>;
on(event: string, handler: EventHandler): any;
off(event: string, handler: EventHandler): any;
/******************** Moment ********************/
getContactMomentList(params: GetContactMomentListParameters): Promise<GetMomentListResponse>;
}
export { APIClient, AddContactParameters, AddContactResponse, DeleteMessageParameters, DeleteMessageResponse, GetAccountListParameters, GetAccountListResponse, GetAccountMomentListParameters, GetContactConversationParameters, GetContactConversationResponse, GetContactListParameters, GetContactListResponse, GetContactMomentListParameters, GetContactParameters, GetContactResponse, GetConversationParameters, GetConversationResponse, GetConversationsParameters, GetConversationsResponse, GetGroupConversationParameters, GetGroupConversationResponse, GetGroupListParameters, GetGroupMemberListParameters, GetGroupMemberListResponse, GetGroupParameters, GetGroupResponse, GetGroupsResponse, GetIMAccountParameters, GetIMAccountResponse, GetMessageListParameters, GetMessageListResponse, GetMomentListResponse, ResendMessageParameters, ResendMessageResponse, ResetConversationUnreadParameters, ResetConversationUnreadResponse, SendMessageDirectParameters, SendMessageParameters, SendMessageResponse, SendMessageToConversationParameters };
//# sourceMappingURL=api.d.ts.map