/** * @since 2.0.0 */ import type * as Cause from "./Cause.js"; import type * as ChildExecutorDecision from "./ChildExecutorDecision.js"; import type * as Chunk from "./Chunk.js"; import type * as Context from "./Context.js"; import type * as Deferred from "./Deferred.js"; import type * as Effect from "./Effect.js"; import type * as Either from "./Either.js"; import type * as Exit from "./Exit.js"; import type { LazyArg } from "./Function.js"; import type * as Layer from "./Layer.js"; import type * as MergeDecision from "./MergeDecision.js"; import type * as MergeStrategy from "./MergeStrategy.js"; import type * as Option from "./Option.js"; import type { Pipeable } from "./Pipeable.js"; import type { Predicate } from "./Predicate.js"; import type * as PubSub from "./PubSub.js"; import type * as Queue from "./Queue.js"; import type * as Ref from "./Ref.js"; import type * as Scope from "./Scope.js"; import type * as SingleProducerAsyncInput from "./SingleProducerAsyncInput.js"; import type * as Sink from "./Sink.js"; import type * as Stream from "./Stream.js"; import type * as Tracer from "./Tracer.js"; import type * as Types from "./Types.js"; import type * as Unify from "./Unify.js"; import type * as UpstreamPullRequest from "./UpstreamPullRequest.js"; import type * as UpstreamPullStrategy from "./UpstreamPullStrategy.js"; /** * @since 2.0.0 * @category symbols */ export declare const ChannelTypeId: unique symbol; /** * @since 2.0.0 * @category symbols */ export type ChannelTypeId = typeof ChannelTypeId; /** * A `Channel` is a nexus of I/O operations, which supports both reading and * writing. A channel may read values of type `InElem` and write values of type * `OutElem`. When the channel finishes, it yields a value of type `OutDone`. A * channel may fail with a value of type `OutErr`. * * Channels are the foundation of Streams: both streams and sinks are built on * channels. Most users shouldn't have to use channels directly, as streams and * sinks are much more convenient and cover all common use cases. However, when * adding new stream and sink operators, or doing something highly specialized, * it may be useful to use channels directly. * * Channels compose in a variety of ways: * * - **Piping**: One channel can be piped to another channel, assuming the * input type of the second is the same as the output type of the first. * - **Sequencing**: The terminal value of one channel can be used to create * another channel, and both the first channel and the function that makes * the second channel can be composed into a channel. * - **Concatenating**: The output of one channel can be used to create other * channels, which are all concatenated together. The first channel and the * function that makes the other channels can be composed into a channel. * * @since 2.0.0 * @category models */ export interface Channel extends Channel.Variance, Pipeable { [Unify.typeSymbol]?: unknown; [Unify.unifySymbol]?: ChannelUnify; [Unify.ignoreSymbol]?: ChannelUnifyIgnore; } /** * @since 2.0.0 * @category models */ export interface ChannelUnify extends Effect.EffectUnify { Channel?: () => A[Unify.typeSymbol] extends Channel | infer _ ? Channel : never; } /** * @category models * @since 2.0.0 */ export interface ChannelUnifyIgnore extends Effect.EffectUnifyIgnore { Channel?: true; } /** * @since 2.0.0 * @category models */ declare module "./Effect.js" { interface Effect extends Channel { } interface EffectUnifyIgnore { Channel?: true; } } /** * @since 2.0.0 */ export declare namespace Channel { /** * @since 2.0.0 * @category models */ interface Variance { readonly [ChannelTypeId]: VarianceStruct; } /** * @since 2.0.0 * @category models */ interface VarianceStruct { _Env: Types.Covariant; _InErr: Types.Contravariant; _InElem: Types.Contravariant; _InDone: Types.Contravariant; _OutErr: Types.Covariant; _OutElem: Types.Covariant; _OutDone: Types.Covariant; } } /** * @since 2.0.0 * @category symbols */ export declare const ChannelExceptionTypeId: unique symbol; /** * @since 2.0.0 * @category symbols */ export type ChannelExceptionTypeId = typeof ChannelExceptionTypeId; /** * Represents a generic checked exception which occurs when a `Channel` is * executed. * * @since 2.0.0 * @category models */ export interface ChannelException { readonly _tag: "ChannelException"; readonly [ChannelExceptionTypeId]: ChannelExceptionTypeId; readonly error: E; } /** * @since 3.5.4 * @category refinements */ export declare const isChannel: (u: unknown) => u is Channel; /** * @since 2.0.0 * @category constructors */ export declare const acquireUseRelease: (acquire: Effect.Effect, use: (a: Acquired) => Channel, release: (a: Acquired, exit: Exit.Exit) => Effect.Effect) => Channel; /** * @since 2.0.0 * @category constructors */ export declare const acquireReleaseOut: { /** * @since 2.0.0 * @category constructors */ (release: (z: Z, e: Exit.Exit) => Effect.Effect): (self: Effect.Effect) => Channel; /** * @since 2.0.0 * @category constructors */ (self: Effect.Effect, release: (z: Z, e: Exit.Exit) => Effect.Effect): Channel; }; /** * Returns a new channel that is the same as this one, except the terminal * value of the channel is the specified constant value. * * This method produces the same result as mapping this channel to the * specified constant value. * * @since 2.0.0 * @category mapping */ export declare const as: { /** * Returns a new channel that is the same as this one, except the terminal * value of the channel is the specified constant value. * * This method produces the same result as mapping this channel to the * specified constant value. * * @since 2.0.0 * @category mapping */ (value: OutDone2): (self: Channel) => Channel; /** * Returns a new channel that is the same as this one, except the terminal * value of the channel is the specified constant value. * * This method produces the same result as mapping this channel to the * specified constant value. * * @since 2.0.0 * @category mapping */ (self: Channel, value: OutDone2): Channel; }; /** * @since 2.0.0 * @category mapping */ export declare const asVoid: (self: Channel) => Channel; /** * Creates a channel backed by a buffer. When the buffer is empty, the channel * will simply passthrough its input as output. However, when the buffer is * non-empty, the value inside the buffer will be passed along as output. * * @since 2.0.0 * @category constructors */ export declare const buffer: (options: { readonly empty: InElem; readonly isEmpty: Predicate; readonly ref: Ref.Ref; }) => Channel; /** * @since 2.0.0 * @category constructors */ export declare const bufferChunk: (ref: Ref.Ref>) => Channel, Chunk.Chunk, InErr, InErr, InDone, InDone>; /** * Returns a new channel that is the same as this one, except if this channel * errors for any typed error, then the returned channel will switch over to * using the fallback channel returned by the specified error handler. * * @since 2.0.0 * @category error handling */ export declare const catchAll: { /** * Returns a new channel that is the same as this one, except if this channel * errors for any typed error, then the returned channel will switch over to * using the fallback channel returned by the specified error handler. * * @since 2.0.0 * @category error handling */ (f: (error: OutErr) => Channel): (self: Channel) => Channel; /** * Returns a new channel that is the same as this one, except if this channel * errors for any typed error, then the returned channel will switch over to * using the fallback channel returned by the specified error handler. * * @since 2.0.0 * @category error handling */ (self: Channel, f: (error: OutErr) => Channel): Channel; }; /** * Returns a new channel that is the same as this one, except if this channel * errors for any typed error, then the returned channel will switch over to * using the fallback channel returned by the specified error handler. * * @since 2.0.0 * @category error handling */ export declare const catchAllCause: { /** * Returns a new channel that is the same as this one, except if this channel * errors for any typed error, then the returned channel will switch over to * using the fallback channel returned by the specified error handler. * * @since 2.0.0 * @category error handling */ (f: (cause: Cause.Cause) => Channel): (self: Channel) => Channel; /** * Returns a new channel that is the same as this one, except if this channel * errors for any typed error, then the returned channel will switch over to * using the fallback channel returned by the specified error handler. * * @since 2.0.0 * @category error handling */ (self: Channel, f: (cause: Cause.Cause) => Channel): Channel; }; /** * Concat sequentially a channel of channels. * * @since 2.0.0 * @category constructors */ export declare const concatAll: (channels: Channel, InElem, OutErr, InErr, any, InDone, Env>) => Channel; /** * Concat sequentially a channel of channels. * * @since 2.0.0 * @category constructors */ export declare const concatAllWith: (channels: Channel, InElem, OutErr, InErr, OutDone2, InDone, Env>, f: (o: OutDone, o1: OutDone) => OutDone, g: (o: OutDone, o2: OutDone2) => OutDone3) => Channel; /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. * * @since 2.0.0 * @category utils */ export declare const concatMap: { /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. * * @since 2.0.0 * @category utils */ (f: (o: OutElem) => Channel): (self: Channel) => Channel; /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. * * @since 2.0.0 * @category utils */ (self: Channel, f: (o: OutElem) => Channel): Channel; }; /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. The provided merging function is used to * merge the terminal values of all channels into the single terminal value of * the returned channel. * * @since 2.0.0 * @category utils */ export declare const concatMapWith: { /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. The provided merging function is used to * merge the terminal values of all channels into the single terminal value of * the returned channel. * * @since 2.0.0 * @category utils */ (f: (o: OutElem) => Channel, g: (o: OutDone, o1: OutDone) => OutDone, h: (o: OutDone, o2: OutDone2) => OutDone3): (self: Channel) => Channel; /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. The provided merging function is used to * merge the terminal values of all channels into the single terminal value of * the returned channel. * * @since 2.0.0 * @category utils */ (self: Channel, f: (o: OutElem) => Channel, g: (o: OutDone, o1: OutDone) => OutDone, h: (o: OutDone, o2: OutDone2) => OutDone3): Channel; }; /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. The provided merging function is used to * merge the terminal values of all channels into the single terminal value of * the returned channel. * * @since 2.0.0 * @category utils */ export declare const concatMapWithCustom: { /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. The provided merging function is used to * merge the terminal values of all channels into the single terminal value of * the returned channel. * * @since 2.0.0 * @category utils */ (f: (o: OutElem) => Channel, g: (o: OutDone, o1: OutDone) => OutDone, h: (o: OutDone, o2: OutDone2) => OutDone3, onPull: (upstreamPullRequest: UpstreamPullRequest.UpstreamPullRequest) => UpstreamPullStrategy.UpstreamPullStrategy, onEmit: (elem: OutElem2) => ChildExecutorDecision.ChildExecutorDecision): (self: Channel) => Channel; /** * Returns a new channel whose outputs are fed to the specified factory * function, which creates new channels in response. These new channels are * sequentially concatenated together, and all their outputs appear as outputs * of the newly returned channel. The provided merging function is used to * merge the terminal values of all channels into the single terminal value of * the returned channel. * * @since 2.0.0 * @category utils */ (self: Channel, f: (o: OutElem) => Channel, g: (o: OutDone, o1: OutDone) => OutDone, h: (o: OutDone, o2: OutDone2) => OutDone3, onPull: (upstreamPullRequest: UpstreamPullRequest.UpstreamPullRequest) => UpstreamPullStrategy.UpstreamPullStrategy, onEmit: (elem: OutElem2) => ChildExecutorDecision.ChildExecutorDecision): Channel; }; /** * Returns a new channel, which is the same as this one, except its outputs * are filtered and transformed by the specified partial function. * * @since 2.0.0 * @category utils */ export declare const collect: { /** * Returns a new channel, which is the same as this one, except its outputs * are filtered and transformed by the specified partial function. * * @since 2.0.0 * @category utils */ (pf: (o: OutElem) => Option.Option): (self: Channel) => Channel; /** * Returns a new channel, which is the same as this one, except its outputs * are filtered and transformed by the specified partial function. * * @since 2.0.0 * @category utils */ (self: Channel, pf: (o: OutElem) => Option.Option): Channel; }; /** * Returns a new channel, which is the concatenation of all the channels that * are written out by this channel. This method may only be called on channels * that output other channels. * * @since 2.0.0 * @category utils */ export declare const concatOut: (self: Channel, InElem, OutErr, InErr, OutDone, InDone, Env>) => Channel; /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's done value. * * @since 2.0.0 * @category utils */ export declare const mapInput: { /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's done value. * * @since 2.0.0 * @category utils */ (f: (a: InDone0) => InDone): (self: Channel) => Channel; /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's done value. * * @since 2.0.0 * @category utils */ (self: Channel, f: (a: InDone0) => InDone): Channel; }; /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's done value. * * @since 2.0.0 * @category utils */ export declare const mapInputEffect: { /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's done value. * * @since 2.0.0 * @category utils */ (f: (i: InDone0) => Effect.Effect): (self: Channel) => Channel; /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's done value. * * @since 2.0.0 * @category utils */ (self: Channel, f: (i: InDone0) => Effect.Effect): Channel; }; /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's error value. * * @since 2.0.0 * @category utils */ export declare const mapInputError: { /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's error value. * * @since 2.0.0 * @category utils */ (f: (a: InErr0) => InErr): (self: Channel) => Channel; /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's error value. * * @since 2.0.0 * @category utils */ (self: Channel, f: (a: InErr0) => InErr): Channel; }; /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's error value. * * @since 2.0.0 * @category utils */ export declare const mapInputErrorEffect: { /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's error value. * * @since 2.0.0 * @category utils */ (f: (error: InErr0) => Effect.Effect): (self: Channel) => Channel; /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's error value. * * @since 2.0.0 * @category utils */ (self: Channel, f: (error: InErr0) => Effect.Effect): Channel; }; /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's output elements. * * @since 2.0.0 * @category utils */ export declare const mapInputIn: { /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's output elements. * * @since 2.0.0 * @category utils */ (f: (a: InElem0) => InElem): (self: Channel) => Channel; /** * Returns a new channel which is the same as this one but applies the given * function to the input channel's output elements. * * @since 2.0.0 * @category utils */ (self: Channel, f: (a: InElem0) => InElem): Channel; }; /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's output elements. * * @since 2.0.0 * @category utils */ export declare const mapInputInEffect: { /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's output elements. * * @since 2.0.0 * @category utils */ (f: (a: InElem0) => Effect.Effect): (self: Channel) => Channel; /** * Returns a new channel which is the same as this one but applies the given * effectual function to the input channel's output elements. * * @since 2.0.0 * @category utils */ (self: Channel, f: (a: InElem0) => Effect.Effect): Channel; }; /** * Returns a new channel, which is the same as this one, except that all the * outputs are collected and bundled into a tuple together with the terminal * value of this channel. * * As the channel returned from this channel collects all of this channel's * output into an in- memory chunk, it is not safe to call this method on * channels that output a large or unbounded number of values. * * @since 2.0.0 * @category utils */ export declare const doneCollect: (self: Channel) => Channel, OutDone], InDone, Env>; /** * Returns a new channel which reads all the elements from upstream's output * channel and ignores them, then terminates with the upstream result value. * * @since 2.0.0 * @category utils */ export declare const drain: (self: Channel) => Channel; /** * Returns a new channel which connects the given `AsyncInputProducer` as * this channel's input. * * @since 2.0.0 * @category utils */ export declare const embedInput: { /** * Returns a new channel which connects the given `AsyncInputProducer` as * this channel's input. * * @since 2.0.0 * @category utils */ (input: SingleProducerAsyncInput.AsyncInputProducer): (self: Channel) => Channel; /** * Returns a new channel which connects the given `AsyncInputProducer` as * this channel's input. * * @since 2.0.0 * @category utils */ (self: Channel, input: SingleProducerAsyncInput.AsyncInputProducer): Channel; }; /** * Returns a new channel that collects the output and terminal value of this * channel, which it then writes as output of the returned channel. * * @since 2.0.0 * @category utils */ export declare const emitCollect: (self: Channel) => Channel<[Chunk.Chunk, OutDone], InElem, OutErr, InErr, void, InDone, Env>; /** * Returns a new channel with an attached finalizer. The finalizer is * guaranteed to be executed so long as the channel begins execution (and * regardless of whether or not it completes). * * @since 2.0.0 * @category utils */ export declare const ensuring: { /** * Returns a new channel with an attached finalizer. The finalizer is * guaranteed to be executed so long as the channel begins execution (and * regardless of whether or not it completes). * * @since 2.0.0 * @category utils */ (finalizer: Effect.Effect): (self: Channel) => Channel; /** * Returns a new channel with an attached finalizer. The finalizer is * guaranteed to be executed so long as the channel begins execution (and * regardless of whether or not it completes). * * @since 2.0.0 * @category utils */ (self: Channel, finalizer: Effect.Effect): Channel; }; /** * Returns a new channel with an attached finalizer. The finalizer is * guaranteed to be executed so long as the channel begins execution (and * regardless of whether or not it completes). * * @since 2.0.0 * @category utils */ export declare const ensuringWith: { /** * Returns a new channel with an attached finalizer. The finalizer is * guaranteed to be executed so long as the channel begins execution (and * regardless of whether or not it completes). * * @since 2.0.0 * @category utils */ (finalizer: (e: Exit.Exit) => Effect.Effect): (self: Channel) => Channel; /** * Returns a new channel with an attached finalizer. The finalizer is * guaranteed to be executed so long as the channel begins execution (and * regardless of whether or not it completes). * * @since 2.0.0 * @category utils */ (self: Channel, finalizer: (e: Exit.Exit) => Effect.Effect): Channel; }; /** * Accesses the whole context of the channel. * * @since 2.0.0 * @category context */ export declare const context: () => Channel, unknown, Env>; /** * Accesses the context of the channel with the specified function. * * @since 2.0.0 * @category context */ export declare const contextWith: (f: (env: Context.Context) => OutDone) => Channel; /** * Accesses the context of the channel in the context of a channel. * * @since 2.0.0 * @category context */ export declare const contextWithChannel: (f: (env: Context.Context) => Channel) => Channel; /** * Accesses the context of the channel in the context of an effect. * * @since 2.0.0 * @category context */ export declare const contextWithEffect: (f: (env: Context.Context) => Effect.Effect) => Channel; /** * Constructs a channel that fails immediately with the specified error. * * @since 2.0.0 * @category constructors */ export declare const fail: (error: E) => Channel; /** * Constructs a channel that succeeds immediately with the specified lazily * evaluated value. * * @since 2.0.0 * @category constructors */ export declare const failSync: (evaluate: LazyArg) => Channel; /** * Constructs a channel that fails immediately with the specified `Cause`. * * @since 2.0.0 * @category constructors */ export declare const failCause: (cause: Cause.Cause) => Channel; /** * Constructs a channel that succeeds immediately with the specified lazily * evaluated `Cause`. * * @since 2.0.0 * @category constructors */ export declare const failCauseSync: (evaluate: LazyArg>) => Channel; /** * Returns a new channel, which sequentially combines this channel, together * with the provided factory function, which creates a second channel based on * the terminal value of this channel. The result is a channel that will first * perform the functions of this channel, before performing the functions of * the created channel (including yielding its terminal value). * * @since 2.0.0 * @category sequencing */ export declare const flatMap: { /** * Returns a new channel, which sequentially combines this channel, together * with the provided factory function, which creates a second channel based on * the terminal value of this channel. The result is a channel that will first * perform the functions of this channel, before performing the functions of * the created channel (including yielding its terminal value). * * @since 2.0.0 * @category sequencing */ (f: (d: OutDone) => Channel): (self: Channel) => Channel; /** * Returns a new channel, which sequentially combines this channel, together * with the provided factory function, which creates a second channel based on * the terminal value of this channel. The result is a channel that will first * perform the functions of this channel, before performing the functions of * the created channel (including yielding its terminal value). * * @since 2.0.0 * @category sequencing */ (self: Channel, f: (d: OutDone) => Channel): Channel; }; /** * Returns a new channel, which flattens the terminal value of this channel. * This function may only be called if the terminal value of this channel is * another channel of compatible types. * * @since 2.0.0 * @category sequencing */ export declare const flatten: (self: Channel, InDone, Env>) => Channel; /** * Folds over the result of this channel. * * @since 2.0.0 * @category utils */ export declare const foldChannel: { /** * Folds over the result of this channel. * * @since 2.0.0 * @category utils */ (options: { readonly onFailure: (error: OutErr) => Channel; readonly onSuccess: (done: OutDone) => Channel; }): (self: Channel) => Channel; /** * Folds over the result of this channel. * * @since 2.0.0 * @category utils */ (self: Channel, options: { readonly onFailure: (error: OutErr) => Channel; readonly onSuccess: (done: OutDone) => Channel; }): Channel; }; /** * Folds over the result of this channel including any cause of termination. * * @since 2.0.0 * @category utils */ export declare const foldCauseChannel: { /** * Folds over the result of this channel including any cause of termination. * * @since 2.0.0 * @category utils */ (options: { readonly onFailure: (c: Cause.Cause) => Channel; readonly onSuccess: (o: OutDone) => Channel; }): (self: Channel) => Channel; /** * Folds over the result of this channel including any cause of termination. * * @since 2.0.0 * @category utils */ (self: Channel, options: { readonly onFailure: (c: Cause.Cause) => Channel; readonly onSuccess: (o: OutDone) => Channel; }): Channel; }; /** * Use an effect to end a channel. * * @since 2.0.0 * @category constructors */ export declare const fromEffect: (effect: Effect.Effect) => Channel; /** * Constructs a channel from an `Either`. * * @since 2.0.0 * @category constructors */ export declare const fromEither: (either: Either.Either) => Channel; /** * Construct a `Channel` from an `AsyncInputConsumer`. * * @since 2.0.0 * @category constructors */ export declare const fromInput: (input: SingleProducerAsyncInput.AsyncInputConsumer) => Channel; /** * Construct a `Channel` from a `PubSub`. * * @since 2.0.0 * @category constructors */ export declare const fromPubSub: (pubsub: PubSub.PubSub>>) => Channel; /** * Construct a `Channel` from a `PubSub` within a scoped effect. * * @since 2.0.0 * @category constructors */ export declare const fromPubSubScoped: (pubsub: PubSub.PubSub>>) => Effect.Effect, never, Scope.Scope>; /** * Construct a `Channel` from an `Option`. * * @since 2.0.0 * @category constructors */ export declare const fromOption: (option: Option.Option) => Channel, unknown, A, unknown>; /** * Construct a `Channel` from a `Queue`. * * @since 2.0.0 * @category constructors */ export declare const fromQueue: (queue: Queue.Dequeue>>) => Channel; /** * @since 2.0.0 * @category constructors */ export declare const identity: () => Channel; /** * Returns a new channel, which is the same as this one, except it will be * interrupted when the specified effect completes. If the effect completes * successfully before the underlying channel is done, then the returned * channel will yield the success value of the effect as its terminal value. * On the other hand, if the underlying channel finishes first, then the * returned channel will yield the success value of the underlying channel as * its terminal value. * * @since 2.0.0 * @category utils */ export declare const interruptWhen: { /** * Returns a new channel, which is the same as this one, except it will be * interrupted when the specified effect completes. If the effect completes * successfully before the underlying channel is done, then the returned * channel will yield the success value of the effect as its terminal value. * On the other hand, if the underlying channel finishes first, then the * returned channel will yield the success value of the underlying channel as * its terminal value. * * @since 2.0.0 * @category utils */ (effect: Effect.Effect): (self: Channel) => Channel; /** * Returns a new channel, which is the same as this one, except it will be * interrupted when the specified effect completes. If the effect completes * successfully before the underlying channel is done, then the returned * channel will yield the success value of the effect as its terminal value. * On the other hand, if the underlying channel finishes first, then the * returned channel will yield the success value of the underlying channel as * its terminal value. * * @since 2.0.0 * @category utils */ (self: Channel, effect: Effect.Effect): Channel; }; /** * Returns a new channel, which is the same as this one, except it will be * interrupted when the specified deferred is completed. If the deferred is * completed before the underlying channel is done, then the returned channel * will yield the value of the deferred. Otherwise, if the underlying channel * finishes first, then the returned channel will yield the value of the * underlying channel. * * @since 2.0.0 * @category utils */ export declare const interruptWhenDeferred: { /** * Returns a new channel, which is the same as this one, except it will be * interrupted when the specified deferred is completed. If the deferred is * completed before the underlying channel is done, then the returned channel * will yield the value of the deferred. Otherwise, if the underlying channel * finishes first, then the returned channel will yield the value of the * underlying channel. * * @since 2.0.0 * @category utils */ (deferred: Deferred.Deferred): (self: Channel) => Channel; /** * Returns a new channel, which is the same as this one, except it will be * interrupted when the specified deferred is completed. If the deferred is * completed before the underlying channel is done, then the returned channel * will yield the value of the deferred. Otherwise, if the underlying channel * finishes first, then the returned channel will yield the value of the * underlying channel. * * @since 2.0.0 * @category utils */ (self: Channel, deferred: Deferred.Deferred): Channel; }; /** * Returns a new channel, which is the same as this one, except the terminal * value of the returned channel is created by applying the specified function * to the terminal value of this channel. * * @since 2.0.0 * @category mapping */ export declare const map: { /** * Returns a new channel, which is the same as this one, except the terminal * value of the returned channel is created by applying the specified function * to the terminal value of this channel. * * @since 2.0.0 * @category mapping */ (f: (out: OutDone) => OutDone2): (self: Channel) => Channel; /** * Returns a new channel, which is the same as this one, except the terminal * value of the returned channel is created by applying the specified function * to the terminal value of this channel. * * @since 2.0.0 * @category mapping */ (self: Channel, f: (out: OutDone) => OutDone2): Channel; }; /** * Returns a new channel, which is the same as this one, except the terminal * value of the returned channel is created by applying the specified * effectful function to the terminal value of this channel. * * @since 2.0.0 * @category mapping */ export declare const mapEffect: { /** * Returns a new channel, which is the same as this one, except the terminal * value of the returned channel is created by applying the specified * effectful function to the terminal value of this channel. * * @since 2.0.0 * @category mapping */ (f: (o: OutDone) => Effect.Effect): (self: Channel) => Channel; /** * Returns a new channel, which is the same as this one, except the terminal * value of the returned channel is created by applying the specified * effectful function to the terminal value of this channel. * * @since 2.0.0 * @category mapping */ (self: Channel, f: (o: OutDone) => Effect.Effect): Channel; }; /** * Returns a new channel, which is the same as this one, except the failure * value of the returned channel is created by applying the specified function * to the failure value of this channel. * * @since 2.0.0 * @category mapping */ export declare const mapError: { /** * Returns a new channel, which is the same as this one, except the failure * value of the returned channel is created by applying the specified function * to the failure value of this channel. * * @since 2.0.0 * @category mapping */ (f: (err: OutErr) => OutErr2): (self: Channel) => Channel; /** * Returns a new channel, which is the same as this one, except the failure * value of the returned channel is created by applying the specified function * to the failure value of this channel. * * @since 2.0.0 * @category mapping */ (self: Channel, f: (err: OutErr) => OutErr2): Channel; }; /** * A more powerful version of `mapError` which also surfaces the `Cause` * of the channel failure. * * @since 2.0.0 * @category mapping */ export declare const mapErrorCause: { /** * A more powerful version of `mapError` which also surfaces the `Cause` * of the channel failure. * * @since 2.0.0 * @category mapping */ (f: (cause: Cause.Cause) => Cause.Cause): (self: Channel) => Channel; /** * A more powerful version of `mapError` which also surfaces the `Cause` * of the channel failure. * * @since 2.0.0 * @category mapping */ (self: Channel, f: (cause: Cause.Cause) => Cause.Cause): Channel; }; /** * Maps the output of this channel using the specified function. * * @since 2.0.0 * @category mapping */ export declare const mapOut: { /** * Maps the output of this channel using the specified function. * * @since 2.0.0 * @category mapping */ (f: (o: OutElem) => OutElem2): (self: Channel) => Channel; /** * Maps the output of this channel using the specified function. * * @since 2.0.0 * @category mapping */ (self: Channel, f: (o: OutElem) => OutElem2): Channel; }; /** * Creates a channel that is like this channel but the given effectful function * gets applied to each emitted output element. * * @since 2.0.0 * @category mapping */ export declare const mapOutEffect: { /** * Creates a channel that is like this channel but the given effectful function * gets applied to each emitted output element. * * @since 2.0.0 * @category mapping */ (f: (o: OutElem) => Effect.Effect): (self: Channel) => Channel; /** * Creates a channel that is like this channel but the given effectful function * gets applied to each emitted output element. * * @since 2.0.0 * @category mapping */ (self: Channel, f: (o: OutElem) => Effect.Effect): Channel; }; /** * Creates a channel that is like this channel but the given ZIO function gets * applied to each emitted output element, taking `n` elements at once and * mapping them in parallel. * * @since 2.0.0 * @category mapping */ export declare const mapOutEffectPar: { /** * Creates a channel that is like this channel but the given ZIO function gets * applied to each emitted output element, taking `n` elements at once and * mapping them in parallel. * * @since 2.0.0 * @category mapping */ (f: (o: OutElem) => Effect.Effect, n: number): (self: Channel) => Channel; /** * Creates a channel that is like this channel but the given ZIO function gets * applied to each emitted output element, taking `n` elements at once and * mapping them in parallel. * * @since 2.0.0 * @category mapping */ (self: Channel, f: (o: OutElem) => Effect.Effect, n: number): Channel; }; /** * @since 2.0.0 * @category utils */ export declare const mergeAll: (options: { readonly concurrency: number | "unbounded"; readonly bufferSize?: number | undefined; readonly mergeStrategy?: MergeStrategy.MergeStrategy | undefined; }) => (channels: Channel, InElem, OutErr, InErr, unknown, InDone, Env>) => Channel; /** * @since 2.0.0 * @category utils */ export declare const mergeAllUnbounded: (channels: Channel, InElem, OutErr, InErr, unknown, InDone, Env>) => Channel; /** * @since 2.0.0 * @category utils */ export declare const mergeAllUnboundedWith: (channels: Channel, InElem, OutErr, InErr, OutDone, InDone, Env>, f: (o1: OutDone, o2: OutDone) => OutDone) => Channel; /** * @since 2.0.0 * @category utils */ export declare const mergeAllWith: ({ bufferSize, concurrency, mergeStrategy }: { readonly concurrency: number | "unbounded"; readonly bufferSize?: number | undefined; readonly mergeStrategy?: MergeStrategy.MergeStrategy | undefined; }) => (channels: Channel, InElem, OutErr, InErr, OutDone, InDone, Env>, f: (o1: OutDone, o2: OutDone) => OutDone) => Channel; /** * Returns a new channel which creates a new channel for each emitted element * and merges some of them together. Different merge strategies control what * happens if there are more than the given maximum number of channels gets * created. See `Channel.mergeAll`. * * @since 2.0.0 * @category mapping */ export declare const mergeMap: { /** * Returns a new channel which creates a new channel for each emitted element * and merges some of them together. Different merge strategies control what * happens if there are more than the given maximum number of channels gets * created. See `Channel.mergeAll`. * * @since 2.0.0 * @category mapping */ (f: (outElem: OutElem) => Channel, options: { readonly concurrency: number | "unbounded"; readonly bufferSize?: number | undefined; readonly mergeStrategy?: MergeStrategy.MergeStrategy | undefined; }): (self: Channel) => Channel; /** * Returns a new channel which creates a new channel for each emitted element * and merges some of them together. Different merge strategies control what * happens if there are more than the given maximum number of channels gets * created. See `Channel.mergeAll`. * * @since 2.0.0 * @category mapping */ (self: Channel, f: (outElem: OutElem) => Channel, options: { readonly concurrency: number | "unbounded"; readonly bufferSize?: number | undefined; readonly mergeStrategy?: MergeStrategy.MergeStrategy | undefined; }): Channel; }; /** * Returns a new channel which merges a number of channels emitted by this * channel using the back pressuring merge strategy. See `Channel.mergeAll`. * * @since 2.0.0 * @category utils */ export declare const mergeOut: { /** * Returns a new channel which merges a number of channels emitted by this * channel using the back pressuring merge strategy. See `Channel.mergeAll`. * * @since 2.0.0 * @category utils */ (n: number): (self: Channel, InElem, OutErr, InErr, OutDone, InDone, Env>) => Channel; /** * Returns a new channel which merges a number of channels emitted by this * channel using the back pressuring merge strategy. See `Channel.mergeAll`. * * @since 2.0.0 * @category utils */ (self: Channel, InElem, OutErr, InErr, OutDone, InDone, Env>, n: number): Channel; }; /** * Returns a new channel which merges a number of channels emitted by this * channel using the back pressuring merge strategy and uses a given function * to merge each completed subchannel's result value. See * `Channel.mergeAll`. * * @since 2.0.0 * @category utils */ export declare const mergeOutWith: { /** * Returns a new channel which merges a number of channels emitted by this * channel using the back pressuring merge strategy and uses a given function * to merge each completed subchannel's result value. See * `Channel.mergeAll`. * * @since 2.0.0 * @category utils */ (n: number, f: (o1: OutDone1, o2: OutDone1) => OutDone1): (self: Channel, InElem, OutErr, InErr, OutDone1, InDone, Env>) => Channel; /** * Returns a new channel which merges a number of channels emitted by this * channel using the back pressuring merge strategy and uses a given function * to merge each completed subchannel's result value. See * `Channel.mergeAll`. * * @since 2.0.0 * @category utils */ (self: Channel, InElem, OutErr, InErr, OutDone1, InDone, Env>, n: number, f: (o1: OutDone1, o2: OutDone1) => OutDone1): Channel; }; /** * Returns a new channel, which is the merge of this channel and the specified * channel, where the behavior of the returned channel on left or right early * termination is decided by the specified `leftDone` and `rightDone` merge * decisions. * * @since 2.0.0 * @category utils */ export declare const mergeWith: { /** * Returns a new channel, which is the merge of this channel and the specified * channel, where the behavior of the returned channel on left or right early * termination is decided by the specified `leftDone` and `rightDone` merge * decisions. * * @since 2.0.0 * @category utils */ (options: { readonly other: Channel; readonly onSelfDone: (exit: Exit.Exit) => MergeDecision.MergeDecision; readonly onOtherDone: (ex: Exit.Exit) => MergeDecision.MergeDecision; }): (self: Channel) => Channel; /** * Returns a new channel, which is the merge of this channel and the specified * channel, where the behavior of the returned channel on left or right early * termination is decided by the specified `leftDone` and `rightDone` merge * decisions. * * @since 2.0.0 * @category utils */ (self: Channel, options: { readonly other: Channel; readonly onSelfDone: (exit: Exit.Exit) => MergeDecision.MergeDecision; readonly onOtherDone: (ex: Exit.Exit) => MergeDecision.MergeDecision; }): Channel; }; /** * Returns a channel that never completes * * @since 2.0.0 * @category constructors */ export declare const never: Channel; /** * Translates channel failure into death of the fiber, making all failures * unchecked and not a part of the type of the channel. * * @since 2.0.0 * @category error handling */ export declare const orDie: { /** * Translates channel failure into death of the fiber, making all failures * unchecked and not a part of the type of the channel. * * @since 2.0.0 * @category error handling */ (error: LazyArg): (self: Channel) => Channel; /** * Translates channel failure into death of the fiber, making all failures * unchecked and not a part of the type of the channel. * * @since 2.0.0 * @category error handling */ (self: Channel, error: LazyArg): Channel; }; /** * Keeps none of the errors, and terminates the fiber with them, using the * specified function to convert the `OutErr` into a defect. * * @since 2.0.0 * @category error handling */ export declare const orDieWith: { /** * Keeps none of the errors, and terminates the fiber with them, using the * specified function to convert the `OutErr` into a defect. * * @since 2.0.0 * @category error handling */ (f: (e: OutErr) => unknown): (self: Channel) => Channel; /** * Keeps none of the errors, and terminates the fiber with them, using the * specified function to convert the `OutErr` into a defect. * * @since 2.0.0 * @category error handling */ (self: Channel, f: (e: OutErr) => unknown): Channel; }; /** * Returns a new channel that will perform the operations of this one, until * failure, and then it will switch over to the operations of the specified * fallback channel. * * @since 2.0.0 * @category error handling */ export declare const orElse: { /** * Returns a new channel that will perform the operations of this one, until * failure, and then it will switch over to the operations of the specified * fallback channel. * * @since 2.0.0 * @category error handling */ (that: LazyArg>): (self: Channel) => Channel; /** * Returns a new channel that will perform the operations of this one, until * failure, and then it will switch over to the operations of the specified * fallback channel. * * @since 2.0.0 * @category error handling */ (self: Channel, that: LazyArg>): Channel; }; /** * Returns a new channel that pipes the output of this channel into the * specified channel. The returned channel has the input type of this channel, * and the output type of the specified channel, terminating with the value of * the specified channel. * * @since 2.0.0 * @category utils */ export declare const pipeTo: { /** * Returns a new channel that pipes the output of this channel into the * specified channel. The returned channel has the input type of this channel, * and the output type of the specified channel, terminating with the value of * the specified channel. * * @since 2.0.0 * @category utils */ (that: Channel): (self: Channel) => Channel; /** * Returns a new channel that pipes the output of this channel into the * specified channel. The returned channel has the input type of this channel, * and the output type of the specified channel, terminating with the value of * the specified channel. * * @since 2.0.0 * @category utils */ (self: Channel, that: Channel): Channel; }; /** * Returns a new channel that pipes the output of this channel into the * specified channel and preserves this channel's failures without providing * them to the other channel for observation. * * @since 2.0.0 * @category utils */ export declare const pipeToOrFail: { /** * Returns a new channel that pipes the output of this channel into the * specified channel and preserves this channel's failures without providing * them to the other channel for observation. * * @since 2.0.0 * @category utils */ (that: Channel): (self: Channel) => Channel; /** * Returns a new channel that pipes the output of this channel into the * specified channel and preserves this channel's failures without providing * them to the other channel for observation. * * @since 2.0.0 * @category utils */ (self: Channel, that: Channel): Channel; }; /** * Provides the channel with its required context, which eliminates its * dependency on `Env`. * * @since 2.0.0 * @category context */ export declare const provideContext: { /** * Provides the channel with its required context, which eliminates its * dependency on `Env`. * * @since 2.0.0 * @category context */ (env: Context.Context): (self: Channel) => Channel; /** * Provides the channel with its required context, which eliminates its * dependency on `Env`. * * @since 2.0.0 * @category context */ (self: Channel, env: Context.Context): Channel; }; /** * Provides a layer to the channel, which translates it to another level. * * @since 2.0.0 * @category context */ export declare const provideLayer: { /** * Provides a layer to the channel, which translates it to another level. * * @since 2.0.0 * @category context */ (layer: Layer.Layer): (self: Channel) => Channel; /** * Provides a layer to the channel, which translates it to another level. * * @since 2.0.0 * @category context */ (self: Channel, layer: Layer.Layer): Channel; }; /** * Transforms the context being provided to the channel with the specified * function. * * @since 2.0.0 * @category context */ export declare const mapInputContext: { /** * Transforms the context being provided to the channel with the specified * function. * * @since 2.0.0 * @category context */ (f: (env: Context.Context) => Context.Context): (self: Channel) => Channel; /** * Transforms the context being provided to the channel with the specified * function. * * @since 2.0.0 * @category context */ (self: Channel, f: (env: Context.Context) => Context.Context): Channel; }; /** * Splits the context into two parts, providing one part using the * specified layer and leaving the remainder `Env0`. * * @since 2.0.0 * @category context */ export declare const provideSomeLayer: { /** * Splits the context into two parts, providing one part using the * specified layer and leaving the remainder `Env0`. * * @since 2.0.0 * @category context */ (layer: Layer.Layer): (self: Channel) => Channel>; /** * Splits the context into two parts, providing one part using the * specified layer and leaving the remainder `Env0`. * * @since 2.0.0 * @category context */ (self: Channel, layer: Layer.Layer): Channel>; }; /** * Provides the effect with the single service it requires. If the effect * requires more than one service use `provideContext` instead. * * @since 2.0.0 * @category context */ export declare const provideService: { /** * Provides the effect with the single service it requires. If the effect * requires more than one service use `provideContext` instead. * * @since 2.0.0 * @category context */ (tag: Context.Tag, service: Types.NoInfer): (self: Channel) => Channel>; /** * Provides the effect with the single service it requires. If the effect * requires more than one service use `provideContext` instead. * * @since 2.0.0 * @category context */ (self: Channel, tag: Context.Tag, service: Types.NoInfer): Channel>; }; /** * @since 2.0.0 * @category constructors */ export declare const read: () => Channel, unknown, In, unknown>; /** * @since 2.0.0 * @category constructors */ export declare const readOrFail: (error: E) => Channel; /** * @since 2.0.0 * @category constructors */ export declare const readWith: (options: { readonly onInput: (input: InElem) => Channel; readonly onFailure: (error: InErr) => Channel; readonly onDone: (done: InDone) => Channel; }) => Channel; /** * @since 2.0.0 * @category constructors */ export declare const readWithCause: (options: { readonly onInput: (input: InElem) => Channel; readonly onFailure: (cause: Cause.Cause) => Channel; readonly onDone: (done: InDone) => Channel; }) => Channel; /** * Creates a channel which repeatedly runs this channel. * * @since 2.0.0 * @category utils */ export declare const repeated: (self: Channel) => Channel; /** * Runs a channel until the end is received. * * @since 2.0.0 * @category destructors */ export declare const run: (self: Channel) => Effect.Effect; /** * Run the channel until it finishes with a done value or fails with an error * and collects its emitted output elements. * * The channel must not read any input. * * @since 2.0.0 * @category destructors */ export declare const runCollect: (self: Channel) => Effect.Effect<[Chunk.Chunk, OutDone], OutErr, Env>; /** * Runs a channel until the end is received. * * @since 2.0.0 * @category destructors */ export declare const runDrain: (self: Channel) => Effect.Effect; /** * Run the channel until it finishes with a done value or fails with an error. * The channel must not read any input or write any output. * * Closing the channel, which includes execution of all the finalizers * attached to the channel will be added to the current scope as a finalizer. * * @since 3.11.0 * @category destructors */ export declare const runScoped: (self: Channel) => Effect.Effect; /** * Use a scoped effect to emit an output element. * * @since 2.0.0 * @category constructors */ export declare const scoped: (effect: Effect.Effect) => Channel>; /** * Use a function that receives a scope and returns an effect to emit an output * element. The output element will be the result of the returned effect, if * successful. * * @since 3.11.0 * @category constructors */ export declare const scopedWith: (f: (scope: Scope.Scope) => Effect.Effect) => Channel; /** * Splits strings on newlines. Handles both Windows newlines (`\r\n`) and UNIX * newlines (`\n`). * * @since 2.0.0 * @category combinators */ export declare const splitLines: () => Channel, Chunk.Chunk, Err, Err, Done, Done, never>; /** * Constructs a channel that succeeds immediately with the specified value. * * @since 2.0.0 * @category constructors */ export declare const succeed: (value: A) => Channel; /** * Lazily constructs a channel from the given side effect. * * @since 2.0.0 * @category constructors */ export declare const suspend: (evaluate: LazyArg>) => Channel; /** * Constructs a channel that succeeds immediately with the specified lazy value. * * @since 2.0.0 * @category constructors */ export declare const sync: (evaluate: LazyArg) => Channel; /** * Converts a `Channel` to a `PubSub`. * * @since 2.0.0 * @category destructors */ export declare const toPubSub: (pubsub: PubSub.PubSub>>) => Channel; /** * Returns a scoped `Effect` that can be used to repeatedly pull elements from * the constructed `Channel`. The pull effect fails with the channel's failure * in case the channel fails, or returns either the channel's done value or an * emitted element. * * @since 2.0.0 * @category destructors */ export declare const toPull: (self: Channel) => Effect.Effect, OutErr, Env>, never, Scope.Scope | Env>; /** * Returns an `Effect` that can be used to repeatedly pull elements from the * constructed `Channel` within the provided `Scope`. The pull effect fails * with the channel's failure in case the channel fails, or returns either the * channel's done value or an emitted element. * * @since 3.11.0 * @category destructors */ export declare const toPullIn: { /** * Returns an `Effect` that can be used to repeatedly pull elements from the * constructed `Channel` within the provided `Scope`. The pull effect fails * with the channel's failure in case the channel fails, or returns either the * channel's done value or an emitted element. * * @since 3.11.0 * @category destructors */ (scope: Scope.Scope): (self: Channel) => Effect.Effect, OutErr, Env>, never, Env>; /** * Returns an `Effect` that can be used to repeatedly pull elements from the * constructed `Channel` within the provided `Scope`. The pull effect fails * with the channel's failure in case the channel fails, or returns either the * channel's done value or an emitted element. * * @since 3.11.0 * @category destructors */ (self: Channel, scope: Scope.Scope): Effect.Effect, OutErr, Env>, never, Env>; }; /** * Converts a `Channel` to a `Queue`. * * @since 2.0.0 * @category destructors */ export declare const toQueue: (queue: Queue.Enqueue>>) => Channel; /** Converts this channel to a `Sink`. * * @since 2.0.0 * @category destructors */ export declare const toSink: (self: Channel, Chunk.Chunk, OutErr, InErr, OutDone, unknown, Env>) => Sink.Sink; /** * Converts this channel to a `Stream`. * * @since 2.0.0 * @category destructors */ export declare const toStream: (self: Channel, unknown, OutErr, unknown, OutDone, unknown, Env>) => Stream.Stream; declare const void_: Channel; export { /** * @since 2.0.0 * @category constructors */ void_ as void }; /** * Constructs a `Channel` from an effect that will result in a `Channel` if * successful. * * @since 2.0.0 * @category constructors */ export declare const unwrap: (channel: Effect.Effect, E, R>) => Channel; /** * Constructs a `Channel` from a scoped effect that will result in a * `Channel` if successful. * * @since 2.0.0 * @category constructors */ export declare const unwrapScoped: (self: Effect.Effect, E, R>) => Channel>; /** * Constructs a `Channel` from a function which receives a `Scope` and returns * an effect that will result in a `Channel` if successful. * * @since 3.11.0 * @category constructors */ export declare const unwrapScopedWith: (f: (scope: Scope.Scope) => Effect.Effect, E, R>) => Channel; /** * Updates a service in the context of this channel. * * @since 2.0.0 * @category context */ export declare const updateService: { /** * Updates a service in the context of this channel. * * @since 2.0.0 * @category context */ (tag: Context.Tag, f: (resource: Types.NoInfer) => Types.NoInfer): (self: Channel) => Channel; /** * Updates a service in the context of this channel. * * @since 2.0.0 * @category context */ (self: Channel, tag: Context.Tag, f: (resource: Types.NoInfer) => Types.NoInfer): Channel; }; /** * Wraps the channel with a new span for tracing. * * @since 2.0.0 * @category tracing */ export declare const withSpan: { /** * Wraps the channel with a new span for tracing. * * @since 2.0.0 * @category tracing */ (name: string, options?: Tracer.SpanOptions | undefined): (self: Channel) => Channel>; /** * Wraps the channel with a new span for tracing. * * @since 2.0.0 * @category tracing */ (self: Channel, name: string, options?: Tracer.SpanOptions | undefined): Channel>; }; /** * Writes a single value to the channel. * * @since 2.0.0 * @category constructors */ export declare const write: (out: OutElem) => Channel; /** * Writes a sequence of values to the channel. * * @since 2.0.0 * @category constructors */ export declare const writeAll: >(...outs: OutElems) => Channel; /** * Writes a `Chunk` of values to the channel. * * @since 2.0.0 * @category constructors */ export declare const writeChunk: (outs: Chunk.Chunk) => Channel; /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with a tuple of * the terminal values of both channels. * * @since 2.0.0 * @category zipping */ export declare const zip: { /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with a tuple of * the terminal values of both channels. * * @since 2.0.0 * @category zipping */ (that: Channel, options?: { readonly concurrent?: boolean | undefined; } | undefined): (self: Channel) => Channel; /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with a tuple of * the terminal values of both channels. * * @since 2.0.0 * @category zipping */ (self: Channel, that: Channel, options?: { readonly concurrent?: boolean | undefined; } | undefined): Channel; }; /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with the * terminal value of this channel. * * @since 2.0.0 * @category zipping */ export declare const zipLeft: { /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with the * terminal value of this channel. * * @since 2.0.0 * @category zipping */ (that: Channel, options?: { readonly concurrent?: boolean | undefined; } | undefined): (self: Channel) => Channel; /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with the * terminal value of this channel. * * @since 2.0.0 * @category zipping */ (self: Channel, that: Channel, options?: { readonly concurrent?: boolean | undefined; } | undefined): Channel; }; /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with the * terminal value of that channel. * * @since 2.0.0 * @category zipping */ export declare const zipRight: { /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with the * terminal value of that channel. * * @since 2.0.0 * @category zipping */ (that: Channel, options?: { readonly concurrent?: boolean | undefined; }): (self: Channel) => Channel; /** * Returns a new channel that is the sequential composition of this channel * and the specified channel. The returned channel terminates with the * terminal value of that channel. * * @since 2.0.0 * @category zipping */ (self: Channel, that: Channel, options?: { readonly concurrent?: boolean | undefined; }): Channel; }; /** * Represents a generic checked exception which occurs when a `Channel` is * executed. * * @since 2.0.0 * @category errors */ export declare const ChannelException: (error: E) => ChannelException; /** * Returns `true` if the specified value is an `ChannelException`, `false` * otherwise. * * @since 2.0.0 * @category refinements */ export declare const isChannelException: (u: unknown) => u is ChannelException; //# sourceMappingURL=Channel.d.ts.map