/** * The abortable, bounded waits the application delivery outbox exposes * (WFT-85): waiting for due work, and waiting for a cancelled delivery's * attempt to settle. * * Both are polling waits, for the same reason the mailbox's are: another * process's enqueue is visible only in durable storage. Every wait is bounded * by a caller-supplied deadline, respects a caller-supplied `AbortSignal`, and * unwinds cleanly on disposal. Waiting never claims, starts, or advances work. * * @module core/outbox-waits */ import { delayUnlessAborted } from './application-primitive-timing.ts'; import type { ApplicationDeliveryCleanupResult, OutboxWaitOptions } from './outbox-contract.ts'; import type { OutboxRuntime } from './outbox-internals.ts'; export { delayUnlessAborted }; /** * Whether a delivery is claimable right now: the earliest genuine due entry * is at or before the clock. Orphaned entries are looked past, bounded, since * a wait mutates nothing and cannot make progress through them. */ export declare function hasDueWork(runtime: OutboxRuntime): Promise; /** * Wait, bounded and abortably, until this outbox has a delivery due. * Returns `true` when one is claimable and `false` when the wait was aborted, * the outbox disposed, or the timeout elapsed first. */ export declare function waitForDueWork(runtime: OutboxRuntime, options?: OutboxWaitOptions): Promise; /** * Wait, bounded, for a cancelled delivery's attempt to settle. A `pending` * result means this outbox stopped waiting, never that the transport stopped. * The semantics match the mailbox's `awaitCleanup`. */ export declare function waitForCleanup(runtime: OutboxRuntime, options: { readonly deliveryId: string; readonly timeoutMs: number; readonly signal?: AbortSignal | undefined; readonly pollIntervalMs?: number | undefined; }): Promise;