import { DownloadFnParamTypes } from './types';
import type { AnyBlock, AnyLink, DbMeta, Loadable, Loader } from '@fireproof/encrypted-blockstore';
import { DataStore as DataStoreBase, MetaStore as MetaStoreBase, RemoteWAL as RemoteWALBase, WALState } from '@fireproof/encrypted-blockstore';
import { Connection } from './connection';
export type LoadHandler = (dbMetas: DbMeta[]) => Promise<void>;
export declare function makeStores(storage: Connection, meta: Connection): {
    makeDataStore: (name: string) => RemoteDataStore;
    makeMetaStore: (loader: Loader) => RemoteMetaStore;
    makeRemoteWAL: (loader: Loadable) => RemoteWAL;
};
export declare class RemoteDataStore extends DataStoreBase {
    tag: string;
    connection: Connection;
    type: DownloadFnParamTypes;
    constructor(name: string, connection: Connection, type?: DownloadFnParamTypes);
    prefix(): string;
    load(carCid: AnyLink): Promise<AnyBlock>;
    save(car: AnyBlock, opts?: {
        public?: boolean;
    }): Promise<void | AnyLink>;
    remove(_cid: AnyLink): Promise<void>;
}
export declare class RemoteMetaStore extends MetaStoreBase {
    tag: string;
    connection: Connection;
    subscribers: Map<string, LoadHandler[]>;
    constructor(name: string, connection: Connection);
    onLoad(branch: string, loadHandler: LoadHandler): () => void;
    prefix(): string;
    handleByteHeads(byteHeads: Uint8Array[], branch?: string): Promise<DbMeta[]>;
    load(branch?: string): Promise<DbMeta[] | null>;
    save(meta: DbMeta, branch?: string): Promise<DbMeta[] | null>;
    dbMetasForByteHeads(byteHeads: Uint8Array[]): DbMeta[];
}
export declare class RemoteWAL extends RemoteWALBase {
    tag: string;
    store: Map<string, string>;
    constructor(loader: Loadable);
    headerKey(branch: string): string;
    load(branch?: string): Promise<WALState | null>;
    save(state: WALState, branch?: string): Promise<void>;
}
