import { Equal, FastCheck, Hash, Inspectable, Schema } from "effect"; import * as CBOR from "./CBOR.js"; import * as IPv4 from "./IPv4.js"; import * as IPv6 from "./IPv6.js"; import * as Port from "./Port.js"; declare const SingleHostAddr_base: Schema.TaggedClass; } & { port: Schema.optional>; ipv4: Schema.optional; ipv6: Schema.optional; }>; /** * Schema for SingleHostAddr representing a network host with IP addresses. * single_host_addr = (0, port/ nil, ipv4/ nil, ipv6/ nil) * * @since 2.0.0 * @category model */ export declare class SingleHostAddr extends SingleHostAddr_base { /** * Convert to JSON-serializable format. * Converts bigint port values to strings for JSON compatibility. * * @since 2.0.0 * @category serialization */ toJSON(): { _tag: "SingleHostAddr"; port: string | null; ipv4: { _tag: "IPv4"; bytes: string; } | null; ipv6: { _tag: "IPv6"; bytes: string; } | null; }; toString(): string; [Inspectable.NodeInspectSymbol](): unknown; [Equal.symbol](that: unknown): boolean; [Hash.symbol](): number; /** * Convert to CBOR bytes. * * @since 2.0.0 * @category serialization */ toCBORBytes(): Uint8Array; /** * Convert to CBOR hex string. * * @since 2.0.0 * @category serialization */ toCBORHex(): string; } /** * Create a SingleHostAddr with IPv4 address. * * @since 2.0.0 * @category constructors */ export declare const withIPv4: (port: Port.Port, ipv4: IPv4.IPv4) => SingleHostAddr; /** * Create a SingleHostAddr with IPv6 address. * * @since 2.0.0 * @category constructors */ export declare const withIPv6: (port: Port.Port, ipv6: IPv6.IPv6) => SingleHostAddr; /** * Create a SingleHostAddr with both IPv4 and IPv6 addresses. * * @since 2.0.0 * @category constructors */ export declare const withBothIPs: (port: Port.Port, ipv4: IPv4.IPv4, ipv6: IPv6.IPv6) => SingleHostAddr; /** * Check if the host address has an IPv4 address. * * @since 2.0.0 * @category predicates */ export declare const hasIPv4: (hostAddr: SingleHostAddr) => boolean; /** * Check if the host address has an IPv6 address. * * @since 2.0.0 * @category predicates */ export declare const hasIPv6: (hostAddr: SingleHostAddr) => boolean; /** * Check if the host address has a port. * * @since 2.0.0 * @category predicates */ export declare const hasPort: (hostAddr: SingleHostAddr) => boolean; /** * CDDL schema for SingleHostAddr. * single_host_addr = (0, port / nil, ipv4 / nil, ipv6 / nil) * * @since 2.0.0 * @category schemas */ export declare const FromCDDL: Schema.transformOrFail, Schema.NullOr, Schema.NullOr, Schema.NullOr]>, Schema.SchemaClass, never>; /** * FastCheck arbitrary for generating random SingleHostAddr instances * * @since 2.0.0 * @category testing */ export declare const arbitrary: FastCheck.Arbitrary; /** * CBOR bytes transformation schema for SingleHostAddr. * * @since 2.0.0 * @category schemas */ export declare const FromCBORBytes: (options?: CBOR.CodecOptions) => Schema.transform, never>, Schema.transformOrFail, Schema.NullOr, Schema.NullOr, Schema.NullOr]>, Schema.SchemaClass, never>>; /** * CBOR hex transformation schema for SingleHostAddr. * * @since 2.0.0 * @category schemas */ export declare const FromCBORHex: (options?: CBOR.CodecOptions) => Schema.transform, string, never>, Schema.transform, never>, Schema.transformOrFail, Schema.NullOr, Schema.NullOr, Schema.NullOr]>, Schema.SchemaClass, never>>>; /** * Parse SingleHostAddr from CBOR bytes. * * @since 2.0.0 * @category parsing */ export declare const fromCBORBytes: (bytes: Uint8Array, options?: CBOR.CodecOptions) => SingleHostAddr; /** * Parse SingleHostAddr from CBOR hex string. * * @since 2.0.0 * @category parsing */ export declare const fromCBORHex: (hex: string, options?: CBOR.CodecOptions) => SingleHostAddr; /** * Encode SingleHostAddr to CBOR bytes. * * @since 2.0.0 * @category encoding */ export declare const toCBORBytes: (data: SingleHostAddr, options?: CBOR.CodecOptions) => Uint8Array; /** * Encode SingleHostAddr to CBOR hex string. * * @since 2.0.0 * @category encoding */ export declare const toCBORHex: (data: SingleHostAddr, options?: CBOR.CodecOptions) => string; export {}; //# sourceMappingURL=SingleHostAddr.d.ts.map