export interface EmailConfig {
    domain: string;
    region?: string;
    mailboxes?: string[];
    storage?: {
        bucket?: string;
        prefix?: string;
        retentionDays?: number;
    };
    smtp?: {
        enabled?: boolean;
        username?: string;
    };
}
export interface EmailSetupResult {
    domainVerified: boolean;
    dkimStatus: string;
    dkimTokens?: string[];
    mailFromStatus?: string;
    receiptRuleSet?: string;
    storageBucket?: string;
    smtpCredentials?: {
        username: string;
        server: string;
        port: number;
    };
}
export interface SendEmailOptions {
    from?: string;
    fromName?: string;
    to: string | string[];
    cc?: string | string[];
    bcc?: string | string[];
    subject: string;
    text?: string;
    html?: string;
    replyTo?: string | string[];
    attachments?: Array<{
        filename: string;
        content: string;
        contentType?: string;
    }>;
}
export interface EmailDeploymentConfig {
    domain: string;
    accountId: string;
    region?: string;
    appName: string;
    environment: string;
    mailboxes?: string[];
    catchAll?: boolean;
    storage?: {
        bucketName?: string;
        prefix?: string;
    };
    notifications?: {
        bounces?: boolean;
        complaints?: boolean;
        newEmail?: boolean;
    };
}
/**
 * High-level Email client for serverless and server deployments
 */
export declare class EmailClient {
    private ses;
    private s3;
    private iam;
    private route53;
    private region;
    private domain?;
    private defaultFrom?;
    constructor(options?: {
        region?: string;
        domain?: string;
        defaultFrom?: string;
    });
    /**
     * Send an email
     */
    send(options: SendEmailOptions): Promise<{
        messageId: string;
    }>;
    /**
     * Send a templated email
     */
    sendTemplate(options: {
        from?: string;
        fromName?: string;
        to: string | string[];
        templateName: string;
        templateData: Record<string, any>;
        replyTo?: string | string[];
    }): Promise<{
        messageId: string;
    }>;
    /**
     * Send bulk emails using a template
     */
    sendBulk(options: {
        from?: string;
        templateName: string;
        defaultTemplateData: Record<string, any>;
        recipients: Array<{
            to: string | string[];
            templateData?: Record<string, any>;
        }>;
    }): Promise<{
        results: Array<{
            status: string;
            messageId?: string;
            error?: string;
        }>;
    }>;
    /**
     * Set up email for a domain (creates identity, DKIM, etc.)
     */
    setupDomain(domain: string): Promise<EmailSetupResult>;
    /**
     * Get DNS records needed for email verification
     */
    getDnsRecords(domain: string): Promise<Array<{
        type: string;
        name: string;
        value: string;
        priority?: number;
        ttl?: number;
    }>>;
    /**
     * Check if domain is fully verified and ready to send
     */
    isDomainReady(domain: string): Promise<boolean>;
    /**
     * Set up email receiving for a domain
     */
    setupReceiving(config: {
        domain: string;
        ruleSetName: string;
        ruleName: string;
        bucketName: string;
        prefix?: string;
        accountId: string;
        recipients?: string[];
        scanEnabled?: boolean;
        lambdaArn?: string;
    }): Promise<void>;
    /**
     * Get incoming emails from S3 bucket
     */
    getIncomingEmails(options: {
        bucket: string;
        prefix?: string;
        maxResults?: number;
    }): Promise<Array<{
        key: string;
        lastModified: string;
        size: number;
    }>>;
    /**
     * Read an email from S3
     */
    readEmail(options: {
        bucket: string;
        key: string;
    }): Promise<string>;
    /**
     * Create SMTP credentials for sending via email clients
     * Note: These use IAM users and SES SMTP interface
     */
    createSmtpCredentials(options: {
        username: string;
        domain: string;
    }): Promise<{
        username: string;
        password: string;
        server: string;
        port: number;
    }>;
    /**
     * Derive SMTP password from AWS secret access key
     * Based on AWS documentation for SES SMTP credentials
     */
    private deriveSmtpPassword;
    /**
     * Create an email template
     */
    createTemplate(options: {
        name: string;
        subject: string;
        text?: string;
        html?: string;
    }): Promise<void>;
    /**
     * Get an email template
     */
    getTemplate(name: string): Promise<{
        name: string;
        subject?: string;
        text?: string;
        html?: string;
    } | null>;
    /**
     * Delete an email template
     */
    deleteTemplate(name: string): Promise<void>;
    /**
     * List all email templates
     */
    listTemplates(): Promise<Array<{
        name: string;
        createdAt?: string;
    }>>;
    /**
     * Deploy full email infrastructure for an application
     */
    deploy(config: EmailDeploymentConfig): Promise<{
        success: boolean;
        domainVerified: boolean;
        dkimStatus: string;
        receiptRuleSet: string;
        storageBucket: string;
        dnsRecords: Array<{
            type: string;
            name: string;
            value: string;
        }>;
    }>;
    /**
     * Undeploy email infrastructure
     */
    undeploy(config: {
        appName: string;
        environment: string;
        domain: string;
        deleteBucket?: boolean;
    }): Promise<void>;
    /**
     * Get sending statistics
     */
    getSendingStats(): Promise<{
        sentLast24Hours: number;
        maxSendRate: number;
        max24HourSend: number;
    }>;
    /**
     * Build a raw MIME email with attachments
     */
    private buildRawEmail;
}
export declare const email: EmailClient;
