import { Effect, Option } from 'effect';
import type { Fetch } from 'fx-fetch';
import type { HttpRequestBuilder } from '../vendor/cel-js/lib/http-builder.js';
/**
 * Normalize the value a request expression evaluates to into an
 * `Option<HttpRequestBuilder>`.
 *
 * A request expression now expects `optional<HttpRequest>` — `None` means the
 * author opted out ("no request, skip the fetch"), enabling conditional fetches
 * (e.g. only when a `form_id` is present). For back-compat a bare `HttpRequest`
 * still works (always fetch) and maps to `Some`. A stray `null`/`undefined` is
 * also treated as `None`.
 *
 * We only distinguish *present* from *absent* here — we do NOT `instanceof`-
 * guard the payload. The type-checker already guarantees an `HttpRequest` at
 * this boundary (the `HttpRequestResult` matcher), and a misconfigured non-
 * builder would fail at `.json()`/`.file()` exactly as it did before this
 * contract existed. (Guarding on `instanceof HttpRequestBuilder` would also
 * wrongly reject test doubles that aren't real instances.)
 */
export declare function asRequest(result: unknown): Option.Option<HttpRequestBuilder>;
/**
 * Resolve a request expression's value to its JSON response as an `Option`:
 * `Some(body)` when a request was produced and issued, `None` when the
 * expression opted out (or produced no builder). The returned Effect needs a
 * `Fetch` layer. Mirrors the `{ request?, data }` datasource shape, where the
 * response is exposed to the `data` expression as the `json` Option.
 */
export declare function fetchJsonOption(result: unknown): Effect.Effect<Option.Option<unknown>, unknown, Fetch.Fetch>;
