import type { IO } from "@effect-ts/core/Effect"; import * as T from "@effect-ts/core/Effect"; import { _A, _E, _R } from "@effect-ts/core/Effect"; import type * as E from "@effect-ts/core/Either"; import * as O from "@effect-ts/core/Option"; import type { _A as _GetA, _E as _GetE } from "@effect-ts/core/Utils"; import type * as C from "@effect-ts/system/Cause"; import * as REF from "@effect-ts/system/Ref"; import type { Cache } from "../../Cache/index.js"; import type { DataSource } from "../../DataSource/index.js"; import type { DataSourceAspect } from "../../DataSourceAspect/index.js"; import * as Q from "../../Query/index.js"; import type { Request } from "../../Request/index.js"; declare class Effect { readonly query: Q.Query; readonly _tag = "Effect"; readonly [_R]: (r: R) => never; readonly [_E]: () => E; readonly [_A]: () => A; constructor(query: Q.Query); } declare class Get { readonly io: IO; readonly _tag = "Get"; readonly [_E]: () => E; readonly [_A]: () => A; constructor(io: IO); } /** * A `Continue[R, E, A]` models a continuation of a blocked request that * requires an environment `R` and may either fail with an `E` or succeed with * an `A`. A continuation may either be a `Get` that merely gets the result of * a blocked request (potentially transforming it with pure functions) or an * `Effect` that may perform arbitrary effects. This is used by the library * internally to determine whether it is safe to pipeline two requests that * must be executed sequentially. */ export declare type Continue = Effect | Get; /** * Constructs a continuation from a request, a data source, and a `Ref` that * will contain the result of the request when it is executed. */ export declare function apply>(request: A, dataSource: DataSource, ref: REF.Ref, _GetA>>>): Continue, _GetA>; /** * Constructs a continuation that may perform arbitrary effects. */ export declare function effect(query: Q.Query): Continue; /** * Constructs a continuation that merely gets the result of a blocked request * (potentially transforming it with pure functions). */ export declare function get(io: IO): Continue; /** * Purely folds over the failure and success types of this continuation. */ export declare function fold(failure: (e: E) => B, success: (a: A) => B): (cont: Continue) => Continue; /** * Effectually folds over the failure and success types of this continuation. */ export declare function foldCauseM(failure: (cause: C.Cause) => Q.Query, success: (a: A) => Q.Query): (self: Continue) => Continue; export declare function foldCauseM_(self: Continue, failure: (cause: C.Cause) => Q.Query, success: (a: A) => Q.Query): Continue; /** * Purely maps over the success type of this continuation. */ export declare function map(f: (a: A) => B): (self: Continue) => Continue; export declare function map_(self: Continue, f: (a: A) => B): Continue; /** * Transforms all data sources with the specified data source aspect. */ export declare function mapDataSources_(self: Continue, f: DataSourceAspect): Continue; /** * Transforms all data sources with the specified data source aspect. */ export declare function mapDataSources(f: DataSourceAspect): (self: Continue) => Continue; /** * Purely maps over the failure type of this continuation. */ export declare function mapError(f: (e: E) => E1): (self: Continue) => Continue; /** * Effectually maps over the success type of this continuation. */ export declare function mapM(f: (a: A) => Q.Query): (self: Continue) => Continue; /** * Purely contramaps over the environment type of this continuation. */ export declare function provideSome(description: string, f: (a: R0) => R): (self: Continue) => Continue; /** * Combines this continuation with that continuation using the specified * function, in sequence. */ export declare function zipWith(that: Continue, f: (a: A, b: B) => C): (self: Continue) => Continue; /** * Combines this continuation with that continuation using the specified * function, in parallel. */ export declare function zipWithPar(that: Continue, f: (a: A, b: B) => C): (self: Continue) => Continue; /** * Runs this continuation.. */ export declare function runCache(cache: Cache): (self: Continue) => T.Effect; export {}; //# sourceMappingURL=index.d.ts.map