import type { Cause } from "../Cause/cause.js"; import type { ExecutionStrategy } from "../Effect/ExecutionStrategy.js"; import * as T from "./deps-core.js"; import type { Managed } from "./managed.js"; import type { Finalizer } from "./ReleaseMap/finalizer.js"; import type { ReleaseMap } from "./ReleaseMap/index.js"; /** * Returns a managed that models the execution of this managed, followed by * the passing of its value to the specified continuation function `f`, * followed by the managed that it returns. * * @ets_data_first chain_ */ export declare function chain(f: (a: A) => Managed, __trace?: string): (self: Managed) => Managed; /** * Returns a managed that models the execution of this managed, followed by * the passing of its value to the specified continuation function `f`, * followed by the managed that it returns. */ export declare function chain_(self: Managed, f: (a: A) => Managed, __trace?: string): Managed; /** * Imports a synchronous side-effect into a pure value */ export declare function succeedWith(effect: () => A, __trace?: string): Managed; /** * Ensures that `f` is executed when this Managed is finalized, after * the existing finalizer. * * For usecases that need access to the Managed's result, see `onExit`. */ export declare function ensuring_(self: Managed, f: T.Effect, __trace?: string): Managed; /** * Ensures that `f` is executed when this Managed is finalized, after * the existing finalizer. * * For usecases that need access to the Managed's result, see `onExit`. * * @ets_data_first ensuring_ */ export declare function ensuring(f: T.Effect, __trace?: string): (self: Managed) => Managed; /** * Returns an effect that models failure with the specified error. The moral equivalent of throw for pure code. */ export declare function fail(e: E, __trace?: string): Managed; /** * Returns an effect that models failure with the specified error. The moral equivalent of throw for pure code. */ export declare function failWith(e: () => E, __trace?: string): Managed; /** * Creates an effect that executes a finalizer stored in a `Ref`. * The `Ref` is yielded as the result of the effect, allowing for * control flows that require mutating finalizers. */ export declare function finalizerRef(initial: Finalizer, __trace?: string): Managed>; /** * A more powerful version of `foldM` that allows recovering from any kind of failure except interruptions. * * @ets_data_first foldCauseM_ */ export declare function foldCauseM(f: (cause: Cause) => Managed, g: (a: A) => Managed, __trace?: string): (self: Managed) => Managed; /** * A more powerful version of `foldM` that allows recovering from any kind of failure except interruptions. */ export declare function foldCauseM_(self: Managed, f: (cause: Cause) => Managed, g: (a: A) => Managed, __trace?: string): Managed; /** * Lifts a `Effect< R, E, A>` into `Managed< R, E, A>` with a release action. * The acquire and release actions will be performed uninterruptibly. * * @ets_data_first make_ */ export declare function make(release: (a: A) => T.Effect, __trace?: string): (acquire: T.Effect) => Managed; /** * Lifts a `Effect< R, E, A>` into `Managed< R, E, A>` with a release action. * The acquire and release actions will be performed uninterruptibly. */ export declare function make_(acquire: T.Effect, release: (a: A) => T.Effect, __trace?: string): Managed; /** * Lifts a `Effect< R, E, A>` into `Managed< R, E, A>` with a release action. * The acquire action will be performed interruptibly, while release * will be performed uninterruptibly. * * @ets_data_first makeInterruptible_ */ export declare function makeInterruptible(release: (a: A) => T.Effect, __trace?: string): (acquire: T.Effect) => Managed; /** * Lifts a `Effect< R, E, A>` into `Managed< R, E, A>` with a release action. * The acquire action will be performed interruptibly, while release * will be performed uninterruptibly. */ export declare function makeInterruptible_(acquire: T.Effect, release: (a: A) => T.Effect, __trace?: string): Managed; /** * Construct a `ReleaseMap` wrapped in a `Managed`. The `ReleaseMap` will * be released with the specified `ExecutionStrategy` as the release action * for the resulting `Managed`. */ export declare function makeManagedReleaseMap(es: ExecutionStrategy, __trace?: string): Managed; /** * Creates a `Managed` from a `Reservation` produced by an effect. Evaluating * the effect that produces the reservation will be performed *uninterruptibly*, * while the acquisition step of the reservation will be performed *interruptibly*. * The release step will be performed uninterruptibly as usual. * * This two-phase acquisition allows for resource acquisition flows that can be * safely interrupted and released. */ export declare function makeReserve(reservation: T.Effect>, __trace?: string): Managed; /** * Returns a managed whose success is mapped by the specified `f` function. * * @ets_data_first map_ */ export declare function map(f: (a: A) => B, __trace?: string): (self: Managed) => Managed; /** * Returns a managed whose success is mapped by the specified `f` function. */ export declare function map_(self: Managed, f: (a: A) => B, __trace?: string): Managed; /** * Returns a managed whose success is mapped by the specified `f` function. */ export declare function mapM_(self: Managed, f: (a: A) => T.Effect, __trace?: string): Managed; /** * Returns a managed whose success is mapped by the specified `f` function. */ export declare function mapM(f: (a: A) => T.Effect, __trace?: string): (self: Managed) => Managed; /** * Ensures that a cleanup function runs when this Managed is finalized, after * the existing finalizers. */ export declare function onExit_(self: Managed, cleanup: (exit: T.Exit) => T.Effect, __trace?: string): Managed; /** * Ensures that a cleanup function runs when this Managed is finalized, after * the existing finalizers. * * @ets_data_first onExit_ */ export declare function onExit(cleanup: (exit: T.Exit) => T.Effect, __trace?: string): (self: Managed) => Managed; /** * Ensures that a cleanup function runs when this Managed is finalized, before * the existing finalizers. * * @ets_data_first onExitFirst_ */ export declare function onExitFirst(cleanup: (exit: T.Exit) => T.Effect, __trace?: string): (self: Managed) => Managed; /** * Ensures that a cleanup function runs when this Managed is finalized, before * the existing finalizers. */ export declare function onExitFirst_(self: Managed, cleanup: (exit: T.Exit) => T.Effect, __trace?: string): Managed; /** * Like provideSome_ for effect but for Managed */ export declare function provideSome_(self: Managed, f: (r0: R0) => R, __trace?: string): Managed; /** * Like provideSome for effect but for Managed * * @ets_data_first provideSome_ */ export declare function provideSome(f: (r0: R0) => R, __trace?: string): (self: Managed) => Managed; /** * Provides the `Managed` effect with its required environment, which eliminates * its dependency on `R`. * * @ets_data_first provideAll_ */ export declare function provideAll(r: R, __trace?: string): (self: Managed) => Managed; /** * Provides the `Managed` effect with its required environment, which eliminates * its dependency on `R`. */ export declare function provideAll_(self: Managed, r: R, __trace?: string): Managed; /** * A `Reservation` encapsulates resource acquisition and disposal * without specifying when or how that resource might be used. * * See `Managed#reserve` and `Effect#reserve` for details of usage. */ export declare class Reservation { readonly acquire: T.Effect; readonly release: (exit: T.Exit) => T.Effect; static of: (acquire: T.Effect, release: (exit: T.Exit) => T.Effect) => Reservation; private constructor(); } /** * Make a new reservation */ export declare function makeReservation_(acquire: T.Effect, release: (exit: T.Exit) => T.Effect): Reservation; /** * Make a new reservation * * @ets_data_first makeReservation_ */ export declare function makeReservation(release: (exit: T.Exit) => T.Effect): (acquire: T.Effect) => Reservation; /** * Lifts a pure `Reservation< R, E, A>` into `Managed< R, E, A>`. The acquisition step * is performed interruptibly. */ export declare function reserve(reservation: Reservation, __trace?: string): Managed; /** * Returns a managed that effectfully peeks at the acquired resource. */ export declare function tap_(self: Managed, f: (a: A) => Managed, __trace?: string): Managed; /** * Returns a managed that effectfully peeks at the acquired resource. * * @ets_data_first tap_ */ export declare function tap(f: (a: A) => Managed, __trace?: string): (self: Managed) => Managed; /** * Runs the acquire and release actions and returns the result of this * managed effect. Note that this is only safe if the result of this managed * effect is valid outside its scope. */ export declare function useNow(self: Managed, __trace?: string): T.Effect; /** * Use the resource until interruption. Useful for resources that you want * to acquire and use as long as the application is running, like a * HTTP server. */ export declare function useForever(self: Managed, __trace?: string): T.Effect; /** * Returns a managed that executes both this managed and the specified managed, * in sequence, combining their results with the specified `f` function. */ export declare function zip_(self: Managed, that: Managed, __trace?: string): Managed; /** * Returns a managed that executes both this managed and the specified managed, * in sequence, combining their results with the specified `f` function. * * @ets_data_first zip_ */ export declare function zip(that: Managed, __trace?: string): (self: Managed) => Managed; /** * Returns a managed that executes both this managed and the specified managed, * in sequence, combining their results with the specified `f` function. * * @ets_data_first zipWith_ */ export declare function zipWith(that: Managed, f: (a: A, a2: A2) => B, __trace?: string): (self: Managed) => Managed; /** * Returns a managed that executes both this managed and the specified managed, * in sequence, combining their results with the specified `f` function. */ export declare function zipWith_(self: Managed, that: Managed, f: (a: A, a2: A2) => B, __trace?: string): Managed; /** * Returns a managed that executes both this managed and the specified managed, * in parallel, combining their results with the specified `f` function. * * @ets_data_first zipWithPar_ */ export declare function zipWithPar(that: Managed, f: (a: A, a2: A2) => B, __trace?: string): (self: Managed) => Managed; /** * Returns a managed that executes both this managed and the specified managed, * in parallel, combining their results with the specified `f` function. */ export declare function zipWithPar_(self: Managed, that: Managed, f: (a: A, a2: A2) => B, __trace?: string): Managed; /** * Returns a `Reservation` that allows separately accessing effects * describing resource acquisition and release. */ export declare function managedReserve(self: Managed): T.UIO>; //# sourceMappingURL=core.d.ts.map