import * as CL from "../Clock/index.js"; import * as Tp from "../Collections/Immutable/Tuple/index.js"; import type { Has, Tag } from "../Has/index.js"; import type * as SC from "../Schedule/index.js"; import type { UnionToIntersection } from "../Utils/index.js"; import type { Layer, MergeA, MergeE, MergeR } from "./definitions.js"; import { LayerChain } from "./definitions.js"; import * as T from "./deps-effect.js"; import * as M from "./deps-managed.js"; export * from "./definitions.js"; /** * Lazily constructs a layer. This is useful to avoid infinite recursion when * creating layers that refer to themselves. */ export declare function suspend(f: () => Layer): Layer; /** * Combines this layer with the specified layer, producing a new layer that * has the inputs of both layers, and the outputs of both layers combined * using the specified function. */ export declare function zipWithPar_(self: Layer, that: Layer, f: (a: ROut, b: ROut1) => ROut2): Layer; /** * Constructs a layer that fails with the specified value. */ export declare function fail(e: E): Layer; /** * Constructs a layer from the specified value. */ export declare function succeed(resource: T): Layer; /** * Combines this layer with the specified layer, producing a new layer that * has the inputs of both layers, and the outputs of both layers combined * using the specified function. */ export declare function zipWithPar(that: Layer, f: (a: ROut, b: ROut1) => ROut2): (self: Layer) => Layer; /** * Combines this layer with the specified layer, producing a new layer that * has the inputs of both layers, and the outputs of both layers combined * into a tuple. */ export declare function zipPar_(self: Layer, that: Layer): Layer>; /** * Combines this layer with the specified layer, producing a new layer that * has the inputs of both layers, and the outputs of both layers combined * into a tuple. */ export declare function zipPar(that: Layer): (self: Layer) => Layer>; /** * Construct a service layer from a value */ export declare function fromValue(has: Tag): (resource: T) => Layer>; /** * Constructs a layer from the specified effect. * * @ets_data_first fromEffect_ */ export declare function fromEffect(has: Tag): (resource: T.Effect) => Layer>; /** * Constructs a layer from the specified effect. */ export declare function fromEffect_(resource: T.Effect, has: Tag): Layer>; /** * Constructs a layer from a managed resource. */ export declare function fromManaged(has: Tag): (resource: M.Managed) => Layer>; /** * Constructs a layer from a managed resource. */ export declare function fromManaged_(resource: M.Managed, has: Tag): Layer>; /** * Constructs a layer from the environment using the specified function. */ export declare function fromFunction(tag: Tag): (f: (a: A) => B) => Layer>; /** * Zips layers together */ export declare function zip_(self: Layer, that: Layer): Layer>; /** * Zips layers together */ export declare function zip(right: Layer): (left: Layer) => Layer>; /** * Merges layers sequentially */ export declare function andSeq(that: Layer): (self: Layer) => Layer; /** * Merges layers sequentially */ export declare function andSeq_(self: Layer, that: Layer): Layer; /** * Merges all layers in parallel */ export declare function all[]>(...ls: Ls & { 0: Layer; }): Layer, MergeE, MergeA>; /** * Merges all layers sequentially */ export declare function allSeq[]>(...ls: Ls & { 0: Layer; }): Layer, MergeE, MergeA>; /** * Type level bound to make sure a layer is complete */ export declare function main(layer: Layer): Layer; /** * Converts a layer to a managed runtime */ export declare function toRuntime(_: Layer): M.Managed>; /** * Creates a fresh version of this layer that will not be shared. */ export declare function fresh(layer: Layer): Layer; /** * Returns a new layer whose output is mapped by the specified function. */ export declare function map(f: (a: A) => B): (fa: Layer) => Layer; /** * Maps the output of the layer using f */ export declare function map_(fa: Layer, f: (a: A) => B): Layer; /** * Chains the output of the layer using f */ export declare function chain(f: (a: A) => Layer): (fa: Layer) => Layer; /** * Chains the output of the layer using f */ export declare function chain_(fa: Layer, f: (a: A) => Layer): LayerChain; /** * Flatten `Layer< R, E, Layer< R2, E2, A>>` */ export declare function flatten(ffa: Layer>): Layer; /** * Restrict output to only contain the specified services */ export declare function restrict[]>(...ts: Tags): (self: Layer] ? Has : never; }[number]>>) => Layer] ? Has : never; }[number]>>; /** * Builds this layer and uses it until it is interrupted. This is useful when * your entire application is a layer, such as an HTTP server. */ export declare function launch(self: Layer): T.Effect; /** * Recovers from all errors. */ export declare function catchAll(handler: Layer, E1, Out1>): (self: Layer) => Layer; /** * A layer that passes along the first element of a tuple. */ export declare function first(): Layer, never, A>; /** * A layer that passes along the second element of a tuple. */ export declare function second(): Layer, never, A>; /** * Returns a layer with its error channel mapped using the specified * function. */ export declare function mapError(f: (e: E) => E1): (self: Layer) => Layer; /** * Translates effect failure into death of the fiber, making all failures * unchecked and not a part of the type of the layer. */ export declare function orDie(self: Layer): Layer; /** * Executes this layer and returns its output, if it succeeds, but otherwise * executes the specified layer. */ export declare function orElse(that: Layer): (self: Layer) => Layer; /** * Retries constructing this layer according to the specified schedule. */ export declare function retry(self: Layer, schedule: SC.Schedule): Layer; //# sourceMappingURL=core.d.ts.map