import { C as ChannelPayloadMap, N as Notification, a as NotificationMessage } from "../packem_shared/notification.d-D0ado_cy.js"; import { C as ChannelType, M as MaybePromise, c as Receipt } from "../packem_shared/types.d-C7l7qdMG.js"; import "../packem_shared/types.d-CRs03TYV.js"; import "../packem_shared/provider.d-Dh32nRm9.js"; /** * A gate decides whether a channel should be attempted for a given payload. Use it for * preferences, capability checks, send-windows or arbitrary conditions. */ type ChannelGate = (channel: ChannelType, payload: ChannelPayloadMap[ChannelType]) => MaybePromise; interface RouteOptions { /** * Optional gate run before each channel send. Returning false skips the channel. */ gate?: ChannelGate; /** * `"best-of"` (default) sends in `order` and stops at the first success; * `"all"` broadcasts to every present, gated channel in parallel. */ mode?: "all" | "best-of"; /** * Channel priority order. Channels absent from the message are skipped; channels in * the message but absent from `order` are appended in object order. */ order?: ChannelType[]; } /** * Routes a multi-channel message across channels with a priority order and an optional * gate. `"best-of"` stops at the first success (channel fallback); `"all"` broadcasts. * @param notification The facade used to send. * @param message The multi-channel message. * @param options Routing options. * @returns The receipts produced (one per attempted channel). */ declare const route: (notification: Notification, message: NotificationMessage, options?: RouteOptions) => Promise; export { ChannelGate, RouteOptions, route };