/**
 * Type definitions for mailpouch (the Proton Mail MCP server)
 */
export interface SMTPConfig {
    host: string;
    port: number;
    secure: boolean;
    username: string;
    password: string;
    /** Optional SMTP token for direct smtp.protonmail.ch submission (paid plans only) */
    smtpToken?: string;
    /** Path to exported Proton Bridge TLS certificate for proper localhost cert trust */
    bridgeCertPath?: string;
    /**
     * Explicit opt-in to accept the local Bridge connection without a pinned TLS cert.
     * Default false → the service refuses to start when localhost is used without a cert.
     * Set true (or MAILPOUCH_INSECURE_BRIDGE=1) to preserve the pre-2026-04 behavior.
     */
    allowInsecureBridge?: boolean;
}
export interface IMAPConfig {
    host: string;
    port: number;
    secure: boolean;
    username: string;
    password: string;
    /** Path to exported Proton Bridge TLS certificate for proper localhost cert trust */
    bridgeCertPath?: string;
    /** See SMTPConfig.allowInsecureBridge — same semantics for IMAP. */
    allowInsecureBridge?: boolean;
}
export interface ProtonMailConfig {
    smtp: SMTPConfig;
    imap: IMAPConfig;
    debug?: boolean;
    autoSync?: boolean;
    syncInterval?: number;
    autoStartBridge?: boolean;
    bridgePath?: string;
    settingsPort?: number;
}
export interface EmailMessage {
    id: string;
    from: string;
    to: string[];
    cc?: string[];
    bcc?: string[];
    subject: string;
    body: string;
    bodyPreview?: string;
    isHtml: boolean;
    date: Date;
    folder: string;
    isRead: boolean;
    isStarred: boolean;
    hasAttachment: boolean;
    attachments?: EmailAttachment[];
    headers?: Record<string, string | string[]>;
    inReplyTo?: string;
    references?: string[];
    isAnswered?: boolean;
    isForwarded?: boolean;
    isSignedPGP?: boolean;
    isEncryptedPGP?: boolean;
    protonId?: string;
}
export interface EmailAttachment {
    filename: string;
    contentType: string;
    size: number;
    content?: Buffer | string;
    contentId?: string;
}
export interface EmailFolder {
    name: string;
    path: string;
    totalMessages: number;
    unreadMessages: number;
    specialUse?: string;
    /** Proton Bridge folder classification */
    folderType?: 'system' | 'user-folder' | 'label';
}
export interface EmailStats {
    totalEmails: number;
    unreadEmails: number;
    starredEmails: number;
    totalFolders: number;
    totalContacts: number;
    averageEmailsPerDay: number;
    mostActiveContact: string;
    mostUsedFolder: string;
    storageUsedMB: number;
}
export interface EmailAnalytics {
    volumeTrends: {
        date: string;
        received: number;
        sent: number;
    }[];
    topSenders: {
        email: string;
        count: number;
        lastContact: Date;
    }[];
    topRecipients: {
        email: string;
        count: number;
        lastContact: Date;
    }[];
    /** Null when there are no sent replies with matching received emails to measure against. */
    responseTimeStats: {
        average: number;
        median: number;
        fastest: number;
        slowest: number;
        sampleSize: number;
    } | null;
    peakActivityHours: {
        hour: number;
        count: number;
    }[];
    attachmentStats: {
        totalAttachments: number;
        totalSizeMB: number;
        averageSizeMB: number;
        mostCommonTypes: {
            type: string;
            count: number;
        }[];
    };
}
export interface Contact {
    email: string;
    name?: string;
    /** Email domain (e.g. "anthropic.com") */
    domain: string;
    /** Inferred organization name from domain; absent for personal email providers */
    organization?: string;
    emailsSent: number;
    emailsReceived: number;
    lastInteraction: Date;
    firstInteraction: Date;
    averageResponseTime?: number;
    isFavorite?: boolean;
}
export interface SendEmailOptions {
    to: string | string[];
    cc?: string | string[];
    bcc?: string | string[];
    subject: string;
    body: string;
    isHtml?: boolean;
    priority?: "high" | "normal" | "low";
    replyTo?: string;
    attachments?: EmailAttachment[];
    inReplyTo?: string;
    references?: string[];
    headers?: Record<string, string>;
}
export interface SearchEmailOptions {
    /** @deprecated Use body or text for full-text search instead. */
    query?: string;
    folder?: string;
    /** Search across multiple folders. Use ["*"] to search all folders (capped at 20). */
    folders?: string[];
    from?: string;
    to?: string;
    subject?: string;
    hasAttachment?: boolean;
    isRead?: boolean;
    isStarred?: boolean;
    dateFrom?: string;
    dateTo?: string;
    limit?: number;
    body?: string;
    text?: string;
    bcc?: string;
    header?: {
        field: string;
        value: string;
    };
    answered?: boolean;
    isDraft?: boolean;
    larger?: number;
    smaller?: number;
    sentBefore?: Date;
    sentSince?: Date;
}
/** Options for saving an email as a draft (all fields optional — drafts can be incomplete). */
export interface SaveDraftOptions {
    to?: string | string[];
    cc?: string | string[];
    bcc?: string | string[];
    subject?: string;
    body?: string;
    isHtml?: boolean;
    attachments?: EmailAttachment[];
    inReplyTo?: string;
    references?: string[];
}
/** A scheduled email queued for future delivery. */
export interface ScheduledEmail {
    id: string;
    scheduledAt: string;
    options: SendEmailOptions;
    status: "pending" | "sending" | "sent" | "failed" | "cancelled";
    createdAt: string;
    error?: string;
    retryCount?: number;
    /** ISO-8601 earliest time the next send attempt may run (per-item backoff). */
    nextAttemptAt?: string;
}
export interface ConnectionStatus {
    smtp: {
        connected: boolean;
        host: string;
        port: number;
        lastCheck: Date;
        error?: string;
    };
    imap: {
        connected: boolean;
        host: string;
        port: number;
        lastCheck: Date;
        error?: string;
    };
}
export interface LogEntry {
    timestamp: Date;
    level: "debug" | "info" | "warn" | "error";
    context: string;
    message: string;
    data?: unknown;
}
//# sourceMappingURL=index.d.ts.map