import type { Either } from "../../Either"; import type { Option } from "../../Option"; import type { Exit } from "../Exit"; import * as M from "../Managed"; import * as T from "../Task"; import type { XQueue } from "../XQueue"; import type { Transducer } from "./internal/Transducer"; import type { EIO, IO, RIO } from "./model"; import { Stream } from "./model"; /** * Creates a stream from an array of values */ export declare const fromArray: (c: readonly A[]) => IO; /** * Creates a stream from a task producing a value of type `A` or an empty Stream */ export declare const fromTaskOption: (fa: T.Task, A>) => Stream; /** * Creates a stream from a task producing a value of type `A` */ export declare const fromTask: (ef: T.Task) => Stream; /** * Creates a stream from an asynchronous callback that can be called multiple times. * The registration of the callback can possibly return the stream synchronously. * The optionality of the error type `E` can be used to signal the end of the stream, * by setting it to `None`. */ export declare const asyncOption: ( register: ( resolve: ( next: T.Task, readonly A[]>, offerCb?: ((e: Exit) => void) | undefined ) => T.IO> ) => Option>, outputBuffer?: number ) => Stream; /** * Creates a stream from an asynchronous callback that can be called multiple times. * The optionality of the error type `E` can be used to signal the end of the stream, * by setting it to `None`. */ export declare const async: ( register: ( resolve: ( next: T.Task, readonly A[]>, offerCb?: ((e: Exit) => void) | undefined ) => T.IO> ) => void, outputBuffer?: number ) => Stream; /** * Creates a stream from an asynchronous callback that can be called multiple times. * The registration of the callback returns either a canceler or synchronously returns a stream. * The optionality of the error type `E` can be used to signal the end of the stream, by * setting it to `None`. */ export declare const asyncInterruptEither: ( register: ( resolve: ( next: T.Task, readonly A[]>, offerCb?: ((e: Exit) => void) | undefined ) => T.IO> ) => Either, Stream>, outputBuffer?: number ) => Stream; /** * Creates a stream from an asynchronous callback that can be called multiple times. * The registration of the callback returns either a canceler or synchronously returns a stream. * The optionality of the error type `E` can be used to signal the end of the stream, by * setting it to `None`. */ export declare const asyncInterrupt: ( register: ( cb: ( next: T.Task, readonly A[]>, offerCb?: ((e: Exit) => void) | undefined ) => T.IO> ) => T.RIO, outputBuffer?: number ) => Stream; export declare const fail: (e: E) => EIO; /** * Creates a stream from a task producing chunks of `A` values until it fails with None. */ export declare const repeatTaskChunkOption: (ef: T.Task, readonly A[]>) => Stream; /** * Creates a stream from a task producing values of type `A` until it fails with None. */ export declare const repeatTaskOption: (fa: T.Task, A>) => Stream; /** * Creates a stream from an `XQueue` of values */ export declare const fromArrayXQueue: (queue: XQueue) => Stream; /** * Creates a stream from an `XQueue` of values. The queue will be shutdown once the stream is closed. */ export declare const fromArrayXQueueWithShutdown: ( queue: XQueue ) => Stream; /** * Creates a stream from an `XQueue` of values */ export declare const fromXQueue: (queue: XQueue) => Stream; /** * Creates a stream from an `XQueue` of values. The queue will be shutdown once the stream is closed. */ export declare const fromXQueueWithShutdown: ( queue: XQueue ) => Stream; /** * The `Stream` that dies with the error. */ export declare const die: (e: unknown) => IO; /** * The stream that dies with an exception described by `message`. */ export declare const dieMessage: (message: string) => Stream; /** * The empty stream */ export declare const empty: IO; /** * The infinite stream of iterative function application: a, f(a), f(f(a)), f(f(f(a))), ... */ export declare const iterate: (a: A, f: (a: A) => A) => IO; export declare const suspend: (thunk: () => Stream) => Stream; /** * Creates a single-valued stream from a managed resource */ export declare const managed: (ma: M.Managed) => Stream; /** * Creates a one-element stream that never fails and executes the finalizer when it ends. */ export declare const finalizer: (finalizer: T.RIO) => RIO; /** * Applies an aggregator to the stream, which converts one or more elements * of type `A` into elements of type `B`. */ export declare const aggregate_: ( stream: Stream, transducer: Transducer ) => Stream; /** * Applies an aggregator to the stream, which converts one or more elements * of type `A` into elements of type `B`. */ export declare const aggregate: ( transducer: Transducer ) => (stream: Stream) => Stream; /** * Creates a new `Stream` from a managed effect that yields chunks. * The effect will be evaluated repeatedly until it fails with a `None` * (to signify stream end) or a `Some` (to signify stream failure). * * The stream evaluation guarantees proper acquisition and release of the * `Managed`. */ export declare const apply: (proc: M.Managed, readonly A[]>>) => Stream; /** * Creates a stream from a single value that will get cleaned up after the * stream is consumed */ export declare const bracket_: ( acquire: T.Task, release: (a: A) => T.Task ) => Stream; /** * Creates a stream from a single value that will get cleaned up after the * stream is consumed */ export declare const bracket: ( release: (a: A) => T.Task ) => (acquire: T.Task) => Stream; /** * Creates a stream from a single value that will get cleaned up after the * stream is consumed */ export declare const bracketExit_: ( acquire: T.Task, release: (a: A, exit: Exit) => T.Task ) => Stream; /** * Creates a stream from a single value that will get cleaned up after the * stream is consumed */ export declare const bracketExit: ( release: (a: A, exit: Exit) => T.Task ) => (acquire: T.Task) => Stream; //# sourceMappingURL=constructors.d.ts.map