/** * @since 1.0.0 */ import type * as Context from "effect/Context"; import type * as Effect from "effect/Effect"; import type * as Layer from "effect/Layer"; import type * as Scope from "effect/Scope"; import type { Generator } from "./Etag.js"; import type { FileSystem } from "./FileSystem.js"; import type * as App from "./HttpApp.js"; import type * as Client from "./HttpClient.js"; import type * as Middleware from "./HttpMiddleware.js"; import type { HttpPlatform } from "./HttpPlatform.js"; import type * as ServerRequest from "./HttpServerRequest.js"; import type { Path } from "./Path.js"; /** * @since 1.0.0 * @category type ids */ export declare const TypeId: unique symbol; /** * @since 1.0.0 * @category type ids */ export type TypeId = typeof TypeId; /** * @since 1.0.0 * @category models */ export interface HttpServer { readonly [TypeId]: TypeId; readonly serve: { (httpApp: App.Default): Effect.Effect | Scope.Scope>; >(httpApp: App.Default, middleware: Middleware.HttpMiddleware.Applied): Effect.Effect | Scope.Scope>; }; readonly address: Address; } /** * @since 1.0.0 * @category models */ export interface ServeOptions { readonly respond: boolean; } /** * @since 1.0.0 * @category address */ export type Address = UnixAddress | TcpAddress; /** * @since 1.0.0 * @category address */ export interface TcpAddress { readonly _tag: "TcpAddress"; readonly hostname: string; readonly port: number; } /** * @since 1.0.0 * @category address */ export interface UnixAddress { readonly _tag: "UnixAddress"; readonly path: string; } /** * @since 1.0.0 * @category constructors */ export declare const HttpServer: Context.Tag; /** * @since 1.0.0 * @category constructors */ export declare const make: (options: { readonly serve: (httpApp: App.Default, middleware?: Middleware.HttpMiddleware) => Effect.Effect; readonly address: Address; }) => HttpServer; /** * @since 1.0.0 * @category accessors */ export declare const serve: { /** * @since 1.0.0 * @category accessors */ (): (httpApp: App.Default) => Layer.Layer>; /** * @since 1.0.0 * @category accessors */ >(middleware: Middleware.HttpMiddleware.Applied): (httpApp: App.Default) => Layer.Layer, ServerRequest.HttpServerRequest | Scope.Scope>>; /** * @since 1.0.0 * @category accessors */ (httpApp: App.Default): Layer.Layer>; /** * @since 1.0.0 * @category accessors */ >(httpApp: App.Default, middleware: Middleware.HttpMiddleware.Applied): Layer.Layer, ServerRequest.HttpServerRequest | Scope.Scope>>; }; /** * @since 1.0.0 * @category accessors */ export declare const serveEffect: { /** * @since 1.0.0 * @category accessors */ (): (httpApp: App.Default) => Effect.Effect>; /** * @since 1.0.0 * @category accessors */ >(middleware: Middleware.HttpMiddleware.Applied): (httpApp: App.Default) => Effect.Effect, ServerRequest.HttpServerRequest>>; /** * @since 1.0.0 * @category accessors */ (httpApp: App.Default): Effect.Effect>; /** * @since 1.0.0 * @category accessors */ >(httpApp: App.Default, middleware: Middleware.HttpMiddleware.Applied): Effect.Effect, ServerRequest.HttpServerRequest>>; }; /** * @since 1.0.0 * @category address */ export declare const formatAddress: (address: Address) => string; /** * @since 1.0.0 * @category address */ export declare const addressWith: (effect: (address: Address) => Effect.Effect) => Effect.Effect; /** * @since 1.0.0 * @category address */ export declare const addressFormattedWith: (effect: (address: string) => Effect.Effect) => Effect.Effect; /** * @since 1.0.0 * @category address */ export declare const logAddress: Effect.Effect; /** * @since 1.0.0 * @category address */ export declare const withLogAddress: (layer: Layer.Layer) => Layer.Layer>; /** * Layer producing an `HttpClient` with prepended url of the running http server. * * @since 1.0.0 * @category layers */ export declare const layerTestClient: Layer.Layer; /** * A Layer providing the `HttpPlatform`, `FileSystem`, `Etag.Generator`, and `Path` * services. * * The `FileSystem` service is a no-op implementation, so this layer is only * useful for platforms that have no file system. * * @since 1.0.0 * @category layers */ export declare const layerContext: Layer.Layer; //# sourceMappingURL=HttpServer.d.ts.map