import { Effect } from "@effect/core/io/Effect/definition"; import { Exit } from "@effect/core/io/Exit/definition"; import type { ErasedExecutor } from "@effect/core/stream/Channel/ChannelExecutor"; export declare const ChannelStateSym: unique symbol; export type ChannelStateSym = typeof ChannelStateSym; export declare const _R: unique symbol; export type _R = typeof _R; export declare const _E: unique symbol; export type _E = typeof _E; /** * @tsplus type effect/core/stream/Channel/State */ export interface ChannelState { readonly [ChannelStateSym]: ChannelStateSym; readonly [_R]: (_: R) => void; readonly [_E]: () => E; } export declare namespace ChannelState { type Done = ChannelStateDone; type Emit = ChannelStateEmit; type Effect = ChannelStateEffect; type Read = ChannelStateRead; } export declare abstract class ChannelStateBase implements ChannelState { readonly [ChannelStateSym]: ChannelStateSym; readonly [_R]: (_: R) => void; readonly [_E]: () => E; } export declare class ChannelStateDone extends ChannelStateBase { readonly _tag = "Done"; } export declare class ChannelStateEmit extends ChannelStateBase { readonly _tag = "Emit"; } export declare class ChannelStateEffect extends ChannelStateBase { readonly effect: Effect; readonly _tag = "Effect"; constructor(effect: Effect); } export declare class ChannelStateRead extends ChannelStateBase { readonly upstream: ErasedExecutor; readonly onEffect: (_: Effect) => Effect; readonly onEmit: (_: unknown) => Effect | undefined; readonly onDone: (_: Exit) => Effect | undefined; readonly _tag = "Read"; constructor(upstream: ErasedExecutor, onEffect: (_: Effect) => Effect, onEmit: (_: unknown) => Effect | undefined, onDone: (_: Exit) => Effect | undefined); } /** * @tsplus type effect/core/stream/Channel/State.Ops */ export interface ChannelStateOps { } export declare const ChannelState: ChannelStateOps; /** * @tsplus unify effect/core/stream/Channel/State */ export declare function unifyChannelState>(self: X): ChannelState<[ X ] extends [{ [_R]: () => infer R; }] ? R : never, [ X ] extends [{ [_E]: () => infer E; }] ? E : never>; /** * @tsplus macro remove */ export declare function concreteChannelState(_: ChannelState): asserts _ is ChannelStateDone | ChannelStateEmit | ChannelStateEffect | ChannelStateRead; /** * @tsplus static effect/core/stream/Channel/State.Ops Done * @tsplus location "@effect/core/stream/Channel/ChannelState" */ export declare const channelStateDone: ChannelState; /** * @tsplus static effect/core/stream/Channel/State.Ops Emit * @tsplus location "@effect/core/stream/Channel/ChannelState" */ export declare const channelStateEmit: ChannelState; /** * @tsplus static effect/core/stream/Channel/State.Ops Effect * @tsplus location "@effect/core/stream/Channel/ChannelState" */ export declare function channelStateEffect(effect: Effect): ChannelState; /** * @tsplus static effect/core/stream/Channel/State.Ops Read * @tsplus location "@effect/core/stream/Channel/ChannelState" */ export declare function channelStateRead(upstream: ErasedExecutor, onEffect: (_: Effect) => Effect, onEmit: (_: unknown) => Effect | undefined, onDone: (_: Exit) => Effect | undefined): ChannelState; /** * @tsplus fluent effect/core/stream/Channel/State effectOrUnit * @tsplus location "@effect/core/stream/Channel/ChannelState" */ export declare function effectOrUnit(self: ChannelState): Effect; /** * @tsplus fluent effect/core/stream/Channel/State effectOrUndefinedIgnored * @tsplus location "@effect/core/stream/Channel/ChannelState" */ export declare function effectOrUndefinedIgnored(self: ChannelState): Effect | undefined; //# sourceMappingURL=ChannelState.d.ts.map