import type { Kysely } from 'kysely';
import type { Database } from '../db/types.js';
/**
 * Delivery ID deduplication cache with dual-layer storage:
 * 1. In-memory Set for hot-path performance (last 10,000 IDs)
 * 2. Database persistence via dedup_cache table for durability
 *
 * In Hybrid mode, the same webhook may arrive both via WS relay and
 * direct ingestion -- the dedup cache ensures each is processed once.
 */
export declare class DedupCache {
    private readonly db;
    private readonly memoryCache;
    private readonly insertionOrder;
    constructor(db: Kysely<Database>);
    /**
     * Check if a delivery ID has already been processed.
     * Checks in-memory cache first (fast path), then DB.
     */
    exists(deliveryId: string): Promise<boolean>;
    /**
     * Mark a delivery ID as processed.
     * Inserts into both in-memory cache and database with 24h TTL.
     * Idempotent -- duplicate marks are silently ignored.
     */
    mark(deliveryId: string): Promise<void>;
    /**
     * Remove expired entries from the database.
     * Also trims the in-memory cache to MAX_MEMORY_CACHE_SIZE.
     *
     * @returns Number of expired entries deleted from database
     */
    cleanup(): Promise<number>;
    /**
     * Add a delivery ID to the in-memory cache, maintaining insertion order.
     */
    private addToMemoryCache;
    /**
     * Trim the in-memory cache to MAX_MEMORY_CACHE_SIZE entries,
     * removing the oldest entries first.
     */
    private trimMemoryCache;
}
//# sourceMappingURL=dedup.d.ts.map