import { Chunk } from "@tsplus/stdlib/collections/Chunk/definition"; import { AtomicReference } from "@tsplus/stdlib/data/AtomicReference"; import { Effect } from "@effect/core/io/Effect/definition"; import type { Exit } from "@effect/core/io/Exit/definition"; import type { FiberRuntime } from "@effect/core/io/Fiber/_internal/runtime"; import type { Patch as P } from "@effect/core/io/Supervisor/patch"; import type { SortedSet } from "@tsplus/stdlib/collections/SortedSet"; import type { Maybe } from "@tsplus/stdlib/data/Maybe"; import type { Env } from "@tsplus/stdlib/service/Env"; export declare const SupervisorURI: unique symbol; export type SupervisorURI = typeof SupervisorURI; export declare namespace Supervisor { type Patch = P; } /** * A `Supervisor` is allowed to supervise the launching and termination of * fibers, producing some visible value of type `A` from the supervision. * * @tsplus type effect/core/io/Supervisor * @tsplus companion effect/core/io/Supervisor.Ops */ export declare abstract class Supervisor { readonly [SupervisorURI]: { _T: (_: never) => T; }; /** * Returns an effect that succeeds with the value produced by this supervisor. * This value may change over time, reflecting what the supervisor produces as * it supervises fibers. */ abstract get value(): Effect; abstract onStart(environment: Env, effect: Effect, parent: Maybe>, fiber: FiberRuntime): void; abstract onEnd(value: Exit, fiber: FiberRuntime): void; abstract onEffect(fiber: FiberRuntime, effect: Effect): void; abstract onSuspend(fiber: FiberRuntime): void; abstract onResume(fiber: FiberRuntime): void; /** * Maps this supervisor to another one, which has the same effect, but whose * value has been transformed by the specified function. */ map(f: (a: T) => B): Supervisor; /** * Returns a new supervisor that performs the function of this supervisor, and * the function of the specified supervisor, producing a tuple of the outputs * produced by both supervisors. */ zip(right: Supervisor): Supervisor; } export declare class ProxySupervisor extends Supervisor { readonly underlying: Supervisor; readonly value0: () => Effect; constructor(underlying: Supervisor, value0: () => Effect); get value(): Effect; onStart(environment: Env, effect: Effect, parent: Maybe>, fiber: FiberRuntime): void; onEnd(value: Exit, fiber: FiberRuntime): void; onEffect(fiber: FiberRuntime, effect: Effect): void; onSuspend(fiber: FiberRuntime): void; onResume(fiber: FiberRuntime): void; } export declare class Zip extends Supervisor { readonly left: Supervisor; readonly right: Supervisor; constructor(left: Supervisor, right: Supervisor); get value(): Effect; onStart(environment: Env, effect: Effect, parent: Maybe>, fiber: FiberRuntime): void; onEnd(value: Exit, fiber: FiberRuntime): void; onEffect(fiber: FiberRuntime, effect: Effect): void; onSuspend(fiber: FiberRuntime): void; onResume(fiber: FiberRuntime): void; } export declare class Track extends Supervisor>> { readonly fibers: Set>; get value(): Effect>>; onStart(_environment: Env, _effect: Effect, _parent: Maybe>, fiber: FiberRuntime): void; onEnd(_value: Exit, fiber: FiberRuntime): void; onEffect(_fiber: FiberRuntime, _effect: Effect): void; onSuspend(_fiber: FiberRuntime): void; onResume(_fiber: FiberRuntime): void; } export declare class Const extends Supervisor { readonly effect: Effect; constructor(effect: Effect); get value(): Effect; onStart(_environment: Env, _effect: Effect, _parent: Maybe>, _fiber: FiberRuntime): void; onEnd(_value: Exit, _fiber: FiberRuntime): void; onEffect(_fiber: FiberRuntime, _effect: Effect): void; onSuspend(_fiber: FiberRuntime): void; onResume(_fiber: FiberRuntime): void; } /** * Creates a new supervisor that tracks children in a set. * @tsplus static effect/core/io/Supervisor.Ops unsafeTrack * @tsplus location "@effect/core/io/Supervisor/definition" */ export declare function unsafeTrack(): Supervisor>>; /** * Creates a new supervisor that tracks children in a set. * @tsplus static effect/core/io/Supervisor.Ops track * @tsplus location "@effect/core/io/Supervisor/definition" */ export declare const track: Effect>>>; /** * Creates a new supervisor that constantly yields effect when polled * @tsplus static effect/core/io/Supervisor.Ops fromEffect * @tsplus location "@effect/core/io/Supervisor/definition" */ export declare function fromEffect(effect: Effect): Supervisor; /** * A supervisor that doesn't do anything in response to supervision events. * @tsplus static effect/core/io/Supervisor.Ops none * @tsplus location "@effect/core/io/Supervisor/definition" */ export declare const none: Supervisor; /** * Creates a new supervisor that tracks children in a set. * @tsplus static effect/core/io/Supervisor.Ops fibersIn * @tsplus location "@effect/core/io/Supervisor/definition" */ export declare function fibersIn(ref: AtomicReference>>): Effect>>>; //# sourceMappingURL=definition.d.ts.map