import { Effect, ParseResult, Schema } from "effect"; import * as Hex from "./Hex.js"; declare const SerializationError_base: new = {}>(args: import("effect/Types").Equals extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & { readonly _tag: "SerializationError"; } & Readonly; export declare class SerializationError extends SerializationError_base<{ message?: ParseResult.ParseError; }> { } /** * Serialization function interfaces for encoding and decoding data * * @since 1.0.0 * @category encoding/decoding */ /** * Base serialization function type * * @since 1.0.0 * @category model */ export interface SerializationFn { (input: Input): Effect.Effect; } /** * Synchronous serialization function that throws on error * * @since 1.0.0 * @category model */ export interface SerializationFnSync { (input: Input): Output; } /** * Converts a value to its CBOR byte representation * * @since 1.0.0 * @category encoding/decoding */ export type ToCBORBytes = SerializationFnSync; /** * Converts a value to its CBOR hex string representation * * @since 1.0.0 * @category encoding/decoding */ export type ToCBOR = SerializationFnSync; /** * Creates a value from its CBOR hex string representation * * @since 1.0.0 * @category constructors */ export type FromCBOR = SerializationFn; /** * Creates a value from its CBOR hex string representation, throws on error * * @since 1.0.0 * @category constructors */ export type FromCBOROrThrow = SerializationFnSync; /** * Creates a value from its CBOR byte representation * * @since 1.0.0 * @category constructors */ export type FromCBORBytes = SerializationFn; /** * Creates a value from its CBOR byte representation, throws on error * * @since 1.0.0 * @category constructors */ export type FromCBORBytesOrThrow = SerializationFnSync; /** * Creates a value from its byte representation * * @since 1.0.0 * @category constructors */ export type FromBytes = SerializationFn; /** * Creates a value from its hex string representation * * @since 1.0.0 * @category constructors */ export type FromHex = SerializationFn; /** * Creates a value from its bech32 string representation * * @since 1.0.0 * @category constructors */ export type FromBech32 = SerializationFn; /** * Creates a value from string representation * * @since 1.0.0 * @category constructors */ export type FromString = SerializationFn; /** * Converts a value to its byte representation * * @since 1.0.0 * @category encoding/decoding */ export type ToBytes = SerializationFnSync; /** * Creates a value from a string identifier * * @since 1.0.0 * @category constructors */ export type Make = SerializationFn; /** * Creates a value from a string identifier, throws on error * * @since 1.0.0 * @category constructors */ export type MakeOrThrow = SerializationFnSync; /** * Type predicate for runtime type checking * * @since 1.0.0 * @category predicates */ export interface TypePredicate { (value: unknown): value is T; } export declare const encode: (schema: Schema.Schema) => (value: A) => Effect.Effect; export declare const decode: (schema: Schema.Schema) => (value: I) => Effect.Effect; export declare const encodeEither: (schema: Schema.Schema) => (value: A) => Effect.Effect; export declare const decodeEither: (schema: Schema.Schema) => (value: I) => Effect.Effect; export declare const encodeOrThrow: (schema: Schema.Schema) => (value: A) => I; export declare const decodeOrThrow: (schema: Schema.Schema) => (value: unknown) => A; export declare const formatError: (parseError: ParseResult.ParseError) => string; export {}; //# sourceMappingURL=Serialization.d.ts.map