import { MailMessage, MailResult } from '@platform-modules/mail';
import { RenderedMessage, NotifyEvent, ChannelAdapter } from './index.js';

type EmailRecipient = {
    to: string;
    from: string;
    replyTo?: string;
    /** Used when rendered.subject is absent. */
    subjectFallback?: string;
    idempotencyKey?: string;
};
type EmailChannelOpts = {
    mapMessage?: (rendered: RenderedMessage, recipient: EmailRecipient, event?: NotifyEvent) => MailMessage;
};
type MailSend = (msg: MailMessage) => Promise<MailResult>;
/** Thin bridge — delegates send to `@platform-modules/mail`, does not re-implement. */
declare function createEmailChannel(mail: {
    send: MailSend;
}, opts?: EmailChannelOpts): ChannelAdapter;

export { type EmailChannelOpts, type EmailRecipient, type MailSend, createEmailChannel };
