import type { EventBus, OutboxEventStore } from "@voyant-travel/core"; /** * Wrap an {@link EventBus} so emits from within a request defer their * (non-`inline`) subscribers past the HTTP response via the request's * `executionCtx.waitUntil`. The response stops paying for subscriber * work — third-party syncs (CMS, e-invoicing), notifications, workflow * ingest — while `inline`-marked subscribers still complete before * `emit()` resolves. * * With a `store` (transactional outbox), emits are also DURABLE: the * envelope is persisted before any handler runs, and failed deliveries * are retried by the drain. If the durable capture itself fails (DB * unreachable), the emit falls back to direct (non-durable) delivery. * Once capture has succeeded, the wrapper must not redeliver directly: * the stored row owns completion/retry, and direct fallback would make * subscriber side effects ambiguous. * * Buses that predate the {@link EmitOptions} parameter simply ignore it * and keep awaiting all handlers — a safe degradation. */ export declare function requestScopedEventBus(bus: EventBus, schedule: ((pending: Promise) => void) | undefined, store?: OutboxEventStore): EventBus;