import { RuntimeConfig } from '../../utils/types/runtime.config';
import type { DeploymentResult } from './deploy.service';
import { RuntimeInfraResourceOptions, RuntimeInfraResources } from '../../infra/interfaces';
/**
 * Options for multi-stack deployment
 */
export interface StacksDeployOptions {
    /** Deployment stage (dev, staging, prod) */
    stage: string;
    /** Runtime CLI configuration */
    config: RuntimeConfig;
    /** Skip build step (default: false) */
    skipBuild?: boolean;
    /** Enable verbose logging (default: false) */
    verbose?: boolean;
}
/**
 * Result of a multi-stack deployment operation
 */
export interface StacksDeployResult {
    /** Whether the deployment succeeded */
    success: boolean;
    /** Infrastructure stack deployment result */
    infraStack: DeploymentResult;
    /** Runtime stack deployment result */
    runtimeStack: DeploymentResult;
    /** Runtime Web stack deployment result */
    runtimeWebStack: DeploymentResult;
    /** Total deployment duration in milliseconds */
    duration: number;
}
/**
 * Service that orchestrates stacks deployment sequence.
 *
 * Deploys Infrastructure stack first, then Runtime stack with cross-stack references.
 *
 * @example First deployment
 * ```typescript
 * const service = new StacksDeployService(process.cwd());
 * const result = await service.deploy({ stage: 'dev', config });
 * console.log(`Deployed in ${result.duration}ms`);
 * ```
 *
 * @example Subsequent deployment
 * ```typescript
 * const service = new StacksDeployService(process.cwd());
 * const result = await service.deploy({ stage: 'dev', config });
 * // Both Infra and Runtime stacks are updated
 * ```
 */
export declare class StacksDeployService implements RuntimeInfraResources {
    private readonly cwd;
    private readonly DEFAULT_CDK_DIR;
    /**
     * Creates a new StacksDeployService instance.
     *
     * @param cwd - Current working directory (project root)
     */
    constructor(cwd?: string);
    /**
     * Deploys both Infrastructure and Runtime stacks in the correct sequence.
     *
     * Determines if this is a first deployment or subsequent deployment by checking
     * if the Infrastructure stack exists. Then executes the appropriate workflow.
     *
     * @param options - Deployment options
     * @param validated
     * @returns Promise that resolves to deployment result
     * @throws {DeploymentError} If deployment fails
     *
     * @example
     * ```typescript
     * const service = new StacksDeployService(process.cwd());
     * const result = await service.deploy({
     *   stage: 'dev',
     *   config: runtimeConfig,
     *   skipBuild: false
     * });
     *
     * console.log(`Infrastructure: ${result.infraStack.stackName}`);
     * console.log(`Runtime: ${result.runtimeStack.stackName}`);
     * console.log(`Total duration: ${result.duration}ms`);
     * ```
     */
    deploy(options: StacksDeployOptions, validated?: boolean): Promise<StacksDeployResult>;
    /**
     * Executes first deployment workflow: deploy Infra → read outputs → deploy Runtime.
     *
     * @param options - Deployment options
     * @param enabledAwake
     * @param startTime - Deployment start timestamp
     * @returns Promise that resolves to deployment result
     * @throws {DeploymentError} If Infra or Runtime deployment fails
     *
     * @todo: Generic Result typing is required to evaluate different Platform stacks, e.g., RuntimeWeb will add to this default stack additional stacks –––>
     *        As a result, we have generic of StacksDeployResult<T> where T is stack enhancement
     *
     * @private
     */
    private executeDeploy;
    /**
     * Deploys a specific CDK stack using the CDK CLI.
     *
     * @param stackName - Name of the CloudFormation stack to deploy
     * @param stage - Deployment stage
     * @param config - Runtime CLI configuration
     * @returns Promise that resolves to deployment result
     * @throws {DeploymentError} If deployment fails
     *
     * @private
     */
    private deployCdkStack;
    /**
     * Validates AWS credentials before deployment.
     *
     * Uses STS GetCallerIdentity to verify credentials are configured and valid.
     *
     * @param stage - Deployment stage
     * @param config - Runtime CLI configuration
     * @throws {DeploymentError} If credentials are missing or invalid
     *
     * @private
     */
    private validateCredentials;
    /**
     * Retrieves Infrastructure stack outputs using InfraOutputsResolver.
     *
     * @param cloudFormationClient
     * @param stage - Deployment stage
     * @param config - Runtime CLI configuration
     * @param infraStackName
     * @param awsProfile - Optional AWS profile name for credentials
     * @returns Promise that resolves to outputs map
     * @throws {DeploymentError} If outputs cannot be retrieved
     *
     * @private
     */
    private getInfraOutputs;
    /**
     * Resolves CDK directory path from configuration.
     *
     * @param config - Runtime CLI configuration
     * @returns Absolute path to CDK directory
     *
     * @private
     */
    private resolveCdkDirectory;
    /**
     * Detects if an error is a cross-stack reference failure.
     *
     * CloudFormation reports ImportValue errors when a Runtime stack tries to import
     * an export that doesn't exist in the Infra stack.
     *
     * @param errorOutput - Error output from CDK deployment
     * @returns True if error is a cross-stack reference failure
     *
     * @private
     */
    private isCrossStackReferenceError;
    /**
     * Extracts missing export names from CloudFormation error output.
     *
     * @param errorOutput - Error output from CDK deployment
     * @returns Array of missing export names
     *
     * @private
     */
    private extractMissingExports;
    /**
     * Creates a detailed error for cross-stack reference failures.
     *
     * @param stackName - Name of the stack that failed
     * @param stage - Deployment stage
     * @param missingExports - Array of missing export names
     * @returns DeploymentError with troubleshooting guidance
     *
     * @private
     */
    private createCrossStackReferenceError;
    /**
     * Parses deployment outputs from CDK outputs file.
     *
     * @param stackName - Name of the CloudFormation stack
     * @returns Deployment outputs map
     *
     * @private
     * @param outputsPath
     */
    private parseStackOutputs;
    /**
     * Generates a signature for the provided region by extracting the first character of each segment in the region string, delimited by hyphens.
     *
     * @param {string} region - The region string to generate the signature from. It is expected to be a hyphen-separated string.
     * @return {string} The generated region signature, formed by concatenating the first character of each valid segment. Returns an empty string if the input is invalid or empty.
     */
    private getRegionSignature;
    /**
     * Generates a resource name by concatenating service name, resource name,
     * simplified region, and stage with hyphens as separators.
     *
     * @param {Object} params - An object containing the required parameters.
     * @param {string} params.name - The name of the resource.
     * @param {string} params.serviceName - The name of the service associated with the resource.
     * @param {string} params.regionSimplified - The simplified region identifier.
     * @param {string} params.stage - The deployment stage of the resource.
     * @returns {string} The concatenated resource name.
     */
    resourceName({ name, serviceName, stage, region }: RuntimeInfraResourceOptions): string;
}
