import { MemoryBlockstore } from '@alanshaw/pail/block';
import { BlockFetcher, AnyBlock, AnyLink, BulkResult, ClockHead, DbCarHeader, IdxCarHeader, IdxMeta, CarCommit, CarMakeable } from './types';
import { DbLoader, IdxLoader } from './loader';
export declare class Transaction extends MemoryBlockstore implements CarMakeable {
    private parent;
    constructor(parent: BlockFetcher);
    get(cid: AnyLink): Promise<AnyBlock | undefined>;
    superGet(cid: AnyLink): Promise<AnyBlock | undefined>;
}
declare abstract class FireproofBlockstore implements BlockFetcher {
    ready: Promise<IdxCarHeader | DbCarHeader>;
    name: string | null;
    loader: DbLoader | IdxLoader | null;
    private transactions;
    constructor(name: string | null, LoaderClass: typeof DbLoader | typeof IdxLoader);
    abstract transaction(fn: (t: Transaction) => Promise<IdxMeta | BulkResult>, indexes?: Map<string, IdxMeta>): Promise<BulkResultCar | IdxMetaCar>;
    put(): Promise<void>;
    get(cid: AnyLink): Promise<AnyBlock | undefined>;
    commitCompaction(t: Transaction, head: ClockHead): Promise<AnyLink | undefined>;
    entries(): AsyncIterableIterator<AnyBlock>;
    protected executeTransaction<T, R>(fn: (t: Transaction) => Promise<T>, commitHandler: (t: Transaction, done: T) => Promise<{
        car?: AnyLink;
        done: R;
    }>): Promise<R>;
}
export declare class IndexBlockstore extends FireproofBlockstore {
    ready: Promise<IdxCarHeader>;
    constructor(name?: string);
    transaction(fn: (t: Transaction) => Promise<IdxMeta>, indexes: Map<string, IdxMeta>): Promise<IdxMetaCar>;
}
export declare class TransactionBlockstore extends FireproofBlockstore {
    ready: Promise<DbCarHeader>;
    constructor(name?: string);
    transaction(fn: (t: Transaction) => Promise<BulkResult>): Promise<BulkResultCar>;
}
type IdxMetaCar = IdxMeta & CarCommit;
type BulkResultCar = BulkResult & CarCommit;
export {};
