/**
 * Transactional email sender registry.
 *
 * cms-core sends transactional email (password resets, form notifications)
 * through a single resolver so callers never reach into a specific plugin or
 * provider. Resolution order:
 *
 *   1. `config.platform.email` — an explicit platform adapter always wins, so
 *      apps that wire their own adapter keep full control.
 *   2. A sender registered via {@link setEmailSender} — this is how the email
 *      plugin (`@actuate-media/plugin-email`) makes its configured provider
 *      available to core *without* core depending on the plugin. Dependency
 *      direction stays plugins → core: the plugin imports `setEmailSender` and
 *      registers itself at boot.
 *
 * The registered sender is stored on `globalThis` so a single value survives
 * even if more than one cms-core module instance is loaded in the same process,
 * mirroring the config runtime contract (see `config/runtime.ts`). It is set
 * once at boot (when the plugin factory runs) and read-only afterwards.
 */
import type { EmailAdapter } from '../config/types.js';
/**
 * Decrypted provider settings handed to the plugin-registered factory when
 * email is configured through Settings > Email (the `__email_config__` doc).
 */
export interface ResolvedEmailProviderSettings {
    provider: 'resend' | 'smtpcom' | 'ses' | 'smtp';
    from: string;
    apiKey?: string;
    channel?: string;
    region?: string;
    host?: string;
    port?: number;
    secure?: boolean;
    auth?: {
        user: string;
        pass: string;
    };
}
/**
 * Builds a concrete sender from DB-configured settings. Registered by
 * `@actuate-media/plugin-email` at boot (the provider implementations and
 * their optional deps live in the plugin, not in core). Returns `null` when
 * the settings are incomplete for the selected provider.
 */
export type EmailProviderFactory = (settings: ResolvedEmailProviderSettings) => EmailAdapter | null;
/**
 * Register the process-wide transactional email sender. Called once at boot by
 * the email plugin. Pass `null` to clear it (used in tests).
 */
export declare function setEmailSender(sender: EmailAdapter | null): void;
/** The sender registered via {@link setEmailSender}, if any. */
export declare function getRegisteredEmailSender(): EmailAdapter | null;
/**
 * Resolve the active transactional email sender, or `null` when email is not
 * configured. Prefers an explicit `platform.email` adapter, then a
 * plugin-registered sender.
 *
 * NOTE: this sync resolver does not see settings configured through the admin
 * UI (Settings > Email). Send paths should prefer `resolveEmailSenderAsync()`
 * from `email/resolve.js`, which checks the DB-backed config first.
 */
export declare function resolveEmailSender(): EmailAdapter | null;
/**
 * Register the factory that turns DB-configured email settings into a sender.
 * Called once at boot by the email plugin. Pass `null` to clear (tests).
 */
export declare function setEmailProviderFactory(factory: EmailProviderFactory | null): void;
/** The factory registered via {@link setEmailProviderFactory}, if any. */
export declare function getEmailProviderFactory(): EmailProviderFactory | null;
//# sourceMappingURL=sender.d.ts.map