/**
 * Wireguard config schema definitions
 *
 * @since 1.0.0
 */
import * as CommandExecutor from "@effect/platform/CommandExecutor";
import * as PlatformError from "@effect/platform/Error";
import * as FileSystem from "@effect/platform/FileSystem";
import * as Path from "@effect/platform/Path";
import * as Socket from "@effect/platform/Socket";
import * as Cause from "effect/Cause";
import * as Effect from "effect/Effect";
import * as ParseResult from "effect/ParseResult";
import * as Request from "effect/Request";
import * as Resolver from "effect/RequestResolver";
import * as Schema from "effect/Schema";
import * as Scope from "effect/Scope";
import * as InternetSchemas from "./InternetSchemas.js";
import * as WireguardControl from "./WireguardControl.js";
import * as WireguardErrors from "./WireguardErrors.js";
import * as WireguardInterface from "./WireguardInterface.js";
import * as WireguardPeer from "./WireguardPeer.js";
declare const WireguardConfig_base: Schema.Class<WireguardConfig, {
    /** The Address of this peer. */
    Address: InternetSchemas.$CidrBlockFromString;
    /** DNS for this peer. */
    Dns: Schema.optional<InternetSchemas.$Address>;
    /**
     * The value for this is a decimal-string integer corresponding to the
     * listening port of the interface.
     */
    ListenPort: Schema.Union<[InternetSchemas.$Port, Schema.transformOrFail<typeof Schema.String, InternetSchemas.$Port, never>]>;
    /**
     * The value for this is a decimal-string integer corresponding to the
     * fwmark of the interface. The value may 0 in the case of a set operation,
     * in which case it indicates that the fwmark should be removed.
     */
    FirewallMark: Schema.optionalWith<typeof Schema.Number, {
        nullable: true;
    }>;
    /**
     * The value for this key should be a lowercase hex-encoded private key of
     * the interface. The value may be an all zero string in the case of a set
     * operation, in which case it indicates that the private key should be
     * removed.
     */
    PrivateKey: Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">;
    /** List of peers to add. */
    Peers: Schema.optionalWith<Schema.Array$<typeof WireguardPeer.WireguardPeer>, {
        default: () => never[];
        nullable: true;
    }>;
}, Schema.Struct.Encoded<{
    /** The Address of this peer. */
    Address: InternetSchemas.$CidrBlockFromString;
    /** DNS for this peer. */
    Dns: Schema.optional<InternetSchemas.$Address>;
    /**
     * The value for this is a decimal-string integer corresponding to the
     * listening port of the interface.
     */
    ListenPort: Schema.Union<[InternetSchemas.$Port, Schema.transformOrFail<typeof Schema.String, InternetSchemas.$Port, never>]>;
    /**
     * The value for this is a decimal-string integer corresponding to the
     * fwmark of the interface. The value may 0 in the case of a set operation,
     * in which case it indicates that the fwmark should be removed.
     */
    FirewallMark: Schema.optionalWith<typeof Schema.Number, {
        nullable: true;
    }>;
    /**
     * The value for this key should be a lowercase hex-encoded private key of
     * the interface. The value may be an all zero string in the case of a set
     * operation, in which case it indicates that the private key should be
     * removed.
     */
    PrivateKey: Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">;
    /** List of peers to add. */
    Peers: Schema.optionalWith<Schema.Array$<typeof WireguardPeer.WireguardPeer>, {
        default: () => never[];
        nullable: true;
    }>;
}>, never, {
    readonly Address: InternetSchemas.CidrBlockBase<"ipv4"> | InternetSchemas.CidrBlockBase<"ipv6">;
} & {
    readonly PrivateKey: string & import("effect/Brand").Brand<"WireguardKey">;
} & {
    readonly Dns?: {
        readonly family: "ipv4";
        readonly ip: InternetSchemas.IPv4Brand;
    } | {
        readonly family: "ipv6";
        readonly ip: InternetSchemas.IPv6Brand;
    } | undefined;
} & {
    readonly ListenPort: InternetSchemas.PortBrand;
} & {
    readonly FirewallMark?: number | undefined;
} & {
    readonly Peers?: readonly WireguardPeer.WireguardPeer[];
}, {}, {}>;
/**
 * A wireguard configuration.
 *
 * @since 1.0.0
 * @category Schemas
 */
export declare class WireguardConfig extends WireguardConfig_base {
    /**
     * Writes a wireguard interface configuration to an INI file.
     *
     * @since 1.0.0
     * @category Constructors
     * @param file - The path to the INI file.
     */
    writeToFile: {
        (file: string): Effect.Effect<void, ParseResult.ParseError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path>;
    };
    /**
     * Starts a wireguard tunnel that will continue to run and serve traffic
     * even after the nodejs process exits.
     *
     * @since 1.0.0
     * @category Wireguard
     */
    up: {
        (interfaceObject?: WireguardInterface.WireguardInterface | undefined): Effect.Effect<WireguardInterface.WireguardInterface, Socket.SocketError | ParseResult.ParseError | Cause.TimeoutException | PlatformError.PlatformError | WireguardErrors.WireguardError, FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor | WireguardControl.WireguardControl>;
    };
    /**
     * Starts a wireguard tunnel that will be gracefully shutdown and stop
     * serving traffic once the scope is closed.
     *
     * @since 1.0.0
     * @category Wireguard
     */
    upScoped: {
        (interfaceObject?: WireguardInterface.WireguardInterface | undefined): Effect.Effect<WireguardInterface.WireguardInterface, Socket.SocketError | ParseResult.ParseError | Cause.TimeoutException | PlatformError.PlatformError | WireguardErrors.WireguardError, FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor | WireguardControl.WireguardControl | Scope.Scope>;
    };
}
/**
 * @since 1.0.0
 * @category Api interface
 */
export type $WireguardIniConfig = Schema.Annotable<$WireguardIniConfig, string, Schema.Schema.Encoded<typeof WireguardConfig>, never>;
/**
 * A wireguard configuration encoded in the INI format.
 *
 * @since 1.0.0
 * @category Schema Transformations
 * @see {@link WireguardConfig}
 */
export declare const WireguardIniConfig: $WireguardIniConfig;
/**
 * Loads a wireguard interface configuration from an INI file.
 *
 * @since 1.0.0
 * @category Constructors
 * @param file - The path to the INI file.
 */
export declare const fromConfigFile: {
    (file: string): Effect.Effect<WireguardConfig, ParseResult.ParseError | PlatformError.PlatformError, FileSystem.FileSystem>;
};
/**
 * @since 1.0.0
 * @category Responses
 * @see https://www.wireguard.com/xplatform/
 */
export declare const WireguardGetConfigResponse: Schema.extend<Schema.SchemaClass<{
    readonly Address: InternetSchemas.CidrBlockBase<"ipv4"> | InternetSchemas.CidrBlockBase<"ipv6">;
    readonly PrivateKey: string & import("effect/Brand").Brand<"WireguardKey">;
    readonly Dns?: {
        readonly family: "ipv4";
        readonly ip: InternetSchemas.IPv4Brand;
    } | {
        readonly family: "ipv6";
        readonly ip: InternetSchemas.IPv6Brand;
    } | undefined;
    readonly ListenPort: InternetSchemas.PortBrand;
    readonly FirewallMark?: number | undefined;
    writeToFile: {
        (file: string): Effect.Effect<void, ParseResult.ParseError | PlatformError.PlatformError, FileSystem.FileSystem | Path.Path>;
    };
    up: {
        (interfaceObject?: WireguardInterface.WireguardInterface | undefined): Effect.Effect<WireguardInterface.WireguardInterface, Socket.SocketError | ParseResult.ParseError | Cause.TimeoutException | PlatformError.PlatformError | WireguardErrors.WireguardError, FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor | WireguardControl.WireguardControl>;
    };
    upScoped: {
        (interfaceObject?: WireguardInterface.WireguardInterface | undefined): Effect.Effect<WireguardInterface.WireguardInterface, Socket.SocketError | ParseResult.ParseError | Cause.TimeoutException | PlatformError.PlatformError | WireguardErrors.WireguardError, FileSystem.FileSystem | Path.Path | CommandExecutor.CommandExecutor | WireguardControl.WireguardControl | Scope.Scope>;
    };
}, {
    readonly Address: `${string}/${number}`;
    readonly PrivateKey: string;
    readonly Dns?: string | undefined;
    readonly ListenPort: string | number;
    readonly FirewallMark?: number | null | undefined;
}, never>, Schema.Struct<{
    Peers: Schema.optionalWith<Schema.Array$<typeof WireguardPeer.WireguardUApiGetPeerResponse>, {
        default: () => never[];
        nullable: true;
    }>;
}>>;
/**
 * @since 1.0.0
 * @category Responses
 */
export type WireguardGetConfigResponse = Schema.Schema.Type<typeof WireguardGetConfigResponse>;
declare const WireguardGetConfigRequest_base: new <Success, Error, A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, typeof Request.RequestTypeId>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | typeof Request.RequestTypeId ? never : P]: A[P]; }) => Request.Request<Success, Error> & Readonly<A> & {
    readonly _tag: "WireguardGetConfigRequest";
};
/**
 * @since 1.0.0
 * @category Requests
 */
export declare class WireguardGetConfigRequest extends WireguardGetConfigRequest_base<Schema.Schema.Type<typeof WireguardGetConfigResponse>, ParseResult.ParseError | Socket.SocketError, {
    readonly address: InternetSchemas.CidrBlockFromStringEncoded;
    readonly wireguardInterface: WireguardInterface.WireguardInterface;
}> {
}
declare const WireguardSetConfigRequest_base: new <Success, Error, A extends Record<string, any>>(args: import("effect/Types").Equals<Omit<A, typeof Request.RequestTypeId>, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" | typeof Request.RequestTypeId ? never : P]: A[P]; }) => Request.Request<Success, Error> & Readonly<A> & {
    readonly _tag: "WireguardSetConfigRequest";
};
/**
 * @since 1.0.0
 * @category Requests
 */
export declare class WireguardSetConfigRequest extends WireguardSetConfigRequest_base<WireguardInterface.WireguardInterface, ParseResult.ParseError | Socket.SocketError, {
    readonly config: WireguardConfig;
    readonly wireguardInterface: WireguardInterface.WireguardInterface;
    readonly peerRequestMapper?: (peer: WireguardPeer.WireguardPeer) => {
        readonly remove?: boolean | undefined;
        readonly updateOnly?: boolean | undefined;
        readonly replaceAllowedIps?: boolean | undefined;
    } | undefined;
}> {
}
/**
 * @since 1.0.0
 * @category Resolvers
 */
export declare const WireguardGetConfigResolver: Resolver.RequestResolver<WireguardGetConfigRequest, never>;
/**
 * @since 1.0.0
 * @category Resolvers
 */
export declare const WireguardSetConfigResolver: Resolver.RequestResolver<WireguardSetConfigRequest, never>;
export {};
//# sourceMappingURL=WireguardConfig.d.ts.map