import type { AssociateResult, DataStore, GetResult, PutResult } from '../types/data-store.js';
import { BlockstoreLevel } from './blockstore-level.js';
import { createLevelDatabase } from './level-wrapper.js';
import { Readable } from 'readable-stream';
/**
 * A simple implementation of {@link DataStore} that works in both the browser and server-side.
 * Leverages LevelDB under the hood.
 *
 * It has the following structure (`+` represents a sublevel and `->` represents a key->value pair):
 *   'data' + <tenant> + <dataCid> -> <data>
 *   'references' + <tenant> + <dataCid> + <messageCid> -> PLACEHOLDER_VALUE
 *
 * This allows for the <data> to be shared for everything that uses the same <dataCid> while also making
 * sure that the <data> can only be deleted if there are no <messageCid> for any <tenant> still using it.
 */
export declare class DataStoreLevel implements DataStore {
    config: DataStoreLevelConfig;
    blockstore: BlockstoreLevel;
    constructor(config?: DataStoreLevelConfig);
    open(): Promise<void>;
    close(): Promise<void>;
    put(tenant: string, messageCid: string, dataCid: string, dataStream: Readable): Promise<PutResult>;
    get(tenant: string, messageCid: string, dataCid: string): Promise<GetResult | undefined>;
    associate(tenant: string, messageCid: string, dataCid: string): Promise<AssociateResult | undefined>;
    delete(tenant: string, messageCid: string, dataCid: string): Promise<void>;
    /**
     * Deletes everything in the store. Mainly used in tests.
     */
    clear(): Promise<void>;
    dump(): Promise<void>;
    /**
     * Gets the blockstore used for reference counting purposes for the given `dataCid` in the given `tenant`.
     */
    private getBlockstoreForReferenceCounting;
    /**
     * Gets the blockstore used for storing data for the given `dataCid` in the given `tenant`.
     */
    private getBlockstoreForStoringData;
}
declare type DataStoreLevelConfig = {
    blockstoreLocation?: string;
    createLevelDatabase?: typeof createLevelDatabase;
};
export {};
//# sourceMappingURL=data-store-level.d.ts.map