/** * Internet schemas for wireguard configuration. * * @since 1.0.0 */ import * as Schema from "effect/Schema"; /** * Transforms a `number` of seconds into a `Duration`. * * @since 1.0.0 * @category Schemas */ export declare const DurationFromSeconds: Schema.decodeTo; /** * 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 const IPv4Endpoint: Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>; readonly natPort: Schema.brand; readonly listenPort: Schema.brand; }>, Schema.Union; }>, Schema.Struct<{ readonly ip: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; readonly family: Schema.Literal<"ipv4">; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>; /** * 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 const IPv6Endpoint: Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>; readonly natPort: Schema.brand; readonly listenPort: Schema.brand; }>, Schema.Union; }>, Schema.Struct<{ readonly ip: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; readonly family: Schema.Literal<"ipv6">; }>, Schema.TemplateLiteral, Schema.String, Schema.Literal<"]">, Schema.Literal<":">, Schema.Finite]>, Schema.TemplateLiteral, Schema.String, Schema.Literal<"]">, Schema.Literal<":">, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>; /** * 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 const HostnameEndpoint: Schema.decodeTo; readonly listenPort: Schema.brand; }>, Schema.Union, Schema.Struct<{ readonly host: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>; /** * 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 const Endpoint: Schema.Union; readonly ip: Schema.brand; }>, Schema.String, never, never>; readonly natPort: Schema.brand; readonly listenPort: Schema.brand; }>, Schema.Union; }>, Schema.Struct<{ readonly ip: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; readonly family: Schema.Literal<"ipv4">; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>; readonly natPort: Schema.brand; readonly listenPort: Schema.brand; }>, Schema.Union; }>, Schema.Struct<{ readonly ip: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; readonly family: Schema.Literal<"ipv6">; }>, Schema.TemplateLiteral, Schema.String, Schema.Literal<"]">, Schema.Literal<":">, Schema.Finite]>, Schema.TemplateLiteral, Schema.String, Schema.Literal<"]">, Schema.Literal<":">, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly listenPort: Schema.brand; }>, Schema.Union, Schema.Struct<{ readonly host: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>]>; /** * 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 const IPv4SetupData: Schema.Tuple; readonly ip: Schema.brand; }>, Schema.String, never, never>; readonly natPort: Schema.brand; readonly listenPort: Schema.brand; }>, Schema.Union; }>, Schema.Struct<{ readonly ip: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; readonly family: Schema.Literal<"ipv4">; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>]>; /** * 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 const IPv6SetupData: Schema.Tuple; readonly ip: Schema.brand; }>, Schema.String, never, never>; readonly natPort: Schema.brand; readonly listenPort: Schema.brand; }>, Schema.Union; }>, Schema.Struct<{ readonly ip: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; readonly family: Schema.Literal<"ipv6">; }>, Schema.TemplateLiteral, Schema.String, Schema.Literal<"]">, Schema.Literal<":">, Schema.Finite]>, Schema.TemplateLiteral, Schema.String, Schema.Literal<"]">, Schema.Literal<":">, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>]>; /** * 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 const HostnameIPv4SetupData: Schema.Tuple; readonly listenPort: Schema.brand; }>, Schema.Union, Schema.Struct<{ readonly host: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>]>; /** * 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 const HostnameIPv6SetupData: Schema.Tuple; readonly listenPort: Schema.brand; }>, Schema.Union, Schema.Struct<{ readonly host: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>]>; /** * 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 const SetupData: Schema.Union; readonly ip: Schema.brand; }>, Schema.String, never, never>; readonly natPort: Schema.brand; readonly listenPort: Schema.brand; }>, Schema.Union; }>, Schema.Struct<{ readonly ip: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; readonly family: Schema.Literal<"ipv4">; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>]>, Schema.Tuple; readonly ip: Schema.brand; }>, Schema.String, never, never>; readonly natPort: Schema.brand; readonly listenPort: Schema.brand; }>, Schema.Union; }>, Schema.Struct<{ readonly ip: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; readonly family: Schema.Literal<"ipv6">; }>, Schema.TemplateLiteral, Schema.String, Schema.Literal<"]">, Schema.Literal<":">, Schema.Finite]>, Schema.TemplateLiteral, Schema.String, Schema.Literal<"]">, Schema.Literal<":">, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>]>, Schema.Tuple; readonly listenPort: Schema.brand; }>, Schema.Union, Schema.Struct<{ readonly host: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>]>, Schema.Tuple; readonly listenPort: Schema.brand; }>, Schema.Union, Schema.Struct<{ readonly host: Schema.String; readonly natPort: Schema.Finite; readonly listenPort: Schema.Finite; }>, Schema.TemplateLiteral, Schema.Finite]>, Schema.TemplateLiteral, Schema.Finite, Schema.Literal<":">, Schema.Finite]>]>, never, never>, Schema.decodeTo; readonly ip: Schema.brand; }>, Schema.String, never, never>]>]>; //# sourceMappingURL=InternetSchemas.d.ts.map