import Bluebird from "bluebird"; import { Task } from "../Task"; import MonikerFrame from "./MonikerFrame"; import type ActivityContext from "./ActivityContext"; import type AmbientStateProxy from "./AmbientStateProxy"; import type { AsyncActivityInfo } from "./AsyncContext"; import type { Engine } from "./Engine"; import type { ExternalEventCallback } from "./ExternalEvent"; import type { IDebugSession } from "./IDebugSession"; import type { IAmbientState, IActivityHandler } from "../IActivityHandler"; import type { ProgramInspector } from "../definition/ProgramInspector"; import type { Step } from "../definition/Step"; import type { Transition } from "../definition/Transition"; import type { LogLevel } from "../diagnostics/logging"; /** * Ambient state deals with the state for the overall workflow. The basic concept * is to have an executor loop which sequences and initiates activities. If the * workflow is completed or halted, the workflow should not continue * to progress. At any point, execute and callback can be called, so to protect * against re-entrancy issues the main loop should indicate somehow that it is * presently executing. */ declare class AmbientState implements IDebugSession, IAmbientState { asyncActivities: Record; cancellationToken: Task; completion: Bluebird; engine: Engine; environment: Record; error: Error | undefined; frame: MonikerFrame | undefined; halted: boolean; handlers: Record>; id: string; inline: boolean; inputs: Record; inspector: ProgramInspector; locale: string | undefined; logLevel: LogLevel | undefined; outputs: Record; printingServiceUrl: string | undefined; proxy: AmbientStateProxy; queue: Transition[]; resources?: Record; scheduler: Bluebird; stack: MonikerFrame[]; trivia: Record | undefined; get activityContexts(): Record; private static createLinkedCancellationToken; attempt(transition: Transition): void; break(): void; bubble(error: Error): void; call(): void; cancel(): void; cancellationResolve: () => void; complete(outputs?: object): void; continue(): void; debug: (activityContext: ActivityContext | undefined, isExit?: boolean) => void; enqueue(step: Step, branch?: string): void; execute(action?: () => void): boolean; fail(thrown?: any): void; fork(): void; goto(frame: MonikerFrame): boolean; next(): void; pop(error?: Error): MonikerFrame | undefined; prepare(next: ActivityContext, context?: ActivityContext, caught?: Error): void; push(): MonikerFrame; reject(error?: any): void; rejectCompletion: (error: any) => void; removeExternalEventHandler: (callback: ExternalEventCallback) => void; resolveCompletion: (result: object) => void; setExternalEventHandler: (callback: ExternalEventCallback) => void; start(step: Step, context?: ActivityContext, caught?: Error): void; } export {};