import type { Either } from "../../Either"; import type { Option } from "../../Option"; import type { HasClock } from "../Clock"; import type { Exit } from "../Exit"; import type { Cause } from "../Exit/Cause"; import * as C from "../Exit/Cause"; import * as Sc from "../Schedule"; import type { Task } from "../Task"; import * as T from "../Task"; import { Stream } from "./model"; export declare const unwrap: (fa: Task>) => Stream; /** * Creates a stream from a `Schedule` that does not require any further * input. The stream will emit an element for each value output from the * schedule, continuing for as long as the schedule continues. */ export declare const fromSchedule: (schedule: Sc.Schedule) => Stream; /** * Creates a stream by effectfully peeling off the "layers" of a value of type `S` */ export declare const unfoldChunkM: ( z: Z ) => (f: (z: Z) => Task>) => Stream; /** * Combines the chunks from this stream and the specified stream by repeatedly applying the * function `f` to extract a chunk using both sides and conceptually "offer" * it to the destination stream. `f` can maintain some internal state to control * the combining process, with the initial state being specified by `s`. */ export declare const combineChunks: ( that: Stream ) => ( z: Z ) => ( f: ( z: Z, s: Task, readonly A[]>, t: Task, readonly B[]> ) => Task, readonly [readonly C[], Z]>> ) => (self: Stream) => Stream; /** * Zips this stream with another point-wise and applies the function to the paired elements. * * The new stream will end when one of the sides ends. * * By default pull is executed in parallel to preserve async semantics, see `zipWithSeq` for * a sequential alternative */ export declare function mapBothPar_( stream: Stream, that: Stream, f: (a: O, a1: O2) => O3, ps: "seq" ): Stream; export declare function mapBothPar_( stream: Stream, that: Stream, f: (a: O, a1: O2) => O3, ps?: "par" | "seq" ): Stream; export declare function mapBothPar( that: Stream, f: (a: O, a1: O2) => O3, ps: "seq" ): (stream: Stream) => Stream; export declare function mapBothPar( that: Stream, f: (a: O, a1: O2) => O3, ps?: "par" | "seq" ): (stream: Stream) => Stream; export declare const mapBoth_: ( stream: Stream, that: Stream, f: (a: A, a1: A1) => B ) => Stream; export declare const bothMap: ( that: Stream, f: (a: A, a1: A1) => B ) => (stream: Stream) => Stream; /** * Switches over to the stream produced by the provided function in case this one * fails. Allows recovery from all causes of failure, including interruption if the * stream is uninterruptible. */ export declare const catchAllCause_: ( stream: Stream, f: (e: Cause) => Stream ) => Stream; export declare const catchAllCause: ( f: (e: Cause) => Stream ) => (stream: Stream) => Stream; /** * Concatenates all of the streams in the chunk to one stream. */ export declare const concatAll: (streams: Stream[]) => Stream; /** * Executes the provided finalizer before this stream's finalizers run. */ export declare const ensuringFirst_: ( self: Stream, fin: Task ) => Stream; /** * Executes the provided finalizer before this stream's finalizers run. */ export declare const ensuringFirst: ( fin: Task ) => (self: Stream) => Stream; export declare type TerminationStrategy = "Left" | "Right" | "Both" | "Either"; /** * Merges this stream and the specified stream together to a common element * type with the specified mapping functions. * * New produced stream will terminate when both specified stream terminate if * no termination strategy is specified. */ export declare const mergeWith_: ( sa: Stream, sb: Stream, l: (a: A) => C, r: (b: B) => C1, strategy?: TerminationStrategy ) => Stream; /** * Merges this stream and the specified stream together to a common element * type with the specified mapping functions. * * New produced stream will terminate when both specified stream terminate if * no termination strategy is specified. */ export declare const mergeWith: ( that: Stream, l: (a: A) => C, r: (b: B) => C1, strategy?: TerminationStrategy ) => (ma: Stream) => Stream; /** * Merges this stream and the specified stream together. * * New produced stream will terminate when both specified stream terminate if no termination * strategy is specified. */ export declare const merge_: ( self: Stream, that: Stream, strategy?: TerminationStrategy ) => Stream; /** * Merges this stream and the specified stream together. * * New produced stream will terminate when both specified stream terminate if no termination * strategy is specified. */ export declare const merge: ( sb: Stream, strategy?: TerminationStrategy ) => (sa: Stream) => Stream; /** * Merges this stream and the specified stream together. New produced stream will * terminate when either stream terminates. */ export declare const mergeTerminateEither_: ( sa: Stream, sb: Stream ) => Stream; /** * Merges this stream and the specified stream together. New produced stream will * terminate when either stream terminates. */ export declare const mergeTerminateEither: ( sb: Stream ) => (sa: Stream) => Stream; /** * Merges this stream and the specified stream together. New produced stream will * terminate when this stream terminates. */ export declare const mergeTerminateLeft_: ( sa: Stream, sb: Stream ) => Stream; /** * Merges this stream and the specified stream together. New produced stream will * terminate when this stream terminates. */ export declare const mergeTerminateLeft: ( sb: Stream ) => (sa: Stream) => Stream; /** * Merges this stream and the specified stream together. New produced stream will * terminate when the specified stream terminates. */ export declare const mergeTerminateRight_: ( sa: Stream, sb: Stream ) => Stream; /** * Merges this stream and the specified stream together. New produced stream will * terminate when the specified stream terminates. */ export declare const mergeTerminateRight: ( sb: Stream ) => (sa: Stream) => Stream; /** * Merges this stream and the specified stream together to produce a stream of * eithers. */ export declare const mergeEither_: ( sa: Stream, sb: Stream, strategy?: TerminationStrategy ) => Stream>; /** * Merges this stream and the specified stream together to produce a stream of * eithers. */ export declare const mergeEither: ( sb: Stream, strategy?: TerminationStrategy ) => (sa: Stream) => Stream>; //# sourceMappingURL=combinators.d.ts.map