/**
 * Utilities for connecting to the Wireguard demo server at demo.wireguard.com
 *
 * @since 1.0.0
 */
import * as SocketServer from "@effect/experimental/SocketServer";
import * as CommandExecutor from "@effect/platform/CommandExecutor";
import * as PlatformError from "@effect/platform/Error";
import * as FileSystem from "@effect/platform/FileSystem";
import * as HttpClient from "@effect/platform/HttpClient";
import * as HttpClientError from "@effect/platform/HttpClientError";
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 Schema from "effect/Schema";
import * as Scope from "effect/Scope";
import * as InternetSchemas from "./InternetSchemas.js";
import * as WireguardConfig from "./WireguardConfig.js";
import * as WireguardControl from "./WireguardControl.js";
import * as WireguardErrors from "./WireguardErrors.js";
import * as WireguardKey from "./WireguardKey.js";
/**
 * @since 1.0.0
 * @category Unbranded types
 */
export type WireguardDemoServerSchema = Schema.Schema.Type<typeof WireguardDemoServerSchema>;
/**
 * @since 1.0.0
 * @category Encoded types
 */
export type WireguardDemoServerSchemaEncoded = Schema.Schema.Encoded<typeof WireguardDemoServerSchema>;
/**
 * @since 1.0.0
 * @category Schema
 */
export declare const WireguardDemoServerSchema: Schema.transform<Schema.TemplateLiteral<`OK:${string}:${number}:${string}\n`>, Schema.Struct<{
    serverPort: InternetSchemas.$Port;
    serverPublicKey: Schema.brand<Schema.refine<string, Schema.Schema<string, string, never>>, "WireguardKey">;
    yourWireguardAddress: InternetSchemas.$Address;
}>>;
/**
 * Creates a Wireguard configuration to connect to demo.wireguard.com. When
 * connected, you should be able to see the hidden page at 192.168.4.1
 *
 * @since 1.0.0
 * @code
 *     import * as NodeContext from "@effect/platform-node/NodeContext";
 *     import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
 *     import * as Effect from "effect/Effect";
 *
 *     import * as WireguardControl from "the-wireguard-effect/WireguardControl";
 *     import * as WireguardDemo from "the-wireguard-effect/WireguardDemo";
 *
 *     Effect.gen(function* (λ) {
 *         const config = yield* λ(
 *             WireguardDemo.requestWireguardDemoConfig({
 *                 host: "localhost",
 *                 port: 42912,
 *             })
 *         );
 *         return yield* λ(config.up());
 *     })
 *         .pipe(Effect.scoped)
 *         .pipe(Effect.provide(NodeContext.layer))
 *         .pipe(Effect.provide(WireguardControl.BundledWgQuickLayer))
 *         .pipe(NodeRuntime.runMain);
 *
 * @see https://git.zx2c4.com/wireguard-tools/plain/contrib/ncat-client-server/client.sh
 */
export declare const requestWireguardDemoConfig: (connectOptions?: {
    port: number;
    host: string;
}, { privateKey, publicKey }?: {
    readonly privateKey: WireguardKey.WireguardKey;
    readonly publicKey: WireguardKey.WireguardKey;
}) => Effect.Effect<WireguardConfig.WireguardConfig, Socket.SocketError | ParseResult.ParseError, never>;
/**
 * Mock implementation of the Wireguard demo server at demo.wireguard.com
 *
 * @since 1.0.0
 * @code
 *     import * as SocketServerNode from "@effect/experimental/SocketServer/Node";
 *     import * as NodeContext from "@effect/platform-node/NodeContext";
 *     import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
 *     import * as Effect from "effect/Effect";
 *
 *     import * as WireguardControl from "the-wireguard-effect/WireguardControl";
 *     import * as WireguardDemo from "the-wireguard-effect/WireguardDemo";
 *
 *     Effect.suspend(() =>
 *         WireguardDemo.WireguardDemoServer({
 *             wireguardPort: 12912,
 *             wireguardNetwork: "192.168.5.1/24",
 *         })
 *     )
 *         .pipe(Effect.scoped)
 *         .pipe(Effect.provide(NodeContext.layer))
 *         .pipe(Effect.provide(WireguardControl.BundledWgQuickLayer))
 *         .pipe(Effect.provide(SocketServerNode.layer({ port: 42912 })))
 *         .pipe(NodeRuntime.runMain);
 *
 * @see https://git.zx2c4.com/wireguard-tools/plain/contrib/ncat-client-server/server.sh
 */
export declare const WireguardDemoServer: (options: {
    maxPeers?: number | undefined;
    serverEndpoint: InternetSchemas.Endpoint;
    wireguardNetwork: InternetSchemas.CidrBlockFromStringEncoded;
}) => Effect.Effect<void, Socket.SocketError | ParseResult.ParseError | Cause.TimeoutException | WireguardErrors.WireguardError | PlatformError.PlatformError | SocketServer.SocketServerError, Scope.Scope | FileSystem.FileSystem | Path.Path | SocketServer.SocketServer | WireguardControl.WireguardControl | CommandExecutor.CommandExecutor>;
/**
 * Attempts to view the hidden page on the demo.wireguard.com server, you should
 * only be able to see it when connected as a peer.
 *
 * @since 1.0.0
 */
export declare const requestHiddenPage: (hiddenPageLocation: string) => Effect.Effect<string, HttpClientError.HttpClientError | Cause.TimeoutException, HttpClient.HttpClient>;
/**
 * Attempts to connect to https://www.google.com to ensure that dns is still
 * working and we can connect to the internet when the wireguard tunnel is up.
 *
 * @since 1.0.0
 */
export declare const requestGoogle: Effect.Effect<void, HttpClientError.HttpClientError | Cause.TimeoutException, HttpClient.HttpClient>;
//# sourceMappingURL=WireguardServer.d.ts.map