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