/// <reference types="readable-stream" />
import type { EventLog } from '../types/event-log.js';
import type { GenericMessageReply } from '../core/message-reply.js';
import type { MethodHandler } from '../types/method-handler.js';
import type { DataStore, DidResolver, MessageStore } from '../index.js';
import type { RecordsDeleteMessage, RecordsWriteMessage } from '../types/records-types.js';
import { RecordsWrite } from '../interfaces/records-write.js';
export declare type RecordsWriteHandlerOptions = {
    skipDataStorage?: boolean;
};
declare type HandlerArgs = {
    tenant: string;
    message: RecordsWriteMessage;
    options?: RecordsWriteHandlerOptions;
    dataStream?: _Readable.Readable;
};
export declare class RecordsWriteHandler implements MethodHandler {
    private didResolver;
    private messageStore;
    private dataStore;
    private eventLog;
    constructor(didResolver: DidResolver, messageStore: MessageStore, dataStore: DataStore, eventLog: EventLog);
    handle({ tenant, message, options, dataStream }: HandlerArgs): Promise<GenericMessageReply>;
    /**
     * Puts the given data in storage unless tenant already has that data for the given recordId
     *
     * @throws {DwnError} with `DwnErrorCode.RecordsWriteMissingDataStream`
     *                    if `dataStream` is absent AND the `dataCid` does not match the current data for the given recordId
     * @throws {DwnError} with `DwnErrorCode.RecordsWriteMissingData`
     *                    if `dataStream` is absent AND dataStore does not contain the given `dataCid`
     * @throws {DwnError} with `DwnErrorCode.RecordsWriteDataCidMismatch`
     *                    if the data stream resulted in a data CID that mismatches with `dataCid` in the given message
     * @throws {DwnError} with `DwnErrorCode.RecordsWriteDataSizeMismatch`
     *                    if `dataSize` in `descriptor` given mismatches the actual data size
     */
    putData(tenant: string, message: RecordsWriteMessage, dataStream?: _Readable.Readable, newestExistingMessage?: RecordsWriteMessage | RecordsDeleteMessage): Promise<void>;
}
export declare function constructRecordsWriteIndexes(recordsWrite: RecordsWrite, isLatestBaseState: boolean): Promise<Record<string, string>>;
export {};
//# sourceMappingURL=records-write.d.ts.map