/**
 * Async Memory Writer
 * Background worker for processing buffered memory writes with retry logic
 */
import { MemoryBuffer } from './buffer.js';
import { MemoryCore } from './memory-core.js';
export declare class CircuitBreaker {
    private failureThreshold;
    private recoveryTimeout;
    private failureCount;
    private lastFailureTime;
    private state;
    constructor(failureThreshold?: number, recoveryTimeout?: number);
    recordSuccess(): void;
    recordFailure(): void;
    canProceed(): boolean;
    getState(): string;
    getFailureCount(): number;
}
export interface WriterStats {
    writesAttempted: number;
    writesSucceeded: number;
    writesFailed: number;
    writesRetried: number;
    lastSuccessTime: number;
    lastFailureTime: number;
    circuitBreakerState: string;
    circuitBreakerFailures: number;
}
export declare class AsyncMemoryWriter {
    private buffer;
    private memoryCore;
    private maxRetries;
    private retryDelays;
    private circuitBreaker;
    private running;
    private pendingTask;
    private retryTask;
    private failureLogPath;
    private stats;
    constructor(buffer: MemoryBuffer, memoryCore: MemoryCore, maxRetries?: number, retryDelays?: number[], // milliseconds
    failureLogPath?: string);
    private ensureFailureLogDir;
    /**
     * Start background processing
     */
    start(): Promise<void>;
    /**
     * Stop background processing
     */
    stop(): Promise<void>;
    private processPendingLoop;
    private processRetryLoop;
    private writeWithVerification;
    private handleWriteFailure;
    private scheduleRetry;
    private handlePermanentFailure;
    /**
     * Get writer statistics
     */
    getStats(): Promise<WriterStats>;
    private sleep;
}
//# sourceMappingURL=writer.d.ts.map