/** * @since 1.0.0 */ import type * as Effect from "effect/Effect" import type { Inspectable } from "effect/Inspectable" import type * as App from "./HttpApp.js" import type * as Error from "./HttpServerError.js" import type * as ServerRequest from "./HttpServerRequest.js" import * as internal from "./internal/httpMultiplex.js" /** * @since 1.0.0 * @category type ids */ export const TypeId: unique symbol = internal.TypeId /** * @since 1.0.0 * @category type ids */ export type TypeId = typeof TypeId /** * @since 1.0.0 * @category models */ export interface HttpMultiplex extends App.Default, Inspectable { readonly [TypeId]: TypeId readonly apps: ReadonlyArray< readonly [ predicate: (request: ServerRequest.HttpServerRequest) => Effect.Effect, app: App.Default ] > } /** * @since 1.0.0 * @category constructors */ export const empty: HttpMultiplex = internal.empty /** * @since 1.0.0 * @category constructors */ export const make: ( apps: Iterable< readonly [ predicate: (request: ServerRequest.HttpServerRequest) => Effect.Effect, app: App.Default ] > ) => HttpMultiplex = internal.make /** * @since 1.0.0 * @category combinators */ export const add: { /** * @since 1.0.0 * @category combinators */ ( predicate: (request: ServerRequest.HttpServerRequest) => Effect.Effect, app: App.Default ): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ ( self: HttpMultiplex, predicate: (request: ServerRequest.HttpServerRequest) => Effect.Effect, app: App.Default ): HttpMultiplex } = internal.add /** * @since 1.0.0 * @category combinators */ export const headerExact: { /** * @since 1.0.0 * @category combinators */ (header: string, value: string, app: App.Default): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ ( self: HttpMultiplex, header: string, value: string, app: App.Default ): HttpMultiplex } = internal.headerExact /** * @since 1.0.0 * @category combinators */ export const headerRegex: { /** * @since 1.0.0 * @category combinators */ (header: string, regex: RegExp, app: App.Default): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ ( self: HttpMultiplex, header: string, regex: RegExp, app: App.Default ): HttpMultiplex } = internal.headerRegex /** * @since 1.0.0 * @category combinators */ export const headerStartsWith: { /** * @since 1.0.0 * @category combinators */ (header: string, prefix: string, app: App.Default): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ ( self: HttpMultiplex, header: string, prefix: string, app: App.Default ): HttpMultiplex } = internal.headerStartsWith /** * @since 1.0.0 * @category combinators */ export const headerEndsWith: { /** * @since 1.0.0 * @category combinators */ (header: string, suffix: string, app: App.Default): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ ( self: HttpMultiplex, header: string, suffix: string, app: App.Default ): HttpMultiplex } = internal.headerEndsWith /** * @since 1.0.0 * @category combinators */ export const hostExact: { /** * @since 1.0.0 * @category combinators */ (host: string, app: App.Default): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ (self: HttpMultiplex, host: string, app: App.Default): HttpMultiplex } = internal.hostExact /** * @since 1.0.0 * @category combinators */ export const hostRegex: { /** * @since 1.0.0 * @category combinators */ (regex: RegExp, app: App.Default): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ (self: HttpMultiplex, regex: RegExp, app: App.Default): HttpMultiplex } = internal.hostRegex /** * @since 1.0.0 * @category combinators */ export const hostStartsWith: { /** * @since 1.0.0 * @category combinators */ (prefix: string, app: App.Default): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ (self: HttpMultiplex, prefix: string, app: App.Default): HttpMultiplex } = internal.hostStartsWith /** * @since 1.0.0 * @category combinators */ export const hostEndsWith: { /** * @since 1.0.0 * @category combinators */ (suffix: string, app: App.Default): (self: HttpMultiplex) => HttpMultiplex /** * @since 1.0.0 * @category combinators */ (self: HttpMultiplex, suffix: string, app: App.Default): HttpMultiplex } = internal.hostEndsWith