import { C as ChannelType, B as BaseNotificationPayload, a as NotificationResult, R as Result } from "./types.d-C7l7qdMG.js"; /** * Context passed through the middleware chain for a single send. */ interface SendContext { /** The channel being sent on. */ channel: ChannelType; /** The (possibly mutated) payload. */ payload: BaseNotificationPayload; /** The provider id handling the send. */ provider: string; } /** * The terminal send function and the type middleware wrap. */ type SendFunction = (context: SendContext) => Promise>; /** * A middleware wraps a {@link SendFunction}. The first registered middleware is the * outermost wrapper (runs first on the way in, last on the way out). */ type Middleware = (context: SendContext, next: SendFunction) => Promise>; /** * Composes middleware around a terminal send function. * @param middlewares Middleware in registration order. * @param terminal The terminal send function. * @returns A single composed send function. */ declare const composeMiddleware: (middlewares: Middleware[], terminal: SendFunction) => SendFunction; export { Middleware as M, SendContext as S, SendFunction as a, composeMiddleware as c };