/**
 * Wireguard peer schema definitions
 *
 * @since 1.0.0
 */
import * as Brand from "effect/Brand";
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import * as Option from "effect/Option";
import * as ParseResult from "effect/ParseResult";
import * as Schema from "effect/Schema";
import * as InternetSchemas from "./InternetSchemas.js";
declare const WireguardPeer_base: Schema.Class<WireguardPeer, {
    /**
     * The persistent keepalive interval in seconds, 0 disables it. The
     * difference between Option.none and Option.some(0) is important when
     * performing something like a config update operation on an interface
     * because Option.none will not include the keep alive setting in the update
     * request, so it will remain the same as it was before the update, whereas
     * Option.some(0) will disable the keep alive setting.
     */
    PersistentKeepalive: Schema.optionalWith<typeof InternetSchemas.DurationFromSeconds, {
        as: "Option";
        nullable: true;
    }>;
    /**
     * The collection of IPs/masks that will be accepted from this peer. If an
     * identical value already exists as part of a prior peer, the allowed IP
     * entry will be removed from that peer and added to this peer.
     */
    AllowedIPs: Schema.optionalWith<Schema.ReadonlySetFromSelf<InternetSchemas.$CidrBlockFromString>, {
        nullable: true;
        default: () => Set<never>;
    }>;
    /**
     * The value for this key is either IP:port for IPv4 or [IP]:port for IPv6
     * or some.hostname.com:port for a hostname endpoint. The endpoint is
     * optional and, if not supplied, the remote peer must connect first (so
     * they should have the endpoint set to know where to connect to) and this
     * client will just send requests back to the remote peer's source IP and
     * port.
     */
    Endpoint: Schema.optionalWith<InternetSchemas.$Endpoint, {
        nullable: true;
    }>;
    /** Lowercase hex-encoded public key of the new peer entry. */
    PublicKey: Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">;
    /**
     * The preshared key is optional and is a lowercase hex-encoded key. The
     * value may be an all zero string in the case of a set operation, in which
     * case it indicates that the preshared-key should be removed.
     */
    PresharedKey: Schema.optionalWith<Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">, {
        nullable: true;
        as: "Option";
    }>;
}, Schema.Struct.Encoded<{
    /**
     * The persistent keepalive interval in seconds, 0 disables it. The
     * difference between Option.none and Option.some(0) is important when
     * performing something like a config update operation on an interface
     * because Option.none will not include the keep alive setting in the update
     * request, so it will remain the same as it was before the update, whereas
     * Option.some(0) will disable the keep alive setting.
     */
    PersistentKeepalive: Schema.optionalWith<typeof InternetSchemas.DurationFromSeconds, {
        as: "Option";
        nullable: true;
    }>;
    /**
     * The collection of IPs/masks that will be accepted from this peer. If an
     * identical value already exists as part of a prior peer, the allowed IP
     * entry will be removed from that peer and added to this peer.
     */
    AllowedIPs: Schema.optionalWith<Schema.ReadonlySetFromSelf<InternetSchemas.$CidrBlockFromString>, {
        nullable: true;
        default: () => Set<never>;
    }>;
    /**
     * The value for this key is either IP:port for IPv4 or [IP]:port for IPv6
     * or some.hostname.com:port for a hostname endpoint. The endpoint is
     * optional and, if not supplied, the remote peer must connect first (so
     * they should have the endpoint set to know where to connect to) and this
     * client will just send requests back to the remote peer's source IP and
     * port.
     */
    Endpoint: Schema.optionalWith<InternetSchemas.$Endpoint, {
        nullable: true;
    }>;
    /** Lowercase hex-encoded public key of the new peer entry. */
    PublicKey: Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">;
    /**
     * The preshared key is optional and is a lowercase hex-encoded key. The
     * value may be an all zero string in the case of a set operation, in which
     * case it indicates that the preshared-key should be removed.
     */
    PresharedKey: Schema.optionalWith<Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">, {
        nullable: true;
        as: "Option";
    }>;
}>, never, {
    readonly Endpoint?: {
        readonly address: InternetSchemas.IPv4;
        readonly natPort: InternetSchemas.PortBrand;
        readonly listenPort: InternetSchemas.PortBrand;
    } | {
        readonly address: InternetSchemas.IPv6;
        readonly natPort: InternetSchemas.PortBrand;
        readonly listenPort: InternetSchemas.PortBrand;
    } | {
        readonly host: string;
        readonly natPort: InternetSchemas.PortBrand;
        readonly listenPort: InternetSchemas.PortBrand;
    } | undefined;
} & {
    readonly PublicKey: string & Brand.Brand<"WireguardKey">;
} & {
    readonly PersistentKeepalive: Option.Option<Duration.Duration>;
} & {
    readonly AllowedIPs?: ReadonlySet<InternetSchemas.CidrBlockBase<"ipv4"> | InternetSchemas.CidrBlockBase<"ipv6">>;
} & {
    readonly PresharedKey: Option.Option<string & Brand.Brand<"WireguardKey">>;
}, {}, {}>;
/**
 * A wireguard peer configuration.
 *
 * @since 1.0.0
 * @category Datatypes
 * @example
 *     import * as Schema from "effect/Schema";
 *     import * as Duration from "effect/Duration";
 *     import * as Option from "effect/Option";
 *     import * as InternetSchemas from "the-wireguard-effect/InternetSchemas";
 *     import * as WireguardKey from "the-wireguard-effect/WireguardKey";
 *
 *     import { WireguardPeer } from "the-wireguard-effect/WireguardPeer";
 *
 *     const preshareKey = WireguardKey.generatePreshareKey();
 *     const { publicKey, privateKey: _privateKey } =
 *         WireguardKey.generateKeyPair();
 *
 *     // WireguardPeer
 *     const peerDirectInstantiation = new WireguardPeer({
 *         PublicKey: publicKey,
 *         AllowedIPs: [
 *             InternetSchemas.CidrBlock({
 *                 ipv4: InternetSchemas.IPv4("192.168.0.0"),
 *                 mask: InternetSchemas.IPv4CidrMask(24),
 *             }),
 *         ],
 *         Endpoint: InternetSchemas.Endpoint(
 *             InternetSchemas.IPv4Endpoint({
 *                 ip: InternetSchemas.IPv4("192.168.0.1"),
 *                 natPort: InternetSchemas.Port(51820),
 *                 listenPort: InternetSchemas.Port(51820),
 *             })
 *         ),
 *         PersistentKeepalive: Duration.seconds(20),
 *         PresharedKey: Option.none(),
 *     });
 *
 *     // Effect.Effect<WireguardPeer, ParseResult.ParseError, never>
 *     const peerSchemaInstantiation = Schema.decode(WireguardPeer)({
 *         PublicKey: publicKey,
 *         PresharedKey: preshareKey,
 *         Endpoint: "192.168.0.1:51820",
 *         AllowedIPs: ["192.168.0.0/24"],
 *         PersistentKeepalive: Duration.seconds(20),
 *     });
 */
export declare class WireguardPeer extends WireguardPeer_base {
}
/**
 * @since 1.0.0
 * @category Api interface
 */
export type $WireguardIniPeer = Schema.Annotable<$WireguardIniPeer, string, Schema.Schema.Encoded<typeof WireguardPeer>, never>;
/**
 * A wireguard peer configuration encoded in INI format.
 *
 * @since 1.0.0
 * @category Transformations
 * @example
 *     import * as Effect from "effect/Effect";
 *     import * as Function from "effect/Function";
 *     import * as Schema from "effect/Schema";
 *     import * as WireguardKey from "the-wireguard-effect/WireguardKey";
 *     import * as WireguardPeer from "the-wireguard-effect/WireguardPeer";
 *
 *     const preshareKey = WireguardKey.generatePreshareKey();
 *     const { publicKey, privateKey: _privateKey } =
 *         WireguardKey.generateKeyPair();
 *
 *     const peer = Schema.decode(WireguardPeer.WireguardPeer)({
 *         PublicKey: publicKey,
 *         PresharedKey: preshareKey,
 *         AllowedIPs: new Set(["192.168.0.0/24"]),
 *         Endpoint: "192.168.0.1:51820",
 *         PersistentKeepalive: 20,
 *     });
 *
 *     const iniPeer = Function.pipe(
 *         peer,
 *         Effect.flatMap(Schema.encode(WireguardPeer.WireguardPeer)),
 *         Effect.flatMap(Schema.decode(WireguardPeer.WireguardIniPeer))
 *     );
 *
 * @see {@link WireguardPeer}
 */
export declare const WireguardIniPeer: $WireguardIniPeer;
/**
 * Creates a wireguard userspace api set peer request from a wireguard peer.
 * This is a one way transformation (hence why schema is not involved), and you
 * are not expected to need to decode this back into a wireguard peer. Instead,
 * you should use the request resolver on the wireguard control interface to
 * "transform" this into a response.
 *
 * @since 1.0.0
 * @category Requests
 * @see https://www.wireguard.com/xplatform/
 */
export declare const makeWireguardUApiSetPeerRequest: (peer: WireguardPeer) => string;
declare const WireguardUApiGetPeerResponse_base: Schema.Class<WireguardUApiGetPeerResponse, {
    /**
     * The persistent keepalive interval in seconds, 0 disables it. The
     * difference between Option.none and Option.some(0) is important when
     * performing something like a config update operation on an interface
     * because Option.none will not include the keep alive setting in the update
     * request, so it will remain the same as it was before the update, whereas
     * Option.some(0) will disable the keep alive setting.
     */
    PersistentKeepalive: Schema.optionalWith<typeof InternetSchemas.DurationFromSeconds, {
        as: "Option";
        nullable: true;
    }>;
    /**
     * The collection of IPs/masks that will be accepted from this peer. If an
     * identical value already exists as part of a prior peer, the allowed IP
     * entry will be removed from that peer and added to this peer.
     */
    AllowedIPs: Schema.optionalWith<Schema.ReadonlySetFromSelf<InternetSchemas.$CidrBlockFromString>, {
        nullable: true;
        default: () => Set<never>;
    }>;
    /**
     * The value for this key is either IP:port for IPv4 or [IP]:port for IPv6
     * or some.hostname.com:port for a hostname endpoint. The endpoint is
     * optional and, if not supplied, the remote peer must connect first (so
     * they should have the endpoint set to know where to connect to) and this
     * client will just send requests back to the remote peer's source IP and
     * port.
     */
    Endpoint: Schema.optionalWith<InternetSchemas.$Endpoint, {
        nullable: true;
    }>;
    /** Lowercase hex-encoded public key of the new peer entry. */
    PublicKey: Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">;
    /**
     * The preshared key is optional and is a lowercase hex-encoded key. The
     * value may be an all zero string in the case of a set operation, in which
     * case it indicates that the preshared-key should be removed.
     */
    PresharedKey: Schema.optionalWith<Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">, {
        nullable: true;
        as: "Option";
    }>;
} & {
    /** The number of received bytes. */
    rxBytes: typeof Schema.NumberFromString;
    /** The number of transmitted bytes. */
    txBytes: typeof Schema.NumberFromString;
    /**
     * The number of seconds since the most recent handshake, expressed relative
     * to the Unix epoch.
     */
    lastHandshakeTimeSeconds: typeof Schema.NumberFromString;
}, {
    readonly PublicKey: string;
} & {
    readonly Endpoint?: `${string}:${number}` | `${string}:${number}:${number}` | {
        readonly ip: string;
        readonly port: number;
        readonly family: InternetSchemas.IPv4Family;
    } | {
        readonly ip: string;
        readonly natPort: number;
        readonly listenPort: number;
        readonly family: InternetSchemas.IPv4Family;
    } | `[${string}]:${number}` | `[${string}]:${number}:${number}` | {
        readonly ip: string;
        readonly port: number;
        family: InternetSchemas.IPv6Family;
    } | {
        readonly ip: string;
        readonly natPort: number;
        readonly listenPort: number;
        family: InternetSchemas.IPv6Family;
    } | {
        readonly host: string;
        readonly port: number;
    } | {
        readonly host: string;
        readonly natPort: number;
        readonly listenPort: number;
    } | null | undefined;
    readonly PersistentKeepalive?: number | null | undefined;
    readonly AllowedIPs?: ReadonlySet<`${string}/${number}`> | null | undefined;
    readonly PresharedKey?: string | null | undefined;
} & {
    readonly rxBytes: string;
    readonly txBytes: string;
    readonly lastHandshakeTimeSeconds: string;
} & {}, never, {
    readonly Endpoint?: {
        readonly address: InternetSchemas.IPv4;
        readonly natPort: InternetSchemas.PortBrand;
        readonly listenPort: InternetSchemas.PortBrand;
    } | {
        readonly address: InternetSchemas.IPv6;
        readonly natPort: InternetSchemas.PortBrand;
        readonly listenPort: InternetSchemas.PortBrand;
    } | {
        readonly host: string;
        readonly natPort: InternetSchemas.PortBrand;
        readonly listenPort: InternetSchemas.PortBrand;
    } | undefined;
} & {
    readonly PublicKey: string & Brand.Brand<"WireguardKey">;
} & {
    readonly PersistentKeepalive: Option.Option<Duration.Duration>;
} & {
    readonly AllowedIPs?: ReadonlySet<InternetSchemas.CidrBlockBase<"ipv4"> | InternetSchemas.CidrBlockBase<"ipv6">>;
} & {
    readonly PresharedKey: Option.Option<string & Brand.Brand<"WireguardKey">>;
} & {
    readonly rxBytes: number;
} & {
    readonly txBytes: number;
} & {
    readonly lastHandshakeTimeSeconds: number;
}, WireguardPeer, {}>;
/**
 * A wireguard peer from an interface inspection request contains three
 * additional fields.
 *
 * @since 1.0.0
 * @category Responses
 * @see https://www.wireguard.com/xplatform/
 */
export declare class WireguardUApiGetPeerResponse extends WireguardUApiGetPeerResponse_base {
}
/**
 * Parses a wireguard userspace api get peer response from a wireguard control
 * request resolver into a wireguard peer.
 *
 * @since 1.0.0
 * @category Responses
 * @see https://www.wireguard.com/xplatform/
 */
export declare const parseWireguardUApiGetPeerResponse: (input: string) => Effect.Effect<WireguardUApiGetPeerResponse, ParseResult.ParseError, never>;
export default WireguardPeer;
//# sourceMappingURL=WireguardPeer.d.ts.map