import { FastifyRequest, FastifyReply } from 'fastify';
import { IdempotencyStore } from '../../adapters/redis/IdempotencyStore';
export interface IdempotencyOptions {
    enabled: boolean;
    ttlSeconds: number;
    store: IdempotencyStore;
}
export interface IdempotencyKey {
    key: string;
    tenant?: string;
    route: string;
    bodyHash: string;
    response: any;
    statusCode: number;
    headers?: Record<string, string>;
    createdAt: Date;
    expiresAt: Date;
}
export interface IdempotencyResult {
    isIdempotent: boolean;
    existingResponse?: {
        statusCode: number;
        body: any;
        headers?: Record<string, string>;
    };
    conflict?: {
        existingHash: string;
        newHash: string;
        message: string;
    };
}
export declare function createIdempotencyMiddleware(options: IdempotencyOptions): (request: FastifyRequest, reply: FastifyReply) => Promise<undefined>;
export declare function captureIdempotencyResponse(request: FastifyRequest, reply: FastifyReply, payload: any): Promise<any>;
declare module 'fastify' {
    interface FastifyRequest {
        idempotencyContext?: {
            key: string;
            tenant: string;
            route: string;
            bodyHash: string;
            store: IdempotencyStore;
        };
    }
}
//# sourceMappingURL=idempotency.d.ts.map