/** * @since 0.67.0 */ import type * as Effect from "effect/Effect"; import type * as Exit from "effect/Exit"; import type * as ParseResult from "./ParseResult.js"; import * as Schema from "./Schema.js"; /** * @since 0.67.0 * @category symbol */ export declare const symbol: unique symbol; /** * The `Serializable` trait allows objects to define their own schema for * serialization. * * @since 0.67.0 * @category model */ export interface Serializable { readonly [symbol]: Schema.Schema; } /** * @since 0.67.0 * @category model */ export declare namespace Serializable { /** * @since 0.68.15 */ type Type = T extends Serializable ? A : never; /** * @since 0.68.15 */ type Encoded = T extends Serializable ? I : never; /** * @since 0.67.0 */ type Context = T extends Serializable ? R : never; /** * @since 0.69.0 */ type Any = Serializable; /** * @since 0.69.0 */ type All = Any | Serializable | Serializable | Serializable; } /** * @since 0.69.0 */ export declare const asSerializable: (serializable: S) => Serializable, Serializable.Encoded, Serializable.Context>; /** * @since 0.67.0 * @category accessor */ export declare const selfSchema: (self: Serializable) => Schema.Schema; /** * @since 0.67.0 * @category encoding */ export declare const serialize: (self: Serializable) => Effect.Effect; /** * @since 0.67.0 * @category decoding */ export declare const deserialize: { /** * @since 0.67.0 * @category decoding */ (value: unknown): (self: Serializable) => Effect.Effect; /** * @since 0.67.0 * @category decoding */ (self: Serializable, value: unknown): Effect.Effect; }; /** * @since 0.67.0 * @category symbol */ export declare const symbolResult: unique symbol; /** * The `WithResult` trait is designed to encapsulate the outcome of an * operation, distinguishing between success and failure cases. Each case is * associated with a schema that defines the structure and types of the success * or failure data. * * @since 0.67.0 * @category model */ export interface WithResult { readonly [symbolResult]: { readonly success: Schema.Schema; readonly failure: Schema.Schema; }; } /** * @since 0.67.0 * @category model */ export declare namespace WithResult { /** * @since 0.68.16 */ type Success = T extends WithResult ? _A : never; /** * @since 0.69.0 */ type SuccessEncoded = T extends WithResult ? _I : never; /** * @since 0.69.0 */ type Failure = T extends WithResult ? _E : never; /** * @since 0.69.0 */ type FailureEncoded = T extends WithResult ? _EI : never; /** * @since 0.67.0 */ type Context = T extends WithResult ? R : never; /** * @since 0.69.0 */ type Any = WithResult; /** * @since 0.69.0 */ type All = Any | WithResult; } /** * @since 0.69.0 */ export declare const asWithResult: (withExit: WR) => WithResult, WithResult.SuccessEncoded, WithResult.Failure, WithResult.FailureEncoded, WithResult.Context>; /** * @since 0.67.0 * @category accessor */ export declare const failureSchema: (self: WithResult) => Schema.Schema; /** * @since 0.67.0 * @category accessor */ export declare const successSchema: (self: WithResult) => Schema.Schema; /** * @since 0.67.0 * @category accessor */ export declare const exitSchema: (self: WithResult) => Schema.Schema, Schema.ExitEncoded, R>; /** * @since 0.67.0 * @category encoding */ export declare const serializeFailure: { /** * @since 0.67.0 * @category encoding */ (value: FA): (self: WithResult) => Effect.Effect; /** * @since 0.67.0 * @category encoding */ (self: WithResult, value: FA): Effect.Effect; }; /** * @since 0.67.0 * @category decoding */ export declare const deserializeFailure: { /** * @since 0.67.0 * @category decoding */ (value: unknown): (self: WithResult) => Effect.Effect; /** * @since 0.67.0 * @category decoding */ (self: WithResult, value: unknown): Effect.Effect; }; /** * @since 0.67.0 * @category encoding */ export declare const serializeSuccess: { /** * @since 0.67.0 * @category encoding */ (value: SA): (self: WithResult) => Effect.Effect; /** * @since 0.67.0 * @category encoding */ (self: WithResult, value: SA): Effect.Effect; }; /** * @since 0.67.0 * @category decoding */ export declare const deserializeSuccess: { /** * @since 0.67.0 * @category decoding */ (value: unknown): (self: WithResult) => Effect.Effect; /** * @since 0.67.0 * @category decoding */ (self: WithResult, value: unknown): Effect.Effect; }; /** * @since 0.67.0 * @category encoding */ export declare const serializeExit: { /** * @since 0.67.0 * @category encoding */ (value: Exit.Exit): (self: WithResult) => Effect.Effect, ParseResult.ParseError, R>; /** * @since 0.67.0 * @category encoding */ (self: WithResult, value: Exit.Exit): Effect.Effect, ParseResult.ParseError, R>; }; /** * @since 0.67.0 * @category decoding */ export declare const deserializeExit: { /** * @since 0.67.0 * @category decoding */ (value: unknown): (self: WithResult) => Effect.Effect, ParseResult.ParseError, R>; /** * @since 0.67.0 * @category decoding */ (self: WithResult, value: unknown): Effect.Effect, ParseResult.ParseError, R>; }; /** * The `SerializableWithResult` trait is specifically designed to model remote * procedures that require serialization of their input and output, managing * both successful and failed outcomes. * * This trait combines functionality from both the `Serializable` and `WithResult` * traits to handle data serialization and the bifurcation of operation results * into success or failure categories. * * @since 0.67.0 * @category model */ export interface SerializableWithResult extends Serializable, WithResult { } /** * @since 0.67.0 * @category model */ export declare namespace SerializableWithResult { /** * @since 0.69.0 */ type Context

= P extends SerializableWithResult ? SR | RR : never; /** * @since 0.69.0 */ type Any = SerializableWithResult; /** * @since 0.69.0 */ type All = Any | SerializableWithResult; } /** * @since 0.69.0 */ export declare const asSerializableWithResult: (procedure: SWR) => SerializableWithResult, Serializable.Encoded, Serializable.Context, WithResult.Success, WithResult.SuccessEncoded, WithResult.Failure, WithResult.FailureEncoded, WithResult.Context>; //# sourceMappingURL=Serializable.d.ts.map