import { CachedDocument } from '../classes.cached.document.js';
/**
 * Email status in the cache
 */
export type TCachedEmailStatus = 'pending' | 'processing' | 'delivered' | 'failed' | 'deferred';
/**
 * CachedEmail - Stores email queue items in the cache
 *
 * Used for persistent email queue storage, tracking delivery status,
 * and maintaining email history for the configured TTL period.
 */
export declare class CachedEmail extends CachedDocument<CachedEmail> {
    createdAt: Date;
    expiresAt: Date;
    lastAccessedAt: Date;
    /**
     * Unique identifier for this email
     */
    id: string;
    /**
     * Email message ID (RFC 822 Message-ID header)
     */
    messageId: string;
    /**
     * Sender email address (envelope from)
     */
    from: string;
    /**
     * Recipient email addresses
     */
    to: string[];
    /**
     * CC recipients
     */
    cc: string[];
    /**
     * BCC recipients
     */
    bcc: string[];
    /**
     * Email subject
     */
    subject: string;
    /**
     * Raw RFC822 email content
     */
    rawContent: string;
    /**
     * Current status of the email
     */
    status: TCachedEmailStatus;
    /**
     * Number of delivery attempts
     */
    attempts: number;
    /**
     * Maximum number of delivery attempts
     */
    maxAttempts: number;
    /**
     * Timestamp for next delivery attempt
     */
    nextAttempt: Date;
    /**
     * Last error message if delivery failed
     */
    lastError: string;
    /**
     * Timestamp when the email was successfully delivered
     */
    deliveredAt: Date;
    /**
     * Sender domain (for querying/filtering)
     */
    senderDomain: string;
    /**
     * Priority level (higher = more important)
     */
    priority: number;
    /**
     * JSON-serialized route data
     */
    routeData: string;
    /**
     * DKIM signature status
     */
    dkimSigned: boolean;
    constructor();
    /**
     * Create a new CachedEmail with a unique ID
     */
    static createNew(): CachedEmail;
    /**
     * Find an email by ID
     */
    static findById(id: string): Promise<CachedEmail | null>;
    /**
     * Find all emails with a specific status
     */
    static findByStatus(status: TCachedEmailStatus): Promise<CachedEmail[]>;
    /**
     * Find all emails pending delivery (status = pending and nextAttempt <= now)
     */
    static findPendingForDelivery(): Promise<CachedEmail[]>;
    /**
     * Find emails by sender domain
     */
    static findBySenderDomain(domain: string): Promise<CachedEmail[]>;
    /**
     * Mark as delivered
     */
    markDelivered(): void;
    /**
     * Mark as failed with error
     */
    markFailed(error: string): void;
    /**
     * Increment attempt counter and schedule next attempt
     */
    scheduleRetry(delayMs?: number): void;
    /**
     * Extract sender domain from email address
     */
    updateSenderDomain(): void;
}
