import * as Config from "effect/Config";
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import type * as FileSystem from "effect/FileSystem";
import { type LazyArg } from "effect/Function";
import * as Layer from "effect/Layer";
import type * as Path from "effect/Path";
import * as Scope from "effect/Scope";
import * as Etag from "effect/unstable/http/Etag";
import type { HttpClient } from "effect/unstable/http/HttpClient";
import type * as Middleware from "effect/unstable/http/HttpMiddleware";
import type * as HttpPlatform from "effect/unstable/http/HttpPlatform";
import * as HttpServer from "effect/unstable/http/HttpServer";
import { ServeError } from "effect/unstable/http/HttpServerError";
import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
import type { HttpServerResponse } from "effect/unstable/http/HttpServerResponse";
import * as Http from "node:http";
import type * as Net from "node:net";
import type { Duplex } from "node:stream";
import * as NodeServices from "./NodeServices.ts";
import { NodeWS } from "./NodeSocket.ts";
/**
 * @since 1.0.0
 * @category constructors
 */
export declare const make: (evaluate: LazyArg<Http.Server<typeof Http.IncomingMessage, typeof Http.ServerResponse>>, options: Net.ListenOptions & {
    readonly disablePreemptiveShutdown?: boolean | undefined;
    readonly gracefulShutdownTimeout?: Duration.Input | undefined;
}) => Effect.Effect<{
    readonly serve: {
        <E, R>(effect: Effect.Effect<HttpServerResponse, E, R>): Effect.Effect<void, never, Exclude<R, HttpServerRequest> | Scope.Scope>;
        <E, R, App extends Effect.Effect<HttpServerResponse, any, any>>(effect: Effect.Effect<HttpServerResponse, E, R>, middleware: Middleware.HttpMiddleware.Applied<App, E, R>): Effect.Effect<void, never, Exclude<R, HttpServerRequest> | Scope.Scope>;
    };
    readonly address: HttpServer.Address;
}, ServeError, Scope.Scope>;
/**
 * @since 1.0.0
 * @category Handlers
 */
export declare const makeHandler: <R, E, App extends Effect.Effect<HttpServerResponse, any, any> = Effect.Effect<HttpServerResponse, E, R>>(httpEffect: Effect.Effect<HttpServerResponse, E, R>, options: {
    readonly scope: Scope.Scope;
    readonly middleware?: Middleware.HttpMiddleware.Applied<App, E, R> | undefined;
}) => Effect.Effect<(nodeRequest: Http.IncomingMessage, nodeResponse: Http.ServerResponse) => void, never, Exclude<Effect.Services<App>, HttpServerRequest | Scope.Scope>>;
/**
 * @since 1.0.0
 * @category Handlers
 */
export declare const makeUpgradeHandler: <R, E, App extends Effect.Effect<HttpServerResponse, any, any> = Effect.Effect<HttpServerResponse, E, R>>(lazyWss: Effect.Effect<NodeWS.WebSocketServer>, httpEffect: Effect.Effect<HttpServerResponse, E, R>, options: {
    readonly scope: Scope.Scope;
    readonly middleware?: Middleware.HttpMiddleware.Applied<App, E, R> | undefined;
}) => Effect.Effect<(nodeRequest: Http.IncomingMessage, socket: Duplex, head: Buffer) => void, never, Exclude<Effect.Services<App>, HttpServerRequest | Scope.Scope>>;
/**
 * @since 1.0.0
 * @category Layers
 */
export declare const layerServer: (evaluate: LazyArg<Http.Server<typeof Http.IncomingMessage, typeof Http.ServerResponse>>, options: Net.ListenOptions & {
    readonly disablePreemptiveShutdown?: boolean | undefined;
    readonly gracefulShutdownTimeout?: Duration.Input | undefined;
}) => Layer.Layer<HttpServer.HttpServer, ServeError>;
/**
 * @since 1.0.0
 * @category Layers
 */
export declare const layerHttpServices: Layer.Layer<NodeServices.NodeServices | HttpPlatform.HttpPlatform | Etag.Generator>;
/**
 * @since 1.0.0
 * @category Layers
 */
export declare const layer: (evaluate: LazyArg<Http.Server>, options: Net.ListenOptions & {
    readonly disablePreemptiveShutdown?: boolean | undefined;
    readonly gracefulShutdownTimeout?: Duration.Input | undefined;
}) => Layer.Layer<HttpServer.HttpServer | NodeServices.NodeServices | HttpPlatform.HttpPlatform | Etag.Generator, ServeError>;
/**
 * @since 1.0.0
 * @category Layers
 */
export declare const layerConfig: (evaluate: LazyArg<Http.Server>, options: Config.Wrap<Net.ListenOptions & {
    readonly disablePreemptiveShutdown?: boolean | undefined;
    readonly gracefulShutdownTimeout?: Duration.Input | undefined;
}>) => Layer.Layer<HttpServer.HttpServer | FileSystem.FileSystem | Path.Path | HttpPlatform.HttpPlatform | Etag.Generator, ServeError | Config.ConfigError>;
/**
 * @since 1.0.0
 * @category Testing
 */
export declare const layerTest: Layer.Layer<HttpServer.HttpServer | FileSystem.FileSystem | Path.Path | HttpPlatform.HttpPlatform | Etag.Generator | HttpClient, ServeError, never>;
//# sourceMappingURL=NodeHttpServer.d.ts.map