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;
    chatUserUid?: string;
    chatUserAuid?: string;
    subTitle?: string;
    marker?: string;
    isFolder?: number;
    folderId?: 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;
    getSessionList(filter?: {
        (item: Session): boolean;
    }): Promise<Session[]>;
    getCurrentSessionSnapshot(): Session[];
    getSessionById(chatId: string): Promise<Session | undefined>;
    getSessionByIds(chatIds: string[]): Promise<Session[]>;
    /**
     * update session unread count & update last message
     * @param chatIds
     */
    bulkUpdateSessionInfo(chatIds: string[]): Promise<void>;
    addConversation(session: Session): void;
    updateSessionById(sessionId: string, updateOps: any, conversation?: Session): Promise<Session | undefined>;
    updateSessionByChatId(chatId: string, updateProps: Partial<Session>): Promise<void>;
    modifyByChatId(chatId: string, session: Partial<Session>): Promise<void>;
    updateSessionBulkIfExist(updateList: any[]): Promise<void>;
    bulkPutSession(putData: any[]): Promise<void>;
    updateUnread(chatId: string): Promise<void>;
    hideSessionByChatId(chatId: string, forceDel?: boolean): Promise<number | boolean | undefined>;
    showSessionByChatId(chatId: string): Promise<boolean>;
    handleHideSessionById(chatId: string, session: Session): Promise<boolean | undefined>;
    handlePublish(sessions: Session[]): void;
    deleteSession(chatId: string): Promise<void>;
    handleDeletePub(chatId: string): void;
}
declare const self: Chat;
export default self;
