import { CarReader } from '@ipld/car';
import { Transaction } from './transaction';
import type { AnyBlock, AnyCarHeader, AnyLink, BulkResult, CarCommit, DbCarHeader, DbMeta, IdxCarHeader, IdxMeta, IdxMetaMap } from './types';
import { CID } from 'multiformats';
import { CarStore, HeaderStore } from './store';
type LoaderOpts = {
    public?: boolean;
};
declare abstract class Loader {
    name: string;
    opts: LoaderOpts;
    headerStore: HeaderStore | undefined;
    carStore: CarStore | undefined;
    carLog: AnyLink[];
    carReaders: Map<string, CarReader>;
    ready: Promise<AnyCarHeader>;
    key: string | undefined;
    keyId: string | undefined;
    static defaultHeader: AnyCarHeader;
    abstract defaultHeader: AnyCarHeader;
    constructor(name: string, opts?: LoaderOpts);
    commit(t: Transaction, done: IndexerResult | BulkResult, compact?: boolean): Promise<AnyLink>;
    getBlock(cid: CID): Promise<AnyBlock | undefined>;
    protected initializeStores(): Promise<void>;
    protected abstract makeCarHeader(_result: BulkResult | IndexerResult, _cars: AnyLink[], _compact: boolean): AnyCarHeader;
    protected loadCar(cid: AnyLink): Promise<CarReader>;
    protected ensureDecryptedReader(reader: CarReader): Promise<CarReader>;
    protected setKey(key: string): void;
    protected ingestCarHeadFromMeta(meta: DbMeta | null): Promise<AnyCarHeader>;
    protected getMoreReaders(cids: AnyLink[]): Promise<void>;
}
export declare class DbLoader extends Loader {
    ready: Promise<DbCarHeader>;
    static defaultHeader: {
        cars: never[];
        compact: never[];
        head: never[];
    };
    defaultHeader: {
        cars: never[];
        compact: never[];
        head: never[];
    };
    protected makeCarHeader({ head }: BulkResult, cars: AnyLink[], compact?: boolean): DbCarHeader;
}
export declare class IdxLoader extends Loader {
    ready: Promise<IdxCarHeader>;
    static defaultHeader: {
        cars: never[];
        compact: never[];
        indexes: Map<string, IdxMeta>;
    };
    defaultHeader: {
        cars: never[];
        compact: never[];
        indexes: Map<string, IdxMeta>;
    };
    protected makeCarHeader({ indexes }: IndexerResult, cars: AnyLink[], compact?: boolean): IdxCarHeader;
}
type IndexerResult = CarCommit & IdxMetaMap;
export {};
