import * as Cause from "../Cause/core.js"; import * as Chunk from "../Collections/Immutable/Chunk/core.js"; import * as E from "../Either/index.js"; import * as Exit from "../Exit/api.js"; import type { Managed } from "../Managed/managed.js"; import * as T from "./_internal/effect-api.js"; import * as Fiber from "./core.js"; /** * Lifts an IO into a `Fiber`. */ export declare function fromEffect(effect: T.IO): T.UIO>; /** * Interrupts all fibers as by the specified fiber, awaiting their interruption. */ export declare function interruptAllAs(id: Fiber.FiberID): (fs: Iterable>) => T.UIO; /** * Interrupts all fibers, awaiting their interruption. */ export declare function interruptAll(fs: Iterable>): T.Effect; /** * Interrupts the fiber from whichever fiber is calling this method. The * interruption will happen in a separate daemon fiber, and the returned * effect will always resume immediately without waiting. */ export declare function interruptFork(fiber: Fiber.Fiber): T.Effect; /** * Effectually maps over the value the fiber computes. */ export declare function mapM(f: (a: A) => T.IO): (fiber: Fiber.Fiber) => Fiber.Fiber; /** * Maps over the value the fiber computes. */ export declare function map(f: (a: A) => B): (fiber: Fiber.Fiber) => Fiber.Fiber; /** * Joins all fibers, awaiting their _successful_ completion. * Attempting to join a fiber that has erred will result in * a catchable error, _if_ that error does not result from interruption. */ export declare function joinAll(as: Iterable>): T.Effect>; /** * Awaits on all fibers to be completed, successfully or not. */ export declare function waitAll(as: Iterable>): T.Effect>>; /** * Maps over the value the fiber computes. */ export declare function map_(fiber: Fiber.Fiber, f: (a: A) => B): Fiber.Fiber; /** * Passes the success of this fiber to the specified callback, and continues * with the fiber that it returns. */ export declare function mapFiber(f: (a: A) => Fiber.Fiber): (fiber: Fiber.Fiber) => T.UIO>; /** * Passes the success of this fiber to the specified callback, and continues * with the fiber that it returns. */ export declare function mapFiber_(fiber: Fiber.Fiber, f: (a: A) => Fiber.Fiber): T.UIO>; /** * Returns a fiber that prefers `this` fiber, but falls back to the * `that` one when `this` one fails. Interrupting the returned fiber * will interrupt both fibers, sequentially, from left to right. */ export declare function orElse(that: Fiber.Fiber): (fiber: Fiber.Fiber) => Fiber.Fiber; /** * Returns a fiber that prefers `this` fiber, but falls back to the * `that` one when `this` one fails. Interrupting the returned fiber * will interrupt both fibers, sequentially, from left to right. */ export declare function orElseEither(that: Fiber.Fiber): (fiber: Fiber.Fiber) => Fiber.Fiber>; /** * Maps the output of this fiber to the specified constant. */ export declare function as(b: B): (fiber: Fiber.Fiber) => Fiber.Fiber; /** * Maps the output of this fiber to `void`. */ export declare function asUnit(fiber: Fiber.Fiber): Fiber.Fiber; /** * Zips this fiber with the specified fiber, combining their results using * the specified combiner function. Both joins and interruptions are performed * in sequential order from left to right. */ export declare function zipWith_(fiberA: Fiber.Fiber, fiberB: Fiber.Fiber, f: (a: A, b: A1) => B): Fiber.Fiber; /** * Zips this fiber and the specified fiber together, producing a tuple of their output. */ export declare function zip_(fiberA: Fiber.Fiber, fiberB: Fiber.Fiber): Fiber.Fiber; /** * Same as `zip` but discards the output of the left hand side. */ export declare function zipRight_(fiberA: Fiber.Fiber, fiberB: Fiber.Fiber): Fiber.Fiber; /** * Same as `zip` but discards the output of the right hand side. */ export declare function zipLeft_(fiberA: Fiber.Fiber, fiberB: Fiber.Fiber): Fiber.Fiber; /** * Collects all fibers into a single fiber producing an in-order list of the * results. */ export declare function collectAll(fibers: Iterable>): Fiber.Fiber>; /** * @ets_optimize identity */ export declare function makeSynthetic(_: Omit, "_tag" | symbol>): Fiber.Fiber; /** * Folds over the runtime or synthetic fiber. */ export declare function fold(runtime: (_: Fiber.Runtime) => Z, syntetic: (_: Fiber.Synthetic) => Z): (fiber: Fiber.Fiber) => Z; /** * A fiber that is done with the specified `Exit` value. */ export declare function done(exit: Exit.Exit): Fiber.Fiber; /** * Returns a fiber that has already succeeded with the specified value. */ export declare function succeed(a: A): Fiber.Fiber; /** * A fiber that has already failed with the specified value. */ export declare function fail(e: E): Fiber.Fiber; /** * Creates a `Fiber` that is halted with the specified cause. */ export declare function halt(cause: Cause.Cause): Fiber.Fiber; /** * A fiber that is already interrupted. */ export declare function interruptAs(id: Fiber.FiberID): Fiber.Fiber; export declare function toManaged(fiber: Fiber.Fiber): Managed>; /** * A fiber that never fails or succeeds. */ export declare const never: Fiber.Fiber; /** * A fiber that has already succeeded with unit. */ export declare const unit: Fiber.Fiber; /** * Awaits the fiber, which suspends the awaiting fiber until the result of the fiber has been determined. */ declare function wait(fiber: Fiber.Fiber): T.UIO>; export { wait as await }; //# sourceMappingURL=api.d.ts.map