/**
 * The `WorkflowProxyServer` module provides server-side layers for exposing
 * workflows through the proxy APIs generated by `WorkflowProxy`. It connects
 * HTTP API endpoints or RPC handlers to the supplied workflow definitions,
 * routing execute, discard, and resume requests to the corresponding workflow
 * operation while keeping the `WorkflowEngine` and workflow implementation
 * services on the server side.
 *
 * **Common tasks**
 *
 * - Serve a workflow proxy over an HTTP API group with {@link layerHttpApi}
 * - Serve the RPC group produced by `WorkflowProxy.toRpcGroup` with
 *   {@link layerRpcHandlers}
 * - Expose durable workflow starts and explicit resume operations to clients
 *   without exposing the workflow implementation itself
 *
 * **Gotchas**
 *
 * - The workflows passed to these layers must match the group produced by
 *   `WorkflowProxy`; RPC prefixes must be the same on both sides
 * - Discard handlers use the workflow discard execution path, so callers should
 *   not rely on receiving the normal workflow success or error value
 * - Resume handlers expect a payload with the persisted `executionId`; clients
 *   must preserve that boundary value because it is not recomputed from the
 *   original workflow payload
 *
 * @since 4.0.0
 */
import type { NonEmptyReadonlyArray } from "../../Array.ts";
import * as Layer from "../../Layer.ts";
import type * as HttpApi from "../httpapi/HttpApi.ts";
import type * as HttpApiGroup from "../httpapi/HttpApiGroup.ts";
import type * as Rpc from "../rpc/Rpc.ts";
import type * as Workflow from "./Workflow.ts";
import type { WorkflowEngine } from "./WorkflowEngine.ts";
/**
 * Creates handlers for a workflow HTTP API group, wiring execute, discard, and
 * resume endpoints to the supplied workflows.
 *
 * @category layers
 * @since 4.0.0
 */
export declare const layerHttpApi: <ApiId extends string, Groups extends HttpApiGroup.Any, Name extends HttpApiGroup.Name<Groups>, const Workflows extends NonEmptyReadonlyArray<Workflow.Any>>(api: HttpApi.HttpApi<ApiId, Groups>, name: Name, workflows: Workflows) => Layer.Layer<HttpApiGroup.ApiGroup<ApiId, Name>, never, WorkflowEngine | Workflow.RequirementsHandler<Workflows[number]>>;
/**
 * Creates RPC handlers for the supplied workflows, wiring execute, discard,
 * and resume RPCs to workflow operations.
 *
 * @category layers
 * @since 4.0.0
 */
export declare const layerRpcHandlers: <const Workflows extends NonEmptyReadonlyArray<Workflow.Any>, const Prefix extends string = "">(workflows: Workflows, options?: {
    readonly prefix?: Prefix;
}) => Layer.Layer<RpcHandlers<Workflows[number], Prefix>, never, WorkflowEngine | Workflow.RequirementsHandler<Workflows[number]>>;
/**
 * Union of RPC handler services required to serve the generated workflow
 * execute, discard, and resume RPCs.
 *
 * @category services
 * @since 4.0.0
 */
export type RpcHandlers<Workflows extends Workflow.Any, Prefix extends string> = Workflows extends Workflow.Workflow<infer _Name, infer _Payload, infer _Success, infer _Error> ? Rpc.Handler<`${Prefix}${_Name}`> | Rpc.Handler<`${Prefix}${_Name}Discard`> | Rpc.Handler<`${Prefix}${_Name}Resume`> : never;
//# sourceMappingURL=WorkflowProxyServer.d.ts.map