import { E as EmailOptions, a as EmailResult, R as Result } from "./types.d-CyiC9uRC.js"; /** * The terminal send function a middleware wraps — ultimately the provider's `sendEmail`. */ type SendFunction = (options: EmailOptions) => Promise>; /** * A send middleware. Receives the (fully-resolved) message and the `next` function in the chain; * may short-circuit, retry, mutate, or observe. * * Middlewares run in registration order, wrapping outward-in (the first registered runs first and is * the outermost wrapper around the provider call). * @param options The resolved email options. * @param next The next middleware (or the provider send) in the chain. * @returns The send result. */ type Middleware = (options: EmailOptions, next: SendFunction) => Promise>; /** * Composes a middleware stack around a terminal send function. * @param middlewares The middlewares, in registration order. * @param terminal The provider send call at the centre of the chain. * @returns A single {@link SendFunction} that runs the whole chain. */ declare const composeMiddleware: (middlewares: ReadonlyArray, terminal: SendFunction) => SendFunction; export { Middleware as M, SendFunction as S, composeMiddleware as c };