/**
 * @module email-transport
 * Email-based transport adapter for xBind agent invitations.
 *
 * Enables viral growth through email-based connection discovery:
 * - Agent A sends email invite to Agent B
 * - Email contains one-click acceptance link
 * - Agent B clicks link, connection established
 * - No manual DID exchange required
 *
 * @example
 * ```ts
 * import { EmailTransport } from '@private.me/xbind/email-transport';
 *
 * const transport = new EmailTransport({
 *   smtpHost: process.env.SMTP_HOST,
 *   smtpPort: 587,
 *   smtpUser: process.env.SMTP_USER,
 *   smtpPass: process.env.SMTP_PASS,
 *   fromEmail: 'noreply@private.me',
 *   acceptBaseUrl: 'https://private.me/xbind/accept'
 * });
 *
 * const agent = await Agent.create({
 *   name: 'payment-processor',
 *   transport
 * });
 *
 * await agent.invite({
 *   to: 'fulfillment@acme.com',
 *   message: 'Connect our systems'
 * });
 * ```
 */
import { Result } from '@private.me/shared';
import type { XailTransportAdapter, TransportError, EnvelopeHandler } from './transport.js';
/**
 * Email transport configuration.
 */
export interface EmailTransportConfig {
    /** SMTP server hostname */
    smtpHost: string;
    /** SMTP server port (typically 587 for TLS) */
    smtpPort: number;
    /** SMTP authentication username */
    smtpUser: string;
    /** SMTP authentication password */
    smtpPass: string;
    /** Sender email address (e.g., noreply@private.me) */
    fromEmail: string;
    /** Sender display name (e.g., Private.Me) */
    fromName: string;
    /** Base URL for acceptance links (e.g., https://private.me/xbind/accept) */
    acceptBaseUrl: string;
    /** Rate limit: max invites per hour per agent (default: 10) */
    rateLimit?: number;
    /** Token expiration in hours (default: 48) */
    tokenExpiryHours?: number;
}
/**
 * Email-based transport adapter for xBind invitations.
 *
 * Sends invitation emails with branded templates and one-click acceptance links.
 * Enforces rate limiting and token expiration for security.
 *
 * Note: Email transport is one-way (sending only). onReceive() is not supported.
 */
export declare class EmailTransport implements XailTransportAdapter {
    private config;
    private transporter;
    private rateLimits;
    /**
     * Create email transport adapter.
     *
     * @param config - SMTP and email configuration
     */
    constructor(config: EmailTransportConfig);
    /**
     * Send invitation email.
     *
     * @param envelope - Transport envelope
     * @param recipientDid - Recipient DID (email address for email transport)
     * @returns Result with void on success
     */
    send(envelope: any, _recipientDid: string): Promise<Result<void, TransportError>>;
    /**
     * Validate email address format.
     *
     * @param email - Email address to validate
     * @returns True if valid
     */
    private isValidEmail;
    /**
     * Check if agent has exceeded rate limit.
     *
     * @param agentDid - Agent DID
     * @returns Result indicating if rate limit is OK
     */
    private checkRateLimit;
    /**
     * Increment rate limit counter for agent.
     *
     * @param agentDid - Agent DID
     */
    private incrementRateLimit;
    /**
     * Generate secure invitation token.
     *
     * Token contains: sender DID, sender public key, timestamp, expiry.
     * Encoded as base64url for URL safety.
     *
     * @param envelope - Message envelope
     * @returns Invitation token
     */
    private generateInviteToken;
    /**
     * Verify connection to SMTP server.
     *
     * @returns Result indicating if SMTP connection is OK
     */
    verify(): Promise<Result<void, TransportError>>;
    /**
     * Close SMTP connection.
     */
    close(): Promise<void>;
    /**
     * Register handler for incoming envelopes.
     *
     * Note: Email transport is one-way (sending only).
     * This method exists for interface compliance but is a no-op.
     *
     * @param handler - Envelope handler (unused)
     */
    onReceive(_handler: EnvelopeHandler): void;
    /**
     * Shut down the transport (close SMTP connection).
     */
    dispose(): void;
}
