import Dexie from "dexie";
import { Message } from "./Message";
export interface Session {
    id?: number;
    aChatId?: string;
    chatId: string;
    lastMessage?: Message;
    unreadCount?: number;
    isMute?: number;
    avatar?: string;
    name: string;
    isTop?: number;
    isShowName?: number;
    timestamp?: number;
    hide?: boolean;
    hideInfo?: {
        i?: number;
        seq: number;
    };
    stickActionTime?: number;
    total?: number;
    type?: number;
    onlyTwo?: number;
    subTitle?: string;
    marker?: string;
    isFolder?: number;
    folderId?: string;
    top_sequence?: number;
    chatPartner?: string;
}
export declare enum EventType {
    ChatChange = "Chat_Change"
}
declare class Chat {
    private db?;
    private userId?;
    private store?;
    private sessionSnapshot;
    static authorize: boolean;
    Event: {
        ChatChange: string;
    };
    init(db: Dexie): void;
    createNewSession(sessionProps: Session): Session | null;
    getUserId(): string | undefined;
    getManyByAChatId(aChatIds: string[]): Promise<Session[] | undefined>;
    getChatsByPartners(partners: string[]): Promise<Session[]>;
    getSessionListInit(): Promise<Session[]>;
    getSessionList(filter?: {
        (item: Session): boolean;
    }): Promise<Session[]>;
    getCurrentSessionSnapshot(): Session[];
    getSessionById(chatId: string): Promise<Session | undefined>;
    getChatIdsByTimeRange(from: number, to: number): Promise<string[] | undefined>;
    getByChatId(chatId: string): Promise<Session | undefined>;
    getSessionByIds(chatIds: string[]): Promise<Session[]>;
    bulkUpdateSessionInfo(chatIds: string[]): Promise<void>;
    addConversation(session: Session): import("dexie").PromiseExtended<void> | undefined;
    updateSessionById(sessionId: string, updateOps: any, conversation?: Session): Promise<Session | undefined>;
    updateSessionByChatId(chatId: string, updateProps: Partial<Session>): Promise<void>;
    bulkUpdateChatInfo(items: {
        chatId: string;
        item: {
            avatar?: string;
            name?: string;
        };
    }[]): Promise<void>;
    modifyByChatId(chatId: string, session: Partial<Session>): Promise<void>;
    getExistChatListOnPull(chatIds: any[]): Promise<{
        exits: {
            id: string;
            achat_id: string;
            only_two: number | undefined;
            type: number | undefined;
        }[];
        unExitsIds: any[];
    }>;
    updateSessionBulkIfExist(updateList: any[]): Promise<void>;
    bulkPutSession(putData: any[], isUpdate?: boolean): Promise<void>;
    updateUnread(chatId: string, count?: number): Promise<void>;
    hideSessionByChatId(chatId: string, forceDel?: boolean, isClear?: boolean): Promise<number | boolean | undefined>;
    showSessionByChatId(chatId: string): Promise<boolean>;
    handleHideSessionById(chatId: string, session: Session, isClear?: boolean): Promise<boolean | undefined>;
    handlePublish(sessions: Session[]): Promise<void>;
    deleteSession(chatId: string): Promise<void>;
    handleDeletePub(chatId: string): void;
}
declare const self: Chat;
export default self;
