/** * Composable HTML transforms applied after rendering. Use via * middleware so the pipeline runs just before `driver.send`: * * ```ts * email.use(htmlPipeline(withPreheader(), inlineCss(), cidRewrite())) * ``` * * Each transform is a pure function over the rendered HTML string. * * @module */ import type { EmailMessage, Middleware } from "../types.mjs"; export type HtmlTransform = (html: string, msg: EmailMessage) => string | Promise; /** Pipe `EmailMessage.html` through each transform in order. */ export declare function htmlPipeline(...transforms: HtmlTransform[]): Middleware; /** Inject a hidden preheader snippet (Litmus-approved) before the * visible content. Uses `msg.preheader` when present, or falls back * to the supplied function. */ export interface PreheaderOptions { /** Explicit text to use. Overrides `msg.preheader`. */ text?: string | ((msg: EmailMessage) => string | undefined); } export declare function withPreheader(options?: PreheaderOptions): HtmlTransform; /** Dark-mode CSS hook — injects Outlook.com / Apple Mail dark-mode * meta tags + a `[data-ogsc]` scope. Consumers supply the rules. */ export interface DarkModeOptions { /** CSS block applied via `[data-ogsc]` (Outlook.com) and * `@media (prefers-color-scheme: dark)`. */ darkCss?: string; } export declare function darkModeHook(options?: DarkModeOptions): HtmlTransform; /** CID auto-rewrite — scan for `` tags whose src matches * a CID on one of the message attachments and rewrite to `cid:`. */ export declare function cidRewrite(): HtmlTransform; /** CSS inliner — lazy-loads `juice` if you have it installed. Passes * through HTML unchanged when juice isn't available. */ export declare function inlineCss(): HtmlTransform;