/** * Suppression store — persistent record of recipients who must not * receive mail. Unifies bounces, complaints, and opt-outs across every * driver we ship. * * @module */ import type { MaybePromise } from "../types.mjs"; export type SuppressionReason = "bounce" | "complaint" | "unsubscribed" | "manual" | "invalid" | string; export interface SuppressionRecord { recipient: string; reason: SuppressionReason; source?: string; at: Date; } export interface SuppressionStore { has: (recipient: string) => MaybePromise; add: (recipient: string, reason: SuppressionReason, source?: string) => MaybePromise; remove: (recipient: string) => MaybePromise; list?: () => MaybePromise>; } /** Options for `memorySuppressionStore`. */ export interface MemorySuppressionStoreOptions { /** Injectable clock for deterministic tests. */ now?: () => number; } /** In-memory store. Recipients are normalized to lowercase. */ export declare function memorySuppressionStore(opts?: MemorySuppressionStoreOptions): SuppressionStore; /** Minimal unstorage-like contract (decoupled so we don't bind the * dependency). Mirrors the shape already used by `src/queue`. */ interface UnstorageLike { getItem: (key: string) => MaybePromise; setItem: (key: string, value: unknown) => MaybePromise; removeItem: (key: string) => MaybePromise; getKeys?: (base?: string) => MaybePromise>; } /** Persist suppressions to any `unstorage` driver (KV, Redis, * filesystem, …). Keys are prefixed with `suppression:`. */ export declare function unstorageSuppressionStore(storage: UnstorageLike): SuppressionStore; export {};