import type * as HKT from "@principia/prelude/HKT"; import type { Sync } from "../Sync"; import { _A, _E, _I, _R, _U, TaskInstructionTag } from "../Task/Task/constants"; import type * as T from "../Task/Task/model"; import type * as Ex from "./AsyncExit"; import { _AI, AsyncInstructionTag } from "./constants"; export declare abstract class Async implements T.Integration { readonly _tag = TaskInstructionTag.Integration; readonly _S1: (_: unknown) => void; readonly _S2: () => never; readonly [_U]: T.URI; readonly [_R]: (_: R) => void; readonly [_E]: () => E; readonly [_A]: () => A; get [_I](): T.Instruction; get [_AI](): AsyncInstruction; } export declare const URI = "Async"; export declare type URI = typeof URI; export declare type V = HKT.V<"R", "-"> & HKT.V<"E", "+">; declare module "@principia/prelude/HKT" { interface URItoKind { readonly [URI]: Async; } } export declare type AsyncInstruction = | SucceedInstruction | SuspendInstruction | PromiseInstruction | ChainInstruction | FoldInstruction | AsksInstruction | DoneInstruction | GiveInstruction | FinalizeInstruction | AllInstruction | FailInstruction | TotalInstruction | PartialInstruction | Sync; export declare class SucceedInstruction extends Async { readonly value: A; readonly _asyncTag = AsyncInstructionTag.Succeed; constructor(value: A); } export declare class TotalInstruction extends Async { readonly thunk: () => A; readonly _asyncTag = AsyncInstructionTag.Total; constructor(thunk: () => A); } export declare class PartialInstruction extends Async { readonly thunk: () => A; readonly onThrow: (error: unknown) => E; readonly _asyncTag = AsyncInstructionTag.Partial; constructor(thunk: () => A, onThrow: (error: unknown) => E); } export declare class DoneInstruction extends Async { readonly exit: Ex.AsyncExit; readonly _asyncTag = AsyncInstructionTag.Done; constructor(exit: Ex.AsyncExit); } export declare class FailInstruction extends Async { readonly e: E; readonly _asyncTag = AsyncInstructionTag.Fail; constructor(e: E); } export declare class AsksInstruction extends Async { readonly f: (_: R0) => Async; readonly _asyncTag = AsyncInstructionTag.Asks; constructor(f: (_: R0) => Async); } export declare class GiveInstruction extends Async { readonly async: Async; readonly env: R; readonly _asyncTag = AsyncInstructionTag.Give; constructor(async: Async, env: R); } export declare class AllInstruction extends Async { readonly asyncs: readonly Async[]; readonly _asyncTag = AsyncInstructionTag.All; constructor(asyncs: readonly Async[]); } export declare class SuspendInstruction extends Async { readonly async: () => Async; readonly _asyncTag = AsyncInstructionTag.Suspend; constructor(async: () => Async); } export declare class PromiseInstruction extends Async { readonly promise: (onInterrupt: (f: () => void) => void) => Promise; readonly onReject: (reason: unknown) => E; readonly _asyncTag = AsyncInstructionTag.Promise; constructor(promise: (onInterrupt: (f: () => void) => void) => Promise, onReject: (reason: unknown) => E); } export declare class ChainInstruction extends Async { readonly async: Async; readonly f: (a: A) => Async; readonly _asyncTag = AsyncInstructionTag.Chain; constructor(async: Async, f: (a: A) => Async); } export declare class FoldInstruction extends Async { readonly async: Async; readonly f: (e: E) => Async; readonly g: (a: A) => Async; readonly _asyncTag = AsyncInstructionTag.Fold; constructor(async: Async, f: (e: E) => Async, g: (a: A) => Async); } export declare class FinalizeInstruction extends Async { readonly async: Async; readonly f: () => Async; readonly _asyncTag = AsyncInstructionTag.Finalize; constructor(async: Async, f: () => Async); } //# sourceMappingURL=model.d.ts.map