/** * Internet schemas for wireguard configuration. * * @since 1.0.0 */ import * as Schema from "effect/Schema"; import { IPv4, IPv4Family, IPv6, IPv6Family, Port } from "effect-schemas/Internet"; declare const DurationFromSeconds_base: Schema.transform; /** * Transforms a `number` of seconds into a `Duration`. * * @since 1.0.0 * @category Schemas */ export declare class DurationFromSeconds extends DurationFromSeconds_base { } declare const DurationFromSecondsString_base: Schema.transform; /** * Transforms a `string` of seconds into a `Duration`. * * @since 1.0.0 * @category Schemas */ export declare class DurationFromSecondsString extends DurationFromSecondsString_base { } declare const IPv4Endpoint_base: Schema.transform, Schema.Struct<{ ip: typeof Schema.String; natPort: typeof Schema.Number; listenPort: typeof Schema.Number; family: typeof IPv4Family; }>, Schema.TemplateLiteral<`${string}:${number}`>, Schema.TemplateLiteral<`${string}:${number}:${number}`>]>, Schema.Struct<{ address: typeof IPv4; natPort: typeof Port; listenPort: typeof Port; }>>; /** * An IPv4 wireguard endpoint, which consists of an IPv4 address followed by a * nat port then an optional local port. If only one port is provided, it is * assumed that the nat port and listen port are the same. * * @since 1.0.0 * @category Schemas * @example * ```ts * * import * as assert from "node:assert"; * * import * as Schema from "effect/Schema"; * import { IPv4Endpoint } from "the-wireguard-effect/InternetSchemas"; * * const decodeEndpoint = Schema.decodeSync(IPv4Endpoint); * const endpoint1 = decodeEndpoint("1.2.3.4:51820"); * const endpoint2 = decodeEndpoint("1.2.3.4:51820:41820"); * * const endpoint3 = decodeEndpoint({ * ip: "1.2.3.4", * port: 51820, * family: "ipv4", * }); * * const endpoint4 = decodeEndpoint({ * ip: "1.2.3.4", * natPort: 51820, * listenPort: 41820, * family: "ipv4", * }); * ```; */ export declare class IPv4Endpoint extends IPv4Endpoint_base { } declare const IPv6Endpoint_base: Schema.transform, Schema.Struct<{ ip: typeof Schema.String; natPort: typeof Schema.Number; listenPort: typeof Schema.Number; family: typeof IPv6Family; }>, Schema.TemplateLiteral<`[${string}]:${number}`>, Schema.TemplateLiteral<`[${string}]:${number}:${number}`>]>, Schema.Struct<{ address: typeof IPv6; natPort: typeof Port; listenPort: typeof Port; }>>; /** * An IPv6 wireguard endpoint, which consists of an IPv6 address in square * brackets followed by a nat port then an optional local port. If only one port * is provided, it is assumed that the nat port and listen port are the same. * * @since 1.0.0 * @category Schemas * @example * ```ts * * import * as assert from "node:assert"; * * import * as Schema from "effect/Schema"; * import { IPv6Endpoint } from "the-wireguard-effect/InternetSchemas"; * * const decodeEndpoint = Schema.decodeSync(IPv6Endpoint); * const endpoint1 = decodeEndpoint( * "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:51820" * ); * const endpoint2 = decodeEndpoint( * "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:51820:41820" * ); * * const endpoint3 = decodeEndpoint({ * ip: "2001:0db8:85a3:0000:0000:8a2e:0370:7334", * port: 51820, * family: "ipv6", * }); * * const endpoint4 = decodeEndpoint({ * ip: "2001:0db8:85a3:0000:0000:8a2e:0370:7334", * natPort: 51820, * listenPort: 41820, * family: "ipv6", * }); * ```; */ export declare class IPv6Endpoint extends IPv6Endpoint_base { } declare const HostnameEndpoint_base: Schema.transform, Schema.Struct<{ host: typeof Schema.String; natPort: typeof Schema.Number; listenPort: typeof Schema.Number; }>, Schema.TemplateLiteral<`${string}:${number}`>, Schema.TemplateLiteral<`${string}:${number}:${number}`>]>, Schema.Struct<{ host: typeof Schema.String; natPort: typeof Port; listenPort: typeof Port; }>>; /** * A hostname wireguard endpoint, which consists of a hostname followed by a\ * Nat port then an optional local port. If only one port is provided, it is * assumed that the nat port and listen port are the same. * * @since 1.0.0 * @category Schemas */ export declare class HostnameEndpoint extends HostnameEndpoint_base { } declare const Endpoint_base: Schema.Union<[typeof IPv4Endpoint, typeof IPv6Endpoint, typeof HostnameEndpoint]>; /** * A wireguard endpoint, which is either an IPv4 or IPv6 endpoint. * * @since 1.0.0 * @category Schemas * @example * import * as Schema from "effect/Schema"; * * import { Endpoint } from "the-wireguard-effect/InternetSchemas"; * * const decodeEndpoint = Schema.decodeSync(Endpoint); * const endpoint1 = decodeEndpoint("1.2.3.4:51820"); * const endpoint2 = decodeEndpoint("1.2.3.4:51820:41820"); * * const endpoint3 = decodeEndpoint({ * ip: "1.2.3.4", * port: 51820, * family: "ipv4", * }); * * const endpoint4: Endpoint = decodeEndpoint({ * ip: "1.2.3.4", * natPort: 51820, * listenPort: 41820, * family: "ipv4", * }); * * const endpoint5 = decodeEndpoint( * "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:51820" * ); * const endpoint6 = decodeEndpoint( * "[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:51820:41820" * ); * * const endpoint7 = decodeEndpoint({ * ip: "2001:0db8:85a3:0000:0000:8a2e:0370:7334", * port: 51820, * family: "ipv6", * }); * * const endpoint8: Endpoint = decodeEndpoint({ * ip: "2001:0db8:85a3:0000:0000:8a2e:0370:7334", * natPort: 51820, * listenPort: 41820, * family: "ipv6", * }); * ```; */ export declare class Endpoint extends Endpoint_base { } declare const IPv4SetupData_base: Schema.Tuple2; /** * A wireguard setup data, which consists of an endpoint followed by an address. * * @since 1.0.0 * @category Schemas * @example * import * as Schema from "effect/Schema"; * import { SetupData } from "the-wireguard-effect/InternetSchemas"; * * const decodeSetupData = Schema.decodeSync(SetupData); * const setupData = decodeSetupData(["1.1.1.1:51280", "10.0.0.1"]); * ```; */ export declare class IPv4SetupData extends IPv4SetupData_base { } declare const IPv6SetupData_base: Schema.Tuple2; /** * A wireguard setup data, which consists of an endpoint followed by an address. * * @since 1.0.0 * @category Schemas * @example * import * as Schema from "effect/Schema"; * import { SetupData } from "the-wireguard-effect/InternetSchemas"; * * const decodeSetupData = Schema.decodeSync(SetupData); * const setupData = decodeSetupData(["1.1.1.1:51280", "10.0.0.1"]); * ```; */ export declare class IPv6SetupData extends IPv6SetupData_base { } declare const HostnameIPv4SetupData_base: Schema.Tuple2; /** * A wireguard setup data, which consists of an endpoint followed by an address. * * @since 1.0.0 * @category Schemas * @see {@link IPv4} * @see {@link HostnameEndpoint} */ export declare class HostnameIPv4SetupData extends HostnameIPv4SetupData_base { } declare const HostnameIPv6SetupData_base: Schema.Tuple2; /** * A wireguard setup data, which consists of an endpoint followed by an address. * * @since 1.0.0 * @category Schemas * @see {@link IPv6} * @see {@link HostnameEndpoint} */ export declare class HostnameIPv6SetupData extends HostnameIPv6SetupData_base { } declare const SetupData_base: Schema.Union<[typeof IPv4SetupData, typeof IPv6SetupData, typeof HostnameIPv4SetupData, typeof HostnameIPv6SetupData]>; /** * A wireguard setup data, which consists of an endpoint followed by an address. * * @since 1.0.0 * @category Schemas * @example * ```ts * * import * as assert from "node:assert"; * * import * as Schema from "effect/Schema"; * import { SetupData } from "the-wireguard-effect/InternetSchemas"; * * const decodeSetupData = Schema.decodeSync(SetupData); * const setupData = decodeSetupData(["1.1.1.1:51280", "10.0.0.1"]); * ```; * * @see {@link Address} * @see {@link Endpoint} */ export declare class SetupData extends SetupData_base { } export {}; //# sourceMappingURL=InternetSchemas.d.ts.map