import type { MantleRuntime, DeferredHookDispatcher, DeferredHookEnvelope } from "@aotter/mantle-runtime"; /** * `DeferredHookDispatcher` impl backed by a Cloudflare Workers Queue * binding. Producer side: serialises each `DeferredHookEnvelope` and * sends it explicitly as JSON. The runtime decorator handles a * rejection with its best-effort fallback. Queue acceptance is not * atomic with the preceding D1 mutation. * * Per ADR-0011 only this adapter package may import the CF binding * type. The runtime sees only the `DeferredHookDispatcher` port. */ export declare class WorkersQueueHookDispatcher implements DeferredHookDispatcher { private readonly queue; constructor(queue: Queue); enqueue(envelope: DeferredHookEnvelope): Promise; } /** * Build the `queue(batch, env, ctx)` Workers handler that consumes * `mantle-internal` messages and re-fires each `after_*` hook through * the runtime. Consumers wire this alongside `fetch` in their default * Worker export: * * ```ts * export default { * fetch: app.fetch, * queue: createQueueHandler(cms), * } satisfies ExportedHandler; * ``` * * Per-message ack / retry: any validation or handler failure retries * the message; success acks. CF Queues then applies the consumer's * retry delay, max_retries, and DLQ configuration. */ export declare function createQueueHandler(cmsRef: { get(): Promise; }): (batch: MessageBatch, env: Env) => Promise; //# sourceMappingURL=WorkersQueueHookDispatcher.d.ts.map