import React, { ReactNode } from "react";
import { DeployingResource, TerraformPlan, TerraformOutput } from "./models/terraform";
import { SynthesizedStack } from "../helper/synth-stack";
export declare enum Status {
    STARTING = "starting",
    SYNTHESIZING = "synthesizing",
    SYNTHESIZED = "synthesized",
    INITIALIZING = "initializing",
    PLANNING = "planning",
    PLANNED = "planned",
    DEPLOYING = "deploying",
    DESTROYING = "destroying",
    OUTPUT_FETCHED = "output fetched",
    DONE = "done"
}
export declare const parseOutput: (str: string) => DeployingResource[];
export declare const getConstructIdsForOutputs: (stackContent: Record<string, any>, outputs: {
    [key: string]: TerraformOutput;
}) => NestedTerraformOutputs;
export declare type NestedTerraformOutputs = {
    [key: string]: TerraformOutput;
} | {
    [key: string]: NestedTerraformOutputs;
};
export declare type DeployState = {
    status: Status;
    resources: DeployingResource[];
    plan?: TerraformPlan;
    url?: string;
    currentStack: SynthesizedStack;
    stacks?: SynthesizedStack[];
    errors?: string[];
    outputs?: {
        [key: string]: TerraformOutput;
    };
    outputsByConstructId?: NestedTerraformOutputs;
};
interface TerraformProviderConfig {
    initialState?: DeployState;
    children: ReactNode;
}
export declare const TerraformProvider: React.FunctionComponent<TerraformProviderConfig>;
export declare const useTerraformState: () => DeployState;
interface UseTerraformOptions {
    targetDir: string;
    targetStack?: string;
    synthCommand: string;
    isSpeculative?: boolean;
}
export declare const useTerraform: ({ targetDir, targetStack, synthCommand, isSpeculative, }: UseTerraformOptions) => {
    synth: (loadExecutor?: boolean) => Promise<void>;
    deploy: () => Promise<void>;
    diff: (destroy?: boolean) => Promise<TerraformPlan | undefined>;
    output: () => Promise<void>;
    destroy: () => Promise<void>;
    init: () => Promise<void>;
};
export declare const useRunWhen: <Fn extends (...args: any[]) => any>(condition: boolean, fn: Fn, ...args: Parameters<Fn>) => void;
declare type UseRunSynthOptions = UseTerraformOptions;
export declare const useRunSynth: (options: UseRunSynthOptions) => DeployState;
declare type UseRunInitOptions = UseTerraformOptions;
export declare const useRunInit: (options: UseRunInitOptions) => DeployState;
declare type UseRunDiffOptions = UseTerraformOptions;
export declare const useRunDiff: (options: UseRunDiffOptions) => DeployState;
interface UseRunDeployOptions extends UseTerraformOptions {
    autoApprove?: boolean;
    onOutputsRetrieved: (outputs: NestedTerraformOutputs) => void;
}
export declare const useRunDeploy: ({ autoApprove, onOutputsRetrieved, ...options }: UseRunDeployOptions) => {
    state: DeployState;
    confirmation: (submitValue: any) => void;
    isConfirmed: boolean;
};
interface UseRunOutputOptions extends UseTerraformOptions {
    onOutputsRetrieved: (outputs: NestedTerraformOutputs) => void;
}
export declare const useRunOutput: ({ onOutputsRetrieved, ...options }: UseRunOutputOptions) => DeployState;
interface UseRunDestroyOptions extends UseTerraformOptions {
    autoApprove?: boolean;
}
export declare const useRunDestroy: ({ autoApprove, ...options }: UseRunDestroyOptions) => {
    state: DeployState;
    confirmation: (submitValue: any) => void;
    isConfirmed: boolean;
};
export {};
