import type { AnyDb } from './dialect.js'; export type EmailMessage = { to: string | string[]; subject: string; html?: string; text?: string; from?: string; replyTo?: string; cc?: string | string[]; bcc?: string | string[]; }; export type SentEmail = { id?: string; providerId?: string; }; type AdapterSentEmail = { id?: string; }; /** Adapters receive the message with `from` already resolved. */ export type EmailAdapter = { send(msg: EmailMessage & { from: string; }): Promise; }; export type EmailConfigInput = { from: string; provider?: 'resend' | 'console' | EmailAdapter | EmailAdapter['send']; }; export type EmailFacade = { send(msg: EmailMessage): Promise; }; export type CreateEmailOptions = { env: { RESEND_API_KEY?: string; SMTP_URL?: string; NODE_ENV?: string; BUNDERSTACK_EMAIL_PROVIDER?: string; BUNDERSTACK_EMAIL_FROM?: string; BUNDERHOST_ENVIRONMENT_ID?: string; }; /** Internal application db. Present when created through createBunderstack. */ db?: AnyDb; /** Test seam for the resend adapter. */ fetchFn?: typeof fetch; }; /** Root string provider tag ('resend' | 'console') or undefined. */ export declare function emailProviderTag(config: EmailConfigInput | undefined): string | undefined; export declare function createEmail(config: EmailConfigInput | undefined, opts: CreateEmailOptions): EmailFacade; export {}; //# sourceMappingURL=email.d.ts.map