import { Lookup } from "../Collections";
import { Program } from "../definition/Program";
import { ProgramInspector } from "../definition/ProgramInspector";
import { Step } from "../definition/Step";
import { Activator } from "../Activator";
import { IActivityHandler } from "../IActivityHandler";
import { IDebugSession } from "./IDebugSession";
import { FormElementRegistration } from "..";
import { Task } from "../Task";
/** Describes run options for a run operation. */
export interface RunOptions {
    /** Indicates a completion promise that is raced with the underlying promise (cancellation). */
    cancellationToken?: PromiseLike<any>;
    /** Indicates a debugger callback. */
    debug?: (session: IDebugSession) => void;
    /** Indicates the locale for the program being run. */
    locale?: string;
    /** Indicates any environment that may be relevant to the program being run. */
    environment?: {};
    /** Indicates any inputs that may be relevant to the program being run. */
    inputs?: {};
    /** Indicates any trivia that may be relevant to the program being run. */
    trivia?: {};
    /** Indicates the start step to start at. */
    start?: Step | number | string;
    /** Allow a master workflow to pass state to a target workflow. */
    state?: Lookup<any>;
    /** Indicates any language strings that the workflow has access to from the context it is being run in. */
    strings?: Lookup<string>;
    /**
     * When true, an `AbortController` will be used to cancel long-running ArcGIS API operations
     * when the workflow is cancelled. Otherwise, `Promise.cancel()` is used. The default value is false.
     */
    useAbortController?: boolean;
}
/** Represents an activity handler class. */
export interface ActivityHandlerClass {
    new (): IActivityHandler;
}
/** Describes an activity handler class. */
export declare type IActivityHandlerImplementation = PromiseLike<ActivityHandlerClass> | ActivityHandlerClass;
/** Describes an activity handler factory. */
export interface IActivityHandlerFactory {
    /** Creates an activity handler. */
    create(action: string, registerFormElement: (registration: FormElementRegistration) => void, inspector?: ProgramInspector): PromiseLike<IActivityHandler> | IActivityHandler;
}
/** Exposes functionality capable of running workflows. */
export declare class Engine {
    constructor(appSkuCode?: string);
    private _getFormElementRegistration;
    private _registerFormElement;
    /** Indicates the SKU code of the app being run. */
    appSkuCode: string;
    /** Indicates the activator to use for any workflow. */
    activator: Activator;
    /** Indicates the default environment for any workflow. */
    environment: {};
    /** Indicates the default trivia for any workflow. */
    trivia: {
        getFormElementRegistration: (id: string) => FormElementRegistration<import("..").FormElementProps<undefined>, Pick<import("..").FormElementProps<undefined>, never> & import("..").FormElementSettableProps<undefined>>;
        registerFormElement: (elReg: FormElementRegistration<import("..").FormElementProps<undefined>, Pick<import("..").FormElementProps<undefined>, never> & import("..").FormElementSettableProps<undefined>>) => void;
    };
    /** Indicates the factories to use to create activity handlers. */
    factories: IActivityHandlerFactory[];
    /** Indicates the implementations to use to create activity handlers. */
    implementations: Lookup<IActivityHandlerImplementation>;
    formElements: Lookup<FormElementRegistration<any>>;
    /** Builds the run options, augmenting the environment. */
    static buildOptions(inspector: ProgramInspector, options: RunOptions): RunOptions;
    /** Creates a handler for the given action. */
    createHandler(action: string, inspector?: ProgramInspector): PromiseLike<IActivityHandler> | IActivityHandler | undefined;
    /** Runs a program and returns a promise for the outputs. */
    run(document: Program, options?: RunOptions): Task<{}>;
    run(inspector: ProgramInspector, options?: RunOptions): Task<{}>;
}
