import type { EmailDriver, EmailMessage } from "../types.mjs"; import type { PreferenceStore } from "../preferences/index.mjs"; export interface PreferencesMiddlewareOptions { store: PreferenceStore; /** How to pick the category for a message. By default reads the * first `EmailTag` named `"category"`, then falls back to * `msg.stream`. Messages without a category pass through. */ categoryFor?: (msg: EmailMessage) => string | null; /** When true, block the entire send if ANY recipient has opted out. * Default: false — drop the opt-outs and continue. */ strict?: boolean; } /** Check the preference store before `driver.send`. Recipients who * opted out of the resolved category are removed. */ export declare function withPreferences(driver: EmailDriver, options: PreferencesMiddlewareOptions): EmailDriver;