import type { DataStore, DataStoreGetResult, DataStorePutResult } from '../types/data-store.js';
import { BlockstoreLevel } from './blockstore-level.js';
import { createLevelDatabase } from './level-wrapper.js';
/**
 * A simple implementation of {@link DataStore} that works in both the browser and server-side.
 * Leverages LevelDB under the hood.
 *
 * It has the following sublevel structure (`+` represents an additional sublevel):
 *   'refs'      + <tenant> + <recordId>  : key <dataCid>  → JSON { dataSize }
 *   'blocks'    + <dataCid>              : key <blockCid>  → block data (shared)
 *   'refcounts' : key <dataCid>                            → JSON { count, dataSize }
 *
 * Identical data (same dataCid) is stored only once in the blocks sublevel.
 * Multiple (tenant, recordId) pairs can reference the same blocks.
 */
export declare class DataStoreLevel implements DataStore {
    config: DataStoreLevelConfig;
    blockstore: BlockstoreLevel;
    constructor(config?: DataStoreLevelConfig);
    open(): Promise<void>;
    close(): Promise<void>;
    put(tenant: string, recordId: string, dataCid: string, dataStream: ReadableStream<Uint8Array>): Promise<DataStorePutResult>;
    get(tenant: string, recordId: string, dataCid: string): Promise<DataStoreGetResult | undefined>;
    delete(tenant: string, recordId: string, dataCid: string): Promise<void>;
    /**
     * Deletes everything in the store. Mainly used in tests.
     */
    clear(): Promise<void>;
    /**
     * Gets the refs sublevel for the given tenant and recordId.
     * Caller uses `dataCid` as the key within the returned partition.
     */
    private getRefsPartition;
    /**
     * Gets the shared blocks sublevel for the given dataCid.
     * Used as a Blockstore for ipfs-unixfs-importer/exporter.
     */
    private getBlocksPartition;
    /**
     * Gets the refcounts sublevel.
     * Key: `dataCid` → JSON `{ count, dataSize }`.
     */
    private getRefcountsPartition;
}
export type DataStoreLevelConfig = {
    blockstoreLocation?: string;
    createLevelDatabase?: typeof createLevelDatabase;
};
//# sourceMappingURL=data-store-level.d.ts.map