Skip to main content Link Search Menu Expand Document (external link)

Multiplex overview

Added in v1.0.0


Table of contents


combinators

add

Signature

export declare const add: {
  <R2, E2, R3, E3>(
    predicate: (request: ServerRequest.ServerRequest) => Effect.Effect<boolean, E2, R2>,
    app: App.Default<R3, E3>
  ): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R3 | R, E2 | E3 | E>
  <R, E, R2, E2, R3, E3>(
    self: Multiplex<R, E>,
    predicate: (request: ServerRequest.ServerRequest) => Effect.Effect<boolean, E2, R2>,
    app: App.Default<R3, E3>
  ): Multiplex<R | R2 | R3, E | E2 | E3>
}

Added in v1.0.0

headerEndsWith

Signature

export declare const headerEndsWith: {
  <R2, E2>(
    header: string,
    suffix: string,
    app: App.Default<R2, E2>
  ): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R, E2 | E>
  <R, E, R2, E2>(
    self: Multiplex<R, E>,
    header: string,
    suffix: string,
    app: App.Default<R2, E2>
  ): Multiplex<R | R2, E | E2>
}

Added in v1.0.0

headerExact

Signature

export declare const headerExact: {
  <R2, E2>(
    header: string,
    value: string,
    app: App.Default<R2, E2>
  ): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R, E2 | E>
  <R, E, R2, E2>(
    self: Multiplex<R, E>,
    header: string,
    value: string,
    app: App.Default<R2, E2>
  ): Multiplex<R | R2, E | E2>
}

Added in v1.0.0

headerRegex

Signature

export declare const headerRegex: {
  <R2, E2>(
    header: string,
    regex: RegExp,
    app: App.Default<R2, E2>
  ): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R, E2 | E>
  <R, E, R2, E2>(
    self: Multiplex<R, E>,
    header: string,
    regex: RegExp,
    app: App.Default<R2, E2>
  ): Multiplex<R | R2, E | E2>
}

Added in v1.0.0

headerStartsWith

Signature

export declare const headerStartsWith: {
  <R2, E2>(
    header: string,
    prefix: string,
    app: App.Default<R2, E2>
  ): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R, E2 | E>
  <R, E, R2, E2>(
    self: Multiplex<R, E>,
    header: string,
    prefix: string,
    app: App.Default<R2, E2>
  ): Multiplex<R | R2, E | E2>
}

Added in v1.0.0

hostEndsWith

Signature

export declare const hostEndsWith: {
  <R2, E2>(suffix: string, app: App.Default<R2, E2>): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R, E2 | E>
  <R, E, R2, E2>(self: Multiplex<R, E>, suffix: string, app: App.Default<R2, E2>): Multiplex<R | R2, E | E2>
}

Added in v1.0.0

hostExact

Signature

export declare const hostExact: {
  <R2, E2>(host: string, app: App.Default<R2, E2>): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R, E2 | E>
  <R, E, R2, E2>(self: Multiplex<R, E>, host: string, app: App.Default<R2, E2>): Multiplex<R | R2, E | E2>
}

Added in v1.0.0

hostRegex

Signature

export declare const hostRegex: {
  <R2, E2>(regex: RegExp, app: App.Default<R2, E2>): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R, E2 | E>
  <R, E, R2, E2>(self: Multiplex<R, E>, regex: RegExp, app: App.Default<R2, E2>): Multiplex<R | R2, E | E2>
}

Added in v1.0.0

hostStartsWith

Signature

export declare const hostStartsWith: {
  <R2, E2>(prefix: string, app: App.Default<R2, E2>): <R, E>(self: Multiplex<R, E>) => Multiplex<R2 | R, E2 | E>
  <R, E, R2, E2>(self: Multiplex<R, E>, prefix: string, app: App.Default<R2, E2>): Multiplex<R | R2, E | E2>
}

Added in v1.0.0

constructors

empty

Signature

export declare const empty: Multiplex<never, never>

Added in v1.0.0

make

Signature

export declare const make: <R, E>(
  apps: Iterable<
    readonly [predicate: (request: ServerRequest.ServerRequest) => Effect.Effect<boolean, E, R>, app: App.Default<R, E>]
  >
) => Multiplex<R, E>

Added in v1.0.0

models

Multiplex (interface)

Signature

export interface Multiplex<R, E> extends App.Default<R, E | Error.RouteNotFound>, Inspectable {
  readonly [TypeId]: TypeId
  readonly apps: ReadonlyArray<
    readonly [predicate: (request: ServerRequest.ServerRequest) => Effect.Effect<boolean, E, R>, app: App.Default<R, E>]
  >
}

Added in v1.0.0

type ids

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v1.0.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0