import * as CS from "../../../Cause"
import type * as CL from "../../../Clock"
import * as A from "../../../Collections/Immutable/Chunk"
import * as L from "../../../Collections/Immutable/List"
import * as Tp from "../../../Collections/Immutable/Tuple"
import * as T from "../../../Effect"
import * as E from "../../../Either"
import * as Ex from "../../../Exit"
import type { Predicate, Refinement } from "../../../Function"
import type { Has } from "../../../Has"
import * as H from "../../../Hub"
import * as M from "../../../Managed"
import * as O from "../../../Option"
import * as P from "../../../Promise"
import * as Q from "../../../Queue"
import * as SC from "../../../Schedule"
import * as C from "../_internal/core"
import * as SK from "../Sink"
import { Stream } from "./core"
import * as Take from "./Take"
/**
 * Submerges the error case of an `Either` into the `ZStream`.
 */
export declare function absolve<R, E, E2, A>(
  xs: Stream<R, E, E.Either<E2, A>>
): Stream<R, E | E2, A>
/**
 * Aggregates elements of this stream using the provided sink for as long
 * as the downstream operators on the stream are busy.
 *
 * This operator divides the stream into two asynchronous "islands". Operators upstream
 * of this operator run on one fiber, while downstream operators run on another. Whenever
 * the downstream fiber is busy processing elements, the upstream fiber will feed elements
 * into the sink until it signals completion.
 *
 * Any sink can be used here, but see `Sink.foldWeightedM` and `Sink.foldUntilM` for
 * sinks that cover the common usecases.
 */
export declare function aggregateAsync_<
  R,
  R1,
  E extends E1,
  E1,
  E2,
  A extends A1,
  A1,
  B
>(
  self: Stream<R, E, A>,
  sink: SK.Sink<R1, E1, A1, E2, A1, B>
): Stream<R & R1 & Has<CL.Clock>, E2, B>
/**
 * Aggregates elements of this stream using the provided sink for as long
 * as the downstream operators on the stream are busy.
 *
 * This operator divides the stream into two asynchronous "islands". Operators upstream
 * of this operator run on one fiber, while downstream operators run on another. Whenever
 * the downstream fiber is busy processing elements, the upstream fiber will feed elements
 * into the sink until it signals completion.
 *
 * Any sink can be used here, but see `Sink.foldWeightedM` and `Sink.foldUntilM` for
 * sinks that cover the common usecases.
 *
 * @dataFirst aggregateAsync_
 */
export declare function aggregateAsync<R1, E1, E2, A1, B>(
  sink: SK.Sink<R1, E1, A1, E2, A1, B>
): <R, E extends E1, A extends A1>(
  self: C.Stream<R, E, A>
) => C.Stream<R & R1 & Has<CL.Clock>, E2, B>
/**
 * Like `aggregateAsyncWithinEither`, but only returns the `Right` results.
 */
export declare function aggregateAsyncWithin_<
  R,
  R1,
  R2,
  E extends E1,
  E1,
  E2,
  A extends A1,
  A1,
  B,
  C
>(
  self: Stream<R, E, A>,
  sink: SK.Sink<R1, E1, A1, E2, A1, B>,
  schedule: SC.Schedule<R2, O.Option<B>, C>
): Stream<R & R1 & R2 & Has<CL.Clock>, E2, B>
/**
 * Like `aggregateAsyncWithinEither`, but only returns the `Right` results.
 *
 * @dataFirst aggregateAsyncWithin_
 */
export declare function aggregateAsyncWithin<R1, R2, E1, E2, A1, B, C>(
  sink: SK.Sink<R1, E1, A1, E2, A1, B>,
  schedule: SC.Schedule<R2, O.Option<B>, C>
): <R, E extends E1, A extends A1>(
  self: C.Stream<R, E, A>
) => C.Stream<R & R1 & R2 & Has<CL.Clock>, E2, B>
/**
 * Aggregates elements using the provided sink until it completes, or until the
 * delay signalled by the schedule has passed.
 *
 * This operator divides the stream into two asynchronous islands. Operators upstream
 * of this operator run on one fiber, while downstream operators run on another. Elements
 * will be aggregated by the sink until the downstream fiber pulls the aggregated value,
 * or until the schedule's delay has passed.
 *
 * Aggregated elements will be fed into the schedule to determine the delays between
 * pulls.
 */
export declare function aggregateAsyncWithinEither_<
  R,
  R1,
  R2,
  E extends E1,
  E1,
  E2,
  A extends A1,
  A1,
  B,
  C
>(
  self: Stream<R, E, A>,
  sink: SK.Sink<R1, E1, A1, E2, A1, B>,
  schedule: SC.Schedule<R2, O.Option<B>, C>
): Stream<R & R1 & R2 & Has<CL.Clock>, E2, E.Either<C, B>>
/**
 * Aggregates elements using the provided sink until it completes, or until the
 * delay signalled by the schedule has passed.
 *
 * This operator divides the stream into two asynchronous islands. Operators upstream
 * of this operator run on one fiber, while downstream operators run on another. Elements
 * will be aggregated by the sink until the downstream fiber pulls the aggregated value,
 * or until the schedule's delay has passed.
 *
 * Aggregated elements will be fed into the schedule to determine the delays between
 * pulls.
 *
 * @dataFirst aggregateAsyncWithinEither_
 */
export declare function aggregateAsyncWithinEither<R1, R2, E1, E2, A1, B, C>(
  sink: SK.Sink<R1, E1, A1, E2, A1, B>,
  schedule: SC.Schedule<R2, O.Option<B>, C>
): <R, E extends E1, A extends A1>(
  self: C.Stream<R, E, A>
) => C.Stream<R & R1 & R2 & Has<CL.Clock>, E2, E.Either<C, B>>
/**
 * Maps the success values of this stream to the specified constant value.
 */
export declare function as_<R, E, A, A2>(
  self: Stream<R, E, A>,
  a2: A2
): Stream<R, E, A2>
/**
 * Maps the success values of this stream to the specified constant value.
 *
 * @dataFirst as_
 */
export declare function as<A2>(
  a2: A2
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R, E, A2>
/**
 * Returns a stream whose failure and success channels have been mapped by
 * the specified pair of functions, `f` and `g`.
 */
export declare function bimap_<R, E, E1, A, A1>(
  self: Stream<R, E, A>,
  f: (e: E) => E1,
  g: (a: A) => A1
): Stream<R, E1, A1>
/**
 * Returns a stream whose failure and success channels have been mapped by
 * the specified pair of functions, `f` and `g`.
 *
 * @dataFirst bimap_
 */
export declare function bimap<E, E1, A, A1>(
  f: (e: E) => E1,
  g: (a: A) => A1
): <R>(self: C.Stream<R, E, A>) => C.Stream<R, E1, A1>
/**
 * Fan out the stream, producing a dynamic number of streams that have the same elements as this stream.
 * The driver stream will only ever advance of the `maximumLag` chunks before the
 * slowest downstream stream.
 */
export declare function broadcastDynamic_<R, E, A>(
  self: Stream<R, E, A>,
  maximumLag: number
): M.Managed<R, never, C.Stream<unknown, E, A>>
/**
 * Fan out the stream, producing a dynamic number of streams that have the same elements as this stream.
 * The driver stream will only ever advance of the `maximumLag` chunks before the
 * slowest downstream stream.
 *
 * @dataFirst broadcastDynamic_
 */
export declare function broadcastDynamic(
  maximumLag: number
): <R, E, A>(self: C.Stream<R, E, A>) => M.Managed<R, never, C.Stream<unknown, E, A>>
/**
 * Converts the stream to a managed list of queues. Every value will be replicated to every queue with the
 * slowest queue being allowed to buffer `maximumLag` chunks before the driver is backpressured.
 *
 * Queues can unsubscribe from upstream by shutting down.
 */
export declare function broadcastedQueues_<R, E, A>(
  self: Stream<R, E, A>,
  n: number,
  maximumLag: number
): M.Managed<R, never, A.Chunk<H.HubDequeue<unknown, never, Take.Take<E, A>>>>
/**
 * Converts the stream to a managed list of queues. Every value will be replicated to every queue with the
 * slowest queue being allowed to buffer `maximumLag` chunks before the driver is backpressured.
 *
 * Queues can unsubscribe from upstream by shutting down.
 *
 * @dataFirst broadcastedQueues_
 */
export declare function broadcastedQueues(
  n: number,
  maximumLag: number
): <R, E, A>(
  self: C.Stream<R, E, A>
) => M.Managed<R, never, A.Chunk<H.HubDequeue<unknown, never, Take.Take<E, A>>>>
/**
 * Converts the stream to a managed dynamic amount of queues. Every chunk will be replicated to every queue with the
 * slowest queue being allowed to buffer `maximumLag` chunks before the driver is backpressured.
 *
 * Queues can unsubscribe from upstream by shutting down.
 */
export declare function broadcastedQueuesDynamic_<R, E, A>(
  self: Stream<R, E, A>,
  maximumLag: number
): M.Managed<
  R,
  never,
  M.Managed<unknown, never, H.HubDequeue<unknown, never, Take.Take<E, A>>>
>
/**
 * Converts the stream to a managed dynamic amount of queues. Every chunk will be replicated to every queue with the
 * slowest queue being allowed to buffer `maximumLag` chunks before the driver is backpressured.
 *
 * Queues can unsubscribe from upstream by shutting down.
 *
 * @dataFirst broadcastedQueuesDynamic_
 */
export declare function broadcastedQueuesDynamic(
  maximumLag: number
): <R, E, A>(
  self: C.Stream<R, E, A>
) => M.Managed<
  R,
  never,
  M.Managed<unknown, never, H.HubDequeue<unknown, never, Take.Take<E, A>>>
>
/**
 * Allows a faster producer to progress independently of a slower consumer by buffering
 * up to `capacity` chunks in a queue.
 */
export declare function buffer_<R, E, A>(
  self: Stream<R, E, A>,
  capacity: number
): Stream<R, E, A>
/**
 * Allows a faster producer to progress independently of a slower consumer by buffering
 * up to `capacity` chunks in a queue.
 *
 * @dataFirst buffer_
 */
export declare function buffer(
  capacity: number
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R, E, A>
/**
 * Allows a faster producer to progress independently of a slower consumer by buffering
 * elements into an unbounded queue.
 */
export declare function bufferUnbounded<R, E, A>(self: Stream<R, E, A>): Stream<R, E, A>
/**
 * Switches over to the stream produced by the provided function in case this one
 * fails with a typed error.
 */
export declare function catchAll_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  f: (e: E) => Stream<R1, E1, A1>
): Stream<R & R1, E1, A | A1>
/**
 * Switches over to the stream produced by the provided function in case this one
 * fails with a typed error.
 *
 * @dataFirst catchAll_
 */
export declare function catchAll<R1, E, E1, A1>(
  f: (e: E) => Stream<R1, E1, A1>
): <R, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1, A1 | A>
/**
 * 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 function catchAllCause_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  f: (cause: CS.Cause<E>) => Stream<R1, E1, A1>
): Stream<R & R1, E1, A | A1>
/**
 * 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.
 *
 * @dataFirst catchAllCause_
 */
export declare function catchAllCause<R1, E, E1, A1>(
  f: (cause: CS.Cause<E>) => Stream<R1, E1, A1>
): <R, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1, A1 | A>
/**
 * Switches over to the stream produced by the provided function in case this one
 * fails with some typed error.
 */
export declare function catchSome_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  pf: (e: E) => O.Option<Stream<R1, E1, A1>>
): Stream<R & R1, E1, A | A1>
/**
 * Switches over to the stream produced by the provided function in case this one
 * fails with some typed error.
 *
 * @dataFirst catchSome_
 */
export declare function catchSome<R1, E, E1, A1>(
  pf: (e: E) => O.Option<Stream<R1, E1, A1>>
): <R, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1, A1 | A>
/**
 * Switches over to the stream produced by the provided function in case this one
 * fails with some errors. Allows recovery from all causes of failure, including interruption if the
 * stream is uninterruptible.
 */
export declare function catchSomeCause_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  pf: (e: CS.Cause<E>) => O.Option<Stream<R1, E1, A1>>
): Stream<R & R1, E | E1, A | A1>
/**
 * Switches over to the stream produced by the provided function in case this one
 * fails with some errors. Allows recovery from all causes of failure, including interruption if the
 * stream is uninterruptible.
 *
 * @dataFirst catchSomeCause_
 */
export declare function catchSomeCause<R1, E, E1, A1>(
  pf: (e: CS.Cause<E>) => O.Option<Stream<R1, E1, A1>>
): <R, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E | E1, A1 | A>
/**
 * Re-chunks the elements of the stream into chunks of
 * `n` elements each.
 * The last chunk might contain less than `n` elements
 */
export declare function chunkN_<R, E, A>(
  self: Stream<R, E, A>,
  n: number
): Stream<R, E, A>
/**
 * Re-chunks the elements of the stream into chunks of
 * `n` elements each.
 * The last chunk might contain less than `n` elements
 *
 * @dataFirst chunkN_
 */
export declare function chunkN(
  n: number
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R, E, A>
/**
 * Exposes the underlying chunks of the stream as a stream of chunks of elements
 */
export declare function chunks<R, E, A>(self: Stream<R, E, A>): Stream<R, E, A.Chunk<A>>
/**
 * Performs a filter and map in a single step.
 */
export declare function collect_<R, E, A, B>(
  self: Stream<R, E, A>,
  f: (a: A) => O.Option<B>
): C.Stream<R, E, B>
/**
 * Performs a filter and map in a single step.
 *
 * @dataFirst collect_
 */
export declare function collect<A, B>(
  f: (a: A) => O.Option<B>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, B>
/**
 * Filters any `Right` values.
 */
export declare function collectLeft<R, E, L1, A>(
  self: Stream<R, E, E.Either<L1, A>>
): Stream<R, E, L1>
/**
 * Filters any `Left` values.
 */
export declare function collectRight<R, E, A, R1>(
  self: Stream<R, E, E.Either<A, R1>>
): Stream<R, E, R1>
/**
 * Filters any `None` values.
 */
export declare function collectSome<R, E, A>(
  self: Stream<R, E, O.Option<A>>
): Stream<R, E, A>
/**
 * Filters any `Exit.Failure` values.
 */
export declare function collectSuccess<R, E, A, L1>(
  self: Stream<R, E, Ex.Exit<L1, A>>
): C.Stream<R, E, A>
/**
 * Performs an effectful filter and map in a single step.
 */
export declare function collectM_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  pf: (a: A) => O.Option<T.Effect<R1, E1, A1>>
): Stream<R & R1, E | E1, A1>
/**
 * Performs an effectful filter and map in a single step.
 *
 * @dataFirst collectM_
 */
export declare function collectM<R1, E1, A, A1>(
  pf: (a: A) => O.Option<T.Effect<R1, E1, A1>>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1 | E, A1>
/**
 * Transforms all elements of the stream for as long as the specified partial function is defined.
 */
export declare function collectWhile_<R, E, A, A1>(
  self: Stream<R, E, A>,
  pf: (a: A) => O.Option<A1>
): Stream<R, E, A1>
/**
 * Transforms all elements of the stream for as long as the specified partial function is defined.
 *
 * @dataFirst collectWhile_
 */
export declare function collectWhile<A, A1>(
  pf: (a: A) => O.Option<A1>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, A1>
/**
 * Terminates the stream when encountering the first `Right`.
 */
export declare function collectWhileLeft<R, E, A1, L1>(
  self: Stream<R, E, E.Either<L1, A1>>
): Stream<R, E, L1>
/**
 * Effectfully transforms all elements of the stream for as long as the specified partial function is defined.
 */
export declare function collectWhileM_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  pf: (a: A) => O.Option<T.Effect<R1, E1, A1>>
): Stream<R & R1, E | E1, A1>
/**
 * Effectfully transforms all elements of the stream for as long as the specified partial function is defined.
 *
 * @dataFirst collectWhileM_
 */
export declare function collectWhileM<R1, E1, A, A1>(
  pf: (a: A) => O.Option<T.Effect<R1, E1, A1>>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1 | E, A1>
/**
 * Terminates the stream when encountering the first `None`.
 */
export declare function collectWhileSome<R, E, A1>(
  self: Stream<R, E, O.Option<A1>>
): Stream<R, E, A1>
/**
 * Terminates the stream when encountering the first `Left`.
 */
export declare function collectWhileRight<R, E, A1, L1>(
  self: Stream<R, E, E.Either<L1, A1>>
): Stream<R, E, A1>
/**
 * Terminates the stream when encountering the first `Exit.Failure`.
 */
export declare function collectWhileSuccess<R, E, A1, L1>(
  self: Stream<R, E, Ex.Exit<L1, A1>>
): Stream<R, E, A1>
/**
 * Combines the elements from this stream and the specified stream by repeatedly applying the
 * function `f` to extract an element 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`.
 *
 * Where possible, prefer `Stream#combineChunks` for a more efficient implementation.
 */
export declare function combine<R, R1, E, E1, A, A2>(
  self: Stream<R, E, A>,
  that: Stream<R1, E1, A2>
): <S>(
  s: S
) => <A3>(
  f: (
    s: S,
    eff1: T.Effect<R, O.Option<E>, A>,
    eff2: T.Effect<R1, O.Option<E1>, A2>
  ) => T.Effect<R1, never, Ex.Exit<O.Option<E | E1>, Tp.Tuple<[A3, S]>>>
) => C.Stream<R1 & R, E | E1, A3>
/**
 * Concatenates the specified stream with this stream, resulting in a stream
 * that emits the elements from this stream and then the elements from the specified stream.
 */
export declare function concat_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  that: Stream<R1, E1, A1>
): Stream<R & R1, E | E1, A | A1>
/**
 * Concatenates the specified stream with this stream, resulting in a stream
 * that emits the elements from this stream and then the elements from the specified stream.
 *
 * @dataFirst concat_
 */
export declare function concat<R1, E1, A1>(
  that: Stream<R1, E1, A1>
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1 | E, A1 | A>
/**
 * Composes this stream with the specified stream to create a cartesian product of elements.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 */
export declare function cross_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  that: Stream<R1, E1, A1>
): Stream<R & R1, E | E1, Tp.Tuple<[A, A1]>>
/**
 * Composes this stream with the specified stream to create a cartesian product of elements.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 *
 * @dataFirst cross_
 */
export declare function cross<R1, E1, A1>(
  that: Stream<R1, E1, A1>
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1 | E, Tp.Tuple<[A, A1]>>
/**
 * Composes this stream with the specified stream to create a cartesian product of elements,
 * but keeps only elements from this stream.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 */
export declare function crossLeft_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  that: Stream<R1, E1, A1>
): Stream<R & R1, E | E1, A>
/**
 * Composes this stream with the specified stream to create a cartesian product of elements,
 * but keeps only elements from this stream.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 *
 * @dataFirst crossLeft_
 */
export declare function crossLeft<R1, E1, A1>(
  that: Stream<R1, E1, A1>
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1 | E, A>
/**
 * Composes this stream with the specified stream to create a cartesian product of elements,
 * but keeps only elements from the other stream.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 */
export declare function crossRight_<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  that: Stream<R1, E1, A1>
): Stream<R & R1, E | E1, A1>
/**
 * Composes this stream with the specified stream to create a cartesian product of elements,
 * but keeps only elements from the other stream.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 *
 * @dataFirst crossRight_
 */
export declare function crossRight<R1, E1, A1>(
  that: Stream<R1, E1, A1>
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1 | E, A1>
/**
 * Composes this stream with the specified stream to create a cartesian product of elements
 * with a specified function.
 * The `that` stream would be run multiple times, for every element in the `this` stream.
 */
export declare function crossWith<R, R1, E, E1, A, A1>(
  self: Stream<R, E, A>,
  that: Stream<R1, E1, A1>
): <C>(f: (a: A, a1: A1) => C) => C.Stream<R & R1, E | E1, C>
/**
 * More powerful version of `Stream#broadcast`. Allows to provide a function that determines what
 * queues should receive which elements. The decide function will receive the indices of the queues
 * in the resulting list.
 */
export declare function distributedWith_<R, E, A>(
  self: Stream<R, E, A>,
  n: number,
  maximumLag: number,
  decide: (a: A) => T.UIO<Predicate<number>>
): M.Managed<R, never, L.List<Q.Dequeue<Ex.Exit<O.Option<E>, A>>>>
/**
 * More powerful version of `Stream#broadcast`. Allows to provide a function that determines what
 * queues should receive which elements. The decide function will receive the indices of the queues
 * in the resulting list.
 *
 * @dataFirst distributedWith_
 */
export declare function distributedWith<A>(
  n: number,
  maximumLag: number,
  decide: (a: A) => T.UIO<Predicate<number>>
): <R, E>(
  self: C.Stream<R, E, A>
) => M.Managed<R, never, L.List<Q.Dequeue<Ex.Exit<O.Option<E>, A>>>>
/**
 * More powerful version of `Stream#distributedWith`. This returns a function that will produce
 * new queues and corresponding indices.
 * You can also provide a function that will be executed after the final events are enqueued in all queues.
 * Shutdown of the queues is handled by the driver.
 * Downstream users can also shutdown queues manually. In this case the driver will
 * continue but no longer backpressure on them.
 */
export declare function distributedWithDynamic_<R, E, A, A1>(
  self: Stream<R, E, A>,
  maximumLag: number,
  decide: (a: A) => T.UIO<Predicate<number>>,
  done: (ex: Ex.Exit<O.Option<E>, never>) => T.UIO<A1>
): M.Managed<R, never, T.UIO<Tp.Tuple<[number, Q.Dequeue<Ex.Exit<O.Option<E>, A>>]>>>
/**
 * More powerful version of `Stream#distributedWith`. This returns a function that will produce
 * new queues and corresponding indices.
 * You can also provide a function that will be executed after the final events are enqueued in all queues.
 * Shutdown of the queues is handled by the driver.
 * Downstream users can also shutdown queues manually. In this case the driver will
 * continue but no longer backpressure on them.
 *
 * @dataFirst distributedWithDynamic_
 */
export declare function distributedWithDynamic<E, A, A1>(
  maximumLag: number,
  decide: (a: A) => T.UIO<Predicate<number>>,
  done: (ex: Ex.Exit<O.Option<E>, never>) => T.UIO<A1>
): <R>(
  self: C.Stream<R, E, A>
) => M.Managed<R, never, T.UIO<Tp.Tuple<[number, Q.Dequeue<Ex.Exit<O.Option<E>, A>>]>>>
/**
 * Converts this stream to a stream that executes its effects but emits no
 * elements. Useful for sequencing effects using streams:
 */
export declare function drain<R, E, A>(self: Stream<R, E, A>): Stream<R, E, never>
/**
 * Drains the provided stream in the background for as long as this stream is running.
 * If this stream ends before `other`, `other` will be interrupted. If `other` fails,
 * this stream will fail with that error.
 */
export declare function drainFork_<R, R1, E, E1, A, Z>(
  self: Stream<R, E, A>,
  other: Stream<R1, E1, Z>
): Stream<R & R1, E | E1, A>
/**
 * Drains the provided stream in the background for as long as this stream is running.
 * If this stream ends before `other`, `other` will be interrupted. If `other` fails,
 * this stream will fail with that error.
 *
 * @dataFirst drainFork_
 */
export declare function drainFork<R1, E1, A, Z>(
  other: Stream<R1, E1, Z>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1 | E, A>
/**
 * Drops the specified number of elements from this stream.
 */
export declare function drop_<R, E, A>(
  self: Stream<R, E, A>,
  n: number
): Stream<R, E, A>
/**
 * Drops the specified number of elements from this stream.
 *
 * @dataFirst drop_
 */
export declare function drop(
  n: number
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R, E, A>
/**
 * Drops all elements of the stream for as long as the specified predicate
 * evaluates to `true`.
 */
export declare function dropWhile_<R, E, A>(
  self: Stream<R, E, A>,
  f: Predicate<A>
): Stream<R, E, A>
/**
 * Drops all elements of the stream for as long as the specified predicate
 * evaluates to `true`.
 *
 * @dataFirst dropWhile_
 */
export declare function dropWhile<A>(
  f: Predicate<A>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, A>
/**
 * Drops all elements of the stream until the specified predicate evaluates
 * to `true`.
 */
export declare function dropUntil_<R, E, A>(
  self: Stream<R, E, A>,
  f: Predicate<A>
): Stream<R, E, A>
/**
 * Drops all elements of the stream until the specified predicate evaluates
 * to `true`.
 *
 * @dataFirst dropUntil_
 */
export declare function dropUntil<A>(
  f: Predicate<A>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, A>
/**
 * Returns a stream whose failures and successes have been lifted into an
 * `Either`. The resulting stream cannot fail, because the failures have
 * been exposed as part of the `Either` success case.
 *
 * @note the stream will end as soon as the first error occurs.
 */
export declare function either<R, E, A>(
  self: Stream<R, E, A>
): Stream<R, never, E.Either<E, A>>
/**
 * Executes the provided finalizer after this stream's finalizers run.
 */
export declare function ensuring_<R, R1, E, A, Z>(
  self: Stream<R, E, A>,
  fin: T.Effect<R1, never, Z>
): Stream<R & R1, E, A>
/**
 * Executes the provided finalizer after this stream's finalizers run.
 *
 * @dataFirst ensuring_
 */
export declare function ensuring<R1, Z>(
  fin: T.Effect<R1, never, Z>
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E, A>
/**
 * Filters the elements emitted by this stream using the provided function.
 */
export declare function filter_<R, E, A, B extends A>(
  self: Stream<R, E, A>,
  f: Refinement<A, B>
): Stream<R, E, B>
export declare function filter_<R, E, A>(
  self: Stream<R, E, A>,
  f: Predicate<A>
): Stream<R, E, A>
/**
 * Filters the elements emitted by this stream using the provided function.
 *
 * @dataFirst filter_
 */
export declare function filter<A, B extends A>(
  f: Refinement<A, B>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, B>
export declare function filter<A>(
  f: Predicate<A>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, A>
/**
 * Executes a pure fold over the stream of values - reduces all elements in the stream to a value of type `S`.
 */
export declare function runReduce<R, E, A, S>(
  self: Stream<R, E, A>,
  s: S
): (f: (s: S, a: A) => S) => T.Effect<R, E, S>
/**
 * Executes an effectful fold over the stream of values.
 */
export declare function runReduceM<R, E, A, S>(
  self: Stream<R, E, A>,
  s: S
): <R1, E1>(f: (s: S, a: A) => T.Effect<R1, E1, S>) => T.Effect<R & R1, E | E1, S>
/**
 * Executes a pure fold over the stream of values.
 * Returns a Managed value that represents the scope of the stream.
 */
export declare function runReduceManaged<R, E, A, S>(
  self: Stream<R, E, A>,
  s: S
): (f: (s: S, a: A) => S) => M.Managed<R, E, S>
/**
 * Executes an effectful fold over the stream of values.
 * Returns a Managed value that represents the scope of the stream.
 */
export declare function runReduceManagedM<R, E, A, S>(
  self: Stream<R, E, A>,
  s: S
): <R1, E1>(f: (s: S, a: A) => T.Effect<R1, E1, S>) => M.Managed<R & R1, E | E1, S>
/**
 * Reduces the elements in the stream to a value of type `S`.
 * Stops the fold early when the condition is not fulfilled.
 */
export declare function runReduceWhile<R, E, A, S>(
  self: Stream<R, E, A>,
  s: S
): (cont: Predicate<S>) => (f: (s: S, a: A) => S) => T.Effect<R, E, S>
/**
 * Executes an effectful fold over the stream of values.
 * Stops the fold early when the condition is not fulfilled.
 */
export declare function runReduceWhileM<R, E, A, S>(
  self: Stream<R, E, A>,
  s: S
): (
  cont: Predicate<S>
) => <R1, E1>(f: (s: S, a: A) => T.Effect<R1, E1, S>) => T.Effect<R & R1, E | E1, S>
/**
 * Executes a pure fold over the stream of values.
 * Returns a Managed value that represents the scope of the stream.
 * Stops the fold early when the condition is not fulfilled.
 */
export declare function runReduceWhileManaged_<S, R, E, A>(
  self: Stream<R, E, A>,
  s: S,
  cont: Predicate<S>,
  f: (s: S, a: A) => S
): M.Managed<R, E, S>
/**
 * Executes a pure fold over the stream of values.
 * Returns a Managed value that represents the scope of the stream.
 * Stops the fold early when the condition is not fulfilled.
 *
 * @dataFirst runFoldWhileManaged_
 */
export declare function runReduceWhileManaged<S, A>(
  s: S,
  cont: Predicate<S>,
  f: (s: S, a: A) => S
): <R, E>(self: C.Stream<R, E, A>) => M.Managed<R, E, S>
/**
 * Executes an effectful fold over the stream of values.
 * Returns a Managed value that represents the scope of the stream.
 * Stops the fold early when the condition is not fulfilled.
 */
export declare function runReduceWhileManagedM<R, E, A, S>(
  self: Stream<R, E, A>,
  s: S
): (
  cont: Predicate<S>
) => <R1, E1>(f: (s: S, a: A) => T.Effect<R1, E1, S>) => M.Managed<R & R1, E | E1, S>
/**
 * Consumes all elements of the stream, passing them to the specified callback.
 */
export declare function forEach_<R, R1, E, E1, A, X>(
  self: Stream<R, E, A>,
  f: (a: A) => T.Effect<R1, E1, X>
): T.Effect<R & R1, E | E1, void>
/**
 * Consumes all elements of the stream, passing them to the specified callback.
 *
 * @dataFirst forEach_
 */
export declare function forEach<R1, E1, A, X>(
  f: (a: A) => T.Effect<R1, E1, X>
): <R, E>(self: C.Stream<R, E, A>) => T.Effect<R & R1, E1 | E, void>
/**
 * Consumes all elements of the stream, passing them to the specified callback.
 */
export declare function runForEach_<R, R1, E, E1, A, X>(
  self: Stream<R, E, A>,
  f: (a: A) => T.Effect<R1, E1, X>
): T.Effect<R & R1, E | E1, void>
/**
 * Consumes all elements of the stream, passing them to the specified callback.
 *
 * @dataFirst runForEach_
 */
export declare function runForEach<R1, E1, A, X>(
  f: (a: A) => T.Effect<R1, E1, X>
): <R, E>(self: C.Stream<R, E, A>) => T.Effect<R & R1, E1 | E, void>
/**
 * Consumes all elements of the stream, passing them to the specified callback.
 */
export declare function runForEachChunk_<R, R1, E, E1, A, Z>(
  self: Stream<R, E, A>,
  f: (c: A.Chunk<A>) => T.Effect<R1, E1, Z>
): T.Effect<R & R1, E | E1, void>
/**
 * Consumes all elements of the stream, passing them to the specified callback.
 *
 * @dataFirst runForEachChunk_
 */
export declare function runForEachChunk<R1, E1, A, Z>(
  f: (c: A.Chunk<A>) => T.Effect<R1, E1, Z>
): <R, E>(self: C.Stream<R, E, A>) => T.Effect<R & R1, E1 | E, void>
/**
 * Like `Stream#forEachChunk`, but returns a `Managed` so the finalization order
 * can be controlled.
 */
export declare function runForEachChunkManaged_<R, R1, E, E1, A, Z>(
  self: Stream<R, E, A>,
  f: (c: A.Chunk<A>) => T.Effect<R1, E1, Z>
): M.Managed<R & R1, E | E1, void>
/**
 * Like `Stream#forEachChunk`, but returns a `Managed` so the finalization order
 * can be controlled.
 */
export declare function runForEachChunkManaged<R1, E1, A, Z>(
  f: (c: A.Chunk<A>) => T.Effect<R1, E1, Z>
): <R, E>(self: C.Stream<R, E, A>) => M.Managed<R & R1, E1 | E, void>
/**
 * Like `Stream#forEach`, but returns a `Managed` so the finalization order
 * can be controlled.
 */
export declare function runForEachManaged_<R, R1, E, A, Z>(
  self: Stream<R, E, A>,
  f: (a: A) => T.Effect<R1, E, Z>
): M.Managed<R & R1, E, void>
/**
 * Like `Stream#forEach`, but returns a `Managed` so the finalization order
 * can be controlled.
 *
 * @dataFirst runForEachManaged_
 */
export declare function runForEachManaged<R1, E, A, B>(
  f: (a: A) => T.Effect<R1, E, B>
): <R>(self: C.Stream<R, E, A>) => M.Managed<R & R1, E, void>
/**
 * Consumes elements of the stream, passing them to the specified callback,
 * and terminating consumption when the callback returns `false`.
 */
export declare function runForEachWhile_<R, R1, E, E1, A>(
  self: Stream<R, E, A>,
  f: (a: A) => T.Effect<R1, E1, boolean>
): T.Effect<R & R1, E | E1, void>
/**
 * Consumes elements of the stream, passing them to the specified callback,
 * and terminating consumption when the callback returns `false`.
 *
 * @dataFirst runForEachWhile_
 */
export declare function runForEachWhile<R1, E1, A>(
  f: (a: A) => T.Effect<R1, E1, boolean>
): <R, E>(self: C.Stream<R, E, A>) => T.Effect<R & R1, E1 | E, void>
/**
 * Like `Stream#forEachWhile`, but returns a `ZManaged` so the finalization order
 * can be controlled.
 */
export declare function runForEachWhileManaged_<R, R1, E, E1, A>(
  self: Stream<R, E, A>,
  f: (a: A) => T.Effect<R1, E1, boolean>
): M.Managed<R & R1, E | E1, void>
/**
 * Like `Stream#forEachWhile`, but returns a `ZManaged` so the finalization order
 * can be controlled.
 *
 * @dataFirst runForEachWhileManaged_
 */
export declare function runForEachWhileManaged<R1, E1, A>(
  f: (a: A) => T.Effect<R1, E1, boolean>
): <R, E>(self: C.Stream<R, E, A>) => M.Managed<R & R1, E1 | E, void>
/**
 * Effectfully filters the elements emitted by this stream.
 */
export declare function filterM_<R, R1, E, E1, A>(
  self: Stream<R, E, A>,
  f: (a: A) => T.Effect<R1, E1, A>
): Stream<R & R1, E | E1, A>
/**
 * Effectfully filters the elements emitted by this stream.
 *
 * @dataFirst filterM_
 */
export declare function filterM<R1, E1, A>(
  f: (a: A) => T.Effect<R1, E1, A>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R & R1, E1 | E, A>
/**
 * Filters this stream by the specified predicate, removing all elements for
 * which the predicate evaluates to true.
 */
export declare function filterNot_<R, E, A, B extends A>(
  self: Stream<R, E, A>,
  pred: Refinement<A, B>
): Stream<R, E, B>
export declare function filterNot_<R, E, A>(
  self: Stream<R, E, A>,
  pred: Predicate<A>
): Stream<R, E, A>
/**
 * Filters this stream by the specified predicate, removing all elements for
 * which the predicate evaluates to true.
 *
 * @dataFirst filterNot_
 */
export declare function filterNot<A, B extends A>(
  pred: Refinement<A, B>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, B>
export declare function filterNot<A>(
  pred: Predicate<A>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, A>
/**
 * Emits elements of this stream with a fixed delay in between, regardless of how long it
 * takes to produce a value.
 */
export declare function fixed_<R, E, A>(
  self: Stream<R, E, A>,
  duration: number
): Stream<R & Has<CL.Clock>, E, A>
/**
 * Emits elements of this stream with a fixed delay in between, regardless of how long it
 * takes to produce a value.
 *
 * @dataFirst fixed_
 */
export declare function fixed(
  duration: number
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R & Has<CL.Clock>, E, A>
/**
 * Submerges the chunks carried by this stream into the stream's structure, while
 * still preserving them.
 */
export declare function flattenChunks<R, E, A>(
  self: Stream<R, E, A.Chunk<A>>
): Stream<R, E, A>
/**
 * Flattens `Exit` values. `Exit.Failure` values translate to stream failures
 * while `Exit.Success` values translate to stream elements.
 */
export declare function flattenExit<R, E, E1, A>(
  self: Stream<R, E, Ex.Exit<E1, A>>
): Stream<R, E | E1, A>
/**
 * Unwraps `Exit` values that also signify end-of-stream by failing with `None`.
 *
 * For `Exit<E, A>` values that do not signal end-of-stream, prefer:
 */
export declare function flattenExitOption<R, E, E1, A>(
  self: Stream<R, E, Ex.Exit<O.Option<E1>, A>>
): Stream<R, E | E1, A>
/**
 * Submerges the iterables carried by this stream into the stream's structure, while
 * still preserving them.
 */
export declare function flattenIterables<R, E, A>(
  self: Stream<R, E, Iterable<A>>
): Stream<R, E, A>
/**
 * Unwraps `Exit` values and flatten chunks that also signify end-of-stream by failing with `None`.
 */
export declare function flattenTake<R, E, E1, A>(
  self: Stream<R, E, Take.Take<E1, A>>
): Stream<R, E | E1, A>
/**
 * Creates a stream from an effect producing a value of type `A`
 */
export declare function fromEffect<R, E, A>(fa: T.Effect<R, E, A>): Stream<R, E, A>
/**
 * Creates a stream from an effect producing a value of type `A` or an empty Stream
 */
export declare function fromEffectOption<R, E, A>(
  fa: T.Effect<R, O.Option<E>, A>
): Stream<R, E, A>
/**
 * Transforms the chunks emitted by this stream.
 */
export declare function mapChunks_<R, E, A, A1>(
  self: Stream<R, E, A>,
  f: (chunk: A.Chunk<A>) => A.Chunk<A1>
): Stream<R, E, A1>
/**
 * Transforms the chunks emitted by this stream.
 *
 * @dataFirst mapChunks_
 */
export declare function mapChunks<A, A1>(
  f: (chunk: A.Chunk<A>) => A.Chunk<A1>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R, E, A1>
/**
 * Transforms the errors emitted by this stream using `f`.
 */
export declare function mapError_<R, E, E1, A>(
  self: Stream<R, E, A>,
  f: (e: E) => E1
): Stream<R, E1, A>
/**
 * Transforms the errors emitted by this stream using `f`.
 *
 * @dataFirst mapError_
 */
export declare function mapError<E, E1>(
  f: (e: E) => E1
): <R, A>(self: C.Stream<R, E, A>) => C.Stream<R, E1, A>
/**
 * Like `Stream#runIntoHub`, but provides the result as a `Managed` to allow for scope
 * composition.
 */
export declare function runIntoHubManaged_<R, R1, E extends E1, E1, A, Z>(
  self: Stream<R, E, A>,
  hub: H.XHub<R1, never, never, unknown, Take.Take<E1, A>, Z>
): M.Managed<R & R1, E | E1, void>
/**
 * Like `Stream#runIntoHub`, but provides the result as a `Managed` to allow for scope
 * composition.
 *
 * @dataFirst runIntoHubManaged_
 */
export declare function runIntoHubManaged<R1, E1, A, Z>(
  hub: H.XHub<R1, never, never, unknown, Take.Take<E1, A>, Z>
): <R, E extends E1>(self: C.Stream<R, E, A>) => M.Managed<R & R1, E1 | E, void>
/**
 * Like `Stream#into`, but provides the result as a `Managed` to allow for scope
 * composition.
 */
export declare function runIntoManaged_<R, R1, E extends E1, E1, A, Z>(
  self: Stream<R, E, A>,
  queue: Q.XQueue<R1, never, never, unknown, Take.Take<E1, A>, Z>
): M.Managed<R & R1, E | E1, void>
/**
 * Like `Stream#into`, but provides the result as a `Managed` to allow for scope
 * composition.
 *
 * @dataFirst runIntoManaged_
 */
export declare function runIntoManaged<R1, E1, A, Z>(
  queue: Q.XQueue<R1, never, never, unknown, Take.Take<E1, A>, Z>
): <R, E extends E1>(self: C.Stream<R, E, A>) => M.Managed<R & R1, E1 | E, void>
export declare const DEFAULT_CHUNK_SIZE = 4096
/**
 * Converts the stream to a managed hub of chunks. After the managed hub is used,
 * the hub will never again produce values and should be discarded.
 */
export declare function toHub_<R, E, A>(
  self: Stream<R, E, A>,
  capacity: number
): M.Managed<R, never, H.Hub<Take.Take<E, A>>>
/**
 * Converts the stream to a managed hub of chunks. After the managed hub is used,
 * the hub will never again produce values and should be discarded.
 *
 * @dataFirst toHub_
 */
export declare function toHub(
  capacity: number
): <R, E, A>(self: C.Stream<R, E, A>) => M.Managed<R, never, H.Hub<Take.Take<E, A>>>
/**
 * Creates a stream from a `XQueue` of values
 */
export declare function fromQueue_<R, E, O>(
  queue: Q.XQueue<never, R, unknown, E, never, O>,
  maxChunkSize?: number
): Stream<R, E, O>
/**
 * Creates a stream from a `XQueue` of values
 */
export declare function fromQueue(
  maxChunkSize?: number
): <R, E, O>(queue: Q.XQueue<never, R, unknown, E, never, O>) => C.Stream<R, E, O>
/**
 * Creates a stream from an effect producing chunks of `A` values until it fails with None.
 */
export declare function repeatEffectChunkOption<R, E, A>(
  fa: T.Effect<R, O.Option<E>, A.Chunk<A>>
): Stream<R, E, A>
/**
 * Creates a stream by effectfully peeling off the "layers" of a value of type `S`
 */
export declare function unfoldChunkM<S>(
  s: S
): <R, E, A>(
  f: (s: S) => T.Effect<R, E, O.Option<Tp.Tuple<[A.Chunk<A>, S]>>>
) => C.Stream<R, E, A>
/**
 * Creates a stream by effectfully peeling off the "layers" of a value of type `S`
 */
export declare function unfoldM<S>(
  s: S
): <R, E, A>(
  f: (s: S) => T.Effect<R, E, O.Option<Tp.Tuple<[A, S]>>>
) => C.Stream<R, E, A>
/**
 * Converts the stream to a managed queue of chunks. After the managed queue is used,
 * the queue will never again produce values and should be discarded.
 */
export declare function toQueue_<R, E, A>(
  self: Stream<R, E, A>,
  capacity?: number
): M.Managed<R, never, Q.Queue<Take.Take<E, A>>>
/**
 * Converts the stream to a managed queue of chunks. After the managed queue is used,
 * the queue will never again produce values and should be discarded.
 *
 * @dataFirst toQueue_
 */
export declare function toQueue(
  capacity?: number
): <R, E, A>(self: C.Stream<R, E, A>) => M.Managed<R, never, Q.Queue<Take.Take<E, A>>>
/**
 * Converts the stream into an unbounded managed queue. After the managed queue
 * is used, the queue will never again produce values and should be discarded.
 */
export declare function toQueueUnbounded<R, E, A>(
  self: Stream<R, E, A>
): M.Managed<R, never, Q.Queue<Take.Take<E, A>>>
/**
 * The stream that always halts with `cause`.
 */
export declare function halt<E>(cause: CS.Cause<E>): Stream<unknown, E, never>
/**
 * Creates a stream from a subscription to a hub.
 */
export declare function fromHub<R, E, A>(
  hub: H.XHub<never, R, unknown, E, never, A>
): Stream<R, E, A>
export declare function runManaged_<R, R1, E, A, E2, B, L>(
  self: Stream<R, E, A>,
  sink: SK.Sink<R1, E, A, E2, L, B>
): M.Managed<R & R1, E2, B>
/**
 * @dataFirst runManaged_
 */
export declare function runManaged<R1, E, A, E2, B>(
  sink: SK.Sink<R1, E, A, E2, any, B>
): <R>(self: C.Stream<R, E, A>) => M.Managed<R & R1, E2, B>
/**
 * Interrupts the evaluation of this stream when the provided IO completes. The given
 * IO will be forked as part of this stream, and its success will be discarded. This
 * combinator will also interrupt any in-progress element being pulled from upstream.
 *
 * If the IO completes with a failure before the stream completes, the returned stream
 * will emit that failure.
 */
export declare function interruptWhen_<R, R1, E, E1, A, Z>(
  self: Stream<R, E, A>,
  io: T.Effect<R1, E1, Z>
): Stream<R1 & R, E | E1, A>
/**
 * Interrupts the evaluation of this stream when the provided IO completes. The given
 * IO will be forked as part of this stream, and its success will be discarded. This
 * combinator will also interrupt any in-progress element being pulled from upstream.
 *
 * If the IO completes with a failure before the stream completes, the returned stream
 * will emit that failure.
 *
 * @dataFirst interruptWhen_
 */
export declare function interruptWhen<R1, E1, Z>(
  io: T.Effect<R1, E1, Z>
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R1 & R, E1 | E, A>
/**
 * Interrupts the evaluation of this stream when the provided promise resolves. This
 * combinator will also interrupt any in-progress element being pulled from upstream.
 *
 * If the promise completes with a failure, the stream will emit that failure.
 */
export declare function interruptWhenP_<R, E, A, E1>(
  self: Stream<R, E, A>,
  p: P.Promise<E1, never>
): Stream<R, E | E1, A>
/**
 * Interrupts the evaluation of this stream when the provided promise resolves. This
 * combinator will also interrupt any in-progress element being pulled from upstream.
 *
 * If the promise completes with a failure, the stream will emit that failure.
 *
 * @dataFirst interruptWhenP_
 */
export declare function interruptWhenP<E1>(
  p: P.Promise<E1, never>
): <R, E, A>(self: C.Stream<R, E, A>) => C.Stream<R, E1 | E, A>
/**
 * Schedules the output of the stream using the provided `schedule`.
 */
export declare function schedule_<R, R1, E, A, Z>(
  self: Stream<R, E, A>,
  schedule: SC.Schedule<R1, A, Z>
): Stream<R & Has<CL.Clock> & R1, E, A>
/**
 * Schedules the output of the stream using the provided `schedule`.
 *
 * @dataFirst schedule_
 */
export declare function schedule<R1, A, Z>(
  schedule: SC.Schedule<R1, A, Z>
): <R, E>(self: C.Stream<R, E, A>) => C.Stream<R & Has<CL.Clock> & R1, E, A>
/**
 * Schedules the output of the stream using the provided `schedule` and emits its output at
 * the end (if `schedule` is finite).
 */
export declare function scheduleEither_<R, R1, E, A, B>(
  self: Stream<R, E, A>,
  schedule: SC.Schedule<R1, A, B>
): Stream<R & Has<CL.Clock> & R1, E, E.Either<B, A>>
/**
 * Schedules the output of the stream using the provided `schedule` and emits its output at
 * the end (if `schedule` is finite).
 *
 * @dataFirst scheduleEither_
 */
export declare function scheduleEither<R1, A, B>(
  schedule: SC.Schedule<R1, A, B>
): <R, E>(
  self: C.Stream<R, E, A>
) => C.Stream<R & Has<CL.Clock> & R1, E, E.Either<B, A>>
/**
 * Schedules the output of the stream using the provided `schedule` and emits its output at
 * the end (if `schedule` is finite).
 * Uses the provided function to align the stream and schedule outputs on the same type.
 */
export declare function scheduleWith<R, R1, E, A, B>(
  self: Stream<R, E, A>,
  schedule: SC.Schedule<R1, A, B>
): <C1, C2>(
  f: (a: A) => C1,
  g: (b: B) => C2
) => C.Stream<R & Has<CL.Clock> & R1, E, C1 | C2>
/**
 * Applies the transducer to the stream and emits its outputs.
 */
export declare function transduce_<R, R1, E, E1, A, Z>(
  self: Stream<R, E, A>,
  sink: SK.Sink<R1, E, A, E1, A, Z>
): Stream<R & R1, E1, Z>
/**
 * Applies the transducer to the stream and emits its outputs.
 *
 * @dataFirst transduce_
 */
export declare function transduce<R, R1, E, E1, A, Z>(
  sink: SK.Sink<R1, E, A, E1, A, Z>
): (self: Stream<R, E, A>) => C.Stream<R & R1, E1, Z>
//# sourceMappingURL=api.d.ts.map
