import { Effect } from "@effect/core/io/Effect/definition";
import { Tag } from "@tsplus/stdlib/service/Tag";
import { Maybe } from "@tsplus/stdlib/data/Maybe/definition";
import { NoSuchElement } from "@tsplus/stdlib/exceptions";
import { Either } from "@tsplus/stdlib/data/Either/definition";
import { Scope } from "@effect/core/io/Scope/definition";
/**
 * inspired by https://github.com/tusharmath/qio/pull/22 (revised)
 */
export declare const _GenR: unique symbol;
export declare type _GenR = typeof _GenR;
export declare const _GenE: unique symbol;
export declare type _GenE = typeof _GenE;
export declare const _GenA: unique symbol;
export declare type _GenA = typeof _GenA;
export declare class GenEffect<R, E, A> {
    readonly effect: Effect<R, E, A>;
    readonly trace?: string | undefined;
    readonly [_GenR]: () => R;
    readonly [_GenE]: () => E;
    readonly [_GenA]: () => A;
    constructor(effect: Effect<R, E, A>, trace?: string | undefined);
    [Symbol.iterator](): Generator<GenEffect<R, E, A>, A, any>;
}
export interface Adapter {
    <A>(_: Tag<A>, __tsplusTrace?: string): GenEffect<A, never, A>;
    <E, A>(_: Maybe<A>, onNone: () => E, __tsplusTrace?: string): GenEffect<unknown, E, A>;
    <A>(_: Maybe<A>, __tsplusTrace?: string): GenEffect<unknown, NoSuchElement, A>;
    <E, A>(_: Either<E, A>, __tsplusTrace?: string): GenEffect<never, E, A>;
    <R, E, A>(_: Effect<R, E, A>, __tsplusTrace?: string): GenEffect<R, E, A>;
}
export interface AdapterWithScope extends Adapter {
    <R, E, A>(_: Effect<R | Scope, E, A>, __tsplusTrace?: string): GenEffect<R, E, A>;
}
/**
 * @tsplus static ets/Effect/Ops genWithManaged
 * @tsplus location "@effect/core/io/Effect/operations/gen"
 */
export declare function genScoped<Eff extends GenEffect<any, any, any>, AEff>(f: (i: AdapterWithScope) => Generator<Eff, AEff, any>, __tsplusTrace?: string): Effect<[
    Eff
] extends [{
    [_GenR]: () => infer R;
}] ? R : never, [
    Eff
] extends [{
    [_GenE]: () => infer E;
}] ? E : never, AEff>;
/**
 * @tsplus static ets/Effect/Ops gen
 * @tsplus location "@effect/core/io/Effect/operations/gen"
 */
export declare function gen<Eff extends GenEffect<any, any, any>, AEff>(f: (i: Adapter) => Generator<Eff, AEff, any>, __tsplusTrace?: string): Effect<[
    Eff
] extends [{
    [_GenR]: () => infer R;
}] ? R : never, [
    Eff
] extends [{
    [_GenE]: () => infer E;
}] ? E : never, AEff>;
//# sourceMappingURL=gen.d.ts.map