import { Logger } from 'pino';
import { GoveeApiClientError } from '../../errors';
import { RetryPolicy } from './RetryPolicy';
/**
 * Represents a request that can be retried
 */
export interface RetryableRequest<T> {
    /** Unique identifier for this request */
    id: string;
    /** Function that executes the actual request */
    execute: () => Promise<T>;
    /** Human-readable description of the request */
    description?: string;
    /** Custom context data for the request */
    context?: Record<string, unknown>;
}
/**
 * Result of a retry operation
 */
export interface RetryResult<T> {
    /** Whether the operation ultimately succeeded */
    success: boolean;
    /** The result if successful */
    data?: T;
    /** The final error if failed */
    error?: GoveeApiClientError;
    /** Number of attempts made */
    totalAttempts: number;
    /** Total time spent including retries */
    totalTimeMs: number;
    /** Details of each retry attempt */
    attempts: RetryAttempt[];
}
/**
 * Details of a single retry attempt
 */
export interface RetryAttempt {
    /** Attempt number (1-based) */
    attemptNumber: number;
    /** Timestamp when attempt started */
    startTime: Date;
    /** Duration of this attempt */
    durationMs: number;
    /** Whether this attempt succeeded */
    success: boolean;
    /** Error encountered (if any) */
    error?: GoveeApiClientError;
    /** Delay before this attempt (0 for first attempt) */
    delayBeforeAttemptMs: number;
}
/**
 * Configuration for retry executor
 */
export interface RetryExecutorConfig {
    /** Retry policy to use */
    retryPolicy: RetryPolicy;
    /** Logger for retry operations */
    logger?: Logger;
    /** Enable detailed request logging */
    enableRequestLogging?: boolean;
    /** Enable performance tracking */
    enablePerformanceTracking?: boolean;
}
/**
 * Enterprise-grade retry executor with comprehensive logging and metrics
 */
export declare class RetryExecutor {
    private readonly retryPolicy;
    private readonly logger?;
    private readonly enableRequestLogging;
    private readonly enablePerformanceTracking;
    constructor(retryPolicy: RetryPolicy, config?: Omit<RetryExecutorConfig, 'retryPolicy'>);
    /**
     * Executes a request with retry logic
     */
    execute<T>(request: RetryableRequest<T>): Promise<T>;
    /**
     * Executes a request with detailed retry result information
     */
    executeWithResult<T>(request: RetryableRequest<T>): Promise<RetryResult<T>>;
    /**
     * Executes a single attempt of the request
     */
    private executeAttempt;
    /**
     * Normalizes any error to a GoveeApiClientError
     */
    private normalizeError;
    /**
     * Utility function for sleeping
     */
    private sleep;
    /**
     * Logging methods for different stages of retry execution
     */
    private logRequestStart;
    private logRequestSuccess;
    private logRequestFailure;
    private logRetryAttempt;
    private logAttemptSuccess;
    private logAttemptFailure;
    /**
     * Gets current retry policy metrics
     */
    getMetrics(): Readonly<import("./RetryPolicy").RetryMetrics>;
    /**
     * Resets retry policy metrics
     */
    resetMetrics(): void;
}
/**
 * Factory for creating common retry executors
 */
export declare class RetryExecutorFactory {
    /**
     * Creates a retry executor optimized for Govee API operations
     */
    static createForGoveeApi(logger?: Logger): RetryExecutor;
    /**
     * Creates a conservative retry executor for production environments
     */
    static createConservative(logger?: Logger): RetryExecutor;
    /**
     * Creates an aggressive retry executor for development/testing
     */
    static createAggressive(logger?: Logger): RetryExecutor;
    /**
     * Creates a custom retry executor with specific policy
     */
    static createCustom(retryPolicy: RetryPolicy, logger?: Logger): RetryExecutor;
}
//# sourceMappingURL=RetryableRequest.d.ts.map