import { aws_events_targets, aws_stepfunctions } from "aws-cdk-lib";
import { IPrincipal } from "aws-cdk-lib/aws-iam";
import { StepFunctions } from "aws-sdk";
import { Construct } from "constructs";
import { ApiGatewayVtlIntegration } from "./api";
import { AppSyncVtlIntegration } from "./appsync";
import { ASL, ASLGraph, Retry, StateMachine, States, Task } from "./asl";
import { Rule } from "./event-bridge";
import { Event } from "./event-bridge/types";
import { CallExpr } from "./expression";
import { NativeIntegration } from "./function";
import { Integration, IntegrationCall } from "./integration";
export declare type AnyStepFunction = ExpressStepFunction<any, any> | StepFunction<any, any>;
/**
 * Machine and Execution context available during runtime.
 *
 * @see https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html
 *
 * To access this data, use the second parameter in a new {@link StepFunction}'s callback.
 *
 * ```ts
 * new StepFunction(stack, 'sfn', (input, context) => {
 *    return context.Execution.Name;
 * })
 * ```
 *
 * > Note: missing fields (ex: `$$.State.Name`) are abstracted away from {@link StepFunction}.
 * > Note: `$$.Execution.Input` is available as the first parameter of the closure `(input) => {}`.
 */
export interface SfnContext {
    /**
     * Data associated with the current execution of the state machine which is available during execution.
     */
    readonly Execution: {
        /**
         * Unique name of the current execution of the {@link StateMachine}.
         *
         * @example - executionName
         */
        readonly Name: string;
        /**
         * Arn of the current execution of the {@link StateMachine}.
         *
         * @example - arn:aws:states:us-east-1:123456789012:execution:stateMachineName:executionName
         */
        readonly Id: string;
        /**
         * Time the current execution started.
         *
         * Format: ISO 8601
         *
         * @example - 2019-03-26T20:14:13.192Z
         */
        readonly StartTime: string;
        /**
         * Execution role ARN
         *
         * @example - arn:aws:iam::123456789012:role
         */
        readonly RoleArn: string;
    };
    /**
     * Data associated with the state machine which is available during execution.
     */
    readonly StateMachine: {
        /**
         * Unique name of the {@link StateMachine}.
         *
         * @example - stateMachineName
         */
        readonly Name: string;
        /**
         * Arn of the {@link StateMachine}.
         *
         * @example  arn:aws:states:us-east-1:123456789012:stateMachine:stateMachineName
         */
        readonly Id: string;
    };
    readonly Task: {
        /**
         * Task token to be used with {@link $SFN.task} and the `waitForTaskToken` integration pattern.
         *
         * https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html
         */
        readonly Token: string;
    };
}
export declare type StepFunctionClosure<Payload extends Record<string, any> | undefined, Out> = (arg: Payload, context: SfnContext) => Promise<Out> | Out;
declare type ParallelFunction<T> = () => Promise<T> | T;
declare type ParallelFunctionReturnType<T extends ParallelFunction<T>> = T extends ParallelFunction<infer P> ? P : never;
export interface $SFN {
    /**
     * Wait for a specific number of {@link seconds}.
     *
     * ```ts
     * new ExpressStepFunction(this, "F", (seconds: number) => $SFN.waitFor(seconds))
     * ```
     *
     * @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-wait-state.html
     */
    waitFor(seconds: number): void;
    /**
     * Wait until a {@link timestamp}.
     *
     * ```ts
     * new ExpressStepFunction(this, "F", (timestamp: string) => $SFN.waitUntil(timestamp))
     * ```
     *
     * @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-wait-state.html
     */
    waitUntil(timestamp: string): void;
    /**
     * Process each item in an {@link array} in parallel and run with the default maxConcurrency.
     *
     * Example:
     * ```ts
     * new ExpressStepFunction(this, "F", async (items: string[]) => {
     *   await $SFN.forEach(items, { maxConcurrency: 2 }, item => task(item));
     * });
     * ```
     *
     * @param array the list of items to process
     * @param callbackfn function to process each item
     */
    forEach<T>(array: T[], callbackfn: (item: T, index: number, array: T[]) => void): Promise<void>;
    /**
     * Process each item in an {@link array} in parallel and run with the default maxConcurrency.
     *
     * Example:
     * ```ts
     * new ExpressStepFunction(this, "F", async (items: string[]) => {
     *   await $SFN.forEach(items, { maxConcurrency: 2 }, item => task(item));
     * });
     * ```
     *
     * @param array the list of items to process
     * @param props configure the maxConcurrency
     * @param callbackfn function to process each item
     */
    forEach<T>(array: T[], props: {
        maxConcurrency: number;
    }, callbackfn: (item: T, index: number, array: T[]) => void): Promise<void>;
    /**
     * Map over each item in an {@link array} in parallel and run with the default maxConcurrency.
     *
     * Example:
     * ```ts
     * new ExpressStepFunction(this, "F", (items: string[]) => {
     *   return $SFN.map(items, item => task(item))
     * });
     * ```
     *
     * @param array the list of items to map over
     * @param callbackfn function to process each item
     * @returns an array containing the result of each mapped item
     */
    map<T, U>(array: T[], callbackfn: (item: T, index: number, array: T[]) => U | Promise<U>): Promise<U[]>;
    /**
     * Map over each item in an {@link array} in parallel and run with the default maxConcurrency.
     *
     * Example:
     * ```ts
     * new ExpressStepFunction(this, "F", (items: string[]) => {
     *   return $SFN.map(items, item => task(item))
     * });
     * ```
     *
     * @param array the list of items to map over
     * @param props configure the maxConcurrency
     * @param callbackfn function to process each item
     * @returns an array containing the result of each mapped item
     */
    map<T, U>(array: T[], props: {
        maxConcurrency: number;
    }, callbackfn: (item: T, index: number, array: T[]) => U | Promise<U>): Promise<U[]>;
    /**
     * Run 1 or more workflows in parallel.
     *
     * ```ts
     * new ExpressStepFunction(this, "F", (id: string) => {
     *   const results = $SFN.parallel(
     *     () => task1(id)
     *     () => task2(id)
     *   )
     * })
     * ```
     */
    parallel<Paths extends readonly ParallelFunction<any>[]>(...paths: Paths): Promise<{
        [i in keyof Paths]: i extends `${number}` ? ParallelFunctionReturnType<Paths[i]> : Paths[i];
    }>;
    /**
     * Apply Step Function's built in Retry logic to a function.
     *
     * ```ts
     * new ExpressStepFunction(this, "F", (id: string) => {
     *   const results = $SFN.retry(
     *     async () => { await task1(id) }
     *   )
     * })
     * ```
     *
     * By default, all errors (`States.ALL`) will be caught and retried with the default backoff strategy:
     * MaxAttempts: 3
     * IntervalSeconds: 1
     * BackoffRate: 2.0
     *
     * Optionally provide specific error codes and backoff strategies.
     *
     * ```ts
     * new ExpressStepFunction(this, "F", (id: string) => {
     *   const results = $SFN.retry(
     *     [{ ErrorEquals: ["Lambda.ToManyRequestsException"], BackoffRate: 2.5, IntervalSeconds: 2, MaxAttempts: 4 }],
     *     async () => { await task1(id) }
     *   )
     * })
     * ```
     *
     * Caveat: `$SFN.retry` does not maintain the state of mutated variables within the callback.
     *
     * ```ts
     * let a = 1;
     * await $SFN.retry(() => { a = 2; return a * 4; })
     * return a;
     * ```
     *
     * The return value will be `1`.
     *
     */
    retry<Func extends ParallelFunction<any>>(retry: Retry[], callback: Func): ReturnType<Func>;
    retry<Func extends ParallelFunction<any>>(callback: Func): ReturnType<Func>;
    /**
     * Use the States.ArrayPartition intrinsic function to partition a large array.
     * You can also use this intrinsic to slice the data and then send the payload in smaller chunks.
     *
     * ```ts
     * SFN.Partition([1,2,3,4,5], 3); // [[1,2,3], [4,5]]
     * ```
     *
     * @param arr - an array to partition, cannot exceed the payload size limit of 256KB.
     * @param size - the desired chunk size, must be non-zero, positive integer.
     */
    partition<T>(arr: T[], size: number): T[][];
    /**
     * Use the States.ArrayRange intrinsic function to create a new array containing a specific range of elements.
     * The new array can contain up to 1000 elements.
     *
     * ```ts
     * SFN.range(1, 10, 3); // [1, 4, 7, 10]
     * ```
     *
     * @param start - first element in the new array
     * @param end - final element of the new array (inclusive)
     * @param step - optional step parameter (default: 1)
     */
    range(start: number, end: number, step?: Exclude<number, 0>): number[];
    /**
     * The States.ArrayUnique intrinsic function removes duplicate values from an array and returns an array containing only unique elements.
     * This function takes an array, which can be unsorted, as its sole argument.
     *
     * ```ts
     * SFN.unique([1,2,3,3,4,4,5,5]); // [1,2,3,4,5]
     * ```
     *
     * @param arr - array of values to return unique values of.
     */
    unique<T>(arr: T[]): T[];
    /**
     * States.ArrayGetItem returns a specified index's value of an array.
     *
     * ```ts
     * SFN.getItem([1,2,3,3,4,4,5,5], 0); // 1
     * ```
     *
     * @param arr - array of values to access.
     * @param index - array index to retrieve.
     */
    getItem<T>(arr: T[], index: number): T;
    /**
     * Use the `base64Encode` intrinsic function to encode data based on MIME Base64 encoding scheme.
     * You can use this function to pass data to other AWS services without using an AWS Lambda function.
     *
     * @param data - String to encode as base64. Up to 10000 characters.
     */
    base64Encode(data: string): string;
    /**
     * Use the base64Decode intrinsic function to decode data based on MIME Base64 decoding scheme.
     * You can use this function to pass data to other AWS services without using a Lambda function.
     *
     * @param base64 - Base64 string to decode. Up to 10000 characters.
     */
    base64Decode(base64: string): string;
    /**
     * Use the `hash` intrinsic function to calculate the hash value of a given input.
     * You can use this function to pass data to other AWS services without using a Lambda function.
     *
     * @param data - data to hash.
     * @param algorithm - algorithm to use.
     */
    hash(data: any, algorithm: ASLGraph.HashAlgorithm): string;
    /**
     * Use the States.MathRandom intrinsic function to return a random number between the specified start and end number.
     * For example, you can use this function to distribute a specific task between two or more resources.
     *
     * @param start - starting number, must be an integer.
     * @param end - ending number, must be an integer.
     * @param seed - optional seed value to determine when generating the random value.
     */
    random(start: number, end: number, seed?: number): number;
    /**
     * Invoke any {@link StepFunction task}. Return type will be whatever the task would return in StepFunctions.
     *
     * https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html
     *
     * @param definition.Resource - Resource to invoke - must be a string literal.
     * @param definition.Retry - an array of {@link Retry}, must only contain literal values.
     * @param definition.Comment - a comment added to the state machine - must be a string literal.
     * @param definition.Parameters - values to pass to the task.
     * @param definition.TimeoutSeconds - time to wait for the task to complete.
     * @param definition.HeartbeatSeconds - time to wait for the task to complete.
     *
     * Note: If Parameters is a reference, TimeoutSeconds and Heartbeat cannot be references.
     */
    task<Result>(definition: Pick<Task, "Resource" | "Retry" | "Comment" | "TimeoutSeconds" | "HeartbeatSeconds" | "Parameters">): Result;
}
export declare const $SFN: {
    waitFor: IntegrationCall<"$SFN.waitFor", (seconds: number) => void>;
    waitUntil: IntegrationCall<"$SFN.waitUntil", (timestamp: string) => void>;
    forEach: IntegrationCall<"$SFN.forEach", {
        <T>(array: T[], callbackfn: (item: T, index: number, array: T[]) => void): Promise<void>;
        <T_1>(array: T_1[], props: {
            maxConcurrency: number;
        }, callbackfn: (item: T_1, index: number, array: T_1[]) => void): Promise<void>;
    }>;
    map: IntegrationCall<"$SFN.map", {
        <T_2, U>(array: T_2[], callbackfn: (item: T_2, index: number, array: T_2[]) => U | Promise<U>): Promise<U[]>;
        <T_3, U_1>(array: T_3[], props: {
            maxConcurrency: number;
        }, callbackfn: (item: T_3, index: number, array: T_3[]) => U_1 | Promise<U_1>): Promise<U_1[]>;
    }>;
    parallel: IntegrationCall<"$SFN.parallel", <Paths extends readonly ParallelFunction<any>[]>(...paths: Paths) => Promise<{ [i in keyof Paths]: i extends `${number}` ? ParallelFunctionReturnType<Paths[i]> : Paths[i]; }>>;
    retry: IntegrationCall<"$SFN.$SFN.retry", {
        <Func extends ParallelFunction<any>>(retry: Retry[], callback: Func): ReturnType<Func>;
        <Func_1 extends ParallelFunction<any>>(callback: Func_1): ReturnType<Func_1>;
    }>;
    partition: IntegrationCall<"$SFN.States.Partition", <T_4>(arr: T_4[], size: number) => T_4[][]>;
    range: IntegrationCall<"$SFN.States.Range", (start: number, end: number, step?: Exclude<number, 0>) => number[]>;
    unique: IntegrationCall<"$SFN.States.Unique", <T_5>(arr: T_5[]) => T_5[]>;
    getItem: IntegrationCall<"$SFN.States.GetItem", <T_6>(arr: T_6[], index: number) => T_6>;
    base64Encode: IntegrationCall<"$SFN.States.Base64Encode", (data: string) => string>;
    base64Decode: IntegrationCall<"$SFN.States.Base64Decode", (base64: string) => string>;
    hash: IntegrationCall<"$SFN.States.Hash", (data: any, algorithm: ASLGraph.HashAlgorithm) => string>;
    random: IntegrationCall<"$SFN.States.Random", (start: number, end: number, seed?: number) => number>;
    /**
     * Invoke any {@link StepFunction task}. Return type will be whatever the task would return in StepFunctions.
     *
     * https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html
     */
    task: IntegrationCall<"$SFN.SFN.task", <Result>(definition: Pick<Task, "Resource" | "Retry" | "Comment" | "TimeoutSeconds" | "HeartbeatSeconds" | "Parameters">) => Result>;
};
/**
 * Data types allowed as a Step Function Cause.
 */
export declare type StepFunctionCause = null | boolean | number | string | StepFunctionCause[] | {
    [prop: string]: StepFunctionCause;
};
/**
 * An Error that can be thrown from within a {@link StepFunction} or {@link ExpressStepFunction}.
 *
 * It encodes a `Fail` state in ASL.
 * ```json
 * {
 *   "Type": "Fail",
 *   "Error": <error>,
 *   "Cause": JSON.stringify(<cause>)
 * }
 * ```
 *
 * For example:
 * ```ts
 * throw new StepFunctionError("MyError", { "key": "value"});
 * ```
 *
 * Produces the following Fail state:
 * ```json
 * {
 *   "Type": "Fail",
 *   "Error": "MyError",
 *   "Cause": "{\"key\":\"value\""}"
 * }
 * ```
 */
export declare class StepFunctionError extends Error {
    /**
     * The name of the Error to place in the Fail state.
     */
    readonly error: string;
    readonly cause: StepFunctionCause;
    static readonly kind = "StepFunctionError";
    static isConstructor(a: any): a is typeof StepFunctionError;
    constructor(
    /**
     * The name of the Error to place in the Fail state.
     */
    error: string, cause: StepFunctionCause);
}
export declare function isStepFunction<P extends Record<string, any> | undefined, O = any>(a: any): a is StepFunction<P, O> | ExpressStepFunction<P, O>;
/**
 * {@see https://docs.aws.amazon.com/step-functions/latest/dg/cw-events.html}
 */
interface StepFunctionDetail {
    executionArn: string;
    stateMachineArn: string;
    name: string;
    status: "SUCCEEDED" | "RUNNING" | "FAILED" | "TIMED_OUT" | "ABORTED";
    startDate: number;
    stopDate: number | null;
    input: string;
    inputDetails: {
        included: boolean;
    };
    output: null | string;
    outputDetails: null | {
        included: boolean;
    };
}
export interface StepFunctionStatusChangedEvent extends Event<StepFunctionDetail, "Step Functions Execution Status Change", "aws.states"> {
}
interface StepFunctionEventBusTargetProps extends Omit<aws_events_targets.SfnStateMachineProps, "input"> {
}
declare abstract class BaseStepFunction<Payload extends Record<string, any> | undefined, CallIn, CallOut> implements Integration<"StepFunction", (input: CallIn) => Promise<CallOut>> {
    readonly resource: aws_stepfunctions.StateMachine;
    readonly kind = "StepFunction";
    readonly functionlessKind = "StepFunction";
    readonly appSyncVtl: AppSyncVtlIntegration;
    readonly __functionBrand: (input: CallIn) => Promise<CallOut>;
    constructor(resource: aws_stepfunctions.StateMachine);
    readonly apiGWVtl: ApiGatewayVtlIntegration;
    appSyncIntegration(integration: Pick<AppSyncVtlIntegration, "request">, grant: (resource: aws_stepfunctions.StateMachine, principal: IPrincipal) => void): AppSyncVtlIntegration;
    asl(call: CallExpr, context: ASL): ASLGraph.NodeState & {
        output: ASLGraph.JsonPath;
    };
    readonly eventBus: import("./event-bridge").EventBusTargetIntegration<Payload, StepFunctionEventBusTargetProps | undefined>;
    private statusChangeEventDocument;
    onSucceeded(scope: Construct, id: string): Rule<StepFunctionStatusChangedEvent>;
    onFailed(scope: Construct, id: string): Rule<StepFunctionStatusChangedEvent>;
    onStarted(scope: Construct, id: string): Rule<StepFunctionStatusChangedEvent>;
    onTimedOut(scope: Construct, id: string): Rule<StepFunctionStatusChangedEvent>;
    onAborted(scope: Construct, id: string): Rule<StepFunctionStatusChangedEvent>;
    /**
     * Create event bus rule that matches any status change on this machine.
     */
    onStatusChanged(scope: Construct, id: string): Rule<StepFunctionStatusChangedEvent>;
}
export interface StepFunctionProps extends Omit<aws_stepfunctions.StateMachineProps, "definition" | "stateMachineType"> {
}
/**
 * An {@link ExpressStepFunction} is a callable Function which executes on the managed
 * AWS Step Function infrastructure. Like a Lambda Function, it runs within memory of
 * a single machine, except unlike Lambda, the entire environment is managed and operated
 * by AWS. Meaning, there is no Operating System, Memory, CPU, Credentials or API Clients
 * to manage. The entire workflow is configured at build-time via the Amazon State Language (ASL).
 *
 * With Functionless, the ASL is derived from type-safe TypeScript code instead of JSON.
 *
 * ```ts
 * import * as f from "@functionless/aws-constructs";
 *
 * const table = new f.Table(this, "Table", { ... });
 *
 * const getItem = new ExpressStepFunction(this, "F", () => {
 *   return f.$AWS.DynamoDB.GetItem({
 *     Table: table,
 *     Key: {
 *       ..
 *     }
 *   });
 * });
 * ```
 */
export interface IExpressStepFunction<Payload extends Record<string, any> | undefined, Out> {
    (input: StepFunctionRequest<Payload>): SyncExecutionResult<Out>;
}
declare class BaseExpressStepFunction<Payload extends Record<string, any> | undefined, Out> extends BaseStepFunction<Payload, StepFunctionRequest<Payload>, SyncExecutionResult<Out>> implements IExpressStepFunction<Payload, Out> {
    /**
     * This static property identifies this class as an ExpressStepFunction to the TypeScript plugin.
     */
    static readonly FunctionlessType = "ExpressStepFunction";
    readonly native: NativeIntegration<(input: StepFunctionRequest<Payload>) => Promise<SyncExecutionResult<Out>>>;
    constructor(machine: aws_stepfunctions.StateMachine);
}
interface BaseExpressStepFunction<Payload extends Record<string, any> | undefined, Out> {
    (input: StepFunctionRequest<Payload>): SyncExecutionResult<Out>;
}
/**
 * An {@link ExpressStepFunction} is a callable Function which executes on the managed
 * AWS Step Function infrastructure. Like a Lambda Function, it runs within memory of
 * a single machine, except unlike Lambda, the entire environment is managed and operated
 * by AWS. Meaning, there is no Operating System, Memory, CPU, Credentials or API Clients
 * to manage. The entire workflow is configured at build-time via the Amazon State Language (ASL).
 *
 * With Functionless, the ASL is derived from type-safe TypeScript code instead of JSON.
 *
 * ```ts
 * import * as f from "@functionless/aws-constructs";
 *
 * const table = new f.Table(this, "Table", { ... });
 *
 * const getItem = new ExpressStepFunction(this, "F", () => {
 *   return f.$AWS.DynamoDB.GetItem({
 *     Table: table,
 *     Key: {
 *       ..
 *     }
 *   });
 * });
 * ```
 */
export declare class ExpressStepFunction<Payload extends Record<string, any> | undefined, Out> extends BaseExpressStepFunction<Payload, Out> {
    readonly definition: StateMachine<States>;
    /**
     * Wrap a {@link aws_stepfunctions.StateMachine} with Functionless.
     *
     * A wrapped {@link StepFunction} provides common integrations like execute (`machine()`) and `describeExecution`.
     *
     * {@link ExpressStepFunction} should only be used to wrap a Express Step Function.
     * Express Step Functions should use {@link StepFunction}.
     *
     * ```ts
     * ExpressStepFunction.fromStateMachine(new aws_stepfunctions.StateMachine(this, "F", {
     *    stateMachineType: aws_stepfunctions.StateMachineType.EXPRESS,
     *    ...
     * }));
     * ```
     */
    static fromStateMachine<Payload extends Record<string, any> | undefined, Out>(machine: aws_stepfunctions.StateMachine): IExpressStepFunction<Payload, Out>;
    constructor(scope: Construct, id: string, props: StepFunctionProps, func: StepFunctionClosure<Payload, Out>);
    constructor(scope: Construct, id: string, func: StepFunctionClosure<Payload, Out>);
}
interface BaseSyncExecutionResult {
    billingDetails?: {
        billedDurationInMilliseconds: number;
        billedMemoryUsedInMB: number;
    };
    executionArn: string;
    input: string;
    inputDetails: {
        included: boolean;
    };
    name: string;
    outputDetails: {
        included: boolean;
    };
    startDate: number;
    stateMachineArn: string;
    status: "SUCCEEDED" | "FAILED" | "TIMED_OUT";
    stopDate: number;
    traceHeader: string;
}
export interface SyncExecutionFailedResult extends BaseSyncExecutionResult {
    cause: string;
    error: string;
    status: "FAILED" | "TIMED_OUT";
}
export interface SyncExecutionSuccessResult<T> extends BaseSyncExecutionResult {
    output: T;
    status: "SUCCEEDED";
}
export declare type SyncExecutionResult<T> = SyncExecutionFailedResult | SyncExecutionSuccessResult<T>;
export declare type StepFunctionRequest<P extends Record<string, any> | undefined> = (P extends undefined ? {
    input?: P;
} : {
    input: P;
}) & ({
    name: string;
    traceHeader: string;
} | {
    name: string;
} | {
    traceHeader: string;
} | {});
export interface ExpressStepFunction<Payload extends Record<string, any> | undefined, Out> {
    (input: StepFunctionRequest<Payload>): Promise<SyncExecutionResult<Out>>;
}
/**
 * A {@link StepFunction} is a callable Function which executes on the managed
 * AWS Step Function infrastructure. Like a Lambda Function, it runs within memory of
 * a single machine, except unlike Lambda, the entire environment is managed and operated
 * by AWS. Meaning, there is no Operating System, Memory, CPU, Credentials or API Clients
 * to manage. The entire workflow is configured at build-time via the Amazon State Language (ASL).
 *
 * With Functionless, the ASL is derived from type-safe TypeScript code instead of JSON.
 *
 * ```ts
 * import * as f from "@functionless/aws-constructs";
 *
 * const table = new f.Table(this, "Table", { ... });
 *
 * const getItem = new StepFunction(this, "F", () => {
 *   return f.$AWS.DynamoDB.GetItem({
 *     Table: table,
 *     Key: {
 *       ..
 *     }
 *   });
 * });
 * ```
 *
 * @typeParam Payload - the object payload to the step function.
 * @typeParam Out - the type of object the step function outputs.
 *                  currently not used: https://github.com/functionless/functionless/issues/129
 */
export interface IStepFunction<Payload extends Record<string, any> | undefined, _Out> extends Integration<"StepFunction", (input: StepFunctionRequest<Payload>) => Promise<AWS.StepFunctions.StartExecutionOutput>> {
    (input: StepFunctionRequest<Payload>): Promise<AWS.StepFunctions.StartExecutionOutput>;
}
declare class BaseStandardStepFunction<Payload extends Record<string, any> | undefined, Out> extends BaseStepFunction<Payload, StepFunctionRequest<Payload>, AWS.StepFunctions.StartExecutionOutput> implements IStepFunction<Payload, Out> {
    /**
     * This static property identifies this class as an StepFunction to the TypeScript plugin.
     */
    static readonly FunctionlessType = "StepFunction";
    readonly native: NativeIntegration<(input: StepFunctionRequest<Payload>) => Promise<AWS.StepFunctions.StartExecutionOutput>>;
    constructor(resource: aws_stepfunctions.StateMachine);
    describeExecution: IntegrationCall<"StepFunction.describeExecution", (executionArn: string) => Promise<AWS.StepFunctions.DescribeExecutionOutput>>;
    sendTaskSuccess: IntegrationCall<"StepFunction.sendTaskSuccess", <Payload_1>(taskToken: AWS.StepFunctions.TaskToken, output: Payload_1) => Promise<AWS.StepFunctions.SendTaskSuccessOutput>>;
    sendTaskFailure: IntegrationCall<"StepFunction.sendTaskFailure", (taskToken: AWS.StepFunctions.TaskToken, error?: string, cause?: string) => Promise<AWS.StepFunctions.SendTaskFailureOutput>>;
    sendTaskHeartbeat: IntegrationCall<"StepFunction.sendTaskHeartbeat", (taskToken: AWS.StepFunctions.TaskToken) => Promise<AWS.StepFunctions.SendTaskHeartbeatOutput>>;
}
interface BaseStandardStepFunction<Payload extends Record<string, any> | undefined, Out> {
    (input: StepFunctionRequest<Payload>): Promise<AWS.StepFunctions.StartExecutionOutput>;
    describeExecution: IntegrationCall<"StepFunction.describeExecution", (executionArn: string) => Promise<AWS.StepFunctions.DescribeExecutionOutput>>;
    sendTaskSuccess: IntegrationCall<"StepFunction.sendTaskSuccess", <Payload>(taskToken: AWS.StepFunctions.TaskToken, output: Payload) => Promise<AWS.StepFunctions.SendTaskSuccessOutput>>;
    sendTaskFailure: IntegrationCall<"StepFunction.sendTaskFailure", (taskToken: AWS.StepFunctions.TaskToken, error?: string, cause?: string) => Promise<AWS.StepFunctions.SendTaskFailureOutput>>;
    sendTaskHeartbeat: IntegrationCall<"StepFunction.sendTaskHeartbeat", (taskToken: AWS.StepFunctions.TaskToken) => Promise<AWS.StepFunctions.SendTaskHeartbeatOutput>>;
}
/**
 * A {@link StepFunction} is a callable Function which executes on the managed
 * AWS Step Function infrastructure. Like a Lambda Function, it runs within memory of
 * a single machine, except unlike Lambda, the entire environment is managed and operated
 * by AWS. Meaning, there is no Operating System, Memory, CPU, Credentials or API Clients
 * to manage. The entire workflow is configured at build-time via the Amazon State Language (ASL).
 *
 * With Functionless, the ASL is derived from type-safe TypeScript code instead of JSON.
 *
 * ```ts
 * import * as f from "@functionless/aws-constructs";
 *
 * const table = new f.Table(this, "Table", { ... });
 *
 * const getItem = new StepFunction(this, "F", () => {
 *   return f.$AWS.DynamoDB.GetItem({
 *     Table: table,
 *     Key: {
 *       ..
 *     }
 *   });
 * });
 * ```
 *
 * @typeParam Payload - the object payload to the step function.
 * @typeParam Out - the type of object the step function outputs.
 *                  currently not used: https://github.com/functionless/functionless/issues/129
 */
export declare class StepFunction<Payload extends Record<string, any> | undefined, Out> extends BaseStandardStepFunction<Payload, Out> implements IStepFunction<Payload, Out> {
    readonly definition: StateMachine<States>;
    /**
     * Wrap a {@link aws_stepfunctions.StateMachine} with Functionless.
     *
     * A wrapped {@link StepFunction} provides common integrations like execute (`machine()`) and `describeExecution`.
     *
     * {@link StepFunction} should only be used to wrap a Standard Step Function.
     * Express Step Functions should use {@link ExpressStepFunction}.
     *
     * ```ts
     * StepFunction.fromStateMachine(new aws_stepfunctions.StateMachine(this, "F", {
     *    ...
     * }));
     * ```
     */
    static fromStateMachine<Payload extends Record<string, any> | undefined, Out>(machine: aws_stepfunctions.StateMachine): IStepFunction<Payload, Out>;
    constructor(scope: Construct, id: string, props: StepFunctionProps, func: StepFunctionClosure<Payload, Out>);
    constructor(scope: Construct, id: string, func: StepFunctionClosure<Payload, Out>);
}
export declare const deploymentOnlyModule = true;
export {};
//# sourceMappingURL=step-function.d.ts.map