import IMEnvironmentType from "../core/constant/IMEnvironmentType";
import React, { HTMLAttributes } from "react";
import { localeMap } from "../../locales/Locales";
import { Session } from "@newSdk/model/Chat";
import { GroupMembers } from "@newSdk/model/GroupMembers";
import IMReceiveMessageStatus from "packages/core/constant/IMReceiveMessageStatus";
import { LoginErrorCode } from "src/packages";
export interface NodeConfig {
    cachePath: string;
    nodeModules: {
        fs: any;
        path: any;
        process: any;
        electron: any;
        crypto: any;
    };
}
export interface SendMessageOption {
    aChatId: string;
    amid: string;
    content: string;
    type: number;
}
export type SendTextMessageOption = Pick<SendMessageOption, "aChatId" | "amid" | "content"> & {
    quoteAmid?: string;
};
export type SendAttachmentMessageOption = Pick<SendMessageOption, "aChatId" | "amid"> & {
    data: File | string;
};
export type SendImageMessageOption = SendAttachmentMessageOption & {
    data: File | string;
    isOrigin?: boolean;
};
export type SendForwardMessageOption = Pick<SendMessageOption, "aChatId" | "amid"> & {
    forwardAMid: string;
};
export type SendForwardMessageListOption = Pick<SendMessageOption, "aChatId"> & {
    items: (Pick<SendMessageOption, "amid"> & {
        forwardAMid: string;
    })[];
};
export type AtMessageContentItemType = "t" | "u";
export type AtMessageContentItem = {
    t: AtMessageContentItemType;
    v: string;
};
export type SendAtMessageOption = Pick<SendMessageOption, "aChatId" | "amid"> & {
    content: AtMessageContentItem[];
    quoteAmid?: string;
};
export type UpdateChatInfoOption = {
    aChatId: string;
    info: Pick<Session, "name" | "avatar">;
};
export interface Delegate {
    authCodeExpire: (auid: string, code: LoginErrorCode) => Promise<void>;
    onShowUserInfo: (auids: string[]) => void;
    onShowChatInfo: (aChatIds: string[]) => void;
    onReceiveMessages?: (messages: {
        aChatId: string;
        amid: string;
    }[]) => void;
    onReceiveCmd?: (data: string) => void;
    onSyncStateChange?: (status: IMReceiveMessageStatus) => void;
    onSendMessageFailed?: (amid: string, aChatId: string, error: {
        code: string;
        msg: any;
    }) => void;
    onDragFilesIntoChat?: (aChatId: string, files: FileList) => void;
    onConversationDeleted?: (aChatId: string) => void;
    onCloseByOtherDevice?: () => void;
}
export type IMConfig = {
    env: IMEnvironmentType;
    apiHost: string;
    wsHost: string;
    deviceId: string;
};
export interface CreateChatOptions {
    aChatId: string;
    chatName: string;
    avatar?: string;
    auids: Array<string>;
    delegate: {
        onSucc: () => void;
        onError: (e: {
            code?: number;
            errorMsg?: string;
        }) => void;
    };
}
export interface UserInfo {
    auid: string;
    item: {
        avatar: string;
        name: string;
        friendAlias?: string;
    };
}
export type UserGroupInfo = Omit<GroupMembers, "chatId" | "uid" | "gid" | "id">;
export interface ChatInfo {
    aChatId: string;
    item: {
        avatar?: string;
        name?: string;
    };
}
export type CustomAvatarViewUserInfo = {
    name: string;
    avatar: string;
    auid: string;
    fromWay: number | null;
};
export interface ChatDelegate {
    onButtonMessageClick?: (amid: string, buttonId: string) => void;
    onMiddleMessageClick?: (amid: string, tmpId: string, buttonId: string) => void;
    onShowCustomMessageView?: (amid: string, content: string) => React.ReactNode;
    onRenderCustomAvatarView?: (info: CustomAvatarViewUserInfo, contentNode: React.ReactNode) => React.ReactNode;
    onRenderFriendRequestView?: (info: CustomAvatarViewUserInfo, contentNode: React.ReactNode) => React.ReactNode;
    onMessageForward?: (amids: string[]) => void;
    onMessageQuote?: (amid: string, aUid: string, message: any) => void;
    onUserAvatarClick?: (amid: string, aChatId: string, aUid: string) => void;
    onMessageMultipleChooseClick?: (chooser: MessageMultipleChooser) => void;
    onMessageItemChoose?: (mid: string) => void;
    onMessageDownFile?: (amid: string, path: string) => void;
    onImagePreview?: (path: string, amid: string) => void;
    onVideoPreview?: (path: string, amid: string) => void;
    onFilePreview?: (path: string, amid: string) => void;
    onTextRegexClick?: (amid: string, id: string, content: string) => void;
}
export interface ChatViewProps extends HTMLAttributes<HTMLDivElement> {
    chatId?: string;
    onChatIdChange?: (chatId: string) => void;
    delegate?: ChatDelegate;
    viewModel?: ChatViewModel;
}
export interface ChatViewModel {
    scrollToSeq?: (seq: string) => void;
}
export interface MessageMultipleChooser {
    onCancelMessageMultipleChoose: () => void;
    getSelectMessageAmids: () => string[];
    getCanForwardSelectMessageAmids: () => string[];
}
export declare enum StrategyVoType {
    Image = 0,
    Video = 1,
    File = 2
}
export interface StrategyVo {
    type: StrategyVoType;
    data: any;
}
export interface ConversationDelegate {
    onItemClick?: (aChatId: string) => void;
    onSearchItemClick?: (seq: string, chatId: string) => void;
    onReadCountChange?: (data: {
        unreadCount: number;
        aChatId: string;
    }) => void;
    onTagRender?: (aChatId: string) => React.ReactNode;
}
export interface ConversationSelector {
    select: () => string[];
    unselect: () => string[];
}
export interface ConversationFolderOptions {
    aChatId: string;
    content: string;
    name: string;
    imageData: string;
}
export type LanguageType = keyof typeof localeMap;
