/** * @since 1.0.0 */ import type * as Chunk from "@effect/data/Chunk"; import type * as Option from "@effect/data/Option"; import type * as Cause from "@effect/io/Cause"; import type * as Effect from "@effect/io/Effect"; import type * as Exit from "@effect/io/Exit"; /** * An `Emit` represents an asynchronous callback that can be * called multiple times. The callback can be called with a value of type * `Effect, Chunk>`, where succeeding with a `Chunk` * indicates to emit those elements, failing with `Some` indicates to * terminate with that error, and failing with `None` indicates to terminate * with an end of stream signal. * * @since 1.0.0 * @category models */ export interface Emit extends EmitOps { (f: Effect.Effect, Chunk.Chunk>): Promise; } /** * @since 1.0.0 * @category models */ export interface EmitOps { /** * Emits a chunk containing the specified values. */ readonly chunk: (chunk: Chunk.Chunk) => Promise; /** * Terminates with a cause that dies with the specified defect. */ readonly die: (defect: Err) => Promise; /** * Terminates with a cause that dies with a `Throwable` with the specified * message. */ readonly dieMessage: (message: string) => Promise; /** * Either emits the specified value if this `Exit` is a `Success` or else * terminates with the specified cause if this `Exit` is a `Failure`. */ readonly done: (exit: Exit.Exit) => Promise; /** * Terminates with an end of stream signal. */ readonly end: () => Promise; /** * Terminates with the specified error. */ readonly fail: (error: E) => Promise; /** * Either emits the success value of this effect or terminates the stream * with the failure value of this effect. */ readonly fromEffect: (effect: Effect.Effect) => Promise; /** * Either emits the success value of this effect or terminates the stream * with the failure value of this effect. */ readonly fromEffectChunk: (effect: Effect.Effect>) => Promise; /** * Terminates the stream with the specified cause. */ readonly halt: (cause: Cause.Cause) => Promise; /** * Emits a chunk containing the specified value. */ readonly single: (value: A) => Promise; } //# sourceMappingURL=Emit.d.ts.map