/**
 * @fileoverview Idempotency utilities for Supabase Edge Functions
 * @description Provides idempotency checking and storage using Postgres table
 *
 * @version 0.1.0
 * @since 0.5.0
 * @author AMBROISE PARK Consulting
 */
import type { SupabaseClient } from '@supabase/supabase-js';
/**
 * Check if an operation has already been processed (idempotency check)
 *
 * @param supabaseAdmin - Supabase admin client
 * @param idempotencyKey - Client-provided idempotency key
 * @param operation - Operation name (e.g., 'create', 'update')
 * @returns Cached result if found, null otherwise
 */
export declare function checkIdempotency<T>(supabaseAdmin: SupabaseClient, idempotencyKey: string, operation: string): Promise<T | null>;
/**
 * Store the result of an operation for idempotency
 *
 * @param supabaseAdmin - Supabase admin client
 * @param idempotencyKey - Client-provided idempotency key
 * @param operation - Operation name (e.g., 'create', 'update')
 * @param result - Operation result to cache
 * @param uid - User ID who processed the operation
 * @param ttlHours - Optional TTL override (defaults to operation-specific TTL)
 */
export declare function storeIdempotency<T>(supabaseAdmin: SupabaseClient, idempotencyKey: string, operation: string, result: T, uid: string, ttlHours?: number): Promise<void>;
/**
 * Clean up expired idempotency records
 *
 * @param supabaseAdmin - Supabase admin client
 * @returns Number of deleted records
 */
export declare function cleanupExpiredIdempotency(supabaseAdmin: SupabaseClient): Promise<number>;
