import { SynthesizedStack } from "./synth-stack";
import { TerraformPlan } from "./models/terraform";
import { NestedTerraformOutputs } from "./output";
export declare type StackUpdate = {
    type: "planning";
    stackName: string;
} | {
    type: "planned";
    stackName: string;
    plan: TerraformPlan;
} | {
    type: "deploying";
    stackName: string;
} | {
    type: "deploy update";
    stackName: string;
    deployOutput: string;
} | {
    type: "deployed";
    stackName: string;
    outputsByConstructId: NestedTerraformOutputs;
    outputs: Record<string, any>;
} | {
    type: "destroying";
    stackName: string;
} | {
    type: "destroy update";
    stackName: string;
    destroyOutput: string;
} | {
    type: "destroyed";
    stackName: string;
} | {
    type: "outputs fetched";
    stackName: string;
    outputsByConstructId: NestedTerraformOutputs;
    outputs: Record<string, any>;
} | {
    type: "errored";
    stackName: string;
    error: string;
} | {
    type: "dismissed";
    stackName: string;
};
export declare type StackApprovalUpdate = {
    type: "waiting for stack approval";
    stackName: string;
    plan: TerraformPlan;
    approve: () => void;
    reject: () => void;
};
declare type CdktfStackOptions = {
    stack: SynthesizedStack;
    onUpdate: (update: StackUpdate | StackApprovalUpdate) => void;
    onLog?: (log: {
        message: string;
        isError: boolean;
    }) => void;
    autoApprove?: boolean;
    abortSignal: AbortSignal;
};
declare type CdktfStackStates = StackUpdate["type"] | StackApprovalUpdate["type"] | "idle" | "done" | "error";
export declare class CdktfStack {
    options: CdktfStackOptions;
    currentPlan?: TerraformPlan;
    stack: SynthesizedStack;
    outputs?: Record<string, any>;
    outputsByConstructId?: NestedTerraformOutputs;
    stopped: boolean;
    currentWorkPromise: Promise<void> | undefined;
    readonly currentState: CdktfStackStates;
    constructor(options: CdktfStackOptions);
    get isPending(): boolean;
    get isDone(): boolean;
    get isRunning(): boolean;
    private updateState;
    private createTerraformLogHandler;
    private waitForApproval;
    private initalizeTerraform;
    private run;
    diff(refreshOnly?: boolean, terraformParallelism?: number): Promise<void>;
    deploy(refreshOnly?: boolean, terraformParallelism?: number): Promise<void>;
    destroy(terraformParallelism?: number): Promise<void>;
    fetchOutputs(): Promise<Record<string, any> | undefined>;
    stop(): Promise<void>;
}
export {};
