import { ReplayStrategy } from '../../types/service-response-store';
export interface KosOfflineQueueLogger {
    info: (...args: any[]) => void;
    warn: (...args: any[]) => void;
    error: (...args: any[]) => void;
    debug: (...args: any[]) => void;
}
/**
 * Queued event with temporal metadata
 */
export interface QueuedEvent {
    /**
     * Event handler function
     */
    handler: () => void;
    /**
     * When this event was received at the framework (timestamp)
     * Used for baseline-delta temporal filtering
     */
    receivedAt: number;
    /**
     * Topic this event was received on (for debugging)
     */
    topic?: string;
    /**
     * Event payload (for debugging)
     */
    payload?: any;
}
/**
 * Statistics about queued events
 */
export interface QueueStatistics {
    /**
     * Total events in queue
     */
    total: number;
    /**
     * Oldest event timestamp
     */
    oldestEventAt?: number;
    /**
     * Newest event timestamp
     */
    newestEventAt?: number;
    /**
     * Events that would be replayed with AFTER_REQUEST strategy
     */
    afterRequest?: number;
    /**
     * Events that would be replayed with AFTER_RESPONSE strategy
     */
    afterResponse?: number;
}
export declare class KosOfflineQueue {
    private log;
    private queue;
    constructor(log: KosOfflineQueueLogger);
    /**
     * Enqueue an event handler with temporal tracking
     *
     * @param handler - Event handler function
     * @param topic - Optional topic for debugging
     * @param payload - Optional payload for debugging
     */
    enqueue(handler: () => void, topic?: string, payload?: any): void;
    /**
     * Flush all queued events (original behavior for backward compatibility)
     */
    flush(): void;
    /**
     * Flush queued events with temporal filtering strategy
     * Used for baseline-delta race condition handling
     *
     * @param strategy - Replay strategy to use
     * @param baselineRequestedAt - When baseline request was sent (for AFTER_REQUEST)
     * @param baselineReceivedAt - When baseline response received (for AFTER_RESPONSE)
     */
    flushWithStrategy(strategy: ReplayStrategy, baselineRequestedAt?: number, baselineReceivedAt?: number): void;
    /**
     * Filter events based on replay strategy
     * @private
     */
    private filterEventsByStrategy;
    /**
     * Get queue statistics for monitoring
     */
    getStatistics(baselineRequestedAt?: number, baselineReceivedAt?: number): QueueStatistics;
    clear(): void;
    get length(): number;
    get isEmpty(): boolean;
}
//# sourceMappingURL=kos-offline-queue.d.ts.map