import type { OpaqueRemoteFailureReason } from "./diagnostics.js"; import { type FormIssue } from "./shared.js"; import { Cause } from "effect"; /** * Records that a failure lost its detail on the way to the client, so callers * can report the original error instead of dropping it silently. * * @example * ```ts * const diagnostic: OpaqueRemoteFailure = { reason: "untagged", value: err }; * ``` * * @since 4.2.0 */ export type OpaqueRemoteFailure = { readonly reason: OpaqueRemoteFailureReason; readonly value: unknown; }; type EncodedRemoteFailure = { readonly encoded: string; readonly opaque?: OpaqueRemoteFailure; }; export type RemoteCauseResolution = { readonly _tag: "SvelteKitControlFlow"; readonly value: unknown; } | { readonly _tag: "InterruptOnly"; readonly cause: Cause.Cause; } | { readonly _tag: "FormInvalid"; readonly issues: readonly FormIssue[]; } | { readonly _tag: "RemoteFailure"; readonly encoded: string; readonly opaque?: OpaqueRemoteFailure; }; /** Preserves SvelteKit control flow before classifying transportable Effect failures. */ export declare function classify_remote_cause(cause: Cause.Cause): RemoteCauseResolution; /** Encodes a remote failure into the transport ABI shared with generated clients. */ export declare function encode_remote_failure(cause: Cause.Cause): string; /** * Encodes a remote failure and reports whether its detail survived encoding. * * @example * ```ts * const { encoded, opaque } = encode_remote_failure_detailed(cause); * ``` * * @since 4.2.0 * @param cause - Cause carrying the handler's failure. * @returns The encoded payload and, when detail was lost, why. */ export declare function encode_remote_failure_detailed(cause: Cause.Cause): EncodedRemoteFailure; export {};