import type { ClaimedDelivery } from '../types/index.js'; import { markAttemptFailed, markDelivered } from './deliveryStore.js'; import { postWebhook } from './webhookFetch.js'; export type DeliverOutcome = { /** `pending` means the attempt failed and a retry is scheduled. */ status: 'delivered' | 'pending' | 'failed'; statusCode: number | null; error: string | null; }; export type DeliverDeps = { post: typeof postWebhook; markDelivered: typeof markDelivered; markAttemptFailed: typeof markAttemptFailed; now: () => Date; }; /** * Send one CLAIMED delivery (status `sending`, `attempts` already counted) and * record the result. The single send path: the subscriber (first attempt), the * cron job (retries) and the test action all come through here. * * `retry: false` (the test event) turns a failure into a final `failed` * instead of scheduling a retry. */ export declare function deliverWebhook(delivery: ClaimedDelivery, options?: { retry?: boolean; }, deps?: DeliverDeps): Promise;