import type { Result } from '../deps/jsr.io/@wentools/result/0.1.3/src/mod.js'; interface RetryOptions { maxAttempts: number; initialDelayMs: number; maxDelayMs: number; backoffStrategy: 'exponential' | 'linear' | 'constant'; jitter?: boolean; shouldRetry?: (error: TError, attempt: number) => boolean; onRetry?: (attempt: number, error: TError, nextDelayMs: number) => void; } interface RetryError { type: 'RETRY_EXHAUSTED'; message: string; attempts: number; lastError: TOriginalError; errors: TOriginalError[]; } /** * Single execution attempt of a retryable operation * * Represents one attempt to execute the operation, whether it's the * first attempt or a retry. Includes timing and result information. */ interface ExecutionAttempt { /** Attempt number (1 = first attempt, 2 = first retry, etc.) */ attemptNumber: number; /** Duration of this specific attempt in milliseconds */ duration: number; /** Result of this attempt (Ok or Err) */ result: Result; /** Timestamp when this attempt started */ timestamp: Date; /** Delay before this attempt (0 for first attempt) */ delayBeforeMs: number; } /** * Complete execution metadata for a retry operation * * Contains the final result plus full execution history of all attempts. * Provides rich context for monitoring, debugging, and audit trails. */ interface ExecutionMetadata { /** The final result of the operation (after all attempts) */ result: Result; /** Total number of attempts made (1 = no retries, 2 = 1 retry, etc.) */ totalAttempts: number; /** Total wall-clock duration including all delays in milliseconds */ totalDuration: number; /** Complete history of all execution attempts */ attempts: ExecutionAttempt[]; /** Convenience: whether the operation ultimately succeeded */ succeeded: boolean; /** Convenience: number of retries needed (totalAttempts - 1) */ retriesNeeded: number; } declare const defaultRetryOptions: Partial; export type { RetryOptions, RetryError, ExecutionAttempt, ExecutionMetadata }; export { defaultRetryOptions }; //# sourceMappingURL=types.d.ts.map