import { A as Suspensable, B as query, C as RecBody, D as RequirementsOf, E as RecPlacement, F as isAtom, H as suspend, L as isPlacement, M as Volatile, N as Yieldable, O as Suspends, R as isSuspensable, S as ReadableAtom, T as RecHandle, V as scoped, _ as ErrorsOf, b as PlacementTypeId, c as RecTypeId, d as rec, f as AnyEffect, g as CatchDispatch, h as CatchApi, j as SuspensableTypeId, k as SuspendsOf, l as RendersOn, m as AtomTypeId, n as CatchHandlers, o as MissingServices, p as Atom, r as Effective, s as REC, t as QueryCache, w as RecGenerator, x as QueryOptions, z as placement } from "./query-cache-sfUY26Qc.mjs";
import { a as Read, c as atomFamily, d as derive, f as Mutation, h as mutation, i as AtomFamilyOptions, l as batch, m as MutationState, n as AtomFamily, o as SerializableAtom, p as MutationOptions, r as AtomFamilyGc, s as atom, t as AsyncDerived, u as defer } from "./reactivity-core-Jf4T2qpz.mjs";
import { ReactNode } from "react";
import * as Layer from "effect/Layer";
//#region src/infrastructure/server/mount.d.ts
/** Options for the server `mount`. */
interface ServerMountOptions {
/**
* How the render's Effect runtime is scoped.
*
* - `'isolated'` (**default**) — a *fresh* runtime is built for each render and
* disposed after it, so any per-user state a service holds in an `atom` cannot
* bleed across concurrent requests. This is the safe default for a server that
* serves many users. (It does **not** isolate a *module-level* `atom` — one
* declared outside a service `make` is a single process-global cell shared by
* every request; keep per-request state *inside* a service's `make`.)
* - `'shared'` — one runtime per layer identity, reused across every render for
* the process (the pre-0.6 behaviour). Correct only for a genuinely global,
* stateless layer; it avoids rebuilding the layer per request. If your layer
* is expensive but has per-user state, split it: a `shared` base composed with
* a per-request layer, or memoise the costly parts with `Layer.memoize`.
*/
readonly scope?: 'isolated' | 'shared';
}
/**
* Mount a root REC as an async React Server Component under an Effect runtime.
* Returns a component you export or place (`export default mount(AppLive, Page)`
* / ``). Verifies at compile time that `layer` provides every service the
* tree requires — the check lives on the `rec` argument, so there is no cast at
* the call site. Hook-bearing bodies reject at render (a hook is a client concept
* RSC forbids); those RECs are client islands and render wherever the browser is.
*
* Unlike the client `mount`, this imposes no loading obligation: a query resolves
* inline before the HTML is sent, so there is no pending state to fall back for.
* A tree's `S` is therefore accepted and ignored here — loading is a client
* concern, handled where the tree actually renders interactively. The volatility
* obligation `V` is accepted and ignored for the same reason: a server render
* happens exactly once, so there are no re-renders for a hot subscription to
* cause — scheduling, like loading, is checked where the tree renders
* interactively.
*
* **Per-request isolation is the default.** Each render builds and disposes its
* own runtime, so two concurrent requests cannot observe each other's service
* state. Pass `{ scope: 'shared' }` to reuse one process-global runtime for a
* stateless layer. See {@link ServerMountOptions}.
*/
declare function mount(layer: Layer.Layer, rec: REC, RE, R, S, V, L> & ([Effective] extends [ROut | QueryCache] ? unknown : MissingServices, ROut | QueryCache>>), options?: ServerMountOptions): () => Promise;
//#endregion
//#region src/application/server-driver.d.ts
/** A REC's `.catchDefect` fallback — the last resort after the tag dispatch. */
type DefectHandler = (defect: unknown, api: CatchApi) => A;
/** Runs an effect against the in-scope runtime, resolving services and async work. */
type RunEffect = (effect: AnyEffect) => Promise;
/**
* Drive a REC body to its rendered node on the server. Four kinds of yield are
* honoured, mirroring the client interpreter:
*
* - a child placement (`yield* Child`) → the child's body is driven *inline*
* against the same runtime, under the child's *own* `.catch` handlers, so a
* universal REC composed of universal RECs renders entirely on the server
* with no client JavaScript — and a parent never swallows a child's errors.
* - an Effect/service → awaited against the request's runtime. If it fails and
* this REC declared a `.catch` for that error's `_tag` (via `handlers`), the
* mapped node is rendered in place; otherwise the failure propagates.
* - a suspensable (`yield* suspend(...)` / `query(...)`) → awaited inline,
* exactly like an effect; there is no loading state on the server (it
* resolves before the HTML is sent), so it is just its effect, `.catch`-handled.
* - a hook → rejected: React Server Components have no render-pass hooks (this
* is React's rule, not effract's), so a hook-bearing body is a client REC.
*
* `handlers` is this REC's typed-error dispatch and `defectHandler` its
* `.catchDefect` fallback — either or both `undefined` for a plain REC.
*/
declare const driveServerRec: (gen: RecGenerator, run: RunEffect, handlers?: CatchDispatch, defectHandler?: DefectHandler) => Promise;
//#endregion
export { type AnyEffect, type AsyncDerived, type Atom, type AtomFamily, type AtomFamilyGc, type AtomFamilyOptions, AtomTypeId, type CatchApi, type CatchHandlers, type Effective, type ErrorsOf, type MissingServices, type Mutation, type MutationOptions, type MutationState, PlacementTypeId, QueryCache, type QueryOptions, type REC, type Read, type ReadableAtom, type RecBody, type RecGenerator, type RecHandle, type RecPlacement, RecTypeId, type RendersOn, type RequirementsOf, type RunEffect, type SerializableAtom, type ServerMountOptions, type Suspends, type SuspendsOf, type Suspensable, SuspensableTypeId, type Volatile, type Yieldable, atom, atomFamily, batch, defer, derive, driveServerRec, isAtom, isPlacement, isSuspensable, mount, mutation, placement, query, rec, scoped, suspend };