/** * @tsplus type effect/core/stream/Channel/MergeState */ export type MergeState = | BothRunning | LeftDone | RightDone export class BothRunning<_Env, Err, Err1, _Err2, Elem, Done, Done1, _Done2> { readonly _tag = "BothRunning" constructor( readonly left: Fiber>, readonly right: Fiber> ) {} } export class LeftDone { readonly _tag = "LeftDone" constructor(readonly f: (exit: Exit) => Effect) {} } export class RightDone { readonly _tag = "RightDone" constructor(readonly f: (ex: Exit) => Effect) {} } /** * @tsplus type effect/core/stream/Channel/MergeState.Ops */ export interface MergeStateOps {} export const MergeState: MergeStateOps = {} /** * @tsplus static effect/core/stream/Channel/MergeState.Ops BothRunning */ export function bothRunning<_Env, Err, Err1, _Err2, Elem, Done, Done1, _Done2>( left: Fiber>, right: Fiber> ): MergeState<_Env, Err, Err1, _Err2, Elem, Done, Done1, _Done2> { return new BothRunning(left, right) } /** * @tsplus static effect/core/stream/Channel/MergeState.Ops LeftDone */ export function leftDone( f: (exit: Exit) => Effect ): MergeState { return new LeftDone(f) } /** * @tsplus static effect/core/stream/Channel/MergeState.Ops RightDone */ export function rightDone( f: (ex: Exit) => Effect ): MergeState { return new RightDone(f) }