import * as Effect from "effect/Effect"; import type * as Scope from "effect/Scope"; import * as Stream from "effect/Stream"; import { type TraceParent } from "../Util/TraceParent.ts"; type RpcEffectHandler, Success, Error> = (...args: Args) => Effect.Effect; type RpcWrappedEffectHandler, Success, Error> = (args: Args, parent?: TraceParent) => Promise>; type RpcStreamHandler, Success, Error> = (...args: Args) => Stream.Stream; type RpcWrappedStreamHandler, Success, Error> = (args: Args, parent?: TraceParent) => RpcSerializedStream; type RpcSerializedStream = ReadableStream; type RpcSerializedExit = { _tag: "Success"; value: Success; } | { _tag: "Failure"; cause: Array>; }; type RpcSerializedCause = { _tag: "Fail"; error: Error; } | { _tag: "Die"; defect: unknown; } | { _tag: "Interrupt"; fiberId: number | undefined; }; export type RpcWrapped = T extends RpcEffectHandler ? RpcWrappedEffectHandler : T extends RpcStreamHandler ? RpcWrappedStreamHandler : T extends Record ? { [K in keyof T]: RpcWrapped; } : T; export type RpcUnwrapped = T extends RpcWrappedEffectHandler ? RpcEffectHandler : T extends RpcWrappedStreamHandler ? RpcStreamHandler : T extends Record ? { [K in keyof T]: RpcUnwrapped; } : T; export declare const wrapRpcHandlers: >(handlers: T, streamKeys?: Array, registerCall?: Effect.Effect) => RpcWrapped; export declare const unwrapRpcHandlers: >(handlers: RpcWrapped, streamKeys?: Array) => RpcUnwrapped; /** * Registers tagged error classes that a provider may fail with across the RPC * sidecar boundary, so the caller receives instances of the real class (for * `instanceof`) rather than plain tagged objects. Registration is by `_tag`; * call it next to the class definitions so both processes register them. */ export declare const registerRpcErrorClasses: (...classes: ReadonlyArray { readonly _tag: string; }>) => void; export {}; //# sourceMappingURL=RpcSerialization.d.ts.map