import { DBSchema, IDBPDatabase } from 'idb';
import { ChatMessageItem, TChatItem, TTagOrStatusItem, UserItem } from '../store/type';
export interface ZignalChatDB extends DBSchema {
    chats: {
        key: string;
        value: {
            id: string;
            data: TChatItem;
            business_id: string;
            shop_id: string;
            updated_at: number;
        };
        indexes: {
            'by-business-shop': [string, string];
            'by-updated': number;
        };
    };
    messages: {
        key: string;
        value: {
            id: string;
            chat_id: string;
            data: ChatMessageItem;
            business_id: string;
            shop_id: string;
            message_at: number;
        };
        indexes: {
            'by-chat': string;
            'by-chat-time': [string, number];
        };
    };
    users: {
        key: string;
        value: {
            id: string;
            data: UserItem;
            business_id: string;
            shop_id: string;
            fetched_at: number;
        };
        indexes: {
            'by-business-shop': [string, string];
            'by-fetched': number;
        };
    };
    metadata: {
        key: string;
        value: {
            id: string;
            data: TTagOrStatusItem[] | unknown;
            business_id: string;
            shop_id: string;
            fetched_at: number;
        };
    };
    media: {
        key: string;
        value: {
            id: string;
            data: ArrayBuffer;
            content_type: string;
            size: number;
            business_id: string;
            shop_id: string;
            accessed_at: number;
            created_at: number;
        };
        indexes: {
            'by-business-shop': [string, string];
            'by-accessed': number;
            'by-size': number;
        };
    };
    sync_state: {
        key: string;
        value: {
            last_sync_at: number;
            business_id: string;
            shop_id: string;
            older_next?: string | null;
            older_prev?: string | null;
            newer_next?: string | null;
            newer_prev?: string | null;
        };
    };
}
export declare function initCacheDB(): Promise<IDBPDatabase<ZignalChatDB>>;
export declare function getCacheDB(): IDBPDatabase<ZignalChatDB> | null;
