import type { GenericMessageReply } from '../types/message-types.js';
import type { HandlerDependencies, MethodHandler } from '../types/method-handler.js';
import type { RecordsQueryReplyEntry, RecordsWriteMessage } from '../types/records-types.js';
type HandlerArgs = {
    tenant: string;
    message: RecordsWriteMessage;
    dataStream?: ReadableStream<Uint8Array>;
};
export declare class RecordsWriteHandler implements MethodHandler {
    private readonly deps;
    constructor(deps: HandlerDependencies);
    handle({ tenant, message, dataStream, }: HandlerArgs): Promise<GenericMessageReply>;
    /**
     * Returns a `RecordsQueryReplyEntry` with a copy of the incoming message and the incoming data encoded to `Base64URL`.
     */
    cloneAndAddEncodedData(message: RecordsWriteMessage, dataBytes: Uint8Array): Promise<RecordsQueryReplyEntry>;
    private processMessageWithDataStream;
    private getInitialWrite;
    private verifyImmutableProperties;
    private processMessageWithoutDataStream;
    /**
     * Enforces the squash backstop: if the incoming message is at a protocol path with `$squash: true`,
     * and there exists a squash record at the same protocol path and parent context whose
     * `messageTimestamp` is >= the incoming message's `messageTimestamp`, reject with 409.
     *
     * This check only applies to protocol-based records at `$squash: true` paths.
     */
    private enforceSquashBackstop;
    private authorizeRecordsWrite;
}
export {};
//# sourceMappingURL=records-write.d.ts.map