import type { ReceiverBuilder, ReceiverOptions } from "@rotorsoft/act-ops/receiver"; /** * Recommended factory for "I want to receive webhooks." Returns a * {@link ReceiverBuilder} the operator configures fluently: * * ```ts * import { receiver } from "@rotorsoft/act-http/receiver"; * import { InMemoryIdempotencyStore } from "@rotorsoft/act-ops/idempotency"; * import { z } from "zod"; * * const r = receiver({ * port: 4001, * store: new InMemoryIdempotencyStore(), * secret: process.env.WEBHOOK_SECRET, * }) * .on("OrderConfirmed", z.object({ * orderId: z.string(), * total: z.number(), * }), async (event, ctx) => { * // event.orderId and event.total are typed * // ctx.key is the deduplicated Idempotency-Key * await process_order(event.orderId, event.total); * }) * .build(); * * await r.listen(); * ``` * * Matches Act's builder pattern: `receiver(...)` is the factory, * `.on()` registers handlers fluently, `.build()` finalizes and * produces an immutable {@link Receiver} — at which point the type * loses `.on()` and gains the runtime methods (`listen` / `close` / * `fetch`). The lifecycle phases are split at the type level. * * Internally uses Hono for routing — the universal-runtime choice * that gives one code path coverage across Node, AWS Lambda, * Cloudflare Workers, Vercel Edge, Bun, and Deno. For operators * with an existing tRPC / Express / Fastify / Hono app who need to * compose the receiver with their own middleware stack, the * lower-level `webhookMiddleware` from * `@rotorsoft/act-http/receiver/` is the escape hatch. * * `@hono/node-server` is imported lazily inside `.listen()` so * Lambda / edge consumers (who never call `.listen()`) don't need * it installed. */ export declare function receiver(options: ReceiverOptions): ReceiverBuilder; //# sourceMappingURL=start.d.ts.map