import type { Exit } from "../Exit"; import * as T from "./_internal/task"; import { Managed } from "./model"; import type { Finalizer } from "./ReleaseMap"; /** * Lift a pure value into a task */ export declare const succeed: (a: A) => Managed; /** * Lifts a `Task` into `Managed` with no release action. The * effect will be performed interruptibly. */ export declare const fromTask: (effect: T.Task) => Managed; /** * Imports a synchronous side-effect into a pure value */ export declare const total: (effect: () => A) => Managed; /** * Returns a task that models failure with the specified error. The moral equivalent of throw for pure code. */ export declare const fail: (e: E) => Managed; /** * Creates a task 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 const finalizerRef: ( initial: Finalizer ) => Managed>; /** * Lifts a `Task` into `Managed` with a release action. * The acquire and release actions will be performed uninterruptibly. */ export declare const make: ( release: (a: A) => T.Task ) => (acquire: T.Task) => Managed; /** * Lifts a `Task` into `Managed` with a release action. * The acquire and release actions will be performed uninterruptibly. */ export declare const make_: ( acquire: T.Task, release: (a: A) => T.Task ) => Managed; /** * Lifts a `Task` into `Managed` with a release action * that handles `Exit`. The acquire and release actions will be performed uninterruptibly. */ export declare const makeExit: ( release: (a: A, exit: Exit) => T.Task ) => (acquire: T.Task) => Managed; /** * Lifts a `Task` into `Managed` with a release action * that handles `Exit`. The acquire and release actions will be performed uninterruptibly. */ export declare const makeExit_: ( acquire: T.Task, release: (a: A, exit: Exit) => T.Task ) => Managed; /** * Creates a `Managed` from a `Reservation` produced by a task. 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 const makeReserve: ( reservation: T.Task> ) => Managed; /** * A `Reservation` encapsulates resource acquisition and disposal * without specifying when or how that resource might be used. */ export declare class Reservation { readonly acquire: T.Task; readonly release: (exit: Exit) => T.Task; static of: ( acquire: T.Task, release: (exit: Exit) => T.Task ) => Reservation; private constructor(); } /** * Make a new reservation */ export declare const makeReservation_: ( acquire: T.Task, release: (exit: Exit) => T.Task ) => Reservation; /** * Make a new reservation */ export declare const makeReservation: ( release: (exit: Exit) => T.Task ) => (acquire: T.Task) => Reservation; /** * Lifts a pure `Reservation` into `Managed`. The acquisition step * is performed interruptibly. */ export declare const reserve: (reservation: Reservation) => Managed; //# sourceMappingURL=constructors.d.ts.map