import { AnyFunction, IMMetaTypes } from "./Meta.i";
import { UtilTypes } from "./Util.i";
import { ChatTypes, GroupTypes, MessageTypes, UserTypes } from "./Request.i";
export declare type Diff<T extends keyof any, U extends keyof any> = ({
    [P in T]: P;
} & {
    [P in U]: never;
} & {
    [x: string]: never;
})[T];
export declare type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U;
export declare namespace SIMTypes {
    /** 会话类型 */
    enum ChatTypeEnum {
        SingleChat = 0,
        GroupChat = 1,
        SubscribeChat = 2,
        SubscribeBoxChat = 10
    }
    interface SIMProps {
        debug?: boolean;
        apiBaseUrl: string;
        serverip: string;
    }
    interface LoginParams {
        appId: string;
        userId: string;
        userSig: string;
        appversion: string;
        bundleId?: string;
    }
    /** 发送消息的domain字段 */
    interface SendMsgDomainType {
        reply?: {
            ancestor: string;
            replyId: string;
            abstract: string;
        };
    }
    /** 发送文本消息体的内容 */
    interface SendTextMsgContentType {
        text: string;
        /** @ 的人员列表 */
        members?: string[];
    }
    /** 单张图片的内容 */
    interface SendImageItemType {
        /** 0-原图  1-缩略大图  2-缩略小图 */
        type: 0 | 1 | 2;
        url: string;
        size: number;
        width: number;
        height: number;
    }
    /** 发送图片消息体的内容 */
    interface SendPicMsgContentType {
        /** 0-JPG，1-PNG，225-未知类型 */
        format: 0 | 1 | 255;
        imageList: SendImageItemType[];
    }
    /** 发送音频文件消息体的内容 */
    interface SendAudioMsgContentType {
        size: number;
        /** 类型 */
        format: number;
        /** 时长 - 秒 */
        duration: number;
        /** 下载地址 */
        downUrl: string;
    }
    /** 发送视频文件消息体的内容 */
    interface SendVideoMsgContentType {
        /** 视频地址 */
        videoUrl: string;
        /** 视频大小 - b */
        videoSize: number;
        /** 视频时长 - 毫秒 */
        duration: number;
        /** 0-AVI，1-RM，2-RMVB，3-WMV，4-MP4，225-未知类型 */
        videoFormat: 0 | 1 | 2 | 3 | 4 | 255;
        /** 封面地址 */
        coverUrl: string;
        /** 封面宽度 - px */
        coverWidth: number;
        /** 封面高度 - px */
        coverHeight: number;
        /** 封面大小 - kb */
        coverSize: number;
        /** 封面类型，0-JPG，1-PNG，225-未知类型 */
        coverFormat: 0 | 1 | 255;
    }
    /** 发送文件消息体的内容 */
    interface SendFileMsgContentType {
        /** 文件类型 */
        format: UtilTypes.FileFormatEnum;
        /** 文件大小 - b */
        size: number;
        /** 下载地址 */
        downUrl: string;
        /** 文件名称 */
        filename: string;
    }
    /** 发送合并转发消息体的内容 */
    interface SendMergeForwardContentType {
        title: string;
        content: string;
        ids: string[];
        chatType: ChatTypeEnum;
    }
    /** 发送自定义表情消息体的内容 */
    interface SendCustomEmojiContentType {
        /** 表情的MD */
        imgMd: string;
        /** 表情地址 */
        imgUrl: string;
        /** 表情大小 */
        size: number;
        /** 表情宽度 */
        width: number;
        /** 表情高度 */
        height: number;
    }
    /** 发送自定义消息体的内容 */
    interface SendExtraMsgContentType {
        data: string;
    }
    /** 发送消息的message字段类型释义 */
    type SendMsgContentTypes = {
        [IMMetaTypes.SendNormalMsgTypeEnum.Msg_Text]: SendTextMsgContentType;
        [IMMetaTypes.SendNormalMsgTypeEnum.Msg_Pic]: SendPicMsgContentType;
        [IMMetaTypes.SendNormalMsgTypeEnum.Msg_Audio]: SendAudioMsgContentType;
        [IMMetaTypes.SendNormalMsgTypeEnum.Msg_Video]: SendVideoMsgContentType;
        [IMMetaTypes.SendNormalMsgTypeEnum.Msg_File]: SendFileMsgContentType;
        [IMMetaTypes.SendNormalMsgTypeEnum.Msg_MergeForward]: SendMergeForwardContentType;
        [IMMetaTypes.SendNormalMsgTypeEnum.Msg_CustomEmoji]: SendCustomEmojiContentType;
        [IMMetaTypes.SendNormalMsgTypeEnum.Msg_Extra]: SendExtraMsgContentType;
    };
    type SendMsgContentType<T extends IMMetaTypes.SendNormalMsgTypeEnum> = SendMsgContentTypes[T];
    /** 发送消息的字段 */
    interface SendMsgItem<T extends IMMetaTypes.SendNormalMsgTypeEnum> {
        /** 接收者 */
        receiver: string;
        /** 消息内容 */
        message: SendMsgContentType<T>;
        /** 安全类型，0-普通，1-密聊 */
        securityType: 0 | 1;
        /** 会话类型 */
        chatType: ChatTypeEnum;
        /** 是否跨域 */
        cross: 0 | 1;
        /** 消息类型 */
        type: T;
        /** 消息ID */
        packetId?: string;
        /** 消息扩展字段 */
        domain?: SendMsgDomainType;
        /** 发送时间 */
        time?: number;
        /** 群类型，可选值[0:私密群，1:公开群，2:讨论组] */
        groupType?: 0 | 1 | 2;
        /** 是否有离线推送 */
        offlinePush?: boolean;
        /** 离线推送内容 */
        offlinePushInfo?: string;
    }
    /** 已读消息的参数类型 */
    interface ReadMsgParamsType {
        /** 已读的消息 */
        id: string;
        /** 会话类型 */
        chatType: ChatTypeEnum;
        /** 密聊类型 */
        securityType: 0 | 1;
        /** 是否跨域 */
        cross: 0 | 1;
        /** 接收者 */
        receiver: string;
        /** 时间 */
        time?: number;
    }
    /** 撤回消息方法的参数 */
    interface RevocationMsgParamsType {
        /** 撤回的消息 */
        id: string;
        /** 会话类型 */
        chatType: ChatTypeEnum;
        /** 密聊类型 */
        securityType: 0 | 1;
        /** 是否跨域 */
        cross: 0 | 1;
        /** 接受者 */
        receiver: string;
        /** 时间 */
        time?: number;
    }
    /** 获取消息已读状态的参数 */
    interface FetchMsgReadParamsType {
        /** 已读的消息 */
        id: string;
        /** 会话类型 */
        chatType: ChatTypeEnum;
        /** 密聊类型 */
        securityType: 0 | 1;
        /** 是否跨域 */
        cross: 0 | 1;
        /** 接受者 */
        receiver: string;
        /** 消息类型 */
        msgType: IMMetaTypes.MsgTypeEnum;
        /** 时间 */
        time?: number;
    }
    /** 删除消息的参数 */
    interface DeleteMsgParamsType {
        /** 删除的消息 */
        id: string;
        /** 会话类型 */
        chatType: ChatTypeEnum;
        /** 密聊类型 */
        securityType: 0 | 1;
        /** 是否跨域 */
        cross: 0 | 1;
        /** 接受者 */
        receiver: string;
        /** 删除类型 0-删除自己的（只影响自己），1-删除所有人（影响所有人） */
        delType?: 0 | 1;
        /** 时间 */
        time?: number;
    }
    interface GetOffLineMsgParamsType {
        /** 上次同步时间 */
        lastMsgTime?: number;
        /** 登陆时间 */
        loginTime?: number;
        /**  后台消息id，最开始一条id */
        tId?: string;
        /** 查询类型，0单聊，1群聊，2指令 */
        queryType: 0 | 1 | 2;
    }
    enum VVCEventMethod {
        uCreate = "uCreate",
        uBusy = "uBusy",
        uCancel = "uCancel",
        uAccept = "uAccept",
        uHangUp = "uHangUp",
        uRefuse = "uRefuse",
        heartBeat = "heartBeat",
        uChange = "uChange",
        uHeartBeat = "uHeartBeat",
        gCreate = "gCreate",
        gHangUp = "gHangUp",
        gAccept = "gAccept",
        gRefuse = "gRefuse",
        gInvite = "gInvite",
        gJoin = "gJoin",
        hangUp = "hangUp"
    }
    interface SendVVCEventParams {
        sender: string;
        method: VVCEventMethod;
        cross: 0 | 1;
        conId?: string;
        communicateType?: number;
        version?: string;
        overTimes?: number;
        receiver?: string;
        uniqueId?: string;
    }
    interface SendInitMessageCountParams {
        chatId: string;
        chatType: SIMTypes.ChatTypeEnum;
        securityType: 0 | 1;
        time?: number;
    }
}
export interface SIMInterface {
    Version?: string;
    utils: {
        getGuid: (x?: number) => string;
    };
    login: (params: SIMTypes.LoginParams) => Promise<string>;
    logout: () => Promise<void>;
    addEventListener: (eventName: string, callback: AnyFunction) => void;
    removeEventListener: (eventName?: string, callback?: AnyFunction) => void;
    testOnline: (delay?: number) => void;
    /** 发送基础消息 */
    sendMsg<T extends IMMetaTypes.SendNormalMsgTypeEnum>(params: SIMTypes.SendMsgItem<T>): Promise<string>;
    /** 已读消息 */
    readMsg(params: SIMTypes.ReadMsgParamsType): Promise<string>;
    /** 撤回消息 */
    revocationMsg(params: SIMTypes.RevocationMsgParamsType): Promise<string>;
    /** 获取消息已读状态 */
    fetchMsgReadState(params: SIMTypes.FetchMsgReadParamsType): Promise<string>;
    /** 删除消息 */
    deleteMsg(params: SIMTypes.DeleteMsgParamsType): Promise<string>;
    /** 获取离线消息 */
    getOfflineMsg(params: SIMTypes.GetOffLineMsgParamsType): Promise<string>;
    /** 初始化会话消息统计数量 */
    initMessageCount(params: SIMTypes.SendInitMessageCountParams): Promise<string>;
    /** 群组相关的接口模块 */
    Group: GroupTypes.GroupInterfaceType;
    /** 人员用户相关的接口模块 */
    User: UserTypes.UserInterfaceType;
    /** 会话相关的接口模块 */
    Chat: ChatTypes.ChatInterfaceType;
    /** 消息相关的接口模块 */
    Message: MessageTypes.MessageInterfaceType;
}
