import "../../../../Operator/index.js"; import * as T from "../../../../Effect/index.js"; import * as Either from "../../../../Either/index.js"; import * as Exit from "../../../../Exit/index.js"; import * as P from "./primitives.js"; declare type ErasedExecutor = ChannelExecutor; declare type ErasedChannel = P.Channel; export declare type SubexecutorStack = FromKAnd | Inner; export declare const FromKAndTypeId: unique symbol; export declare type FromKAndTypeId = typeof FromKAndTypeId; export declare class FromKAnd { readonly fromK: ErasedExecutor; readonly rest: Inner; readonly _typeId: FromKAndTypeId; constructor(fromK: ErasedExecutor, rest: Inner); } export declare const InnerTypeId: unique symbol; export declare type InnerTypeId = typeof InnerTypeId; export declare class Inner { readonly exec: ErasedExecutor; readonly subK: (u: unknown) => ErasedChannel; readonly lastDone: unknown; readonly combineSubK: (a: unknown, b: unknown) => unknown; readonly combineSubKAndInner: (a: unknown, b: unknown) => unknown; readonly _typeId: InnerTypeId; constructor(exec: ErasedExecutor, subK: (u: unknown) => ErasedChannel, lastDone: unknown, combineSubK: (a: unknown, b: unknown) => unknown, combineSubKAndInner: (a: unknown, b: unknown) => unknown); close(ex: Exit.Exit): T.RIO> | undefined; } export declare const ChannelStateDoneTypeId: unique symbol; export declare type ChannelStateDoneTypeId = typeof ChannelStateDoneTypeId; export declare class ChannelStateDone { readonly _typeId: ChannelStateDoneTypeId; } export declare const ChannelStateEmitTypeId: unique symbol; export declare type ChannelStateEmitTypeId = typeof ChannelStateEmitTypeId; export declare class ChannelStateEmit { readonly _typeId: ChannelStateEmitTypeId; } export declare const ChannelStateEffectTypeId: unique symbol; export declare type ChannelStateEffectTypeId = typeof ChannelStateEffectTypeId; export declare class ChannelStateEffect { readonly effect: T.Effect; readonly _typeId: ChannelStateEffectTypeId; constructor(effect: T.Effect); } export declare type ChannelState = ChannelStateDone | ChannelStateEmit | ChannelStateEffect; export declare function channelStateEffect(state: ChannelState | undefined): T.Effect; export declare function channelStateUnroll(runStep: () => ChannelState): T.Effect>; export declare function maybeCloseBoth(l: T.Effect | undefined, r: T.Effect | undefined): T.RIO> | undefined; export declare class ChannelExecutor { private providedEnv; private executeCloseLastSubstream; private input?; private inProgressFinalizer?; private subexecutorStack?; private doneStack; private done?; private cancelled?; private emitted?; private currentChannel?; private closeLastSubstream?; constructor(initialChannel: () => P.Channel, providedEnv: unknown, executeCloseLastSubstream: (io: T.Effect) => T.Effect); private restorePipe; private unwindAllFinalizers; private popAllFinalizers; private popNextFinalizersGo; private popNextFinalizers; private storeInProgressFinalizer; private clearInProgressFinalizer; private ifNotNull; close(ex: Exit.Exit): T.Effect | undefined; getDone(): Exit.Exit; getEmit(): OutElem; cancelWith(exit: Exit.Exit): void; run(): ChannelState; private runReadGo; private runRead; private runBracketOut; private addFinalizer; private drainSubexecutor; private handleSubexecFailure; private drainFromKAndSubexecutor; private replaceSubexecutor; private finishSubexecutorWithCloseEffect; private doneSucceed; private runFinalizers; private doneHalt; private drainInnerSubExecutor; private processCancellation; } export {}; //# sourceMappingURL=executor.d.ts.map