import { P as Provider } from "../../packem_shared/provider.d-Dh32nRm9.js"; import { E as EmailChannelPayload } from "../../packem_shared/types.d-C7l7qdMG.js"; /** * The result shape returned by `@visulima/email`'s `Mail.send`. */ interface EmailSendResult { data?: { messageId: string; provider?: string; response?: unknown; sent?: boolean; timestamp?: Date; }; error?: unknown; success: boolean; } /** * Structural type for a `@visulima/email` `Mail` instance. Kept structural so the email * peer stays optional — pass a configured `createMail(...)` result. */ interface EmailLike { send: (message: unknown) => Promise; } interface EmailChannelConfig { /** Provider id reported on results (default `"email"`). */ id?: string; } /** * Adapts a configured `@visulima/email` `Mail` instance into a notification channel * provider, so email can participate in multi-channel sends and routing. * @param mail A `Mail` instance from `createMail(...)`. * @param config Optional config. * @returns An email-channel provider. * @example * ```ts * import { createMail } from "@visulima/email"; * import { resendProvider } from "@visulima/email/providers/resend"; * import { createNotification } from "@visulima/notification"; * import { emailChannel } from "@visulima/notification/channels/email"; * * const mail = createMail(resendProvider({ apiKey })); * const notify = createNotification({ email: emailChannel(mail) }); * ``` */ declare const emailChannel: (mail: EmailLike, config?: EmailChannelConfig) => Provider; export { type EmailChannelConfig, type EmailLike, emailChannel };